query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
ca81f38726e4a037a759b6f377aa38be
Returns the latest date. Note that this returns a date that has the precision set, not the latest day.
[ { "docid": "3cf1b68a45125369289675d482c7b690", "score": "0.6077985", "text": "def latest_raw\n @latest\n end", "title": "" } ]
[ { "docid": "3f85385599af7787daf822570e9f1656", "score": "0.7635147", "text": "def latest_date\n self.class.latest_date_from(self)\n end", "title": "" }, { "docid": "40c9b5221b1e6de41611498d44b6999a", "score": "0.7357057", "text": "def latest_date\n swing_dates.maximum(...
e6dd902bd4bd00849b89f618f2810aea
Wraps get by default
[ { "docid": "62b5b66d94ba8ac4a32a5e662fe2bee3", "score": "0.0", "text": "def query(query, use_valkyrie: Hyrax.config.query_index_from_valkyrie, **args)\n Rails.logger.warn rows_warning unless args.key?(:rows)\n method = args.delete(:method) || :get\n\n result = case method\n ...
[ { "docid": "182a6f9ecce3cdd7657cc4aabdbbebea", "score": "0.7566537", "text": "def method_missing(method, *args, &block)\n get.send(method, *args, &block)\n end", "title": "" }, { "docid": "9aaeec3e58f53a20213325646a695df8", "score": "0.73352045", "text": "def method_missing(m...
c2b9d764522d5c1ddbce38572595d7e1
only_valid is used to avoid recursion when a piece creates valid_moves
[ { "docid": "13e4eb73ff4c9d93fc93ce49076f4111", "score": "0.0", "text": "def move_piece(start_pos, end_pos, only_valid: true)\n error_message = \"There's no piece at #{start_pos}\"\n raise MoveError, error_message if self[start_pos].is_a?(NullPiece)\n\n piece = self[start_pos]\n valid_ends = ...
[ { "docid": "c24e5ea3b22a96247facd1d3744a4825", "score": "0.773761", "text": "def valid_moves\n\n end", "title": "" }, { "docid": "39669a417e696d4d73e21ab9301d83a1", "score": "0.76501805", "text": "def valid_moves # do this method with the board#dup and all that and check if in check...
11180f1c2421052ce2dfc51573cb1ed5
GET /resources/new.json TODO: na razie nie ma zastosowania
[ { "docid": "e1bc9a5c7d5dc36da2fd873d88e65d1f", "score": "0.8066211", "text": "def new\n\tputs \"new\"\n @resource = Resource.new\n\n respond_to do |format|\n format.json { render json: @resource }\n#\t format.html { render html: @resources }\n end\n end", "title": "" } ]
[ { "docid": "c38f1a3603b5de5824f457cac4925b2d", "score": "0.76766187", "text": "def new\n @resource = Resource.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource }\n end\n end", "title": "" }, { "docid": "0eb1e08613a69bba991330...
82aca695a0d0a93a5489ee157fc71c8e
TODO: This is a bad way of doing things .. this needs redo
[ { "docid": "5bb50c02e05af9209af2062f31ac24fb", "score": "0.0", "text": "def seo_meta_data(pagename, seo_data = nil)\n params = {pagename: pagename, seo_data: seo_data}\n if pagename == 'home'\n params.merge!(current_url: request.fullpath)\n end\n @seo = SeoSlug.new(params)\n check_fo...
[ { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.6158068", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.6158068", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",...
1e7c5ffff3484ecde068ef5265a6e940
Performs the atomic $unset on the supplied field.
[ { "docid": "d37f07bf38d67a9c1cd6639be1743f19", "score": "0.72686774", "text": "def unset(field, options = {})\n Unset.new(self, field, 1, options).persist\n end", "title": "" } ]
[ { "docid": "842b61eedd9aa036818e374a56973d2c", "score": "0.7408633", "text": "def unset(field)\n query.update_all(\"$unset\" => { database_field_name(field) => true })\n end", "title": "" }, { "docid": "c9cb61e4c14ba06cce35634388bcf77a", "score": "0.7113247", "text": "def...
52a5e1fc3a45edf9c8ff625dd21321ef
End of New Method: Create
[ { "docid": "9c7d8edcfd12bdaa3aedbb8c79dba030", "score": "0.0", "text": "def create\n\t\t@rental = Rental.new(params[:rental])\n\t\t@rental.created_by = 1\n\t\t@rental.modified_by = 1\n\n\t\tif @rental.save\n\t\t\tflash[:notice] = 'rental Sucessfully Created.'\n\t\t\tredirect_to :action => 'list'\n\t\tel...
[ { "docid": "cfa08c71c616cdc11ac3715b69147db0", "score": "0.82246476", "text": "def new\n \n end", "title": "" }, { "docid": "cfa08c71c616cdc11ac3715b69147db0", "score": "0.82246476", "text": "def new\n \n end", "title": "" }, { "docid": "cfa08c71c616cd...
6f112a99f2cbe701b916e47f0ed78ad0
the path from the url, without the protocol and domain parts, and without the leading `/`
[ { "docid": "aca373946d94f57d9f6ca9e23c237eb1", "score": "0.7096161", "text": "def url_file_path\n return @url_file_path if @url_file_path\n url_parts = url.match /\\A[^:]+:\\/*[^\\/]+\\/(?<path_portion>.*)/\n url_parts = url.match /\\A\\/?(?<path_portion>.*)/ unless url_parts\n @url_...
[ { "docid": "9d57372c484d18f8a7d010791ba4b42a", "score": "0.8649388", "text": "def path\r\n url.gsub(/https?:\\/\\/[^\\/]+\\//i, '').scan(/([^&]+)/i).first().first()\r\n end", "title": "" }, { "docid": "7df5cafb412ac059c8565cc92f8e0b51", "score": "0.83171934", "text": "def...
e822b31d2c35463b09ebcaefdfe065ef
See if the CrossRef ClickThrough Service Record says that CR_CLICKTHROUGH_CLIENT_API_TOKEN has accpted an appropriate license
[ { "docid": "7da38ceaa05f8642166dbb8732b2bf7f", "score": "0.7361867", "text": "def has_accepted_clickthrough_license?\n\tclient_api_token = request.env['HTTP_CR_CLICKTHROUGH_CLIENT_TOKEN']\n\tclickthrough_profile = get_profile(settings.clickthrough_publisher_api_token,client_api_token)\n\tclickthrough_pr...
[ { "docid": "fef144d4e2eb4fc50dffc0196a989b3c", "score": "0.6541825", "text": "def open_license?\r\n @open_license\r\n end", "title": "" }, { "docid": "6d9a4ea9d5b4abd1101b4b99e0e2cc50", "score": "0.6454036", "text": "def supports_api\n license = License.get\n\n if licen...
0b8159948263ed9bc45e1f84bae00daf
Returns the application categories for traffic shaping rules.
[ { "docid": "7f9a51d194b9ef853899836af3e361d8", "score": "0.6856869", "text": "def get_network_traffic_shaping_application_categories(network_id)\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'network_id' => network_id\r\n )\r\n # Prepare query url.\r\n ...
[ { "docid": "5dd95d870c641f7947c6d9c05ffaa6f1", "score": "0.6558476", "text": "def categories\n unless self.SUPPRESS_FROM_OPAC == 'T' or self.SUPPRESS_FROM_INDEX == 'T'\n add_category('opac')\n end\n @categories\n end", "title": "" }, { "docid": "6b7aac24eba9c018ec4f1d885f05b42...
975a830017e0ab4ceeaa88a427ee27fb
Constructs a new instance.
[ { "docid": "d3aa65375f4c2ecabbcabfad16ee17b6", "score": "0.0", "text": "def initialize(ruby_values = nil, struct_value = nil)\n super(self.class.binding_type, ruby_values, struct_value)\n end", "title": "" } ]
[ { "docid": "e2b31d60b2b5b380040a867c381a1b70", "score": "0.8045547", "text": "def new\n \n end", "title": "" }, { "docid": "e2b31d60b2b5b380040a867c381a1b70", "score": "0.8045547", "text": "def new\n \n end", "title": "" }, { "docid": "e2b31d60b2b5b380040a867c381a1b70...
566ad486f5a723af4ae7207dee7a9613
PATCH/PUT /group_roles/1 PATCH/PUT /group_roles/1.json
[ { "docid": "13c05570b34356c769b3e884b82c7ab8", "score": "0.7239791", "text": "def update\n respond_to do |format|\n if @group_role.update(group_role_params)\n format.html { redirect_to @group_role, notice: 'Group role was successfully updated.' }\n format.json { head :no_content }\...
[ { "docid": "94716e905eea23f362dc8b9a98aedbec", "score": "0.7274569", "text": "def update\n @role = Role.find(params[:id])\n @role_groups = @role.group_ids\n\n @checked_groups = params[:group_ids].map {|group| group.to_i}\n @common_groups = (@role_groups & @checked_groups)\n\n # delete rol...
22aac76925411362bf877e77214c1f1b
GET /devans GET /devans.json
[ { "docid": "8fdaaae337dbe08de3fc3cb13f7b9e42", "score": "0.70520955", "text": "def index\n @devans = Devan.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @devans }\n end\n end", "title": "" } ]
[ { "docid": "067d06caa6a8b58931d32a4b7ef24e00", "score": "0.67215383", "text": "def show\n @devan = Devan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @devan }\n end\n end", "title": "" }, { "docid": "e1b6dafde626a...
68ace5be59306c6dacf06c0cfec9729a
PUT /documenttypes/1 PUT /documenttypes/1.json
[ { "docid": "11c8ffe6303ab1d446cc5b02f24052c2", "score": "0.7173488", "text": "def update\n @documenttype = Documenttype.find(params[:id])\n\n respond_to do |format|\n if @documenttype.update_attributes(params[:documenttype])\n format.html { redirect_to @documenttype, notice: 'Documentt...
[ { "docid": "078fc6f0e5e0fd65b1218492de0bb9e3", "score": "0.76491725", "text": "def update\n @document_type =DocumentType.find(params[:id])\n respond_to do |format|\n if @document_type.update(document_type_params)\n format.json { render json: @document_type, status: :ok }\n else\n ...
d0848cee9ea416dfbd5b07103b6fd1ec
get every test to pass before coding runner below
[ { "docid": "ee01661b7bf9e498b80a3b486222665b", "score": "0.0", "text": "def runner\n welcome\n total_draw = initial_round\n while total_draw < 21\n total_draw = hit?(total_draw)\n display_card_total(total_draw)\nend\nend_game(total_draw)\nend", "title": "" } ]
[ { "docid": "4214d9c38556c2b02453744c9abd3771", "score": "0.7492311", "text": "def pass(suite, test, test_runner); end", "title": "" }, { "docid": "e820a876acc56d01d07c4fe31f07d454", "score": "0.74173", "text": "def run_tests\n count = 0\n puts \"Starting test run...\"\n self...
5e9eed428cbfef3d767fb0454ae51d18
Inserts the specified record in the specified +database+ (either :left or :right). +table+ is the name of the target table. +values+ is a hash of column_name => value pairs.
[ { "docid": "2a943bb6b259ddefe427b016fe0c15c0", "score": "0.7915203", "text": "def insert_record(database, table, values)\n connections[database].insert_record(table, values)\n end", "title": "" } ]
[ { "docid": "8ac787357158511c21e8029e626389b9", "score": "0.70809025", "text": "def insert_row(table_name, values)\n @database[table_name].insert(values)\n end", "title": "" }, { "docid": "d1d94db3ae62b752ea7fbc1a5dc12162", "score": "0.69683987", "text": "def insert(table, columns...
c3e18f2a89bf36e06e43a16a973f9a65
Yields the given block if the user logged in is the system administrator
[ { "docid": "73fd3f98313ab62269eeafea10395337", "score": "0.75328636", "text": "def if_app_admin\n if logged_in?\n user = User.find(session[:user_id])\n if user.user_role.role == \"administrator\"\n yield if block_given?\n return\n end\n end\n end", "title": "" }...
[ { "docid": "b720550483b1ba63895278e6bc7e53e6", "score": "0.7226892", "text": "def admins_only(&block)\n block.call if current_user.try(:admin?)\n nil\n end", "title": "" }, { "docid": "e371f8acf57da196889e7c8ace8ba8ee", "score": "0.721178", "text": "def admins_only(&block)\n ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "f5a3bc017e5ecfa98bc5db0dcb1be720", "score": "0.0", "text": "def synonymou_params\n params.require(:synonymou).permit(:word_id, :word_2_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...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "961582b19f0ed318c21af21bfb2a9ab3", "score": "0.0", "text": "def set_p_user\n @p_user = PUser.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.6032574", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6015663", "text": "def...
ba4f1e9a0ca041d3cc818d7dad1609d2
looks up all songs with associated artist
[ { "docid": "181ad9193e1b01776cded551b9ddf61f", "score": "0.78424376", "text": "def songs\n Song.all_by_artist(self)\n end", "title": "" } ]
[ { "docid": "7ed8679abc454268948aa877d1d09544", "score": "0.7756042", "text": "def songs\n #use select to iterate thru songs\n Song.all.select{|song| song.artist == self}\n end", "title": "" }, { "docid": "82aaf3d4bcc2015b7a905fa47c0781a9", "score": "0.77346545", "tex...
0fbdc94a304a049097013e77bc9a500d
Set the value of the SecurityToken input for this Choreo.
[ { "docid": "9add1465b6e21c628dd9d20251e8cc42", "score": "0.7984486", "text": "def set_SecurityToken(value)\n set_input(\"SecurityToken\", value)\n end", "title": "" } ]
[ { "docid": "e7d7dafd2b1227377badf026162492f1", "score": "0.5834737", "text": "def set_Token(value)\n set_input(\"Token\", value)\n end", "title": "" }, { "docid": "e7d7dafd2b1227377badf026162492f1", "score": "0.5834737", "text": "def set_Token(value)\n set_input(\"...
339729f3253e477d8660dfea2feb3436
decode an error message into a protobuf reset message
[ { "docid": "493a1a7d528710defd91b4cd904569a6", "score": "0.7447884", "text": "def decode_err(err)\n\t\treturn Netbat::Msg.new(\n\t\t\t:op_code => Netbat::Msg::OpCode::RESET,\n\t\t\t:err => err.msg,\n\t\t\t:err_type => err.err_type\n\t\t)\n\tend", "title": "" } ]
[ { "docid": "39419d668e015b34779412930a2f4b7d", "score": "0.6542626", "text": "def decode_message(bytes)\n raise \"Empty message\" if bytes.empty?\n reserved, schema_id, avro = bytes.unpack('cNa*')\n raise \"Reserved byte #{reserved.inspect} in message header (expected 0)!\\nmessage: #{byt...
912c0e0cf8816366872f1b29941d2de1
DELETE /events/1 DELETE /events/1.json
[ { "docid": "f41eedf4bbec81ae85e0190150e8c3da", "score": "0.0", "text": "def destroy\n @verbindung = Verbindung.find(params[:verbindung_id])\n if !has_access_to_verbindung(@verbindung) then return end\n\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n f...
[ { "docid": "11f7138ce2d6d84fa0d9949fbd14cb07", "score": "0.7693224", "text": "def destroy\n @event = Event.using(:shard_one).find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", ...
579bd488b3671bce83b55832ab2a042e
The current user profile picture URL
[ { "docid": "09e97aa3836d24a524feff417a8ffb78", "score": "0.8135242", "text": "def profile_pic_url\n json[\"entry_data\"][\"ProfilePage\"].first[\"graphql\"][\"user\"][\"profile_pic_url\"]\n end", "title": "" } ]
[ { "docid": "0ce2b01aa2886806e02774355d59f22d", "score": "0.82898366", "text": "def profile_pic_url\n result_hash['pic']\n end", "title": "" }, { "docid": "9580aa58a884d1dad29a2e22116b65c7", "score": "0.82226527", "text": "def profile_url\n if self.profile and self.profile ...
668d3fcaedfdf166d97b60d1d3d4474f
Query the configuration of a service using QueryServiceConfigW or QueryServiceConfig2W
[ { "docid": "421a531afd39f2bfbdd4cb0b78145fbb", "score": "0.0", "text": "def service_start_type(service_name)\n start_type = nil\n open_service(service_name, SC_MANAGER_CONNECT, SERVICE_QUERY_CONFIG) do |service|\n query_config(service) do |config|\n start_type = SERVICE_START_T...
[ { "docid": "e1eb300cf3fe418c314b1a7fb5e115b9", "score": "0.64543587", "text": "def query_service\n Valkyrie.config.metadata_adapter.query_service\n end", "title": "" }, { "docid": "a4f28e293425372492a0111a1b5c0cf8", "score": "0.64202106", "text": "def get_serv_config\n\t\tact...
9d7d5593dd5a1115d1737a32fb5175e5
Process the scale results for the current iteration, update the CSV file, fail if KOs are found
[ { "docid": "e3561a773ffef9a98b888049376f65f2", "score": "0.55703866", "text": "def check_scale_results(scenario_hash) # rubocop:disable Metrics/AbcSize\n scenario = scenario_hash[:name]\n scale_scenario_instances = scenario_hash[:instances]\n success = true\n\n puts \"Checking results for sc...
[ { "docid": "99ed031e66e586da06b86c6a86f9dd6b", "score": "0.64745367", "text": "def process\n return if @metrics.size_all == 0\n\n collate\n write_to_disk\n end", "title": "" }, { "docid": "fc5034360e744ad3ce7ca0307e76c364", "score": "0.63621795", "text": "def update...
542ae9a8f7b4ef3316e310ea0a145af5
wector.rationalize Arguments: other: (Array)
[ { "docid": "a13732cf01e91c4f2c3d6bd42114f2c1", "score": "0.7964815", "text": "def rationalize(other)\n if other.is_a? Array\n raise \"Incorrect Dimensions\" unless self.size == other.size\n other = other.dup\n self.class.new(map { |i| i.rationalize other.shift })\n elsif o...
[ { "docid": "13157bcd7c387b189308312f047655d0", "score": "0.7073642", "text": "def rationalize(*eps)\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "13157bcd7c387b189308312f047655d0", "score": "0.7073642", "text": "def rationalize(*eps)\n #This...
fdac98ba6a67af665537daaa5b56aaaa
Export all events from selected categories as an ics file
[ { "docid": "8e318a46f99a2f586f992680f69e087f", "score": "0.75939524", "text": "def export_selected_events\n\n cat = params[:category]\n cat = cat.split(\",\")\n\n @events = Calendar.find(:all) do\n any do\n cat.each do |c|\n categories.id == \"#{c}\"\n end\n end...
[ { "docid": "16924f25dd8a56c491182d22b021daeb", "score": "0.7362611", "text": "def export_ical\n @event = Event.find(params[:id]) \n # dates = EventDatetime.find_by_event_id(@event.id)\n urls = @event.get_urls\n url_total = \"\"\n for url in urls\n url_total += url.to_s + ...
fca81a9a2b1f51d6bf4ab69b8d8680fd
Process each of the commit by sequentially going through by index and inserting in to hash
[ { "docid": "5dd9f1f84b183be46872e7d7cebd2352", "score": "0.72361445", "text": "def index_process_commit(arr, hash)\n\n commit_hash_str = arr[0].strip\n author_email_str = arr[2].strip\n created_at_tstamp = DateTime.parse(arr[3].strip)\n parent_hash = arr[4].strip\n\n #add commit hash\n ...
[ { "docid": "8782af53669bf2a0b6311529ef5a0389", "score": "0.6770591", "text": "def each_entry_with_index\n @index.each_with_index do |hash, idx|\n next if hash.nil?\n entry = '' \n hash.each {|x| entry << pack(x.sha1, @block_ary[x.block].start, @block_ary[x.block].size, x.buflo...
810290d5cd5b03ecc44bcd06090872f9
Defined humanreadable name of this resource type
[ { "docid": "54e0d16037d5f2536d63a78713ace601", "score": "0.73650485", "text": "def resource_type\n return 'Undefined'\n end", "title": "" } ]
[ { "docid": "386920a0ac4fab72fd352cc5fe782ef6", "score": "0.7926036", "text": "def resource_name\n Util.to_plural(instance.class.resource).to_sym\n end", "title": "" }, { "docid": "4334f41d9a6d564fa0055fab9b019c0c", "score": "0.78441566", "text": "def resource_name\n ...
02c15269374d44508f2194b919f69c13
=begin rdoc Note: operands are added after instantiation. =end
[ { "docid": "70ae85c035d72f57c847bb65fb7686a3", "score": "0.0", "text": "def initialize( arch, ascii, opcode, prefixes=[], effects=[] )\n @arch = arch\n @ascii = ascii\n @opcode = opcode\n @operands = OperandList.new\n @prefixes = [ (prefixes || []) ].flatten \n @side_effect...
[ { "docid": "84461160c7fd31ede2e5d7ca81c1063d", "score": "0.6743221", "text": "def operand1; end", "title": "" }, { "docid": "3d9abab6384f891b3bc8138a5a311580", "score": "0.6730509", "text": "def op; end", "title": "" }, { "docid": "3d9abab6384f891b3bc8138a5a311580", "...
fe37da3cc26f81c7d1f895ecec56b932
iterate through all fields and test conversion
[ { "docid": "033aba6abb6f8a170f0deefbcc7fc93e", "score": "0.6187216", "text": "def compare_all_fields(model_name)\n @scp_field_names.each_with_index do |scp_name, index|\n converted_name = FacetNameConverter.convert_schema_column(:alexandria, model_name, scp_name)\n assert_equal @expected_co...
[ { "docid": "6cbaa7a41e75e13fa3a94890a94c8616", "score": "0.6872563", "text": "def unconverted_fields?() @unconverted_fields end", "title": "" }, { "docid": "ad9784dd8b9cfd8f9bf576b69a93bc01", "score": "0.61326075", "text": "def each_field\n all_fields.each do |field|\n va...
ddc30c99513c9ba855626bab1fa3ff0a
Creates JSON of the curent object
[ { "docid": "e70adda17d089a30b656fc1b78c6e643", "score": "0.0", "text": "def to_json(options = {})\r\n hash = key_map\r\n hash.to_json(options)\r\n end", "title": "" } ]
[ { "docid": "88d583e291ae96cf67ce99a9df5bb82b", "score": "0.7116037", "text": "def write_json(object); write object.to_json; end", "title": "" }, { "docid": "9951867288d5591d9d7b213a760914d6", "score": "0.711067", "text": "def to_json(*args)\n {\n JSON.create_id => self.cl...
4cf20121d3f76fd4a5b254878bc7037a
Execute the given file using the associate app
[ { "docid": "43f5a57b770358b079a8225b230c58c8", "score": "0.78458637", "text": "def run( file_name )\n application = select_app( file_name )\n system( \"#{application} #{file_name}\" )\n end", "title": "" } ]
[ { "docid": "e4aa793ced7f635f21a1c7571a408baf", "score": "0.7883974", "text": "def run file_name\n\t\tapplication = select_app file_name\n\t\tsystem \"#{application} #{file_name}\"\n\tend", "title": "" }, { "docid": "1a2c2570bac9b34b9bf226709fef1cde", "score": "0.78704983", "text": "d...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "d2c8141883047786eb5b80c10e03e62d", "score": "0.0", "text": "def update!(**args)\n @blog_data = args[:blog_data] if args.key?(:blog_data)\n @book_citation_data = args[:book_citation_data] if args.key?(:book_citation_data)\n @deprecated_author_obfuscated_gaia = args[...
[ { "docid": "150fa2bdc1fc43d28ac45e2278a1f797", "score": "0.7012263", "text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "t...
b652df54ca362e6a00c08f1c370e8af3
GET /short_names/1 GET /short_names/1.json
[ { "docid": "1ef54524658761267a3d51c7982a44ab", "score": "0.76477915", "text": "def show\n @short_name = ShortName.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @short_name }\n end\n end", "title": "" } ]
[ { "docid": "220b981cc822f20bea60434f0865ddfc", "score": "0.71382123", "text": "def rest_name\n short_name.downcase\n end", "title": "" }, { "docid": "eb103bac7a291d061fd722fb4b4a4cc7", "score": "0.6771936", "text": "def short_name\n @short_name ||= name.to_...
15d4d8598c0ac10d22959881f7c05d31
Remove an anonymization rule Removing a nonexistent rule is your business. This method only cares that the rule does not exist when it's done.
[ { "docid": "e5c394d854f15b8e2a0bc00ece3f9296", "score": "0.7124882", "text": "def forget_anonymization_rule rule_name\n self.anonymization_rules.delete rule_name\n end", "title": "" } ]
[ { "docid": "9e2b4e2b3a766f6d448eac452ff194bc", "score": "0.73454595", "text": "def delete_rule rule\n delete rule.meaning.to_sym\n end", "title": "" }, { "docid": "95b1c93f51511c0c9dc58d1aaea95257", "score": "0.72581553", "text": "def delete_rule(rule)\n delete_rules(rule)\n...
0ae5c1e9409bfc992e5f746a31db176d
Set the value of the Name input for this Choreo.
[ { "docid": "556b2d3ed77dc127d19f7fa1a0d04847", "score": "0.0", "text": "def set_Name(value)\n set_input(\"Name\", value)\n end", "title": "" } ]
[ { "docid": "bd8df1d1ba74b7b21f005d968816a612", "score": "0.7494862", "text": "def set_Name(value)\n set_input(\"Name\", value)\n end", "title": "" }, { "docid": "bd8df1d1ba74b7b21f005d968816a612", "score": "0.7494862", "text": "def set_Name(value)\n set_input(\"Nam...
f4fd3a2012baab763c47aa276fb7dc90
Abstract method that subclasses override to produce the content of the effective path. It should either succeed and return a String or fail with an exception.
[ { "docid": "d131169e2614f4fcb5895d8c2492453b", "score": "0.6269343", "text": "def get_contents(effective_path)\n raise NotImplementedError.new\n end", "title": "" } ]
[ { "docid": "670816e28aa2c0fcc725897a7e12ffff", "score": "0.64498395", "text": "def to_s\n path\n end", "title": "" }, { "docid": "398fb7809b9439849140d689ea3c45b6", "score": "0.6403689", "text": "def path() end", "title": "" }, { "docid": "398fb7809b9439849140d689ea3c...
0c80708ca8f91c930bd6c4b50bed425b
Combine any legacy options into a single global overlay and create new bit collection to track any bitwise overlays.
[ { "docid": "9752db98e9a9c703408518340f8d6c06", "score": "0.54773116", "text": "def extract_overlay_data(reg_or_val, size, options = {})\n if reg_or_val.respond_to?(:data)\n ovl = reg_or_val.dup\n else\n ovl = Reg.dummy(size)\n end\n\n if options[:overlay]\n globa...
[ { "docid": "3820f134428f28f403a3f344345b50a7", "score": "0.6088688", "text": "def combine_opts\n result = 0\n flags.each { |f| result |= f }\n\n result\n end", "title": "" }, { "docid": "55c478f931068c9e53db611cd1e56065", "score": "0.55061555", "text": "def composit...
05be79c11209441fc6de9cbc08a115b3
DELETE /pics/1 DELETE /pics/1.xml
[ { "docid": "f040140f2f441a89c3b958f440baffe4", "score": "0.72565556", "text": "def destroy\n @pic = Pic.find(params[:id])\n @pic.destroy\n\n respond_to do |format|\n format.html { redirect_to(pics_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
[ { "docid": "e33f242b37af43369183ed6142762c65", "score": "0.7087131", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n @image.delete_img(@image.name)\n \n respond_to do |format|\n format.html { redirect_to(images_url) }\n format.xml { head :ok }\n en...
b1d567e52e0d5be4d8b5f7d8ff0c6f5b
POST /replies or /replies.json
[ { "docid": "c3efb8565284a0a30161950ff4ee8854", "score": "0.74285275", "text": "def create\n @post = Post.find(params[:post_id])\n @reply = @post.replies.new(reply_params)\n\n respond_to do |format|\n if @reply.save\n format.html { redirect_to @post, notice: \"Reply was successfully ...
[ { "docid": "3e3b7de0abe75d77ee71aae532a0188e", "score": "0.73354673", "text": "def create\n content = params[:content]\n location = params[:location]\n lat = params[:lat]\n lng = params[:lng]\n @reply = @current_user.replies.new(content: content,\n lo...
0d1d35e2f3b51df560dacd9fa0f85f34
Use dylib instead of so
[ { "docid": "e8f277f31fb65847265234ca2c98c49f", "score": "0.0", "text": "def patches; DATA; end", "title": "" } ]
[ { "docid": "9331697a0c8c3182a639a7badb7b5f17", "score": "0.8023466", "text": "def linked_dylibs; end", "title": "" }, { "docid": "9331697a0c8c3182a639a7badb7b5f17", "score": "0.8023466", "text": "def linked_dylibs; end", "title": "" }, { "docid": "dd5c00f1ee7162ed1742cbb3...
fe7acb914104d7dad27ec4658db80370
Halt the current request and respond with a 401 AUTHORIZATION REQUIRED
[ { "docid": "fdc343138a9dd2faf2837ba717288c2a", "score": "0.671223", "text": "def send_authrequired_response( realm=\"gemserver\" )\n\t\tself.response['WWW-Authenticate'] = %(Basic realm=\"#{realm}\")\n\t\tthrow :halt, [ 401, 'Authorization required' ]\n\tend", "title": "" } ]
[ { "docid": "29a7964cff363860f618cb1a37318782", "score": "0.75654465", "text": "def unauthorized\n headers['WWW-Authenticate'] = 'Bearer realm=\"API\"'\n head :unauthorized\n end", "title": "" }, { "docid": "c0cb18cdbcb85c8e43d3ad80b6757021", "score": "0.7549013", "text": "def ...
5182f02a0719adc5d29d9ec64095e5e5
tell a string is Chinese words or not return true if is
[ { "docid": "532ccd1e383542b22ebc2112ab360b74", "score": "0.7288308", "text": "def han?(str)\n str =~ /\\p{Han}/\nend", "title": "" } ]
[ { "docid": "3851d6ad4dfb140ef15c8d115a83187d", "score": "0.78648174", "text": "def chinese?(c)\n (0x2000..0x2069).include?(c.ord) || # General Punctuation\n (0x2e80..0x2fff).include?(c.ord) || # CJK Radicals Supplement, Kangxi \n # Radicals, Ideographic...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "272585c40980ab395f72b97b113f0ef7", "score": "0.0", "text": "def set_affected_system_master\n @affected_system_master = AffectedSystemMaster.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.6031952", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6015048", "text": "def...
631dd3a8a58da655dc482813e556a35b
POST /goals POST /goals.json
[ { "docid": "c16af45e9b9c24a0f9b4532dfba3cfa2", "score": "0.6585995", "text": "def create\n # validate that current_user exists\n logger.info current_user.id\n goal = params[:goal]\n goal['owner_id'] = current_user.id\n \n auto_add = params[:goal][:user]\n\n g...
[ { "docid": "509107298fad661a8b3789eeec343f58", "score": "0.7672443", "text": "def create\n @goal = Goal.new(goal_params)\n current_user.goals << @goal\n\n if @goal.save\n render json: @goal, status: :created\n else\n render json: @goal.errors, status: :unprocessable_entity\n end...
fd6290f8c16e9d29060cc48339fadb2e
delayed_job hands us this message after max_attempts are exhausted
[ { "docid": "fd49c4980222874614ab8b920794184a", "score": "0.0", "text": "def failure\n orchestration = Orchestration.find(self.orchestration_id)\n orchestration.message_delivery_failed\n end", "title": "" } ]
[ { "docid": "48e4609258376ed91f529ba075091850", "score": "0.810124", "text": "def max_attempts\n # don't try this job again if it fails. We'll let the client side trigger it again manually\n 1\n end", "title": "" }, { "docid": "d412354d9d0934cd4dedd9ca00db55d8", "score": "0.7431657...
49f7ff62de1489b2f8c973bcc9d07a6a
Creates a new instance.
[ { "docid": "c184b1eb896290fbd643348b675ab1c0", "score": "0.0", "text": "def initialize(value = '')\n @value = Value.new(value)\n end", "title": "" } ]
[ { "docid": "785ca7af6bc64e08d1478854d1e7c46e", "score": "0.8193921", "text": "def new\n @instance = Instance.new\n end", "title": "" }, { "docid": "52b4fba67deb4dd7f43f3fb486fd1535", "score": "0.8173991", "text": "def create(*args)\n new(*args)\n end", "title": "" }...
b0c6b81f7b30f46e5a8044aace6f182f
Returns +1 if player +1 has won in the given game state, 1 if player 1 has won, and 0 if no one has won.
[ { "docid": "bbdd714c2d0290c33372ea9770b9cc94", "score": "0.71353203", "text": "def is_win?(game_state)\n position = @referee.player(game_state.turn).position\n return +game_state.turn if game_state.game_board.kalah(position) > game_state.game_board.TOTAL_STONES/2\n return -game_state.turn...
[ { "docid": "ec2ef83488405b3d983343bba35fd031", "score": "0.6858723", "text": "def win?\n if won_game?\n @games_won += 1\n won_set\n return true\n end\n end", "title": "" }, { "docid": "5c81996e644364808ac22bc9b94d3375", "score": "0.6832063", "text": ...
63fb026aa965069c98aa6bebbc0f32c5
Argument: A 2 dimensional array representing an M N matrix Side effects: None Return: None Edge cases: rotate90([[]]) == [] rotate90([[1, 2, 3, 4]]) == [[4], [3], [2], [1]] rotate90([1],[2],[3],[4]) == [[4, 3, 2, 1] Algorithm: matrix <= argument There are M rows and N columns in matrix rotated_matrix = [] Go through ea...
[ { "docid": "78d3eca440a09047b4f48dcb3de6acdb", "score": "0.84194565", "text": "def rotate90(matrix)\n number_of_rows = matrix.size\n number_of_columns = matrix.first.size\n rotated_matrix = []\n \n number_of_columns.times do |column_number|\n new_row = []\n (number_of_rows - 1).downto(0) do |...
[ { "docid": "93d08018de16a23b5c9b249f8a3d3776", "score": "0.837677", "text": "def rotate90(matrix)\n columns = matrix.size\n rows = matrix.first.size\n r_row = []\n r_matrix = []\n\n 0.upto(matrix.first.size - 1) do |y|\n r_row = []\n 0.upto(matrix.size - 1) do |x|\n r_row << matrix[x][y]...
7c4ffa8a63a117cbab6561150aa27a4d
this creates a file listing all refpages categories (Modular, Foundation, etc.)
[ { "docid": "f97460f5e1132e48329c2efb26b3507f", "score": "0.0", "text": "def moduleTOC(docModules)\n root = Element.new(\"root\")\n\n docModules.each do |moduleName|\n m = Element.new(\"module\")\n m.text = \"Jamoma#{moduleName}\"\n root.add_element m\n end\n @xml.add_element root\n\n ...
[ { "docid": "eb9d1a14a089962587a350a72d1eca85", "score": "0.66267246", "text": "def get_file_categories\n Resources::FileCategory.parse(request(:get, \"FileCategories\"))\n end", "title": "" }, { "docid": "76147f79e91d568ba0d8f91f844e7e10", "score": "0.6525559", "text": "def c...
036d3ae18bc113e4b712f5a6c644b8a2
input: string output: boolean true if all are uppercase. false otherwise. ignore non alphabetic characters
[ { "docid": "88558428bb95b30469f1d23e59f51b71", "score": "0.836456", "text": "def uppercase?(string)\n string.chars.all? do |char|\n char.match(/[A-Z]/)\n end \nend", "title": "" } ]
[ { "docid": "d2b8ea434526bff9b2b3775d5f37aba2", "score": "0.8402715", "text": "def uppercase?(string)\n result = true\n string.chars.each do |char|\n result = false if char.match(/[a-zA-Z]/) && char.upcase != char\n end\n result\nend", "title": "" }, { "docid": "afe34211a2eb25dc11639a5...
b86c32b6a5c21ef5074ed7046c8bfd4f
Compute the direction between the first number and the second. Arguments : +startPos+ > the starting position +currentPos+ > the end position Returns : 1 if the direction is negative 0 if the direction is null +1 if the direction is positive
[ { "docid": "ed89f231c16742562affb60cf64fcd9b", "score": "0.7521163", "text": "def calcDirection(startPos, currentPos)\n\t\t# clamp() is available in Ruby 2.4 only\n\t\t# https://bugs.ruby-lang.org/issues/10594\n\t\t# so this is a quick equivalent of\n\t\t# return (currentPos - startPos).clamp(-1, 1)\n\t...
[ { "docid": "f47ca9def7e4c6ceb8e3084bb1033092", "score": "0.6831465", "text": "def direction(current_node, destination_node)\n direction = [ destination_node.y - current_node.y, # down/up\n destination_node.x - current_node.x ] # negative: left, positive: right\n\n return 2 if dir...
ebb3878c7f5042795d7100a31da97824
For sdiff output. Don't split it in advance!!
[ { "docid": "dd400cec92bd0062cb3c7d16dbe130b7", "score": "0.6251105", "text": "def sdiff_markup(sdiff_output, ignore_limit=1)\n # The unfortunate truth is that the Ruby Diff::LCS gem is\n # slow as hell, so this method is the only practical way\n # to diff large sets - dump them to f...
[ { "docid": "b913255df5700845ecf48d16634a925f", "score": "0.6708139", "text": "def printable_diff\n data_old = @s1.split(/\\n/).map! { |e| e.chomp }\n data_new = @s2.split(/\\n/).map! { |e| e.chomp }\n output = \"\"\n diffs = ::Diff::LCS.diff(data_old, data_new)\n retur...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "6760ca0859aadb9e3e99e5c408fc2f02", "score": "0.0", "text": "def _create_user_params\n params.require(:user).permit(_admin_params)\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.7121987", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "b32229655ba2c32ebe754084ef912a1a", "score": "0.70541996", "text": "def expected_permitted_parameter_names; end", "title": "...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "47402261c7f4d9e3a0541b7a2d238274", "score": "0.0", "text": "def adventure_params\n raw = params.require(:adventure).permit(:name, :setting, :owner_id)\n raw[:owner] = User.find(raw[:owner_id]) unless raw[:owner_id].blank?\n raw\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...
3cd0b65c86b08a84942e75bd2954821d
Pass examination if _expected_ is _actual_ based on object identity. (by equal?)
[ { "docid": "50a8f17890a566c2955abbf03ff761dd", "score": "0.7417961", "text": "def assert_same(expected, actual, message = nil)\n assertion_frame(expected.equal?(actual), message) do\n sprintf(\n \"Expected %s (0x%x) to be the same as %s (0x%x)\",\n expected.inspect, expecte...
[ { "docid": "1a192c5a4478f849f88832c933c5f2a1", "score": "0.77768534", "text": "def eq(expected); end", "title": "" }, { "docid": "bacb5a1114b33d820dd6eab0521a19c4", "score": "0.7748693", "text": "def strict_match\n @expected == @actual\n end", "title": "" }, { "do...
24ad528b2687023f8943ba103c59b95b
New group user object attributes: attributes for object
[ { "docid": "4f6cc96937fb8afe5121c202708395dc", "score": "0.0", "text": "def initialize(attributes = {})\n attr_with_defaults = {\n daily_reminder: true,\n weekly_reminder: true,\n mine_only: false\n }.merge(attributes)\n super(attr_with_defaults)\n end", "title": "" } ]
[ { "docid": "5b07599791586ef98095a1f56c313132", "score": "0.70010525", "text": "def addMembers (group_id, user_id)\n \tm = GroupUser.new(:group_id => group_id, :user_id => user_id)\n \tm.save\n end", "title": "" }, { "docid": "6dd481133c870efbf8fb8bf246d23245", "score": "0.6938688", ...
5977adf3cc0cab184317eeb56ff347fa
def _______________________________ GETTERS & SETTERS _______________________________
[ { "docid": "624eb131144da93ef8923c3283e21a0f", "score": "0.0", "text": "def get_nombre; @nombre; end", "title": "" } ]
[ { "docid": "5a3dc0e6482d536f380828c82e0f7fb7", "score": "0.7638688", "text": "def getters; end", "title": "" }, { "docid": "8975f95936438911763d46097c40f12f", "score": "0.73366773", "text": "def set; end", "title": "" }, { "docid": "8975f95936438911763d46097c40f12f", ...
ebeef36cd21fefcb9e2052daeaa355e1
POST /todolists POST /todolists.json
[ { "docid": "5026c86f42ff160dd122c5547c52d277", "score": "0.7465282", "text": "def create\n @todolist = Todolist.new(params[:todolist])\n @todolist.todo_id= $current_todo\n\n respond_to do |format|\n if @todolist.save\n format.html { redirect_to @todolist, notice: 'Task was successfu...
[ { "docid": "6c0f37560ccc24bf6cede147f4a2f339", "score": "0.7963792", "text": "def create_todolist(todo_list)\n post_params = {\n :body => todo_list.post_json,\n :headers => Logan::Client.headers.merge({'Content-Type' => 'application/json'})\n }\n \n response = Logan...
ad2ac9d92e18a74b973a8cb158ba5acf
the new item form page
[ { "docid": "0ac3f3900a89da59a90f4a4ce7e31a4d", "score": "0.0", "text": "def new\n \t@item = Item.new\n \t@cupboards = Cupboard.all\n end", "title": "" } ]
[ { "docid": "c039cbef96f11f484ef1b747e617c69e", "score": "0.7877464", "text": "def new\n\t@item = Item.new(:number => 1, :user_id => current_user.id )\n\trender :layout => 'form' \n end", "title": "" }, { "docid": "95e0c965c9423f05ca61b53a509cfb87", "score": "0.75517267", "text": "de...
d8b5e2680b87bb9122cdaf2938fb7ad2
PATCH/PUT /franjas/1 PATCH/PUT /franjas/1.json
[ { "docid": "4c7405b6372bcdb1468cb118bc67a2ea", "score": "0.60574216", "text": "def update\n respond_to do |format|\n if @franja.update(franja_params)\n format.html { redirect_to @franja, notice: 'La Franja se ha editado correctamente.' }\n format.json { render :show, status: :ok, l...
[ { "docid": "e7663d0348b74542ff1d2f4fd96156fe", "score": "0.6680832", "text": "def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end", "title": "" }, { "docid": "4e0e59715d19dce2a47fccc2c67326dd", "score": "0.66611487", "text": "def patch!\n reques...
829eec49525d2bffbb189290e7ffbb7f
GET /it_cases GET /it_cases.json
[ { "docid": "0935a2a67b9ed0a673aaa5061ed8f1aa", "score": "0.767946", "text": "def index\n @it_cases = ItCase.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @it_cases }\n end\n end", "title": "" } ]
[ { "docid": "1291cd387b3cc03254957f67fe3ed8db", "score": "0.7223965", "text": "def test_cases\n @api.get_cases( :project_id => @project_id, :suite_id => @suite_id, :section_id => @id )\n end", "title": "" }, { "docid": "4dd35b6497ef3b59e503ec1ec0fa7b1f", "score": "0.7078609", ...
16ff7029e9a37a653b88a6f255cc2ee8
Common to both OS X & Linux
[ { "docid": "0fd7677e288effb5d87ed5cd6179eb58", "score": "0.0", "text": "def awk\n %{awk -F\"[: ]+\" '/inet /}\n end", "title": "" } ]
[ { "docid": "32d28cce86357f9e1f1b767587e67fc6", "score": "0.7201171", "text": "def host_os; end", "title": "" }, { "docid": "32d28cce86357f9e1f1b767587e67fc6", "score": "0.7201171", "text": "def host_os; end", "title": "" }, { "docid": "ea9711643e3f0bda12ce6c88b5ab9c85", ...
efb3c31a279ca65fa8cdec3fd719efb2
GET /newsletter_archives/:id GET /newsletter_archives/:id.xml
[ { "docid": "53437d99f05c93f4cc5f6dbde4d0ab1d", "score": "0.0", "text": "def show\n @newsletter_editions = @newsletter_archive.newsletter_editions.accessible.where([ 'published <> ?', 'unpublished' ]).page(params[:page]).per(25)\n\n first_page = !params[:page] || params[:page] == 1\n @latest_new...
[ { "docid": "d5a26159a8b3b5c341d13f7655452e1d", "score": "0.6683545", "text": "def index\n logger.debug \"cm/archives/index - session_id: #{request.session_options[:id]}\"\n @archives = @current_user.archives\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { ren...
bac322d56126a441c0f5156a5c84fe9d
DELETE /aggregate_metadata/1 DELETE /aggregate_metadata/1.json
[ { "docid": "1c98db05e0b35c2e4ba08a43953f3334", "score": "0.74667597", "text": "def destroy\n @aggregate_metadatum = AggregateMetadatum.find(params[:id])\n @aggregate_metadatum.destroy\n\n respond_to do |format|\n format.html { redirect_to aggregate_metadata_url }\n format.json { head ...
[ { "docid": "c9c1efa513c6158d3160c8beb9b575d6", "score": "0.7061719", "text": "def destroy\n @aggregate = Aggregate.find(params[:id])\n @aggregate.destroy\n\n respond_to do |format|\n format.html { redirect_to(aggregates_url) }\n format.xml { head :ok }\n end\n end", "title": ...
589b0f5d2385fb9555d468a8cb602c85
Method will prepare the body of the issue with the steps, expected result and the actual result. issue = A single gitlab issue row from the csv file. Examples prepare_issue_body(row[1]) Returns the updated body with the gitlab markup.
[ { "docid": "eff1331488336211ae66d89293bd4cb0", "score": "0.7746517", "text": "def prepare_issue_body issue\n @steps = issue[6]\n @expected = issue[7]\n @actual = issue[8]\n body = \"\\n## Steps to Reproduce\n \\n#{@steps}\n \\n## Expected Result\n \\n#{@expected}\n \\n## Actual R...
[ { "docid": "fadc60ad0e244722e7383dfd2b924888", "score": "0.6531542", "text": "def issue_body\n @issue_body ||= context.issue_body\n @issue_body ||= issue.body\n end", "title": "" }, { "docid": "e2fa666d30265f5ef232ae1027c493a2", "score": "0.6087002", "text": "def report_issue_...
c8106894973cccf0102a772142eb50fd
Returns the word string that is entailed by the source words.
[ { "docid": "c096c5cf9d148000cd9fb0702cd0a1e0", "score": "0.0", "text": "def entailed_word\n entailed_tree = entailment_json.fetch(\"entailedTree\", nil)\n entailed_tree.fetch(\"word\", nil) if entailed_tree\n end", "title": "" } ]
[ { "docid": "72e6aab41e62dcefe35c1682000df141", "score": "0.7180277", "text": "def word\n #@short_context[0].split(/\\s+/)[-1]\n @short_context[1].map{|s| s.to_s}.join(\"\")\n end", "title": "" }, { "docid": "e3d774544fdac01ccfde4707f70c122a", "score": "0.673349", "text":...
ee974bdcc565fbb17f4230c8d6a1379d
Start a new conversation with the API
[ { "docid": "faaf0a31b2030d67251a52d34ab795ac", "score": "0.0", "text": "def initialize(key)\n @key = key\n end", "title": "" } ]
[ { "docid": "cfda706c9562b809eb43cb5d15d98713", "score": "0.737714", "text": "def start_conversation( organization_id, params={} )\n conversation_uri = 'conversations.json'\n conversation_uri = \"stencils/#{params[:stencil_id]}/#{conversation_uri}\" if params.include? :stencil_id\n convers...
7126ab3a9a49c6435c0006268edac7ba
Loads the userspecified timezone from configatron, if one exists
[ { "docid": "c4af4d4c52461c2b76580c4a8edaf0f2", "score": "0.68316555", "text": "def set_timezone\n Time.zone = configatron.timezone.to_s if configatron.timezone?\n end", "title": "" } ]
[ { "docid": "4227018bb2e2c65c0a9988b865f1fe7a", "score": "0.69587654", "text": "def load_tzinfo\n insert_listener_into_tzinfo\n load_tzinfo_definitions\n end", "title": "" }, { "docid": "a9821140209cfd80bac2a1ba12c0e2a3", "score": "0.6772825", "text": "def load_timezone_i...
cbbdad0ba2b2853c53c4cb98531e7665
Create a job to check the disk quota on a gear INPUTS: gear: a Gear object RETURNS: a RemoteJob object NOTES: uses RemoteJob
[ { "docid": "c790585d8f845822b15723d14c99ce09", "score": "0.75603455", "text": "def get_show_gear_quota_job(gear)\n args = Hash.new\n args['--uuid'] = gear.uuid\n job = RemoteJob.new('openshift-origin-node', 'get-quota', args)\n job\n end", "title": "" } ]
[ { "docid": "047e8509b30fc6ac25f6cd5c274dd982", "score": "0.7133455", "text": "def get_update_gear_quota_job(gear, storage_in_gb, inodes)\n args = Hash.new\n args['--uuid'] = gear.uuid\n # quota command acts on 1K blocks\n args['--blocks'] = Integer(storage_in_gb * 1024 * 1024)\n ...
c690d91b7e765c8453bc44cad98c50a7
GET /dices/1 or /dices/1.json
[ { "docid": "14519ae9397cc974d54a2521183d86ba", "score": "0.0", "text": "def show\n number=@dice.dice_number #Number of dice\n sides=@dice.dice_sides #sides\n @roll_array = [] #array to store multiple results of dices\n number.times do\n @roll_array << (rand(sides) + 1)\n end\n @to...
[ { "docid": "19aa3aeb1bb18d715a0ab5c25cc2a620", "score": "0.7197419", "text": "def index\n @dices = Dice.all\n\n render json: @dices\n end", "title": "" }, { "docid": "54f11e212cf36fb9ca79e4172c4dc5e1", "score": "0.65421116", "text": "def index\n @dices = Dice.all\n end", ...
5e240ffae9f78875d2da0fbbbb270b95
Returns a boolean indicating whether or not the provided board is solved. The input board will be in whatever form `solve` returns. def solved?(board) end Takes in a board in some form and returns a _String_ that's well formatted for output to the screen. No `puts` here! The input board will be in whatever form `solve`...
[ { "docid": "a0b7432cab8a1dedcc4b6ea184feb707", "score": "0.0", "text": "def make_board(input_str)\n board_side_length = 9\n\n board = Array.new(board_side_length) { [ ] }\n\n board_side_length.times.with_index do |x|\n board_side_length.times.with_index do |y|\n next_number = input_str[(x*boa...
[ { "docid": "10c1e05ceda9578a9b4e4c2f1c33eec6", "score": "0.78276414", "text": "def solved?(board)\n return true if solve(board)\n false\nend", "title": "" }, { "docid": "68eb91701d4887b104e08350c689a37a", "score": "0.7419186", "text": "def solved?(board)\n\t\tif board.include?('0')...
ebea1298b608a07c0d94b59d5c15d679
Find all nodes for which this node has become a finger in their finger table, and notify them. TODO: Doing this monolithically, all at once, seems expensive maybe this happens asynchronous, over time?
[ { "docid": "368b1e991b8b1368605a96c2c3485970", "score": "0.50415117", "text": "def notify\n KeySpace.times do |position|\n do_notify(position)\n end\n end", "title": "" } ]
[ { "docid": "12e4630f77459cdaa968563702c50d7a", "score": "0.592446", "text": "def watch_appropriate_nodes\n remaining_paths.last( threshold + 1 ).reverse_each do |path|\n next if watched_paths.include? path\n watched_paths << path\n finish_node(path) unless zk.exists?(pa...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "518b4fd6ab05bfdf31bf8932b6f7bb00", "score": "0.0", "text": "def set_user\n @user = User.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60326946", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6015941", "text": "de...
8d177d6a61194d87a350ba5ad5098c2b
Gets the marker shape. ==== Description See setMarkerShape for a list of strings that can be returned ==== Syntax markerShape name ==== Parameters +name+ String ==== Returns String ==== Multiplayer ==== See Also Official Wiki: ==== Examples ====== Example 1: (example)
[ { "docid": "84f9cfeed520f0dcc00d42433717fb5e", "score": "0.6482316", "text": "def markerShape _args\n \"markerShape _args;\" \n end", "title": "" } ]
[ { "docid": "c553bd472f658bdcc56ca6f9fc8935dd", "score": "0.5681211", "text": "def geoObject()\n return @shape ;\n end", "title": "" }, { "docid": "4b6912a2d2b40a8de1760e568a34afda", "score": "0.56372476", "text": "def shape\n=begin\n\t\tgeometries = Rails.cache.fetch(MEMO...
cc8d8d8081a98aa70b01111c433bb3b8
Use this matcher to check that a controller action was successful === Example controller.should respond_successfully
[ { "docid": "d7fd60bcf7f16a827963e5d6aa42b1e6", "score": "0.0", "text": "def respond_successfully\n RespondSuccessfully.new\nend", "title": "" } ]
[ { "docid": "e541b0fe66ccf918409715b3be1acd86", "score": "0.6662589", "text": "def ok\n respond_with :ok, status: :ok\n end", "title": "" }, { "docid": "222e25e173992849f6ce7431d6dc90b9", "score": "0.66291237", "text": "def successful?\n status == :successful\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "adce976fbeffbe5a49c1fc1a44944493", "score": "0.0", "text": "def set_ensamblaje\n @ensamblaje = Ensamblaje.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60320485", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6013371", "text": "de...
ef1bc5eac9e44b6cdc70f79b1e2e1c25
Returns the 'directory' of the RubyPython::Python object; similar to methods in Ruby.
[ { "docid": "889eabd2c249d8754580a3601ad87c3b", "score": "0.7192968", "text": "def dir\n return self.class.new(RubyPython::Python.PyObject_Dir(@pointer)).rubify.map do |x|\n x.to_sym\n end\n end", "title": "" } ]
[ { "docid": "001e64c3a08c7fdd687e6a1243c74a03", "score": "0.69503546", "text": "def get_dir; @dir; end", "title": "" }, { "docid": "1968e80e8e7d533f1c255bb6d520d4bb", "score": "0.69063044", "text": "def dirname\n File.dirname(self)\n end", "title": "" }, { "docid": "be...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "1db9482e9a7e68b9996e0a8eb7d9a15a", "score": "0.0", "text": "def set_classroom\n @classroom = Classroom.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...
1d7dff36c2b7e96a4c407a701f206371
Customize Signing Up Devise Params def sign_up_params params.require(:user).permit(:name, :email, :location, :sex, :dob, :bio, :language, :skillset, :password, :password_confirmation) end Customize User Profile Update Devise Params
[ { "docid": "309fd24d28b1b664548516c4115cc12d", "score": "0.0", "text": "def account_update_params\n params.require(:user).permit(:name, :email, :location, :sex, :dob, :bio, :language, :skillset, :password, :password_confirmation, :avatar, :short_description, :tw_url, :fb_url, :ta_url, :video_url, :em...
[ { "docid": "64ab54da0301ae04b7883dcff580e894", "score": "0.8391736", "text": "def sign_up_params\n params.require(:user).permit(:email, :password, :password_confirmation, :first_name, :last_name, :dob, :gender,\n :bio, :country_id, :language_id)\n end", "tit...
71948503e0151e3242db7b6e8c6cc2a2
Search for SLOs. Get a list of service level objective objects for your organization.
[ { "docid": "5aef5a2f764c37da48b40748486e61a6", "score": "0.58679676", "text": "def search_slo_with_http_info(opts = {})\n\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ServiceLevelObjectivesAPI.search_slo ...'\n end\n # resource path\n local...
[ { "docid": "5a17a014d226ed9cd817e7fcf231cad6", "score": "0.5965571", "text": "def list_slos_with_http_info(opts = {})\n\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ServiceLevelObjectivesAPI.list_slos ...'\n end\n # resource path\n local_va...
f33dc865f2bd1cbacc29187cd1d9c062
GET /instructors_schedules/1 GET /instructors_schedules/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "65901b538dbd713ad56ff36880e3f7b7", "score": "0.7951076", "text": "def index\n @instructors_schedules = InstructorsSchedule.all\n end", "title": "" }, { "docid": "e1e3695bacfb45f4b4424cfdc864246e", "score": "0.74569154", "text": "def set_instructors_schedule\n @in...
5a0c3a6b8a20a2fa396afc5abf5ba15c
Restart, start or stop the controller service Restart, start or stop the controller service
[ { "docid": "b0c4e295a26d25892b3a002dffd3ca08", "score": "0.0", "text": "def create_controller_server_service_action_start(opts = {})\n data, _status_code, _headers = create_controller_server_service_action_start_with_http_info(opts)\n data\n end", "title": "" } ]
[ { "docid": "2e000d3fa7fe7feb4d08c8c9b11ef23f", "score": "0.7844295", "text": "def restart\n stop if service.loaded?\n start\n end", "title": "" }, { "docid": "21c2bee0d6a9aea77a4172f38343c31d", "score": "0.7315493", "text": "def restart\n do_for_each_service { |serv...
9e25d4440ab1999386d911d16791a823
The deserialization information for the current model
[ { "docid": "8baa7b8a2a6a9935026530e3fd8e5ed9", "score": "0.0", "text": "def get_field_deserializers()\n return super.merge({\n \"daysWithoutContactBeforeUnenroll\" => lambda {|n| @days_without_contact_before_unenroll = n.get_number_value() },\n \"mdmE...
[ { "docid": "613f62eeb3655523fae5d548dc6e7875", "score": "0.6580273", "text": "def get_field_deserializers()\n return {\n \"downloadUrl\" => lambda {|n| @download_url = n.get_string_value() },\n \"fileName\" => lambda {|n| @file_name = n.get_string_val...
4e477b00cb57971433cd08d44d23f874
method.call invokes the method to run as if you invoked the orignial object
[ { "docid": "a3f5665754429c19b99225316a3640bd", "score": "0.0", "text": "def double(a)\r\n\t2*a\r\nend", "title": "" } ]
[ { "docid": "e425baaf687d96472068e3331bbf8824", "score": "0.78450584", "text": "def call(*args)\n __call__( args )\n end", "title": "" }, { "docid": "4fc848bc851b85c0155842e2c413fc41", "score": "0.77887106", "text": "def call() end", "title": "" }, { "docid...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "1d1afa7f2af6d2ef41368a89237ffe3a", "score": "0.0", "text": "def ride_offer_comment_params\n params.require(:ride_offer_comment).permit(:user_name, :body, :ride_offer_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...
db1641723df11e29ae7fda8d6327f75d
This method returns a node for a principal. The passed array contains principal information, and is guaranteed to at least contain a uri item. Other properties may or may not be supplied by the authentication backend.
[ { "docid": "cb7ed09be073c1c5157240a7882d8337", "score": "0.5794403", "text": "def child_for_principal(principal)\n AddressBookHome.new(@carddav_backend, principal['uri'])\n end", "title": "" } ]
[ { "docid": "7e5a71700cc7f41083ae6f3d47174d04", "score": "0.6499383", "text": "def principal_by_uri(uri)\n result = nil\n collections = @principal_collection_set\n collections.each do |collection|\n principal_collection = @server.tree.node_for_path(collection)\n unl...
4009f5cdf21c59d36db60a5d44edda83
REGISTER MUST EQUAL THIS METHOD
[ { "docid": "ef35d636c9c6f1a77d09d36bef4ea6e5", "score": "0.0", "text": "def add(stack, register)\n value = stack.pop\n register = register + value\nend", "title": "" } ]
[ { "docid": "706ce5b01190c0b1a7ec0680575e4aa3", "score": "0.7390158", "text": "def register; end", "title": "" }, { "docid": "23d67defd4fbcf6a4404ec0c28651ca7", "score": "0.7129588", "text": "def register\n end", "title": "" }, { "docid": "09df31aea3fc669d3f1b506fc8d5a8...
9c6adf2e9a1b047b56844da48bea7b38
Returns the UID, the UID where the Bricklet is connected to, the position, the hardware and firmware version as well as the device identifier. The position can be 'a', 'b', 'c' or 'd'. The device identifiers can be found :ref:`here `. .. versionadded:: 2.0.0~(Plugin)
[ { "docid": "4199bf34a8321956c383cfade648c6cf", "score": "0.0", "text": "def get_identity\n send_request(FUNCTION_GET_IDENTITY, [], '', 25, 'Z8 Z8 k C3 C3 S')\n end", "title": "" } ]
[ { "docid": "38014bee9d55625708880540e64e8bf4", "score": "0.5757256", "text": "def uid() \n @uid ||= command && [command.uid, ident].compact.join(\".\").sub(/!\\./, \".\") \n end", "title": "" }, { "docid": "5eb933b0d0e2b85413105e02e42d1940", "score": "0.5740657", "text": ...
6be0e40114ef4b60519d6cca2319239b
Computes the path to an image asset. Full paths from the document root will be passed through. Used internally by +image_tag+ to build the image path: image_path("edit") => "/assets/edit" image_path("edit.png") => "/assets/edit.png" image_path("icons/edit.png") => "/assets/icons/edit.png" image_path("/icons/edit.png") ...
[ { "docid": "4a2a6f6554afcfb72e02c3f9bf955ce1", "score": "0.58905894", "text": "def image_path(source, options = T.unsafe(nil)); end", "title": "" } ]
[ { "docid": "fe8292459e87fcd9726ad081ef0dd1d1", "score": "0.75131047", "text": "def image_path(path, options={})\n asset_path(path, :type => :image)\n end", "title": "" }, { "docid": "7a5ce2b492974e1cedc6281e86564ebe", "score": "0.7415515", "text": "def images_path...
286d0fc463a8003642ad3f18c23a20cf
Method to update the quantity of an item input: new quantity of item steps: check hash for quantity of particular item, update quantity output: print new list with updated hash to verify change is made
[ { "docid": "85d5bb98adf4000d965c2a94fe2f786a", "score": "0.0", "text": "def update_quantity(hash, item, quantity)\r\n\tnew_hash = {item => quantity}\r\n\thash.merge!(new_hash)\r\n\thash\r\nend", "title": "" } ]
[ { "docid": "8ead57b705dc18950976d3779465e023", "score": "0.8084319", "text": "def update_quanity(list, item, quantity)\r\n# input: list, item and quantity to be updated to\r\n# steps:\r\n # check if item exists\r\n # update quantity\r\n list[item] = quantity\r\n # print success \"your cart has been ...
becaa8363c6ebd5f99d75ed147e1513e
Adds all the solution numbers to the grid cells. If +isHorizontal+ equals true, then it adds all the left numbers, otherwise, the top numbers. Arguments : +cells+ > the Gtk::Grid to add the numbers to +solution+ > the array of array of numbers containing the solution +lineOffset+ > the top offset +columnOffset+ > the l...
[ { "docid": "55f6cb6b2db66a3bd9aa8f5e703167ba", "score": "0.692376", "text": "def createNumbers(cells, solution, lineOffset, columnOffset, isHorizontal)\n\n\t\tisHorizontal ? offset = lineOffset : offset = columnOffset\n\t\ti = 0\n\t\tsolution.each do |n|\n\t\t\tj = 0\n\t\t\tn = n.reverse.fill(n.size..of...
[ { "docid": "dc8619a9437ef057e9fdfc2f3ab79382", "score": "0.5924389", "text": "def add_cells(cells)\n add_members_to_collection(cells) {|collection| @cells = collection }\n end", "title": "" }, { "docid": "c842f53cff9cbef23f4c930c96600987", "score": "0.58961576", "text": "def add(...
c845ff22a8902cf942c409f49b2808a7
Returns a hash with the contents of the sqs.yml file
[ { "docid": "3aafe903c853fd8b85c734973f422d2e", "score": "0.6576069", "text": "def config\n @config ||= YAML.load_file(\"#{Rails.root}/config/sqs.yml\").with_indifferent_access\n end", "title": "" } ]
[ { "docid": "94e4fd2bcea4ea1dd5be09edd9e5cda3", "score": "0.61511236", "text": "def hash\n require 'yaml'\n hash = YAML.load(File.read(self.yaml_file))\n return hash\n end", "title": "" }, { "docid": "590364872e3efd367926a8566fcf07f1", "score": "0.5985398", "text": "...
eee4f599e7e724951682aeeed4aaaf28
PUT /solicitudes/1 PUT /solicitudes/1.xml
[ { "docid": "08e9549a17b43b77cd3f3b43ba26f524", "score": "0.54916936", "text": "def update\n @solicitud = Solicitud.find(params[:id])\n\n #limpiamos fecha de creacion pasandola a formato MM/DD/YYYY\n params[:solicitud][:fecha_creacion] = fix_date(params[:solicitud][:fecha_creacion]) if params[:s...
[ { "docid": "6e418358cd766cf57276382c5f1d9af6", "score": "0.65754133", "text": "def update\n @solicitante = Solicitante.find(params[:id])\n\n respond_to do |format|\n if @solicitante.update_attributes(params[:solicitante])\n format.html { redirect_to(@solicitante, :notice => 'Solicitant...
79077fbb9faba6ef48142f5ed6220d4b
view for :instance_view is provided directly by view_for_state.
[ { "docid": "45e29e6cfb1c5918794693c5bb28cb92", "score": "0.6635425", "text": "def test_view_for_state\n t = CellsTestOneCell.new(@controller)\n c = render_cell_state(t, :instance_view)\n assert_selekt c, \"#renamedInstanceView\"\n end", "title": "" } ]
[ { "docid": "ea24f760c891d7988999e34220579f76", "score": "0.65331066", "text": "def view\n @_view\n end", "title": "" }, { "docid": "15fb33b16b474715e54ca66afd7a9089", "score": "0.6454245", "text": "def _view; end", "title": "" }, { "docid": "6c37573a78eb27bee0...
16468c8520591739380cb7465757e200
Format the node pretty printing.
[ { "docid": "9ca24d20c4793447d4aefedc16579574", "score": "0.75439733", "text": "def _format\r\n result = \"#{' '*_depth}#{_name} #{_sample}\\n\"\r\n each do |node|\r\n result << node._format\r\n end\r\n result\r\n end", "title": "" } ]
[ { "docid": "b3e8d4159d7b8fefeb69859f062a83b3", "score": "0.7504719", "text": "def pretty_print(node = @root, prefix = '', is_left = true)\n\t\tpretty_print(node.right_children, \"#{prefix}#{is_left ? '│ ' : ' '}\", false) if node.right_children\n\t\tputs \"#{prefix}#{is_left ? '└── ' : '┌── '}#{nod...
476dff1e2011ba498e1a504f802a644f
Builds a docker image from a Dockerfile
[ { "docid": "04982790b2fcdf33d8b561ccd9ef51f3", "score": "0.73407304", "text": "def build_docker_image(image_id, build_context: '.',\n dockerfile: 'Dockerfile', build_args: {},\n timeout: 600, **options)\n\n build_args_json = generate_build_args_js...
[ { "docid": "ca518a0ee3b34adebe72f1aa918b5061", "score": "0.79904574", "text": "def build(dir, docker_file)\n docker_file.write!\n\n @underlying_image = build_from_dir(dir, docker_file.relative_output_file)\n\n add_tag!(@tag)\n image\n end", "title": "" }, { "docid": "3...
313ac54be79f5e47257bcdb52420f60c
Command to run rolling restart of roles in a service. The sequence is:\n\nRestart all the nonslave roles\nIf slaves are present restart them in batches of size specified in RollingRestartCmdArgs\nPerform any postcommand needed after rolling restart\n\n\nAvailable since API v3. Only available with Cloudera Manager Enter...
[ { "docid": "02987685b72d6a7d7124bf301aff3f24", "score": "0.48505244", "text": "def api_v11_clusters_cluster_name_services_service_name_commands_rolling_restart_post(service_name, cluster_name, opts = {})\n api_v11_clusters_cluster_name_services_service_name_commands_rolling_restart_post_with_http_i...
[ { "docid": "f4e0f537a62b693b92a20f548e337c81", "score": "0.661345", "text": "def q_rolling_restart\n q = 'Are you sure you want to ROLLING RESTART on the above ' \\\n 'roles (y|n)? '\n Utils.exit_with_msg('STOPPED'.red, true) unless CHK.yn?(q.cyan, true)\n end", "title"...