query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
4cd2e837184b17ef889818da732bbde3
Return if a schema is canonical
[ { "docid": "42660f09ebb14f2bfb80c10e67e88f5f", "score": "0.78406936", "text": "def canonical?\n equal?(canonical)\n end", "title": "" } ]
[ { "docid": "47ebb107c613c7528b98fe8ad0f161fa", "score": "0.7666742", "text": "def canonical?\n canonical == to_s\n end", "title": "" }, { "docid": "4684ce46b1f4588672c9af0c1df63a16", "score": "0.7336937", "text": "def canonical?\n return self.canonical.first == 'yes'\n ...
2f284b94577de913bcc3655c0368503c
This is where you check the validatable for any issues
[ { "docid": "8e243a19d181c71569730025ef317269", "score": "0.0", "text": "def is_this_valid?(validatable)\n errors = []\n warnings = []\n\n # Run some validation checks here ...\n # add errors:\n if 'error_condition'\n errors << Reportable.error(\n ...
[ { "docid": "9b0c2c5b4c15bf89c9c2177343e92a1c", "score": "0.7830596", "text": "def validate?()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "5ffbfed600baa4e302eee7ad982c24a8", "score": "0.77572036", "text": "def check_validit...
1765beb9a61adefa875bccf680144121
Page Render Function Renders the All Subscribers Page which contains a table of all subscribers on for the current app
[ { "docid": "3e52da8d816cb4812ce3bd4755907e87", "score": "0.0", "text": "def all_abandoned_subscribers\n\n # Get the Current App\n @app = MailfunnelsUtil.get_app\n\n # Get all subscribers instances for the app\n @subscribers = Subscriber.where(app_id: @app.id, initial_ref_type: 3)\n\n @use...
[ { "docid": "20b5169ef2579187efef35c9e8fd9800", "score": "0.71197814", "text": "def index\n template = 'index'\n @total_subscribers = @subscribers = Subscriber.where(:unsubscribe => false)\n if params[:unsubscribed] == 'true'\n @subscribers = Subscriber.where(:unsubscribe => true)\n...
f56ccaafe6658e6b38a42c95dede2cf7
Retrieve the value for the "ContactID" output from this Choreo execution
[ { "docid": "eebe4258d98f1a62a10731444d747521", "score": "0.726062", "text": "def get_ContactID()\n \t return @outputs[\"ContactID\"]\n \tend", "title": "" } ]
[ { "docid": "3f5cc2508bf40cb07a5a6bbc57c647d5", "score": "0.7098781", "text": "def contact_id\n attributes[:contact] && attributes[:contact][:contact_id]\n end", "title": "" }, { "docid": "836145390c1aef9e0974a1dcc185fff0", "score": "0.68073535", "text": "def contact_id\n ...
db0a7da6d241f4e4f75f5e2cf2d25a52
Reads the students credentials
[ { "docid": "1821326480ad588a5ab20a5a62e946a0", "score": "0.608556", "text": "def read_students_list\n @students_list = Hash.new\n for row in STUDENTS_FIRST_ROW..@credentials_sheet.num_rows\n name = @credentials_sheet[row, STUDENTS_NAME_COL]\n username = @credentials_sheet[row, STUDENTS_U...
[ { "docid": "5e2c9292d33504cf18d115b424458a6b", "score": "0.71372974", "text": "def read_credentials\n print \"Username: \"\n username = gets.chomp\n print \"Password: \"\n password = STDIN.noecho(&:gets).chomp\n puts \"\"\n print \"Full name: \"\n fullname = gets.chomp\n print \"Email: \"\n ema...
b7dfd18921901aac41111f811e2328d5
POST /rfcs POST /rfcs.json
[ { "docid": "7dc2c50f25dde05c05085a8cc3a5b184", "score": "0.6042238", "text": "def create\n @rfc = Rfc.new(rfc_params)\n\n respond_to do |format|\n if @rfc.save\n format.html { redirect_to @rfc, notice: 'Rfc was successfully created.' }\n format.json { render :show, status: :crea...
[ { "docid": "1d3815e8e537765b599c99d50689e4f3", "score": "0.60378844", "text": "def create\n @rfq = Rfq.new(params[:rfq])\n @rfq.creator_id = current_user.id\n\n respond_to do |format|\n if @rfq.save\n format.html { redirect_to @rfq, notice: 'Rfq was successfully created.' }\n ...
b2703384c8c03c0e1832e337df7d419c
Gets the isEnabled property value. Indicates whether email threading and near duplicate detection are enabled.
[ { "docid": "e60cac9e838d6260ecd7f2f4b2609d8d", "score": "0.7078687", "text": "def is_enabled\n return @is_enabled\n end", "title": "" } ]
[ { "docid": "8b37421e4da75e67fae0bed7e5bb27a7", "score": "0.72222894", "text": "def isEnabled\n @enabled\n end", "title": "" }, { "docid": "8b37421e4da75e67fae0bed7e5bb27a7", "score": "0.72222894", "text": "def isEnabled\n @enabled\n end", "title": "" }, { ...
3bbc1a2eb951b2d8b6ef6380ee23b173
Call the method directors_database to retrieve the NDS
[ { "docid": "e4cc276bb571069f49baeeef78677720", "score": "0.57302684", "text": "def pretty_print_nds(nds)\n pp directors_database\nend", "title": "" } ]
[ { "docid": "9ecd13812bb6d3a62a38df65051994ed", "score": "0.60521644", "text": "def dsn; end", "title": "" }, { "docid": "3c6a093c0bc38b573b0b244db3b54fc1", "score": "0.5949609", "text": "def fetch_databases\n url = @url + '?type=registry'\n document = REXML::Document.ne...
471c8d2178479e19d7e62259c2bd6a3d
This is something of an integration test
[ { "docid": "90b5b261993d459afea11da2f08f9ac9", "score": "0.0", "text": "def test_parse_to_xpath\n content = <<-HTML\n <html>\n <head>\n <title>HTML Page Title</title>\n </head>\n <body>\n <ul>\n <li>Foo</li>\n <li>Bar</li>\n </ul>\n </body...
[ { "docid": "16a6d5e8eabd975007f205c109c50890", "score": "0.72776", "text": "def testing; end", "title": "" }, { "docid": "072514f3348fe62556dcdfd4b06e3d08", "score": "0.7256923", "text": "def spec; end", "title": "" }, { "docid": "072514f3348fe62556dcdfd4b06e3d08", "s...
4d76e9ba5d2e9d424cc731086914ef28
POST /personaje_blaz_blues POST /personaje_blaz_blues.xml
[ { "docid": "fca2caed0c42fd56002f94f6749985f0", "score": "0.64748734", "text": "def create\n if autenticacion == \"admin\"\n @personaje_blaz_blue = PersonajeBlazBlue.new(params[:personaje_blaz_blue])\n\n respond_to do |format|\n if @personaje_blaz_blue.save\n format.html { redirect_t...
[ { "docid": "c695e8ce2daadf5cf5794ea352db78d7", "score": "0.6383525", "text": "def new\n @personaje_blaz_blue = PersonajeBlazBlue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @personaje_blaz_blue }\n end\n end", "title": "" }, { ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "c756633b5216437aaa173815b2fa19c7", "score": "0.0", "text": "def set_document\n @document = Document.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...
9673ac67e5def4af11eb2f80bacafe9b
The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.
[ { "docid": "2ecf317fe2f0a0052887d7a6e767d7e7", "score": "0.80289227", "text": "def min_depth(root)\n return 0 if root.nil?\n\n node_stack = [[root, 1]]\n shortest_path_seen = nil\n until node_stack.empty?\n current_node, current_depth = node_stack.pop\n\n if !current_node.left ...
[ { "docid": "f4d3ad3960d1d4b5115f1ca51998f2b9", "score": "0.81078196", "text": "def depth_min; depths.min end", "title": "" }, { "docid": "ea41f93c76b2c7b6795925532cd6d088", "score": "0.72657406", "text": "def min_depth\n return 0 if @poss.empty?\n @poss[0].length\n e...
7d38fd089a26e1c5d0f987fef9445f0c
PUT /posts/1 PUT /posts/1.xml
[ { "docid": "40dce5e192d0226d81be4f931bb60500", "score": "0.0", "text": "def update\n @blog = Blog.find(params[:id])\n\n respond_to do |format|\n if @blog.update_attributes(params[:blog])\n flash[:notice] = 'Post was successfully updated.'\n format.html { redirect_to blog_url(:id...
[ { "docid": "e631b376ae2ccb776680432bf94b01cc", "score": "0.68657696", "text": "def put(uri, xml)\r\n req = Net::HTTP::Put.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end", "title": "" }, { "docid": "c2c0b673628fdc28b...
fa6bfbb96726acaf53686ae3522892ec
POST /function_sets POST /function_sets.json
[ { "docid": "289c98e7a1d25876274489b38b6b8d79", "score": "0.75147843", "text": "def create\n @function_set = FunctionSet.new(function_set_params)\n\n respond_to do |format|\n if @function_set.save\n format.html { redirect_to @function_set, notice: 'Function set was successfully created....
[ { "docid": "3cd66e0f04fb903b844b0dc88218e3c5", "score": "0.6831665", "text": "def function_set_params\n params.require(:function_set).permit(:name, :restype, :description, :root_path)\n end", "title": "" }, { "docid": "ddcca1e2a0e9000e2a795e3003474f33", "score": "0.66590124", ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "12e534fa4b29a1d7e26e588795aa468a", "score": "0.0", "text": "def confession_params\n params.require(:confession).permit(: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...
6bc6057ba772bc700a74dee8d6eb1c9e
GET /bilhetes/1 GET /bilhetes/1.json
[ { "docid": "b4817d667a07e740a13bbdac758e59d7", "score": "0.75451165", "text": "def show\n @bilhete = Bilhete.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bilhete }\n end\n end", "title": "" } ]
[ { "docid": "62de74584f20732a2af2dc7b0f3569a2", "score": "0.69004136", "text": "def show\n @bili = Bili.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bili }\n end\n end", "title": "" }, { "docid": "3bb3224bc88cbb00...
4d0b77a64705a55608af7bc47ac28c89
method to generate a json representing the hourly values of forecast data
[ { "docid": "0f15d10aac7e9c32d075f8b74f6a4777", "score": "0.78201514", "text": "def generate_hourly_json_output\n @json_converter = WrfForecast::JsonConverter::HourlyForecastJsonConverter.\n new(@wrf_handler, @repository, @threshold_handler.warnings)\n @json_converter.con...
[ { "docid": "bbe4aa02773ce07401c23072e6d12488", "score": "0.71088946", "text": "def hourly_forecast\n weather_data[:hourly][:data].map do |forecast_data|\n Forecast.new(forecast_data)\n end\n end", "title": "" }, { "docid": "c2e7ea7ab7f96d128386259f4895deb2", "score": "0.67798...
886818100b969d50754a07741f58d2ca
POST /disciplines_studies POST /disciplines_studies.json
[ { "docid": "ba4f9ea5158c0218e45701fd4ff67b23", "score": "0.70802367", "text": "def create\r\n @academic_work=AcademicWork.find(params[:academic_work_id])\r\n @disciplines_study = @academic_work.disciplines_studies.new(params[:disciplines_study])\r\n\r\n respond_to do |format|\r\n if @disci...
[ { "docid": "1630f417ecc93386c17f26a2b0de8536", "score": "0.6698155", "text": "def create\n @study = Study.new(params[:study])\n\n respond_to do |format|\n if @study.save\n format.html { redirect_to @study, notice: 'Study was successfully created.' }\n format.json { render json: ...
242107172475aa9eb9a12c4f9de37f88
get hash base string.
[ { "docid": "bbfc08f0ecdd92e091a9bb806a936ca6", "score": "0.71249926", "text": "def base_str\r\n @base_str\r\n end", "title": "" } ]
[ { "docid": "12e03e2f19e8569f66b5edfe84a15ea4", "score": "0.74458265", "text": "def hash_string\n hash_value.to_s(36)\n end", "title": "" }, { "docid": "63a1efcae413daa6634c692d95393202", "score": "0.70152456", "text": "def hashable_string\n byte_reverse(\"%08x\" % version) +...
a6505a3670c559eb006fad4e58d578e9
no LWRP way to do this either
[ { "docid": "4250fa7ff82124c0277d42b1089920e7", "score": "0.0", "text": "def recipe(arg=nil, &block)\n arg ||= block\n set_or_return(\n :recipe,\n arg,\n :kind_of => [ Proc ]\n )\nend", "title": "" } ]
[ { "docid": "1203c0e3fd08108617f39225324359bf", "score": "0.6429255", "text": "def lwrp\n path_array = File.expand_path(statement.file).to_s.split('/')\n if path_array.include?(\"resources\")\n type = RESOURCE\n type_sym = :resource\n elsif path_array.include?(\"pro...
9c59a4e3330201ed0764e05a8cec0f8e
Opens a Facebook session and optionally shows the login UX.
[ { "docid": "5d1f2c17835c15609c3570126677a014", "score": "0.64170116", "text": "def openSessionWithAllowLoginUI(allowLoginUI)\n completionBlock = Proc.new do |session, state, error|\n sessionStateChanged(session, state: state, error: error)\n end\n FBSession.openActiveSessionWithReadPermiss...
[ { "docid": "8eb848173ae0df750ed5f0882ef1a310", "score": "0.7005379", "text": "def login_with_facebook\n\t\taccess_token = params[:access_token]\n\t\t\n\t\t#url = 'https://graph.facebook.com/me?access_token='+access_token\n\t\tbegin\n\t\t\tfb_user = FbGraph::User.fetch('me', :access_token=>access_token)\...
90754a5b1e291c01fd68952203a4dbcd
Maps the query parameters names to their encoded names for the URI template parsing.
[ { "docid": "e933ca23672f1e856c44eb496e3a43d1", "score": "0.0", "text": "def get_query_parameter(original_name)\n raise StandardError, 'original_name cannot be null' if original_name.nil?\n case original_name\n when \"co...
[ { "docid": "7bd6c5e8a432e5a8b81c3d73ba96ec0d", "score": "0.661619", "text": "def query_params\n Hash[@query_params.map do |param, value|\n [param.to_s.camelize(:lower), cast_to_string(value)]\n end]\n end", "title": "" }, { "docid": "640f062d2b809a04bd3f372e438ce063", ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "fc859572f1b2761c042c119e21f78fa1", "score": "0.0", "text": "def test_params\n params.require(:test).permit(:user_id, :exam_id, :special, :obtained_experience)\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...
ea8f65ba90b50725f9df65277424e7fb
Return an array of modules to be added to puppet's module path when provisioning
[ { "docid": "39513e2abb34ef387f32ff51d6c0b757", "score": "0.6729234", "text": "def get_puppet_module_paths\n if @puppet_module_paths == UNSET_VALUE\n @puppet_module_paths = []\n end\n return @puppet_module_paths\n end", "title": "" } ]
[ { "docid": "2c4f1affbfa6cf85288b7b5d512382c8", "score": "0.72233784", "text": "def add_supported_modules\n PuppetForge::Module.where( supported: 'true' ).unpaginated.each do |supported|\n mod \"#{supported.owner.username}/#{supported.name}\"\n end\nend", "title": "" }, { "docid": "af035...
8252ba316fd12f5ddd550ab43d95b324
Grant edit permissions to the groups specified. Revokes edit permission for any of the eligible_groups that are not in groups. This may be used when different users are responsible for setting different groups. Supply the groups the current user is responsible for as the 'eligible_groups'
[ { "docid": "dbb54f0a99bdbe0a8346c76cfce9ba06", "score": "0.78735226", "text": "def set_edit_groups(groups, eligible_groups)\n set_entities(:edit, :group, groups, eligible_groups)\n end", "title": "" } ]
[ { "docid": "c11319892ea846075ad888c360b6dce8", "score": "0.6869976", "text": "def edit_groups\n search_by_type_and_mode(:group, ::ACL.Write).map(&:agent_name)\n end", "title": "" }, { "docid": "0a0a5e0d139303731c19d4a94ca82e83", "score": "0.66729814", "text": "def edit_gr...
578ebc58819485cca8f5a2ff14368f1f
stub for interface to get player's choice of available actions
[ { "docid": "bd39ab3716fd1fb1c59cacc814f57036", "score": "0.6114843", "text": "def get_decision(actions)\n\n end", "title": "" } ]
[ { "docid": "4f81aefd0818b96baf1c42e8ce4067e3", "score": "0.7132125", "text": "def menu_choice(action)\n if action == \"a\"\n @humanplayer.search_weapon\n elsif action == \"s\"\n @humanplayer.search_health_pack\n elsif action == \"1\"\n @humanplayer.attack(@player_1)\n ...
328271c25561f19c44706c3e9a8cba20
Remind users of conversations that have not been accepted or rejected
[ { "docid": "55017c6e0c92fd792e22d1518c142d57", "score": "0.0", "text": "def confirm_reminder(conversation, recipient, community, days_to_cancel)\n @email_type = \"email_about_confirm_reminders\"\n recipient = conversation.buyer\n set_up_layout_variables(recipient, community, @email_type)\n w...
[ { "docid": "c63906500a955f50f2790e80088c8d23", "score": "0.6336204", "text": "def not_pending\n if user.incoming_friend_requests.pluck(:user_id).include?(friend_id)\n errors.add(:friend, 'already requested friendship')\n end\n end", "title": "" }, { "docid": "dbf54c79d77c96a47b52...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "c1e7372935ff3836f11825a3742dc3e2", "score": "0.0", "text": "def asignation_params\n params.require(:asignation).permit(:Num_Semana, :fecha, :hora, :Activo, :companies_id, :predios_id, :predios_id2, :plantum_id, :navieras_id, :cliente_navieras_id, :routes_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...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "202dc59c3c8809284df702d59efa166c", "score": "0.0", "text": "def update!(**args)\n @not = args[:not] if args.key?(:not)\n @sequence_segment = args[:sequence_segment] if args.key?(:sequence_segment)\n @simple_segment = args[:simple_segment] if args.key?(:simple_segme...
[ { "docid": "184b1b1ed771473d3eb9f338c0734c38", "score": "0.73066413", "text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end", "title": "" }, { "docid": "5076c5a88404ae72986f958710f5687a", "score": "0.72631145", "text": "def update...
cbe27e6f661b8b0188843aed26176db2
POST /Magissues POST /Magissues.json
[ { "docid": "eff36a2dd1a06e4ac66bf62b028194e0", "score": "0.7058857", "text": "def create\n @magissue = Magissue.new(params[:magissue])\n\n respond_to do |format|\n if @magissue.save\n format.html { redirect_to @magissue, notice: 'Magazine issue was successfully created.' }\n for...
[ { "docid": "aab070b7975be3112c78c71cbe7b9e25", "score": "0.7039552", "text": "def new\n @magissue = Magissue.new(params[:new_issue])\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @magissue }\n end\n end", "title": "" }, { "do...
4a815f635f627645250758de130836f9
DELETE /links/1 DELETE /links/1.json
[ { "docid": "edc778302c8f530abdfad2170d77740d", "score": "0.6955412", "text": "def destroy\n @link.destroy\n respond_to do |format|\n format.html { redirect_to links_url, notice: 'Review was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" ...
[ { "docid": "45db0dd30998091a7c52fa8553fa3637", "score": "0.75313544", "text": "def destroy\n @link.destroy\n\n respond_to do |format|\n format.html { redirect_to links_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "7ba6fbe4387588d244d7a76800c926...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "068f2ea9fff980f5e0b1895a658a23da", "score": "0.0", "text": "def set_event\n @event = Event.friendly.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60310596", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6014974", "text": "de...
b6c574a7770b0ebf6e350d4418889750
Instantiates a new Backup::Notifier::Mail object
[ { "docid": "2955addb91197fe935a2454d691bf547", "score": "0.0", "text": "def initialize(&block)\n load_defaults!\n\n instance_eval(&block) if block_given?\n\n set_defaults!\n end", "title": "" } ]
[ { "docid": "cd32bcec165a1c32719e646db2691a60", "score": "0.7104838", "text": "def new_email\n method = %w{ smtp sendmail exim file test }.\n index(@delivery_method.to_s) ? @delivery_method.to_s : 'smtp'\n\n options =\n case method\n when 'smtp'\n ...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "4d2d1ad0107bca19990820b6c52fefc3", "score": "0.0", "text": "def update!(**args)\n @detections = args[:detections] if args.key?(:detections)\n end", "title": "" } ]
[ { "docid": "184b1b1ed771473d3eb9f338c0734c38", "score": "0.73066413", "text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end", "title": "" }, { "docid": "5076c5a88404ae72986f958710f5687a", "score": "0.72631145", "text": "def update...
d1f4245fadaf48f2f38f8be4cf4edb6f
=begin CREATED: Henry Karagory 2/19/2018 Description: Tests that a game can be added to a Sport object. =end
[ { "docid": "b82b23ee607b7e5e457665001f7f7afd", "score": "0.74397665", "text": "def test_add_game \n \tgame_to_add = Game.new(Date.new(2018, 01, 19), \"Columbus OH\", \"Michigan\")\n \tgame_to_add.game_result = \"W\"\n \tgame_to_add.score_osu = 20\n \tgame_to_add.score_opponent = 10\n\n \t@sport_no_...
[ { "docid": "00248b9314d9b11f8b0fa390a444e3e4", "score": "0.72908646", "text": "def test_can_add_player\n sports_team = SportsTeam.new(\"Rangers\", [\"Morelos\", \"Defoe\"], \"Gerrard\")\n sports_team.add_player(\"Davis\")\n assert_equal(3, sports_team.get_player_count)\n end", "title": "" ...
94298485ac4e66f7d398c29eeb915502
POST /staff/users Creates a new database entry for the staff member and redirects to permissions action.
[ { "docid": "08378d33aa46aa74d37cf001b990ac54", "score": "0.69411725", "text": "def create\n @member = Staff.new user_params_with_password\n @member.skip_confirmation!\n\n # Non-admin can only add staff to their own college.\n unless current_staff.has_role? :site_admin\n @member.college ...
[ { "docid": "299d7c7b186c8c60b394e5a7d991c576", "score": "0.7636758", "text": "def create\n if permit?(Role::USER_ADMINISTRATOR)\n @user = Staff.new(params[:staff])\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to(users_path) }\n format.xml { r...
2c47dc702b3f7f0a925d9e1653b93567
method to calculate the distance between planets
[ { "docid": "03939e7e83fbc899691a0b9a8f653d4e", "score": "0.65646446", "text": "def distance_apart(planet1, planet2, abs = true)\n distance = planet1.distance_from_sun - planet2.distance_from_sun\n return distance.abs\n end", "title": "" } ]
[ { "docid": "2561806d3ab59c4836035c0ae012fa17", "score": "0.77218515", "text": "def planets_distance(planet_one, planet_two)\n distance = (@all_planets[planet_one].distance-@all_planets[planet_two].distance).abs\n puts \"#{@all_planets[planet_one].name} and #{@all_planets[planet_two].name} are #{di...
69426002176d3f3c74750ccef735c865
display a topic message (denoted by >)
[ { "docid": "b9a36c0767caa51280f88403fd749642", "score": "0.74616694", "text": "def topic(message)\n Kernel.puts \"-----> #{message}\"\n $stdout.flush\n end", "title": "" } ]
[ { "docid": "d61aa30af70a057d6a41729c46673ead", "score": "0.7489955", "text": "def topic(message)\n Kernel.puts \"-----> #{message}\"\n $stdout.flush\n end", "title": "" }, { "docid": "f23b2ef9c7dbb9b53474b5d5085be017", "score": "0.7306705", "text": "def topic(msg)\n\t\t@socket...
a915b8fba4fe3801edcbfe22c8e7f612
Method to respond right away with a placeholder image
[ { "docid": "651cffbfe3793782cf15292152592a6c", "score": "0.66023016", "text": "def render_placeholder(request, response)\n @placeholder_img_path ||= File.expand_path(\n \"../#{Config.placeholder_image}\",\n File.dirname(__FILE__)\n )\n\n # serve an UMBRELLA wita a bit of binary magic\...
[ { "docid": "32841f7d29571502bfa5539b79f234af", "score": "0.68987775", "text": "def placeholder_image_tag(text, args={})\n image_tag('koi/application/placeholder-image-none.png', args)\n# image_tag(placeholder_image(text, args).url, args)\n end", "title": "" }, { "docid": "32841f7d2957...
b0cc6337603d7ea561bd06de8911d7e5
GET /attachments/1 GET /attachments/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "64c3c95b677e79c4addd874eabb528d2", "score": "0.75918025", "text": "def show\n @attachment = Attachment.find(params[:id])\n respond_to do |format|\n format.json { render json: @attachment.as_json(methods: [:file_url, *AttachableWithMetadata::ATTACHMENT_METADATA_FIELDS.map { |m| \"f...
0d1399b2ef7aa6805bc2fbeb77824057
construct an int entity with the information from the aip descriptor
[ { "docid": "742c661bb42e3adf6f444c822e226149", "score": "0.62405103", "text": "def fromAIP aip\n entity = aip.find_first('//p2:object[p2:objectCategory=\"intellectual entity\"]', NAMESPACES)\n raise \"cannot find required intellectual entity object in the aip descriptor\" if entity.nil?\n # ext...
[ { "docid": "85301b601b36f90382becec757fdd087", "score": "0.6245062", "text": "def fromAIP aip\n entity = aip.find_first('//p2:object[p2:objectCategory=\"intellectual entity\"]', NAMESPACES)\n raise \"cannot find required intellectual entity object in the aip descriptor\" if entity.nil?\n ...
4549db13879ffebf1c15b78a02dd63ce
Copyright (C) 20102016 dtk contributors This file is part of the dtk project. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distr...
[ { "docid": "7bfff07994f8faa4d180b5f1f0971da3", "score": "0.0", "text": "def r8_require(*files_x)\n files = (files_x.first.is_a?(Array) ? files_x.first : files_x)\n caller_dir = caller.first.gsub(/\\/[^\\/]+$/, '')\n files.each { |f| require File.expand_path(f, caller_dir) }\nend", "title": "" }...
[ { "docid": "3db157d82460cb0632778815b62dbc35", "score": "0.6470989", "text": "def dh; end", "title": "" }, { "docid": "752e2844a9f276ee5cfa6836def131a9", "score": "0.6219166", "text": "def tld; end", "title": "" }, { "docid": "752e2844a9f276ee5cfa6836def131a9", "score...
66fcac4fdf9dbab7722f018c41bd09ca
on purchases page, show all orders where buyer of order equal to current user. Display as created at, descending.
[ { "docid": "b848c01f72484baff186e8f4801eb534", "score": "0.8562683", "text": "def purchases\n @orders = Order.all.where(buyer: current_user).order(\"created_at DESC\")\n end", "title": "" } ]
[ { "docid": "267154f294e90a8b635034d19662beff", "score": "0.7067291", "text": "def my_purchases( user_id , status, page_info )\n if ( !status && status != 0 ) || status == ''\n @orders = Order.where(buyer_id: user_id).order(OrdersHelper::Default_Order_By).page(page_info)\n else\n if stat...
327fb42b2340a02ca3d0ef9173add89f
Students should never be able to access any of the functions of this controller
[ { "docid": "944248c8e5811c1d6a0c849d8cfe4c1a", "score": "0.0", "text": "def test_student_locked_out\n # Index\n get_as @student, :index\n assert_response :missing\n\n # Edit\n get_as @student, :edit\n assert_response :missing\n\n # Update\n get_as @student, :update\n assert_re...
[ { "docid": "517ea033009d387f5d2c5255ead7d0a2", "score": "0.67269135", "text": "def access_control\n \n end", "title": "" }, { "docid": "d66f163afff1bb354afd1391f901c011", "score": "0.6637815", "text": "def index\n @students = Student.all\n unless current_student.try(:isAdmi...
21da9d446475e52983b17e82a9e676c0
Display all collection which is applied to specific student.
[ { "docid": "2c98b60d6ec404eaff695b72b5867270", "score": "0.67763937", "text": "def fees_collection_student\n @student = Student.shod(params[:id])\n @collections ||= @student.finance_fee_collections\n authorize! :read, @collections.first\n end", "title": "" } ]
[ { "docid": "a8e0bed338cfbe649ef8c1286d52ab54", "score": "0.73966986", "text": "def display_students\n Student.all.each do |student|\n puts \"#{student.name.upcase}\".colorize(:blue)\n puts \" location:\".colorize(:light_blue) + \" #{student.location}\"\n puts \" profile quote:\".colo...
312cf37f57b36558cf244c3bdf2ef93f
Transitional site lookup array, allowing servers to translate sites (oy,pg) to legacy symbols
[ { "docid": "f4938c1027e89d53b56e079b3a06f8f4", "score": "0.6523868", "text": "def translate_site_symbol(site)\n return :primary_site if @sites.find_index(site) == 0\n return :secondary_site if @sites.find_index(site) == 1\n fail \"Environment: #{environment.name} does not support site: #{site...
[ { "docid": "2a439f111cf7882dc72fbab5884eaeee", "score": "0.7006778", "text": "def site_lookup(domain)\n tracker=Wmap::SiteTracker.instance\n tracker.verbose=false\n #first order search\n tracker.known_sites.each do |key,val|\n if key.include?(domain.strip.downcase) && key.include?(\"htt...
d2c7f345dd5fee8110b8fc1e3dae2766
the "second take" feature
[ { "docid": "9b1cfbc79a09f55532b1cbc8739007e3", "score": "0.5096176", "text": "def test_second_take\n\n @dashboard.register_participant :troublemaker, TroubleMaker\n\n pdef = Ruote.define do\n define 'sub0' do\n set '__on_error__' => 'redo'\n end\n sequence :on_error => 'sub0'...
[ { "docid": "8b917c8488e0dfacab1a972e5226071f", "score": "0.69137454", "text": "def take\n\n end", "title": "" }, { "docid": "83ef8cfd32ca76cbfce500d3a55b8f95", "score": "0.6569563", "text": "def test_0790_take\n @@log.debug \"test_0790_take starts\" if @@log.debug?\n assert_re...
f3e365bc1a2d7411d56a2401b79b5ebd
Encodes the current builder as JSON.
[ { "docid": "01a517488c69d701ee7c335b5e5d8a89", "score": "0.0", "text": "def target!\n @attributes.to_json\n end", "title": "" } ]
[ { "docid": "06fa7195b090da619c2ba202f9d2db24", "score": "0.7037499", "text": "def json_encoder; end", "title": "" }, { "docid": "06fa7195b090da619c2ba202f9d2db24", "score": "0.7037499", "text": "def json_encoder; end", "title": "" }, { "docid": "06fa7195b090da619c2ba202f9...
11dd92abf82694240c5c5c448cb3eb85
Returns a list of CacheSecurityGroup descriptions === Parameters (optional) name The name of an existing cache security group options (optional): :marker marker provided in the previous request :max_records the maximum number of records to include
[ { "docid": "5c2ee13890e5d6728823899bc12f5254", "score": "0.8467328", "text": "def describe_cache_security_groups(name = nil, options = {})\n request({\n 'Action' => 'DescribeCacheSecurityGroups',\n 'CacheSecurityGroupName' => name,\n 'Marker' ...
[ { "docid": "354c1179851835fd3bfb5ac6d5ebc644", "score": "0.7437113", "text": "def describe_cache_security_groups(options = {})\n request({\n 'Action' => 'DescribeCacheSecurityGroups',\n :parser => Fog::Parsers::AWS::ACS::DescribeSecurityGroups.new\n }.merge(option...
3bd12aea916fffae04084f5267c5c42f
ASSAYSTYLE ASSERTIONS (not yet supported b/c api is not 100%) Is the `assertion` object an assaystyle assertion?
[ { "docid": "59fb2c415a8065cd8bd0d033e6b34b34", "score": "0.7454205", "text": "def assay_assertion?(assertion)\n assertion.respond_to?(:exception) && assertion.respond_to?(:pass?)\n end", "title": "" } ]
[ { "docid": "1ea0145f1766317f8875773e74bd2a56", "score": "0.78864187", "text": "def assertions; end", "title": "" }, { "docid": "1ea0145f1766317f8875773e74bd2a56", "score": "0.78864187", "text": "def assertions; end", "title": "" }, { "docid": "85ab9439eb4ff4294959217fbd44...
30d782949c01781e7309b6ebc9f0eef8
Remove a member from the team
[ { "docid": "57664cbd6a3d7f4ba58d04cce8409108", "score": "0.6996481", "text": "def team_remove_member(team_member_id:, keep_account: false, wipe_data: true, transfer_to: nil, trace: nil)\n # Don't wipe the data if we are keeping the account (becomes a non-Team basic account)\n # Or if we are transf...
[ { "docid": "44ca510efd675a82a34d53c42d28a87b", "score": "0.87393874", "text": "def remove_member(_team, _user)\n # stub\n end", "title": "" }, { "docid": "c11c17084dee34b0fe640a200d51e581", "score": "0.8596272", "text": "def remove_member_from_team(opts)\n Hell...
101f288acf63264f762ad44e02065757
GET /brlevels/1 GET /brlevels/1.json
[ { "docid": "3867cf2e72df1d1dea695a3a392cc526", "score": "0.58238125", "text": "def show\n\t@newbrlevel = Brlevel.new\n\t@breadcrumb = @brlevel.find_my_direct_parent\n\t@productsofthislevel = Brlevel.with_products(@brlevel)\n\t@directchildrent = @brlevel.find_my_direct_childrent.load\n\t\n end", "t...
[ { "docid": "74c8df2cd2fef5a2aa108a403291c21a", "score": "0.74205714", "text": "def levels\n response = JSON.parse(@client.get(\"/api/v1/levels\").body)\n return response[\"levels\"] || response\n end", "title": "" }, { "docid": "d6bbecf63b31fceb2409547d87ce5680", "score": "0...
f9e5346b3e072dd587c3299b3321be03
end Texto descritivo do item Red Tshirt
[ { "docid": "df8fb5d7886997c2b74099e18a30195a", "score": "0.627465", "text": "def text_descRedTshirt\n driver.find_element(:css, 'div.inventory_list > div:nth-child(6) div.inventory_item_label > div')\n end", "title": "" } ]
[ { "docid": "c6e23bbfde4d29967e0afc766b217dff", "score": "0.64217424", "text": "def draw_item_description\n return if @skill_type == \"\"\n draw_text_ex(10, line_height, sprintf(\"%s: %s\", @skill_type, @text))\n end", "title": "" }, { "docid": "369109f880aff38ff355aa0484c7e995", "...
d75e783cc638cb8b079af87e0fd8a0e3
Returns true if a password reset has expired.
[ { "docid": "45a5e2484a89f1bd7a388a85cd49a5d7", "score": "0.85636353", "text": "def password_reset_expired?\n \n # “Password reset sent earlier than two hours ago.” \n reset_sent_at < 2.hours.ago\n end", "title": "" } ]
[ { "docid": "a5d9572fb32c08bcf164eb7f8668095f", "score": "0.8866848", "text": "def password_reset_expired?\n reset_sent_at < Settings.timeout_reset_password.hours.ago\n end", "title": "" }, { "docid": "b5d49aa7583158041f3d1b1511be5244", "score": "0.8742425", "text": "def password_...
e35d001b78698971602901e5dd411814
Suffixes a, ?, c become regexp /(a|\?|c)$/
[ { "docid": "63ec7e16d9cb2e1e7d7a6aab2abed12a", "score": "0.0", "text": "def rebuild_attribute_method_regexp\n suffixes = attribute_method_suffixes.map { |s| Regexp.escape(s) }\n @@attribute_method_regexp = /(#{suffixes.join('|')})$/.freeze\n end", "title": "" } ]
[ { "docid": "9f4c8e3bf4f7911c44492741c7661622", "score": "0.61713725", "text": "def suffix_matcher\n return @suffix_matcher if defined?(@suffix_matcher)\n re = self.suffixes.reverse.map{|e| \"(#{e})\"}.join(\"|\")\n @suffix_matcher = /(?:#{re})$/\n end", "title": "" }, {...
4397c4d7f2377cd2ab890129bd1ed432
Return true of a KAP is matched to this activator.
[ { "docid": "f4e943e125a67c35dd54778596913441", "score": "0.53687334", "text": "def activated? \n # We need to check the step number of else we will skip the last\n # step.\n return (!@step.nil? and @step >= 7 and !@kar.kap.nil?)\n end", "title": "" } ]
[ { "docid": "9db8061c5ad04180bcab4d9869f79710", "score": "0.63373226", "text": "def match?(_args)\n @logger.log_if_debug('[AllKeysMatcher] is always -> true')\n true\n end", "title": "" }, { "docid": "be8f306d7207e32e2f7774d8ff4e9ef8", "score": "0.62547463", "text": "def ...
28236fa3622a72617980624ea60d9808
Returns a list of Vpcs. Support optional query parameters like account_id, region_id, cidr and/or op_status Returns a list of Vpcs. Support optional query parameters like account_id, region_id, cidr and/or op_status
[ { "docid": "29d0cec40b0345c8fcfa1f32dc979678", "score": "0.5201898", "text": "def list_aws_vpcs(opts = {})\n data, _status_code, _headers = list_aws_vpcs_with_http_info(opts)\n return data\n end", "title": "" } ]
[ { "docid": "c316459acdc263b0c7a348035b84e298", "score": "0.64581114", "text": "def query_vpc_ids\n stdout, stderr, status = Open3.capture3('aws ec2 describe-vpcs')\n raise(\"Error: Failed to recover vpc list #{stderr}\") unless status.success?\n\n JSON.parse(stdout)['Vpcs'].each do |vpc|\n ...
46f867126d75484385469964b1b1feef
If id == 1 then create a new candidate otherwise find one. === Attributes :id Candidate id :erros
[ { "docid": "9c5adb271ce5bc6f8ad1666fc4f0bbea", "score": "0.0", "text": "def cand_account_confirmation\n @candidate = params[:id].to_i.equal?('-1'.to_i) ? Candidate.create : Candidate.find(params[:id])\n @errors = params[:errors]\n\n # need admin contact info even though candidate or no one is l...
[ { "docid": "6e8e5eaa43ffb9753c8f1f2a5bdcc3f7", "score": "0.72256905", "text": "def find_candidate\n @candidate = Candidate.find(params[:id])\n end", "title": "" }, { "docid": "6210b6b600524913d654910e677f0482", "score": "0.71263754", "text": "def set_candida...
a7937b9e228c54d65b7cf86ee4ace832
descarga un archivo de s3
[ { "docid": "195d01af2c470a48665196f8fdbef150", "score": "0.6733152", "text": "def download_file_from_aws_s3(file_to_download, file_on_local)\n\n s3 = Aws::S3::Resource.new(\n credentials: Aws::Credentials.new(ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']),\n region:...
[ { "docid": "1348fbf462263197e6eb6c5e9cc08c0d", "score": "0.7108863", "text": "def retrieve_from_s3\n artifact_file cached_tar_path do\n location new_resource.artifact_location\n owner new_resource.owner\n group new_resource.group\n checksum new_resource.artifact_checksum\n ac...
1eb0a8880d90e227af6b4e9086300820
lists all current, old, an inprogress versions for this index
[ { "docid": "e94e85b30e9d2c70249229ac2537c584", "score": "0.69140106", "text": "def index_versions(index)\n $elastic_search_client.index_status()[\"indices\"].keys.grep(/^#{index}_/)\n end", "title": "" } ]
[ { "docid": "a685281193e60912d9e043ee9b21ea79", "score": "0.750031", "text": "def index\n @versions = Version.all\n end", "title": "" }, { "docid": "a685281193e60912d9e043ee9b21ea79", "score": "0.750031", "text": "def index\n @versions = Version.all\n end", "title": "" }...
3517555785efb528d6bfddd0b6bfaef6
Utility method that cleans up any schema info that was cached by ActiveRecord during a test. Normally called automatically at setup and teardown. If you override those methods, you'll need to call this from your method.
[ { "docid": "2c055f9a41fdb5323312061f98593f4b", "score": "0.68203783", "text": "def cleanup_caches\n klass_ = self.class.const_get(:DEFAULT_AR_CLASS)\n\n # Clear any RGeo factory settings.\n klass_.connection_pool.rgeo_factory_settings.clear!\n\n # Clear out any ActiveRecord c...
[ { "docid": "fbbdd822c968f713df85180164b44e3b", "score": "0.78650177", "text": "def clean_schema\n # AppControl.restart_server # if Rails.env.production?\n ActiveRecord::Base.connection.schema_cache.clear!\n end", "title": "" }, { "docid": "64820b38e79d122e63392488902ebcb1", ...
6048055a72e4b68030aca5673ccd4447
words are powerful but the WORD is all powerful
[ { "docid": "07ebf01ce66f38b89c43fa3a81a7b553", "score": "0.0", "text": "def create_one_or_more_loads_and_import_pallets\n return if authorise_for_web(program_name?, 'create')==false\n session[:create_load_and_import_pallets]=nil\n order_id = params[:id]\n session[:order_id] = order_id\n ...
[ { "docid": "c22742383d14f57fcf9edab7dfa2e13c", "score": "0.72713923", "text": "def words\n %w(\n shit\n shitty\n fuck\n fucked\n fucking\n ass\n asshole\n cunt\n dick\n cock\n pussy\n )\n end", "title": "" },...
50e7e0851685cc80133367d2d39db5cf
Metodo el cual valida que el peso del paquete no sea menor o igual a cero, enviando un error de este llegar a ser negativo.
[ { "docid": "d48e658f7553070240db15ed08035574", "score": "0.77199864", "text": "def validate()\n errors.add(:peso, \"debe ser positivo\") if peso < 0\n end", "title": "" } ]
[ { "docid": "4a9e974a95409a95cb6901b35c5addbc", "score": "0.6566417", "text": "def cuit_valido_0\n # rubocop:disable LineLength\n errors.add(:cuit, \"La primera parte debe estar entre 0 y 100\") unless cuit_0.blank? || cuit_0 > 1 && cuit_0 < 100\n end", "title": "" }, { "docid": "2f7ec...
e303380ba82173bbe24fedaf4655c97f
stop all active scans Usage: n=NessusXMLRPC::NessusXMLRPC.new(' if n.logged_in n.scan_stop_all end
[ { "docid": "959d2a622b269f8788d8f29c7557909c", "score": "0.6833065", "text": "def scan_stop_all\n\t\t\tb=scan_list_uids\n\t\t\tb.each {|uuid|\n\t\t\t\tscan_stop(uuid)\n\t\t\t}\n\t\t\treturn b\n\t\tend", "title": "" } ]
[ { "docid": "a6dde94e870d80fa29ec2b0820e0bd1f", "score": "0.69044244", "text": "def scan_stop_all\r\n\t\tb=scan_list_uids\r\n\t\tb.each {|uuid|\r\n\t\t\tscan_stop(uuid)\r\n\t\t}\r\n\t\treturn b\r\n\tend", "title": "" }, { "docid": "c2d8cb35cbaa58c5d7f21e0dbdd0eb76", "score": "0.61264247",...
1634d609af41089d5faf390dcc09016e
Close Edit's form or Show
[ { "docid": "025243d8007c619d1c5c7fb0cdbee693", "score": "0.0", "text": "def close\n @sms_inbox = SmsInbox.find_by_id(params[:id])\n \n render :update do |page| page.redirect_to :action => 'index' end if @sms_inbox.nil?\n \n elem_id = \"sms_inbox_offset_#{@sms_inbox.id}\"\n render :upda...
[ { "docid": "dd5ca5c1b732a1ec9d5b5aecab344690", "score": "0.6628149", "text": "def close_editor\n\t\t@project = Project.find(params[:project_id])\n\t\t@extraction_forms = ExtractionForm.where(:project_id => @project.id).all\n end", "title": "" }, { "docid": "9dadf7790037f6fbee7d2a3693c32092"...
b55b530890fba208b287a6562b0e1853
Return byte rate avergage
[ { "docid": "d6636e530c7d0c961ba8678d2e5fb0c3", "score": "0.6766655", "text": "def byte_rate\n Rational(size,duration)\n end", "title": "" } ]
[ { "docid": "e590c584ea46eef8d5ced449eef8a3b3", "score": "0.75780743", "text": "def avg_bit_rate\n @sectors.collect { |s| s.avg_bit_rate }.sum/@sectors.length.to_f\n end", "title": "" }, { "docid": "d1ccd9c838b6b25a28d025b276b1e54c", "score": "0.6965397", "text": "def average_load...
d25cb1ca0d5c87997a4f98ea6f177ecf
DELETE /orgaos/1 DELETE /orgaos/1.json
[ { "docid": "38c4015f169d1795e7f4f060995f96d2", "score": "0.0", "text": "def destroy\n if Lotacao.where(:id_orgao => params[:id]).count > 0\n flash[:notice] = 'Este órgão possui lotações associadas e não pode ser apagado.' \n redirect_to orgaos_path\n else\n\n @orgao = Orgao.find(par...
[ { "docid": "179ff0053e8f4f967cb3d92206094cf0", "score": "0.7620003", "text": "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "title": "" }, { "docid": "232881507958f39fff196ce3a330d10d", "score": "0.73081297", "text": "def delet...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "831beff0f5a00ff91981e8cdd1fd2b05", "score": "0.0", "text": "def post_params\n params.require(:post).permit(:title, :content, :publish_at, :is_top, :is_hide)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7496729", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6958585", "text": "def strong_params\n params.require(:request).permit(param_white...
5db392e549893e9172742a1e155f788a
=begin companyadmin large view mode =end
[ { "docid": "a5b8054dde0e7937865764ded579ad3e", "score": "0.0", "text": "def next_pic_large_view_company_admin\n original_pic = self.original_picture\n # id_list = original_pic.project_submission.original_pictures_id\n id_list = original_pic.project.pictures.\n where(:is_ori...
[ { "docid": "d94955607794c1448b69e690db6c7427", "score": "0.60013294", "text": "def view_table\n\n\tend", "title": "" }, { "docid": "f4aaf6ac7d8c7d42110cb87815b8b992", "score": "0.5909666", "text": "def admin_index\n @companies = Company.all.includes(:location,:industry, :size, :cl...
9688082b93698bef8a3a3a17f230dc56
GET /admin/roles def roles end GET /admin/stats def stats end GET /admin/sync def sync end GET /admin/downloadsbymonth def downloads_by_month end GET /admin/downloadsbyquarter
[ { "docid": "dda75a969b3cd086880d7474c168d977", "score": "0.0", "text": "def downloads_by_quarter\n @year = params[:year].to_i.positive? ? params[:year].to_i : Time.zone.today.year\n end", "title": "" } ]
[ { "docid": "434cf2bbb6af81f96e496b59c309ab1a", "score": "0.6337177", "text": "def index\n calculate_downloads_by_time_period\n calculate_active_user_downloads\n any_user_activity\n end", "title": "" }, { "docid": "d6f8bfc48516ae43b2f784754d3954fc", "score": "0.61736935", "t...
dbbb625369aa5155641ec9a5fb27f6cd
WARNING: This blindly assumes a new kernel and building on the target box.
[ { "docid": "68a03d78bb8dbbaa2cbcc01cbf823e8d", "score": "0.0", "text": "def build\n make 'TARGET' => 'linux2628', 'CPU' => 'native', 'USE_PCRE' => '1', 'USE_PCRE_JIT' => '1', 'USE_OPENSSL' => '1', 'USE_ZLIB' => '1', 'USE_LIBCRYPT' => '1', 'USE_LUA' => '1'\n\n # halog\n make '-C', 'contrib/halog...
[ { "docid": "27589399e8382d2440c6799e8960a1e6", "score": "0.6476378", "text": "def build_kernel_launcher\n \n Log.info(\"Building kernel launcher\")\n\n assert_ready_to_build\n\n result = \"\"\n if !reuse_memor...
bfa98b997516b8edcb3764bea8e9ec86
GET /data_source_collections GET /data_source_collections.json
[ { "docid": "577fd68334fd07e726e3d1d3dafe00fe", "score": "0.7730385", "text": "def index\n @data_source_collections = DataSourceCollection.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @data_source_collections }\n end\n end", "title": "...
[ { "docid": "5004c0f2351c3729240da4ceb2bb7fa2", "score": "0.7054372", "text": "def get_collection_data(id)\n @conn.get(\"/api/v1/collections/#{id}\")\n end", "title": "" }, { "docid": "e71dc0c0504d9eefdb735fc7d114cdc1", "score": "0.6865865", "text": "def collections(params={})...
1335526c7004eafe21622f118906abe0
Download appropriate packages and startup monit
[ { "docid": "1322fb7a180478831b0d79d2f05d55af", "score": "0.6634961", "text": "def installMonit\r\n `yum install pam-devel -y`\r\n `wget studenthome.nku.edu/~rileyt3/monit-5.8.1.tar.gz`\r\n `tar zxf monit-5.8.1.tar.gz`\r\n Dir.chdir(\"monit-5.8.1\")\r\n `./configure`\r\n `ma...
[ { "docid": "dcc29d0a3101f6a3ee52234a9898e913", "score": "0.6433669", "text": "def install!\n download_package\n install_package\n end", "title": "" }, { "docid": "dcc29d0a3101f6a3ee52234a9898e913", "score": "0.6433669", "text": "def install!\n downlo...
71ade1308da00dfd1ad012d78a113431
12.5 Named Destinations add_nameddest(string name, string optlist) 12.6 PDF Packages and Portfolios int add_portfolio_folder(int parent, string foldername, string optlist)
[ { "docid": "c9918ead7c8c73b15f5017897325553a", "score": "0.6646377", "text": "def add_portfolio_folder(*args)\n Handle::Folder.create(super(*args), self)\n end", "title": "" } ]
[ { "docid": "3373f2dd8bbe92a2bd2ffb91d1715327", "score": "0.6432925", "text": "def add_portfolio_folder(*args)\n @p.add_portfolio_folder(self, *args)\n end", "title": "" }, { "docid": "9d500db4761db9531e0edc3d0c66de30", "score": "0.5889761", "text": "def add_folder(name)\n...
2727e5f7fa4667a60cb61cdab757e8f6
Initialize a thread that will register with a lookup service according to (describe lookup service) settings.lookup_service_uri settings.lookup_service_version (describe this service) settings.name settings.description settings.uri settings.version
[ { "docid": "0660b9c2acccdc308ee84914453dff6e", "score": "0.72419906", "text": "def init_registration_thread\n\n # Important to not require 'cg_lookup_client' until we're ready to\n # start the registration thread. This must be done after rackup\n # daemonized so the registration thread runs in...
[ { "docid": "0210567fb322dc42cf0e2f1c7df93a4c", "score": "0.6219673", "text": "def initialize object, service = :RingyDingy, name = nil,\n lookup = BROADCAST_LIST\n DRb.start_service unless DRb.primary_server\n\n @identifier = [Socket.gethostname.downcase, $PID, name].compact.join '...
0ac737d6f59009bcc5b94f03b7befd22
call Call the script with provided arguments.
[ { "docid": "50ceb03cc372b9dec33cb31f3e933875", "score": "0.0", "text": "def call(config: {}, args: {})\n raise Morrow::Error, \"refusing to run unsafe script: #{self}\" unless @proc\n\n # eval the code within the Sandbox, but first set the entity & actor\n # provided.\n Sandbox.instance_exec...
[ { "docid": "4d7eba9e439e497952f7cd09a25b74cd", "score": "0.6736778", "text": "def execute_script(script, *args); end", "title": "" }, { "docid": "91d44efa62e0c7b013198245b1edc668", "score": "0.6420689", "text": "def call_script(file_name, *args)\n conn, keys, argv = extract_ar...
0337f79c86280f0bf5963746e3f2fae9
gets the length of items waiting to process ie, queued or held with rejected_shutting_down
[ { "docid": "b41bcc824d700125117fb01eee825eda", "score": "0.63235253", "text": "def length\n # by default we should calculate the length as rejected_shutting_down and enqueued\n @queue_length = StashEngine::RepoQueueState.latest_per_resource.where(state: %w[enqueued rejected_shutting_down]).cou...
[ { "docid": "1fbfa9589f826a70a7fced0d8f9366b9", "score": "0.7870436", "text": "def waiting\r\n @queue.size\r\n end", "title": "" }, { "docid": "a086efc0dd3f278bb1004811f7014e8c", "score": "0.78257215", "text": "def waiting\n @queue.size\n end", "title": "" }, { ...
d4c94b1224e0641548235561a810661e
POST /asistants POST /asistants.json
[ { "docid": "c41bd3abd48aac87666be49d29ca3d98", "score": "0.58911824", "text": "def create\n @asistant = Asistant.new(asistant_params)\n\n respond_to do |format|\n if @asistant.save\n format.html { redirect_to @asistant, notice: 'Asistant was successfully created.' }\n format.jso...
[ { "docid": "87ffcf72b79542019854e5ab7955cd99", "score": "0.6479303", "text": "def create\n @estudiante = Estudiante.new(params[:estudiante])\n\n if @estudiante.save\n render json: @estudiante, status: :created, location: @estudiante\n else\n render json: @estudiante.errors, status: :u...
6d657b02405184377d93f9626b52f80b
Initialize the response object
[ { "docid": "2280f32b98e4b64c40d69d791c480d96", "score": "0.66372854", "text": "def initialize(faraday_response)\n @response = faraday_response\n end", "title": "" } ]
[ { "docid": "c4e49b7f32b322a9cfc83241905a5736", "score": "0.82009995", "text": "def initialize(response)\n @response = response\n end", "title": "" }, { "docid": "8a3b6dfe2a990e89689760aa0197a81f", "score": "0.8190668", "text": "def initialize(response)\n @response = ...
59c320238aa1105401e03b375f8bab53
When processing, if the spawn plugin is installed, processing can be done in a background fork or thread if desired.
[ { "docid": "eca331489eb9dd2ad389f1249c7b1ae1", "score": "0.0", "text": "def attachment_background_for(name, background)\n attachment_definitions[name][:background] = background\n end", "title": "" } ]
[ { "docid": "698fc1736b4fae03ed6f2f30269c2628", "score": "0.68844455", "text": "def spawn; end", "title": "" }, { "docid": "354743eff5789fd0ae115be4b6a86967", "score": "0.6751868", "text": "def spawn(&block); end", "title": "" }, { "docid": "06ad65695281b3400d6b2cba5ea563b...
9642529b8722b54d533ecbf4b03916ac
initialize the Stackexchange API with the user's oauth token
[ { "docid": "17de8e3d98d216797c834e5eaaecc876", "score": "0.72684884", "text": "def initialize_stackexchange\n @info ||= Serel::AccessToken.new(self.token)\n end", "title": "" } ]
[ { "docid": "bc1f2e4324279d2f68d633c2e861b67b", "score": "0.77049035", "text": "def init\n init_oauth_access_token\n end", "title": "" }, { "docid": "371ae4564b9078649cfab560fc2d1063", "score": "0.70217997", "text": "def init\n\t\tuser_credentials = {\n\t\t\t:access_token => acces...
3c91ba0ceedefb8a776f113f59b0194b
process after each test method
[ { "docid": "32a42d13ef5af7ad76ec682b8163fbf6", "score": "0.0", "text": "def teardown\n\n end", "title": "" } ]
[ { "docid": "569ed2b3582c51e47c8dd6f94d7c0ab1", "score": "0.8043188", "text": "def after_test(test)\n end", "title": "" }, { "docid": "ce9ff74b6ea76a7d6b4091d716ce02b3", "score": "0.79490674", "text": "def after_test\n end", "title": "" }, { "docid": "f0fbb19b868b7d4...
ef3eef334b66c611ac5216dfb043df9a
Whether this is a global variable assignment (`!global`).
[ { "docid": "3d8e32cf91d050f42553f552c35f4cee", "score": "0.0", "text": "def global; end", "title": "" } ]
[ { "docid": "4831149abe39126bed6abdd52c906bd1", "score": "0.7715091", "text": "def global?() false end", "title": "" }, { "docid": "4831149abe39126bed6abdd52c906bd1", "score": "0.7715091", "text": "def global?() false end", "title": "" }, { "docid": "452e5be95a8f3d88244500...
7ecf6bacbf4c4509751e40583db741c5
Return "active" if its the current action
[ { "docid": "8997387e06f1842d20240fe36a4caae6", "score": "0.75534916", "text": "def active_action(link_path)\n if params[:action] == link_path\n return 'active'\n end \n end", "title": "" } ]
[ { "docid": "c3a320cbcd05c48855ca7b9b3e674169", "score": "0.85333794", "text": "def is_active(action)\n params[:action] == action ? \"active\" : nil\n end", "title": "" }, { "docid": "3691beed02c7c05cbcc613b1ad30aef4", "score": "0.84046555", "text": "def is_active?(action)\n if...
92c33f82c73ed82005a89759b96d6047
Returns the Technet product list.
[ { "docid": "bab660e0cb5c765290e5e35ee1c463d4", "score": "0.5934221", "text": "def get_product_dropdown_list\n @product_dropdown_list ||= lambda {\n list = []\n\n page = ::Nokogiri::HTML(firstpage)\n page.search('//div[@class=\"sb-search\"]//select[@id=\"productD...
[ { "docid": "812c4bcbe7fe1b0ebee35c31e2ca7314", "score": "0.7442088", "text": "def products_list\n @products = Haiwet::Product.list\n @products.each.with_index(1) do |prod, i|\n puts \"#{i}- #{prod.name}\"\n end\n end", "title": "" }, { "docid": "7919614da55...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "d5ce132304ef8d0b8d5cb4dcb4809021", "score": "0.0", "text": "def set_omim\n @omim = Omim.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163443", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.604317", "text": "def action_hook; ...
925a3b7e60be9e52e65677e045d3de5c
ratio is: x_coordinate / x_axis_length = ( date date_range.begin ) / date_range_length
[ { "docid": "2daff5da6fa08bb4a11ac4ee2568d930", "score": "0.6957568", "text": "def date_to_x_coordinate(date) # => Numeric\n date_range_begin, date_range_end = @x_axis_tick_dates.first.jd, @x_axis_tick_dates.last.jd\n date_range_length = date_range_end - date_range_begin \n ( @x_axis_le...
[ { "docid": "440a7b20ec7494284f14b06ad0b7fbf7", "score": "0.6388313", "text": "def coord_date(i)\n (@timeline_date_start - i).abs.to_f / (@timeline_date_start.to_i - @timeline_date_end).abs.to_f * @width\nend", "title": "" }, { "docid": "25492f999bfb1660c81743c1203353be", "score": "0.616...
47fc7ee5ab9ccb203b5ba090855939e7
GET /vacinas GET /vacinas.json
[ { "docid": "ce43471485d922a9c744560641ab1c0a", "score": "0.0", "text": "def index\n if params[:animal_id]\n @vacinas = apply_scopes(Vacina).includes(:animal, :tipo_vacina).animal(params[:animal_id])\n else\n @vacinas = apply_scopes(Vacina).includes(:animal, :tipo_vacina).propriedade(curr...
[ { "docid": "212241a552a6a35bb1cadacf18765fd6", "score": "0.741527", "text": "def index\n @vacancies = Vacancy.all_vacancies# current_user.vacancies #\n render json: @vacancies\n end", "title": "" }, { "docid": "e655e31720bc3c0ae3ac8e58adab2497", "score": "0.73747987", ...
df3019fc85bf5c4b299c4b14208fc466
POST /supports POST /supports.json
[ { "docid": "fc7085ddb25a5f67d5395657300a5288", "score": "0.62033737", "text": "def create\n @support = current_user.supports.build(support_params)\n\n respond_to do |format|\n if @support.save\n format.html { redirect_to @support, notice: 'Support was successfully created.' }\n ...
[ { "docid": "66aa8d6a1775ddd4afb04ded12594c7b", "score": "0.6709622", "text": "def supports\n @supports ||= {}\n end", "title": "" }, { "docid": "32d4b398436e20b9098cb53dadfe180f", "score": "0.6465519", "text": "def supports_json?; end", "title": "" }, { "docid": "...
abe34b538e2d0da0ef7402a02d49ca2f
Wraps the +text+ into lines no longer than +line_width+ width. This method breaks on the first whitespace character that does not exceed +line_width+ (which is 80 by default). ==== Examples word_wrap('Once upon a time', 4) => Once\nupon\na\ntime word_wrap('Once upon a time', 8) => Once upon\na time word_wrap('Once upon...
[ { "docid": "1e15fcdc3a28a9a17d56386e04ce1efc", "score": "0.8422439", "text": "def word_wrap(text, line_width = 80)\n text.split(\"\\n\").collect do |line|\n line.length > line_width ? line.gsub(/(.{1,#{line_width}})(\\s+|$)/, \"\\\\1\\n\").strip : line\n end * \"\\n\"\n end",...
[ { "docid": "94da0b6be516ff75fd129401b9724b7c", "score": "0.83602417", "text": "def word_wrap(text, line_width: 80, break_sequence: \"\\n\")\n text.split(\"\\n\").collect! do |line|\n line.length > line_width ? line.gsub(/(.{1,#{line_width}})(\\s+|$)/, \"\\\\1#{break_sequence}\").rstrip : line\n ...
c9e7adc27f0f5e5c5a14cfc15991415b
variables, and methods passed through the game loop on each of the players turns.
[ { "docid": "323f3bc23261277732c9c14e126383b4", "score": "0.0", "text": "def player_display\n user_prompt = \"Please enter Coordinates: \"\n @win.setpos(@centre_y + @centre_y/2, @centre_x - @centre_x/2 - user_prompt.length/2 )\n @win << user_prompt\n @win.refresh\n coordinate = @win.getstr...
[ { "docid": "819422ea2e9939075e4fc5424099d822", "score": "0.7294009", "text": "def game_turns\n end", "title": "" }, { "docid": "85258287fd08199ff04af0fad0fac204", "score": "0.7053859", "text": "def turns\n @players.each do |player| \n action = player.take_turn\n end\n ...
45b82028d07f0e1580c3ae1cff7e294b
have to answer 3 questions correct to proceed, otherwise game over(method)
[ { "docid": "df312e01f9af251a76a5cb6bb567dc4d", "score": "0.6873657", "text": "def question_room\n puts \"You've entered a very strange rooms\"\n puts \"It has question marks all over the walls\"\n sleep(0.5)\n 10.times do\n puts \"??????\"\n sleep(rand(0.06..0.07))\n end\n \n puts \"You hea...
[ { "docid": "a12098ed1b58c0d3e5d6197d8e273ea1", "score": "0.7468135", "text": "def correct_answer\n case @turn\n when 1\n @p1_score += 100\n @turn = 2\n puts TSTAR + \"CORRECT!\".bold + BSTAR\n puts TLINE + \"#{@p1_name} +100 points\" \n puts \"\\n\\n\"\n return gener...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "4f36006c8364a7d460d108b8ecc50b83", "score": "0.0", "text": "def update!(**args)\n @rejoined_user_events_count = args[:rejoined_user_events_count] if args.key?(:rejoined_user_events_count)\n end", "title": "" } ]
[ { "docid": "184b1b1ed771473d3eb9f338c0734c38", "score": "0.730762", "text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end", "title": "" }, { "docid": "5076c5a88404ae72986f958710f5687a", "score": "0.7263234", "text": "def update(pr...
9fd270f40b34d6fe7f1c9a57136df3fd
Generates short Course names from VA Course Codes param state_course code A VA state course code These must be 9 characters or less!
[ { "docid": "b8cfe3b15cd8a5615880bfe6dd4957fb", "score": "0.7497486", "text": "def gen_short_course(state_course_code)\n short_courses = { '1109' => 'Eng 6', '3110' => 'Math 6', \n '2354' => 'US-His 6', '2357' => 'Civ Econ', '1110' => 'Eng 7',\n '3111' => 'Math 7', '3112' => 'Math 8', '4125' => 'Sci 8'...
[ { "docid": "14c117d624217b5dd4961de008f70e2a", "score": "0.66249096", "text": "def batch_course_code\n [course.code, name].join(' ')\n end", "title": "" }, { "docid": "bfed44c4a52ee6dfaff67e485a0df649", "score": "0.60674906", "text": "def full_name_course_num\n \"#{course_num}...
c5d2e5a71683bf52d3a7e79610ca7b0a
POST /projects POST /projects.json
[ { "docid": "d97d6669b722c455a1c00d593668cd10", "score": "0.0", "text": "def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.json { render :json => {:valid => true, :designation => @project, :notice => \" project was successfully...
[ { "docid": "3987b362caed851c61fc0c13c211f4a8", "score": "0.7338948", "text": "def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.json { render :json => @project, :status => :created, :location => @project }\n format.html ...
e356e8836d8679c2aab3ee5b81b5193a
ask for rowwise matrix on stdin
[ { "docid": "2cc7da2cea7feb9f61100cfc92239730", "score": "0.635213", "text": "def ask_matrix(rows, columns)\n accl = []\n while accl.length < rows * columns do\n accl.concat ask\n end\n Matrix::build(rows, columns) do |r, c|\n accl[ c + r * rows ]\n end\nend", "title": "" } ]
[ { "docid": "780ed408a647314927952d273858003c", "score": "0.6833453", "text": "def take_input\n p 'Which row?'\n row = gets.chomp.to_i\n p 'Which column?'\n column = gets.chomp.to_i\n [row, column]\n end", "title": "" }, { "docid": "b36d62263d38dfdfbcf760320f825c22...
de2bcf87aa79ffd12b60764abd17e518
Determines whether sinatra's layout functionality should be used.
[ { "docid": "36b8bcae7c6f0a20a7d28eeb32bc346c", "score": "0.75759935", "text": "def layout?\n content_type == \"text/html\"\n end", "title": "" } ]
[ { "docid": "3134f8a5664f566802133f9e6ff7c306", "score": "0.7839085", "text": "def layout_for_page\n if params[:layout] == 'none' || params[:layout] == 'false'\n false\n else\n params[:layout] || 'application'\n end\n end", "title": "" }, { "docid": "540a323c8e...
4bef1fbb23f3bd27e63f37896450267e
Set +published_at+ Verify whether value is a Date. If this is not the case then value will be set to nil. ==== Paramaters value:: Date on which this content should be published
[ { "docid": "795e7ab9948d6a634ddf0c0c71213672", "score": "0.79982466", "text": "def published_at=(value)\n value = nil if value.instance_of?(String) && value.length == 0\n attribute_set(:published_at, value)\n end", "title": "" } ]
[ { "docid": "081c97110d41b6360196020fe19fde16", "score": "0.7869139", "text": "def set_published_at\n return if self.is_draft?\n if @publish_date.nil?\n self.published_at = DateTime.now\n else\n years, months, days = @publish_date.split('-').map { |x| x.to_i }\n hours, minutes = (...
d99088e2d3e2bca9756da1efa1ba6376
TODO: build more custom errors for anything the client should be able to resolve
[ { "docid": "0ba5ff101e8a540b40736e910ae1485e", "score": "0.0", "text": "def consume_message(message)\n create_inbound_batch\n handler = build_handler(message)\n process_message(handler)\n Inbound::Response.build_response(handler.message_id, @batch.inbound_batch_id, @errors)\n resc...
[ { "docid": "ed5a5bb126b87c1085cbd8e32c5359cd", "score": "0.72327965", "text": "def client_error?; end", "title": "" }, { "docid": "525bfb7eb245e4277cf7e723df898d4c", "score": "0.71864796", "text": "def api_error; end", "title": "" }, { "docid": "ade4fd80403f4cc198e115d8a4...
a28e478681ac9d29c5dd796aa824781d
PATCH/PUT /users/1 PATCH/PUT /users/1.json
[ { "docid": "e60c8e80e55678fb067fd31081a866f8", "score": "0.0", "text": "def update\n respond_to do |format|\n if @user.update(user_params)\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.ht...
[ { "docid": "23a904e6ddd4b6b07c4b53353e78cf93", "score": "0.7224859", "text": "def update\n render json: User.update(params[\"id\"], params[\"user\"])\n end", "title": "" }, { "docid": "4781fa7337315133553edb54194e6202", "score": "0.7128554", "text": "def update\n render json: ...