query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
e39c824b49c8e2a9a0cce700ea5d2d28
GET /oauth_clients/1 GET /oauth_clients/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "b7cb9ea3f9c0478e89b8e68a92766308", "score": "0.73146665", "text": "def get_oauth_clients_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: OAuthApi.get_oauth_clients ...\"\n end\n \n # resource path\n ...
d33f2e5a9a49fb6096e0411352aa7da8
I worked on this challenge by myself. 2. Review the simple assert statement
[ { "docid": "ca0df44d8b905e0fd44c1e24ba84312c", "score": "0.0", "text": "def assert\n raise \"Assertion failed!\" unless yield\nend", "title": "" } ]
[ { "docid": "0e27ed76988a692adb5cdf7709fe4144", "score": "0.70981866", "text": "def test_case_7\n assert false\n end", "title": "" }, { "docid": "3fcc75a227c5cd0de58359677e7bc992", "score": "0.70734555", "text": "def test_case_6\n assert false\n end", "title": "" }, ...
83521d9eb2e464fcd317feaf9218ac39
GET /review_stages/new GET /review_stages/new.xml
[ { "docid": "6986eddb475ada54421a406b59132406", "score": "0.7387545", "text": "def new\n @user = User.find(params[:user_id])\n @project = Project.find( params[:project_id] )\n seq = @project.review_stages.collect { |rs| rs.sequence }.max || 1\n @review_stage = @project.review_stages.build( :n...
[ { "docid": "28c400c36e86bddc1ae667fbc9ecba27", "score": "0.7324944", "text": "def new\n @stage = Stage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @stage }\n end\n end", "title": "" }, { "docid": "28c400c36e86bddc1ae667fbc9ec...
6d40a7124f0518e8afb3cc49f7cc866e
This returns the url for the month article index
[ { "docid": "c1f6a292cfcb8fb9e52a055680e09312", "score": "0.6908199", "text": "def month_url(year, month)\n url(:month, {:year => year, :month => Padding::pad_single_digit(month)})\n end", "title": "" } ]
[ { "docid": "d6ae0cb32d4908c79f907825056df634", "score": "0.7542965", "text": "def month_url\n base_url + month_path\n end", "title": "" }, { "docid": "5f241cd58ef3c705cf7b550d02baa967", "score": "0.71439", "text": "def link_to_monthly_articles(month, folder, options = {})\n mo...
31e3dd0b931464e2a50ba1675c30cc14
GET /updated_objects/new GET /updated_objects/new.xml
[ { "docid": "a50c4f405f70baafffa7ec21b1b477c5", "score": "0.76538694", "text": "def new\n @updated_object = UpdatedObject.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @updated_object }\n end\n end", "title": "" } ]
[ { "docid": "501d7c7b69381b30eae7516585864c7a", "score": "0.66520596", "text": "def new\n @page_updated_info = PageUpdatedInfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page_updated_info }\n end\n end", "title": "" }, { "do...
a619c3ce7fe00332d235af2fbb29e38c
POST /loan_sectors POST /loan_sectors.xml
[ { "docid": "2af6a60de6766f2ecd04468134781c61", "score": "0.69270104", "text": "def create\n @loan_sector = LoanSector.new(params[:loan_sector])\n\n respond_to do |format|\n if @loan_sector.save\n format.html { redirect_to(@loan_sector, :notice => 'Loan sector was successfully created.'...
[ { "docid": "5cd707d8ecf428e6487437bbe6474a33", "score": "0.5997539", "text": "def new\n @loan_sector = LoanSector.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @loan_sector }\n end\n end", "title": "" }, { "docid": "d0c44a91b8d...
f53bc9b5904878e7f04d0a25deeae613
Returns an array of code for aliascolumn name pair.
[ { "docid": "c174abf9f27b1c7b4c714f740dd7dd29", "score": "0.0", "text": "def key\n @key.inspect\n end", "title": "" } ]
[ { "docid": "cfb3bd45a8c8391dfbaab5f5edd705eb", "score": "0.7169997", "text": "def aliases_for_column(column)\n []\n end", "title": "" }, { "docid": "908743491752145353738e85b43cdea9", "score": "0.7062815", "text": "def column_names_with_alias\n unless @column_nam...
2d0ae6f42d9010cd59f1d3a26f580c89
Takes a last fm list of artists
[ { "docid": "ad33bb529687e56d301efb1b044014bf", "score": "0.0", "text": "def add_artists_to_db(artists)\r\n\t\tartist_list = []\r\n\t\tif artists\r\n\t\t\tarr = artists[\"results\"][\"artistmatches\"][\"artist\"]\r\n\t\t\tarr.each do |artist|\r\n\t\t\t\tif artists.size \r\n\t\t\t\t\tartist_list << create...
[ { "docid": "0f7db144e0712ed357e57eb7cd635ee3", "score": "0.74574244", "text": "def artists_abrv(item)\n item.artists_last\n end", "title": "" }, { "docid": "d5edf1ac7a477b7fc6c75918bcf5d7fa", "score": "0.7003799", "text": "def artists\n artists = songs.collect do |song|\n ...
6e88e3605d06ea2de85a05991c471280
Convert the range to a $gte/$lte mongo friendly query for dates.
[ { "docid": "1dcba945c2aa0e2c14e7547bb955e083", "score": "0.0", "text": "def __evolve_date__\n __evolve_range_naive__.transform_values! {|v| v&.__evolve_date__ }\n end", "title": "" } ]
[ { "docid": "ee3785095bc2e97d13d77d278ea55178", "score": "0.723282", "text": "def __evolve_date__\n { \"$gte\" => min.__evolve_date__, \"$lte\" => max.__evolve_date__ }\n end", "title": "" }, { "docid": "250b4a3d84f4e332c3378dcccd668e34", "score": "0.67420846", "te...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "fd52e0b2648d89637c5c36eeae614bcd", "score": "0.0", "text": "def set_package\n @package = Package.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...
cec65949b8754bba5fd877c96b8f74bd
this method accepts a block, wich will be executed between rescue blocs and surrounded by creating dataload log and finishing it Accepts values of options hash :dataload_type (string) type, recorder in log :user_id user to bind this dataload to Returns dataload log object it created
[ { "docid": "6eefec25721c02d28399e38ca93a65fc", "score": "0.7695214", "text": "def do_with_rescue_and_logging(options = {})\n return nil unless block_given?\n \n @errors ||= []\n @success_rows = 0\n @error_rows = 0\n \n dataload_log = DataloadLog.create(\n :dataload_type => option...
[ { "docid": "931db9f495e4f419c93a2356afdc30cb", "score": "0.5725134", "text": "def log_block\n @log_block ||= proc { context_processor.call(worker) }\n end", "title": "" }, { "docid": "5eeb7cf7a83fc6bb1303c91bb796e349", "score": "0.57115793", "text": "def log_block\n @log...
1e2a639e375818d3e7d4c7f1eb2d8219
The alphalist's focus resides in the entry widget. But the scroll widget will not draw items highlighted unless it has focus. Temporarily adjust the focus of the scroll widget when drawing on it to get the right highlighting.
[ { "docid": "91eecc50b0e02ce32cc86218e2941284", "score": "0.5576102", "text": "def saveFocus\n @save = @scroll_field.has_focus\n @scroll_field.has_focus = @entry_field.has_focus\n end", "title": "" } ]
[ { "docid": "18210e8f6d0d1e9a5485e48e915af4a5", "score": "0.6372531", "text": "def set_focused(idx_focus)\n if (@idx_focused != idx_focus)\n matching_selection = @matching_selection\n original_pointer_widget = @builder['original_container'].children[0]\n original_pointer...
9b5fe8146a88c1d7acbbce60528574a9
Check key if it is correct type. Used for argument validation.
[ { "docid": "c43c898e6c549589eda6ebb1732ae10f", "score": "0.7785456", "text": "def check_type(key, type)\n sv_err(\"No such key in Config [#{key}]\") unless self[key]\n sv_err(\"Config Key Type mismatch [#{key}]\") unless self[key].is_a?(type)\n true\n end", "title": "" } ]
[ { "docid": "440672be08390ca9f249e3d21a468ff4", "score": "0.7549055", "text": "def validate_key(key)\n unless key.is_a?(Symbol) || key.is_a?(String)\n raise ArgumentError, 'Key must be a string or symbol'\n end\n key\n end", "title": "" }, { "docid": "387debdcde16f631...
d07023ea13ce7562d71f1ff8524075d4
========================================================================== getOutputs : Get the outputs.
[ { "docid": "8f8752c607c1ee57c718ae9e158ae35e", "score": "0.87133044", "text": "def getOutputs\n\n\t\tputLog(\"getOutputs() -> (#{@outputs})\");\n\t\n\t\treturn @outputBuffer;\n\n\tend", "title": "" } ]
[ { "docid": "114e28c628546ea559a321ff297051b3", "score": "0.9043036", "text": "def getOutputs\n\n\t\tputLog(\"getOutputs() -> (#{@outputs})\");\n\t\n\t\treturn @outputs;\n\n\tend", "title": "" }, { "docid": "08c9ac6191b2c7f5dfdf39ab1de3e44b", "score": "0.80474705", "text": "def get_ou...
3747ce8b3dc805b5885e742feca061ab
TODO: Always good to save these enteries in tables
[ { "docid": "a51ccfccef4dc4db4c46a42910730eb9", "score": "0.0", "text": "def furnished\n [\n ['Furnished', 'Furnished'],\n ['Partially Furnished', 'Partially Furnished'],\n ['Furniture For Sale', 'Furniture For Sale'],\n ['Furniture Negotiable', 'Furniture Negotiable'],\n ['Un...
[ { "docid": "518d63458e152adbdba71d70b39f2e46", "score": "0.6158991", "text": "def inserts; end", "title": "" }, { "docid": "eb59faab6ff109bf3966680c84076be3", "score": "0.5888667", "text": "def insert_all; end", "title": "" }, { "docid": "bba794f68c0ce1dfb52f7205a7f5b00d"...
1cb3e1a39ee310f7ca7e913597583ba1
Provide the various reports link for particular student. like recent exam report, subject wise report, transcript report.
[ { "docid": "302ba2ab3f253e4171b5338c65a619c0", "score": "0.56609213", "text": "def report\n @student = Student.shod(params[:format])\n @batch = @student.batch\n authorize! :read, @student\n end", "title": "" } ]
[ { "docid": "55f2edc619a038c22b049f9450e2cfab", "score": "0.66423875", "text": "def student_report\n offering_id = params[:id]\n offering = Portal::Offering.find(offering_id)\n authorize offering\n student_id = current_visitor.portal_student.id\n report = DefaultReportService.instance\n ...
2f93ed9db1a0465bf2ad1ff7157b0c68
:callseq: uri The URI of this aggregate. It should be an absolute URI.
[ { "docid": "adc68665ce6df52a40be57fb0dc5eabb", "score": "0.69590825", "text": "def uri\n @structure[:uri]\n end", "title": "" } ]
[ { "docid": "09504dc248f3c8938dee6d1239c810da", "score": "0.70603025", "text": "def uri()\n @uri\n end", "title": "" }, { "docid": "de4c7c0575a5c9acfe19c79edd7938f2", "score": "0.68807244", "text": "def uri\n @attributes[:uri]\n end", "title": "" }, { "doci...
c049719db7d65181ced83c8f7c0d91cf
POST /wellformednessverifications POST /wellformednessverifications.json
[ { "docid": "364dcf6d47dfe5da6f08d714df4d05e4", "score": "0.6716527", "text": "def create\n @wellformednessverification = Wellformednessverification.new(wellformednessverification_params)\n\n respond_to do |format|\n if @wellformednessverification.save\n format.html { redirect_to @wellf...
[ { "docid": "fc49b4a77ad920e2ce79af19b2deb0f0", "score": "0.6076898", "text": "def wellformednessverification_params\n params.require(:wellformednessverification).permit(:g1_x, :g1_y, :g2_x, :g2_y, :c_1, :c_2, :r_1, :r_2, :big_ri_x, :big_ri_y, :big_zi_x, :big_zi_y )\n end", "title": "" }, ...
4d6a493a049a37fd62b93c1c46be9a2b
A nivel de controlador
[ { "docid": "9664623df1cdbee4d7855b396beee597", "score": "0.0", "text": "def index\n # render layout: 'index'\t\t\n end", "title": "" } ]
[ { "docid": "0d0510d31dfe9824e79f34285f40785d", "score": "0.64898646", "text": "def set_nivel_acceso\n @nivel_acceso = NivelAcceso.find(params[:id])\n end", "title": "" }, { "docid": "77a8328c149201a216ed4f4bc69e0bc1", "score": "0.6384443", "text": "def contador\n @contad...
74d569d8fb0484fdbf1b58d6c9fad1a7
Gets the weight property value. Value to use when configuring the weight property of the SRV record at the DNS host.
[ { "docid": "4de283d87b4861c51eda3a47dfe174aa", "score": "0.68266875", "text": "def weight\n return @weight\n end", "title": "" } ]
[ { "docid": "0a41430e069ac00a54f9accf5bb37e9c", "score": "0.7426265", "text": "def weight\n parse('drone.weight')\n end", "title": "" }, { "docid": "09850faeab2cd0633c1a4a32518e3c0e", "score": "0.71253765", "text": "def weight\n\t\treturn @api[\"weight\"]\n\tend", "tit...
ab8204e4ffb044f8c8bb87ff7c3f9516
Applies configurations to remote nodes.
[ { "docid": "1754d8589305fdce3160a6c259e63e48", "score": "0.0", "text": "def apply(nodes)\n node_manager.assert_known(nodes)\n for node in nodes\n node_manager.find(node).apply\n end\n end", "title": "" } ]
[ { "docid": "915f825651711630c1e51026c1680e77", "score": "0.71861666", "text": "def configure_cloud\n message \"Configuring master\"\n build_and_send_config_files_in_temp_directory\n remote_configure_instances\n \n nodes.each do |node|\n node.configure\n end \n ...
d1768d0936e36b8e9b9ea1801f582ac9
def sum_list(head) return 0 if head.nil? head.val + sum_list(head.next) end p sum_list(head) 16 Write a fn that takes in a LL and a target value that returns a bool indicating whether or not the target is contained in the LL.
[ { "docid": "6c9e701316ced217f5b2da2912e03fd5", "score": "0.7173723", "text": "def contains(head, target)\n return false if head.nil?\n \n head.val == target || contains(head.next, target)\n end", "title": "" } ]
[ { "docid": "2a6253e1cd6e05da7508c2a2360d4a17", "score": "0.70693964", "text": "def tree_sum(head, target)\n @res = 0\n helper(head, target, 0, {0=> true})\n return @res\nend", "title": "" }, { "docid": "1e8f8fa403eb2c98e08d5ecdc3df2c2c", "score": "0.6798239", "text": "def sum_list...
6866bbd21b9243fc394acebfaffc3e6d
GET /cov_suspects/1 GET /cov_suspects/1.json
[ { "docid": "3780e292d89cb2707a8ea212134d4b74", "score": "0.6311844", "text": "def show\n authorize @cov_suspect\n end", "title": "" } ]
[ { "docid": "69d226de1a626aa5058c3163a83000fd", "score": "0.6998741", "text": "def set_cov_suspect\n @cov_suspect = CovSuspect.friendly.find(params[:id])\n end", "title": "" }, { "docid": "a6aae4c3f1dd8efb4015de8d5b11d0aa", "score": "0.6718208", "text": "def index\n @suspec...
fe2341344adde878196e2a9b0f9efd11
Allow optional select attributes to be loaded manually when they are not present. This is associated with auxiliary statement, which permits columns that can be loaded through CTEs, be loaded individually for a single record For instance, if you have a statement that can load an user's last comment content, by querying...
[ { "docid": "27eee46a5bed8cf84e052306ccfb90dd", "score": "0.5130645", "text": "def dynamic_attribute(name, &block)\n define_method(name) do\n return read_attribute(name) if has_attribute?(name)\n result = self.instance_exec(&block)\n\n type_klass = Active...
[ { "docid": "15d45027a183dd0247e95d285f20c3fa", "score": "0.64091676", "text": "def lazy_attributes(*attrs)\n unless select = dataset.opts[:select]\n select = dataset.columns.map{|c| Sequel.qualify(dataset.first_source, c)}\n end\n set_dataset(dataset.select(*select....
4006439b0732cec3258f4f7a3608e56d
used for converting to arrays of java.lang.Object
[ { "docid": "baec45580f6cbc46c155692b877988db", "score": "0.0", "text": "def convert_to_best_type(val)\r\n # some types convert OK in JRuby\r\n# return val if val.kind_of?(JavaProxy) || val.kind_of?(String) || val.kind_of?(Time)\r\n# val.kind_of?(TrueClass) || val.kind_of?(FalseClass) || val.n...
[ { "docid": "598cf5ee9d991c56e2bc98728820ea67", "score": "0.75553", "text": "def coerce_to_array\n @data.coerce_to_array\n end", "title": "" }, { "docid": "687291bf326b59e379009097482973d8", "score": "0.7535108", "text": "def to_array(obj)\n obj.is_a?(Array) ? obj : [obj]...
9b7b046d8b673324bae18c9309c14432
put the business name, coordinates, image url into a file
[ { "docid": "8b38f0b7c676959143928c6f9c1d5326", "score": "0.0", "text": "def get_address_coordinates(street, city)\n # puts \"got in get_location_coordinates\"\n # puts \"inside get_coordinates #{street}\"\n # puts \"inside get_coordinates #{city}\"\n\n coordinate_results = Geocoder.search(\"...
[ { "docid": "517b1c2bd460e682a26575174398cd7f", "score": "0.6463629", "text": "def save\n \t\tdescription = {}\t\n \t\tdescription[:metadata] = {} \n \t\tif self.persisted? then\n \t\t\tdescription[:metadata][:location] = self.location.to_hash unless self.location.nil?\n \t\t\tdescription[:metadata][:p...
43372e2867390f2786c42c7e6d30983f
Sets the rowCount property value. Returns the total number of rows in the range. Readonly.
[ { "docid": "574ca0db5f54e00e258ebf65210d025d", "score": "0.7352355", "text": "def row_count=(value)\n @row_count = value\n end", "title": "" } ]
[ { "docid": "492e5a2291fd243bbd3c7ad59d4376da", "score": "0.6887946", "text": "def set_RowCount(value)\n set_input(\"RowCount\", value)\n end", "title": "" }, { "docid": "492e5a2291fd243bbd3c7ad59d4376da", "score": "0.6887946", "text": "def set_RowCount(value)\n ...
d1677694fc3a932a45c0a0604282283a
If an association method is passed in (f.input :author) try to find the reflection object.
[ { "docid": "1e94b02bb544ab24853c1fbcab36c4a5", "score": "0.6528705", "text": "def reflection_for(method) #:nodoc:\n @object.class.reflect_on_association(method) if @object.class.respond_to?(:reflect_on_association)\n end", "title": "" } ]
[ { "docid": "e9c7d4e2181e41b35e4ad1a8f85bf365", "score": "0.6466932", "text": "def reflection_for(method) #:nodoc:\n @object.class.reflect_on_association(method) if @object.class.respond_to?(:reflect_on_association)\n end", "title": "" }, { "docid": "9973da6a5e8581e120eef6baba6442...
ba618b86faef8413284652b75bc24e74
Validates attributes to determine if they contain valid email addresses. Does not perform an in depth check, but does verify that the format is valid.
[ { "docid": "3725cf1c375961831bc6ef06b3268958", "score": "0.6712243", "text": "def validate_each(record, attribute, value)\n unless value.blank?\n record.errors[attribute] << (options[:message] || 'is not a valid email address') unless value =~ VALID_EMAIL_REGEX\n end\n end", "tit...
[ { "docid": "790aec9e26c6af3d06e01d4376086916", "score": "0.788152", "text": "def validates_email(attr)\n validates_format(RFC822::EMAIL_REGEXP_WHOLE, attr, message: :email) if send(attr)\n end", "title": "" }, { "docid": "ed84bac46abd3e82d7b08cc7c127b8f4", "score": "0.76064444", ...
007b76ef3c4d83df483544e3549caf02
Public: Calls the 'TranscribeRecording' SOAP Action recording_id a String in GUID format Returns the SOAP response Hash
[ { "docid": "1c771115e483df486b1795c1056a0b8f", "score": "0.81536764", "text": "def transcribe_recording(recording_id)\n # initialize_session unless @session.try :valid?\n\n response = @soap_client.call :transcribe_recording, \n message: { 'wsdl:sessionID' => @sess...
[ { "docid": "3e408b376db8b760c226a755c4361081", "score": "0.785164", "text": "def transcribe_recording(recording_id)\n # initialize_session unless @session.try :valid?\n\n response = @savon.call :transcribe_recording, \n message: { 'wsdl:sessionID' => @sessio...
613ceca6f0d1c4a814df80fc5749dded
GET /magazines/new GET /magazines/new.xml
[ { "docid": "da7fec3dd36ebbbfe846d33eea94f353", "score": "0.6702318", "text": "def new\n @magazine = Magazine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @magazine }\n end\n end", "title": "" } ]
[ { "docid": "c8ad564bad8fec93719920cad3ecbff6", "score": "0.6861159", "text": "def new\n @magzine = Magzine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @magzine }\n end\n end", "title": "" }, { "docid": "2cce25f6b5d51737ad6bba79...
1bb80d6de2521fb31cb5fe957d9568c0
The project level configuration settings.
[ { "docid": "0040fb49c4520b966b85f8146c6bbce7", "score": "0.72652733", "text": "def project_config\n context = @config_options['context']\n @project ||= PDK::Config::Namespace.new('project') do\n mount :environment, PDK::ControlRepo.environment_conf_as_config(File.join(context.root_path,...
[ { "docid": "a3f23459c711b2814e4e423f8c72936e", "score": "0.77076143", "text": "def settings\n @global_settings.deep_merge @project_settings\n end", "title": "" }, { "docid": "758404ff3472f8b523bc81d782deb4af", "score": "0.74781823", "text": "def base_settings\n Config::P...
e02bf69eb0f5958e2fd44573968b7ba7
If the related request was an email request, add any response headers to the email, as well as adding the response body to the email. Return the email unless no body was set for it, which would indicate that the routing tree did not handle the request.
[ { "docid": "e96ccddbb3927ba6fd4550e62879d3d9", "score": "0.5728622", "text": "def finish\n if m = mail\n header_content_type = @headers.delete(RodaResponseHeaders::CONTENT_TYPE)\n m.headers(@headers)\n m.body(@body.join) unless @body.empty?\n mail_att...
[ { "docid": "058207e67b5bb09dcc5ff49a3a89fd93", "score": "0.6043005", "text": "def block_result_body(_)\n unless env['roda.mail_handled']\n scope.unhandled_mail('mail was not handled during mail_processor routing')\n end\n end", "title": "" }, { "docid": "d...
014f80b76bcd34fb420d956453c8522a
TODO Remove this method.
[ { "docid": "fbdf42f8c974e229a9894db1c49cdd28", "score": "0.0", "text": "def github_api(user = current_user)\n @github_api ||= GithubApi.new(github_token, user)\n end", "title": "" } ]
[ { "docid": "2290804b238fc95bfd6b38f87c6d2895", "score": "0.66294503", "text": "def override; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.65551853", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3...
444e6cee0f591614f51c08f0915fca77
Performs the _queryset_ command.
[ { "docid": "f1c413f4c9095b38f6c53dd9cc19b916", "score": "0.0", "text": "def perform\n if arguments.empty?\n raise ArgumentError, 'wrong number of arguments (0 for N)'\n end\n\n add_request_if_new do |request|\n self.class.notify_if_cookies_cleared request do\n escaped_arguments...
[ { "docid": "0aef285d24df006ecf6132d7f14ff0ae", "score": "0.61573774", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ListViewsResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "87d6211f6e98c247148df3856832a4eb", ...
bcd6daabf50a8ece1a34e7c3c8442521
time remaining in this period
[ { "docid": "e500400897c5bfee6ee1a4a46a8655ef", "score": "0.7823231", "text": "def time_remaining\n created_at.utc + game.period_length - Time.now.utc\n end", "title": "" } ]
[ { "docid": "bc20e862feab93106bf25577e60174da", "score": "0.82632166", "text": "def remaining_time(from = Time.now)\n if period.granularity == Period::Granularity::Eternity\n -1\n else\n (period.finish - from).ceil\n end\n end", "tit...
dec0505dbaeb6cdf29fa21d7fcb5e1d5
Find and create a suitable source plugin instance for each source and have it check out the given source using the transport.
[ { "docid": "690c9838c74aa386ff7324e298343f3e", "score": "0.6860455", "text": "def checkout_sources(transport, ctx, sources)\n # Group each entry by type\n groups = {}\n sources.each do |job_source|\n raise 'no type given in source definition' unless job_source.key? ...
[ { "docid": "609a3bd29ec9af098a078f50c7057c58", "score": "0.6186097", "text": "def initialize\n @enabled_sources = []\n @config = Configuration.instance\n @config[\"enabled_sources\"].each do |source|\n if klass = parse_class(camelize(source))\n current_source = klass.new\n...
d64d95aad79a0b05dc76e6ab05fb9fbb
GET /photo_albums GET /photo_albums.json
[ { "docid": "2a26345368dfac0f073f9c560d58ea93", "score": "0.0", "text": "def index\n @user = User.find_by_id(params[:user_id])\n if !@user.nil?\n @photo_albums = get_albums(@user)\n @result_list = @photo_albums.map do |u|\n image = view_context.get_small_photo_url(u.default_photo)\...
[ { "docid": "a6a13dcf8cf4ce83cdef5b35e328fc77", "score": "0.8109615", "text": "def get_albums\n \t json = call_api(\"#{base_url}\", {})\n\n \t return json[\"data\"]\n \tend", "title": "" }, { "docid": "36903453c7179ac3cbb206cffc59401d", "score": "0.78046584", "text": "d...
82a9837f0035d4490cee2ba118d56920
Returns the value of attribute total. source://rubyprogressbar//lib/rubyprogressbar/progress.rb8
[ { "docid": "30cba691e76a94210eb4f4133f4a60ad", "score": "0.7517051", "text": "def total; end", "title": "" } ]
[ { "docid": "a457cb3b7a9f6aa020cff319326e22bc", "score": "0.7940263", "text": "def total\n @total\n end", "title": "" }, { "docid": "a457cb3b7a9f6aa020cff319326e22bc", "score": "0.7940263", "text": "def total\n @total\n end", "title": "" }, { "docid": "a457...
c2948445703455771420426d19aa8c23
edge to the function exit
[ { "docid": "e227ae5b72c96445870338c7587b9d76", "score": "0.0", "text": "def edge_to_exit\n Edge.new(self, nil)\n end", "title": "" } ]
[ { "docid": "1ff430471586efed7159f3451f580328", "score": "0.78700984", "text": "def exit!() end", "title": "" }, { "docid": "43285d5d9d0023dfcc28a661e1b022e6", "score": "0.77917254", "text": "def exit() end", "title": "" }, { "docid": "343e62c981d930e153699450ef939c23", ...
8c56963dffc96793c8c40d7b6e72d7ce
GET /responsibility_types GET /responsibility_types.json
[ { "docid": "97f3352bba6da66087cfc755b4d754b2", "score": "0.78925586", "text": "def index\n @responsibility_types = ResponsibilityType.all\n end", "title": "" } ]
[ { "docid": "341982657361bebf9d59165f89b68eb1", "score": "0.6870611", "text": "def getResourcesType\n type = [Announcement, Discussion, DiscussionSolution, Exam, ExamSolution, Homework, HomeworkSolution, LectureNotes, OnlineResource, Other]\n dic = {:type => type}\n respond_to do |format|\n ...
5dfda355022078fd374a894b9672d31a
Indica si el usuario tiene canciones que mostrar en su pagina
[ { "docid": "f792b94f1fa889b4766fd2420bb4f07f", "score": "0.0", "text": "def profile_songs?\n profile_songs.any?\n end", "title": "" } ]
[ { "docid": "5fddd7044e7bd6e5e43e98ce21eb564d", "score": "0.67460364", "text": "def ensure_mooveit\n # Chequear si hay un usuario logeado\n u = session[:user_id] && current_user\n # Si no hay un usuario logeado o el mismo no es un contaco, no darle permiso\n if !u || u.class == Contact\n ...
185987c914052ec1728d833a46c5a4de
returns the jersey numbers of a given team
[ { "docid": "a5f899c021db1b260b521847cd4fc3f4", "score": "0.7104701", "text": "def player_numbers(team)\n numbers = []\n game_hash.each do |location, team_data|\n if team_data[:team_name] == team\n team_data[:players].each do |player_hash|\n numbers.push(player_hash[:number])\n end\...
[ { "docid": "dba9b76115a11a3c2184b641068a20e0", "score": "0.7611676", "text": "def player_numbers(team)\n jersey_numbers = []\n game_hash.each do |location, team_data|\n if team_data[:team_name].to_s == team\n team_data[:players].each do |name, stats|\n jersey_numbers.push(stats[:number]...
935063ceeacdffcb9ef4653465a83de5
dynamically execute add_index because static parser can't handle [[:comments, :post_id], [:comments, :user_id]].each do |args| add_index args end
[ { "docid": "3a0de4f471877a769cb0a6ae317a66a8", "score": "0.0", "text": "def remember_indexes(nodes)\n nodes[1..-1].each do |node|\n begin\n eval(node.to_ruby)\n rescue Exception\n end\n end\n end", "title": "" } ]
[ { "docid": "34c710a8c0efb55e18ff54cfc1035092", "score": "0.6164772", "text": "def add_index(_, *args) #:nodoc:\n index(*args)\n end", "title": "" }, { "docid": "a504f39efd60b21584e0f7d11814aedb", "score": "0.6067503", "text": "def index( _text, _uid )\n # TODO\n end", ...
d60b96254c5e39a5761799712c21b1e1
It locates the user by callerid and plays his voicemails
[ { "docid": "119648a1ea90bd139659c44170f3e95d", "score": "0.8525212", "text": "def play_user_voicemails\n user = locate_user(callerid)\n if user\n play_voicemails(user)\n else\n play \"invalid\"\n end\n end", "title": "" } ]
[ { "docid": "7bb9b54d22cd8de2707a14d264efcc77", "score": "0.72373307", "text": "def play_voicemails(user)\n begin\n latest_status = user.latest_status\n if latest_status\n replies = latest_status.replies\n if replies\n user.latest_status.replies.each_with_index do |tr, index|\n ...
71dc9bec6822bf219bb9c7b518254082
def reset_session_token! self.token = SecureRandom.hex self.save! token end
[ { "docid": "a4ffde6427a996a3e5f5686848fb679f", "score": "0.84446734", "text": "def ensure_session_token\n self.token ||= SecureRandom.hex\n end", "title": "" } ]
[ { "docid": "fb419b687bd78866df36b202fdb46d54", "score": "0.9494562", "text": "def reset_session_token!\n self.session_token = SecureRandom::urlsafe_base64(16)\n self.save!\n self.session_token\n end", "title": "" }, { "docid": "61e2f25ca2cdf0f4e2b6506d55c87a69", "score": "0.949...
3507455d5bc420e5d5c835b95a4461f4
Gets the MinSize of an AutoScalingGroup
[ { "docid": "c4d73d206c590f3ead265c0b9c828c2e", "score": "0.9050028", "text": "def min_size\n group = describe_autoscaling_group\n group.min_size\n end", "title": "" } ]
[ { "docid": "ac9a22ce26cd76ee457dbc3e6ca399f3", "score": "0.77688766", "text": "def get_min_nodes\n return @describe_scaling_group.auto_scaling_groups[0].min_size\n end", "title": "" }, { "docid": "a492962351baa6464921999afd10d84e", "score": "0.70546854", "text": "def test_describ...
1768a609b2b540c6a451d4d7e987f27d
Helper function to help wait untill we have left the worldpay site
[ { "docid": "da6a865baece69524d84d8ef4556a23b", "score": "0.7022175", "text": "def waitForWorldpayRedirect\n # Check if on the worldpay is waiting for redirect page. This often results in the browser client side redirecting to\n # an page in our site that is no longer available as the tests have moved ...
[ { "docid": "841292bf48ae1d4087efd6ca89f2d1f3", "score": "0.6384511", "text": "def wait_until_not_full; end", "title": "" }, { "docid": "5616478e35dcbd9adc92c56644bacd2f", "score": "0.61447704", "text": "def wait_for_landing_page_load(timeout_ms = 3000)\n $tracer.trace(\"WebInStore...
faa213acd1745e035e92029dba475217
request adapter method by default if does jsonrpc v2 as string xmlrpc overload this message
[ { "docid": "fc8cf43fee1f82dc9095a7e3d08f0c8e", "score": "0.6993398", "text": "def adapter_request(cmd, *args)\n rpc = {\n jsonrpc: \"2.0\",\n id: rand(1 << 16),\n method: cmd\n }\n\n unless args.empty?\n params = args.flatten\n ...
[ { "docid": "2036f91622445bf2f24767d13b859c43", "score": "0.60457766", "text": "def xmlrpc\n api\n end", "title": "" }, { "docid": "d6a5d7d159c6b4b489959e94bbf1f15f", "score": "0.58475995", "text": "def format_request(message)\n raise \"please implement format_request(m...
fa6ae6278e9b6103809e3b0b3eca65c8
Adds information from the given Pod::Spec to the definition of the CMake framework target. Subspecs are not automatically handled. Cocoapods subspecs are not independent librariesthey contribute sources and dependencies to a final single Framework. Args: spec: A root or subspec that contributes to the final state of th...
[ { "docid": "172f9c14a5478b83d2bac89da8736bb5", "score": "0.7376015", "text": "def add_framework(spec)\n spec = spec.consumer(PLATFORM)\n files = Pod::Sandbox::FileAccessor.new(@path_list, spec)\n sources = [\n files.source_files,\n files.public_headers,\n files.private_headers,\n...
[ { "docid": "b27fbd79ca232edc5c417d9a85991185", "score": "0.6920386", "text": "def add_specification(spec)\n raise Informative, \"[Local Pod] Attempt to add a specification from another pod\" unless spec.top_level_parent == top_specification\n spec.activate_platform(platform)\n @specificat...
44fd6be6a11041858b738f4b3682a7ec
Captures $stdout and $stderr into strings, using Tempfile to ensure that subprocess IO is captured as well. out, err = capture_subprocess_io do system "echo Some info" system "echo You did a bad thing 1>&2" end assert_match %r%info%, out assert_match %r%bad%, err NOTE: This method is approximately 10x slower than captu...
[ { "docid": "f68ba364919aec9b6b0130004bb5ef66", "score": "0.7603079", "text": "def capture_subprocess_io\n require 'tempfile'\n\n captured_stdout, captured_stderr = Tempfile.new(\"out\"), Tempfile.new(\"err\")\n\n synchronize do\n orig_stdout, orig_stderr = $stdout.dup, $stderr.dup\...
[ { "docid": "185cf97f54549c887eade4d7fa33e23c", "score": "0.7960107", "text": "def test_capture_subprocess_io\n out, err = capture_subprocess_io do\n system \"echo What do you get if you multiply six by nine?\"\n system \"echo The answer is 42 1>&2\"\n end\n\n assert_equal \"What do yo...
33610fb339936759be780b30d26fea9a
user_ids = Array of user_id's. Send the recommendation to these user ids message_id = the recommended message id
[ { "docid": "1fa9e14d9ee38956b76ca08f20fe2b99", "score": "0.6982635", "text": "def share_a_message user_ids, message_id, group_id, recommendation_text=''\n post(:share_message, :params => {:user_ids => user_ids.join(\",\"), :group_ids=>group_id, :message_id => message_id, :recommendation_text => re...
[ { "docid": "3c4f44a86c6f7365bea69eabd62a304d", "score": "0.6898806", "text": "def recommendations_for(user_id)\n if current_user = @@users[user_id]\n other_users = @@users.reject { |key| key == user_id }.values\n p \"Other Users #{other_users.size}\"\n ::Recommender::En...
634d5023f007b7255c6126dbe665c94a
Checks the database to ensure the Shortcut is not already taken
[ { "docid": "b4384f38502fff7e40f3e6968fed0cc1", "score": "0.6959119", "text": "def check_unique_shortcut?\n if (not new_record? and Node.where('nodes.shortcut = ? AND nodes.id != ?', shortcut, id).exists?) or (new_record? and Node.exists?(:shortcut => shortcut))\n puts \"Problem Node: (Title: #{t...
[ { "docid": "f33791f66914eaf5ce20ba40906cc300", "score": "0.6475214", "text": "def not_a_duplicate\n if Handbag.find_by(brand: brand, color: color, designer_id: designer_id)\n errors.add(:brand, 'is already in database')\n end\nend", "title": "" }, { "docid": "2135f74e446d530566d697248...
ec2f352fe61f76fd9126471ca7ec6b63
TODO: with() TODO: this is not a join, but an IN x2 UNION, i.e. there is likely room for optimization via a join.
[ { "docid": "2df75240fd34023c39d310f022593f86", "score": "0.0", "text": "def taxon_name_id_facet\n return nil if taxon_name_id.empty?\n\n o = nil\n if descendants\n o = ::Otu.descendant_of_taxon_name(taxon_name_id)\n else\n o = ::Otu.where(taxon_name_id:)\n ...
[ { "docid": "b8b80f1ffd5bf1abbf25b6ef16d5151f", "score": "0.61826", "text": "def test_join1\n t1 = ['a', 'b']\n t2 = ['b', 'd']\n l = OMF::Rete::IndexedTupleSet.new([:a?, :x?], [:x?])\n r = OMF::Rete::IndexedTupleSet.new([:x?, :b?], [:x?])\n out = IndexedTupleSet.new([:a?, :b?], [:a?])\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "9961f808445174af616560665196712b", "score": "0.0", "text": "def set_cert_signing_request\n @csr = CertSigningRequest.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook;...
b9cf366f3485183c3d83e0c7b97d3a21
Returns a new TimeWithZone object that represents the difference between the current object's time and the +other+ time. Time.zone = 'Eastern Time (US & Canada)' => 'Eastern Time (US & Canada)' now = Time.zone.now => Sun, 02 Nov 2014 01:26:28 EST 05:00 now 1000 => Sun, 02 Nov 2014 01:09:48 EST 05:00 If subtracting a Du...
[ { "docid": "dc7251c70964bafb7d8fa9def4c15e43", "score": "0.6806809", "text": "def -(other)\n if other.acts_like?(:time)\n to_time - other.to_time\n elsif duration_of_variable_length?(other)\n method_missing(:-, other)\n else\n result = utc.acts_like?(:date) ? utc.ago(...
[ { "docid": "b9de661b08b9a5e73bbe628eb06542f0", "score": "0.69307196", "text": "def -(other)\n moment = @time.to_time.localtime(zone) - other.to_f.round(1)\n base = ::Date.parse(moment.strftime('%Y-%m-%d'))\n\n self.class.new(moment.strftime('T%H:%M:%S.%L%:z'), base)\n end", "title"...
066675d4dedb4f6f6bebce652b9d552f
Execute the Choreo using the specified InputSet as parameters, wait for the Choreo to complete and return a ResultSet containing the execution results.
[ { "docid": "7c842c99442ea4bd96b2e383aafd4925", "score": "0.0", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = CreateCommentResultSet.new(resp)\n return results\n end", "title": "" } ]
[ { "docid": "c4ca32683e8ce75eb6a187d63df8fa77", "score": "0.7665963", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = DoneResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "6f7a7d9be674ad4cf17d6743eb1f7836", "score...
7191ebd9e83a21b0adae6888dcace057
GET /celebs/new GET /celebs/new.json
[ { "docid": "5655cb809180e65d03fe9f11cd1b4a88", "score": "0.7575974", "text": "def new\n @celeb = Celeb.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @celeb }\n end\n end", "title": "" } ]
[ { "docid": "f393d0f61ff5c546f0b3d7f440c8add1", "score": "0.74153906", "text": "def new\n @cow = Cow.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cow }\n end\n end", "title": "" }, { "docid": "df6632112b379b87889711011c7108b6", ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "b8710dcb2300f0a4a0cffe91f54e8a95", "score": "0.0", "text": "def set_user_dish\n @user_dish = UserDish.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60315156", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6018921", "text": "de...
0c48f33fae8ab1890198209baf2a9f34
GET /transactions GET /transactions.json
[ { "docid": "29eb95e2cabf2886bbfaa158b253e58a", "score": "0.0", "text": "def index\n #@transactions = Transaction.all\n @search = Transaction.search(params[:q])\n @transactions = @search.result\n @search.build_condition if @search.conditions.empty?\n @search.build_sort if @search.sorts.emp...
[ { "docid": "8c881930159a0e4227bb5dead3cb4e4c", "score": "0.8518901", "text": "def transactions(params = {})\n request(:get, '/transactions', params)\n end", "title": "" }, { "docid": "6c8d0bb89b3254ce41f23ee95c5e6976", "score": "0.7992501", "text": "def index\n json_respon...
d887f14a4db6e427da0e095bd6a10177
if invoked directly, will use default configuration
[ { "docid": "a73dc409228eec7d58e7c01fc4c800fb", "score": "0.0", "text": "def print_list\n print_list_config = active_scaffold_config.print_list\n if params[:print_list_columns].nil?\n print_list_columns = {}\n print_list_config.columns.each { |col|\n print_list_columns[co...
[ { "docid": "eb2b661ff9733a180d228b595311124b", "score": "0.83329356", "text": "def default_config; end", "title": "" }, { "docid": "2728bc067ebad27b416ae8942d300296", "score": "0.8281492", "text": "def default_configuration=(_arg0); end", "title": "" }, { "docid": "5516d2...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "f0f70a211613864e7567be82e8209e03", "score": "0.0", "text": "def set_men_shop_collection\n @men_shop_collection = MenShopCollection.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.61642385", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.60448", "text": "def action_hook; ...
ad9118e04940f5d6daf6337e62445163
This converts the node to a hash.
[ { "docid": "d343eb78628327b70ba406f21a25ea86", "score": "0.0", "text": "def to_hash\r\n {\r\n name: @name,\r\n age: @age,\r\n total_grossing_value: @total_grossing_value,\r\n adjacency_list: @adjacency_list\r\n }\r\n end", "title": "" } ]
[ { "docid": "df7ae2115219af0d2fb0b675f4b441e7", "score": "0.7830069", "text": "def extract_hash(node); end", "title": "" }, { "docid": "3d7d0f168145504c9b097e959feb6872", "score": "0.7744184", "text": "def hash\n node.hashCode\n end", "title": "" }, { "docid": "7c79b4c...
756dd5bdeb1e3de7e9ff416706edd058
This returns a proc that can be used with the builder that simply appends data to an array in the env.
[ { "docid": "18ddf2b065a8b139431707efd01709be", "score": "0.63213307", "text": "def appender_proc(data)\n Proc.new { |env| env[:data] << data }\n end", "title": "" } ]
[ { "docid": "7e086b3ad7d11dd3e3c07a2643eb424f", "score": "0.61829436", "text": "def pyfix_array_push\n @message_name = 'append'\n [self, target.deep_copy]\n end", "title": "" }, { "docid": "e86f6fb1da66b32141e30a5a9ec31ce5", "score": "0.5893432", "text": "def array(&block)\n ...
43628b919e7f922adec963f1c2225247
Deletes the Template specified by the id parameter.
[ { "docid": "ff46959abbc820333b5de1613b1b0bec", "score": "0.79997844", "text": "def delete_template(opts)\n post(\"/template/delete/#{opts[:template_id]}\")\n end", "title": "" } ]
[ { "docid": "6ac1dd7d7a40735b84c9f376ef33b24f", "score": "0.882083", "text": "def delete_template(id:)\n api_delete(endpoint: \"templates/#{id}\")\n end", "title": "" }, { "docid": "9c135393ff8490a6860b323d1f087b34", "score": "0.8410824", "text": "def delete(id, params = {})\n...
23892974fd56494e65eebd2bffd0fb4f
Get the hash of current arguments. === Returns
[ { "docid": "864485daf3a550b485f842128cdf623b", "score": "0.6723847", "text": "def arguments\n @arguments ||= Launchr::OrderedHash.new\n @arguments\n end", "title": "" } ]
[ { "docid": "85a6e606aeba517c7ee6ddbf8e20cfd2", "score": "0.76175016", "text": "def hash\n hash_args.hash\n end", "title": "" }, { "docid": "4b82f1a285d3e92c2fd39c7f9dc045ab", "score": "0.7500313", "text": "def hash\n [name, args].hash\n end", "title": "" }, ...
e0fd94eafdf8be8044d88764b1a248b3
POST /libr_libros POST /libr_libros.json
[ { "docid": "eed74fbe55700b536849312dd230dbb3", "score": "0.69634694", "text": "def create\n @libr_libro = LibrLibro.new(libr_libro_params)\n\n respond_to do |format|\n if @libr_libro.save\n format.html { redirect_to @libr_libro, notice: 'Libr libro was successfully created.' }\n ...
[ { "docid": "bc3b4c690c56bd34ef98d325c8970d99", "score": "0.61859554", "text": "def libr_libro_params\n params.require(:libr_libro).permit(:titulo, :autor, :editorial, :comentario, :otro1, :otro2)\n end", "title": "" }, { "docid": "5e7ac2dd5ec1118c9de4f58f877b6b8b", "score": "0.61...
56c3fc15923f1da4224dbc7633358b59
DELETE /music_albums/1 DELETE /music_albums/1.xml
[ { "docid": "ddb8b4e6105f01d5403e6e65e423d4ee", "score": "0.69066375", "text": "def destroy\n @music_album = MusicAlbum.find(params[:id])\n @music_album.favorites.destroy_all\n del_post_wall(@music_album)\n @music_album.destroy\n\n respond_to do |format|\n format.html { redirect_to(mu...
[ { "docid": "eb8adb777175bb35b7f88b10b36f92da", "score": "0.7452885", "text": "def destroy\n @album = Album.find(params[:id])\n deleted_files = 0\n deleted_album = @album.title\n @album.destroy\n\n respond_to do |format|\n format.html { redirect_to(albums_url, :notice => \"Deleted #{d...
e2485c914cceb27ebd7cfeacc4d21913
Public: Gets total invoice amount for all invoices associated with a team start_date Time to filter from end_date Time to filter to Returns an Integer
[ { "docid": "44815bf640a664193964c628d54c8188", "score": "0.75009114", "text": "def total_invoice_amount(start_date, end_date)\n total = 0\n projects.each do |project|\n total += project.invoices.where(due_on_date: start_date...end_date).map(&:total_amount_inc_vat).sum\n end\n total\n e...
[ { "docid": "01b8e788d384a462745acfe237624fe5", "score": "0.634846", "text": "def invoice_total\n self.invoices.sum(:total).to_f\n end", "title": "" }, { "docid": "01b8e788d384a462745acfe237624fe5", "score": "0.634846", "text": "def invoice_total\n self.invoices.sum(:total).to_...
4ac5512773286131ccacfe544762a7b0
Returns the number of hours spent on this issue
[ { "docid": "226fda02efb5d4c01c2dbf9ab4048760", "score": "0.7592853", "text": "def spent_hours\n @spent_hours ||= time_entries.sum(:hours) || 0\n end", "title": "" } ]
[ { "docid": "3051a86cc7e8908d5115fce9b491dc59", "score": "0.78579354", "text": "def spent_hours\n @spent_hours ||= TimeEntry.joins(:issue).where(\"#{Issue.table_name}.fixed_version_id = ?\", id).sum(:hours).to_f\n end", "title": "" }, { "docid": "3051a86cc7e8908d5115fce9b491dc59", "sc...
077504a48b63edbd4d6e76f9a07c5784
end of initialization function
[ { "docid": "02fab61936194260c91ec09c8a717c8c", "score": "0.0", "text": "def state_at(t)\n\n if @time_span.include?(t)\n \n leg_percent = (t - @launch_time) / @flight_time\n dist = leg_percent * @distance\n dist_rad = leg_percent * @distance_rad\n\n alt_track = @al...
[ { "docid": "5cf2cba0ee7f9825b63b087af5363b37", "score": "0.86511624", "text": "def init; end", "title": "" }, { "docid": "5cf2cba0ee7f9825b63b087af5363b37", "score": "0.86511624", "text": "def init; end", "title": "" }, { "docid": "5cf2cba0ee7f9825b63b087af5363b37", "...
40ed33fb445b0671935a9040a4fb6116
my issue with the solution is that the same names that are very similiar are passed back and forth and it makes it difficult to separate array names, parameter names, and method names Print Me (Part 1)
[ { "docid": "2101279042189d9d00466f18d345b223", "score": "0.0", "text": "def print_me\n puts \"I'm printing within the method!\"\nend", "title": "" } ]
[ { "docid": "a1cfd6650f6417168fff821535cec970", "score": "0.6141786", "text": "def name(*) end", "title": "" }, { "docid": "a1cfd6650f6417168fff821535cec970", "score": "0.6141786", "text": "def name(*) end", "title": "" }, { "docid": "13d02f41ca2bd65dc9bd79e2f433556d", ...
b946af623f17535be59023bebd675ef5
Check if minimum size is inclusive. When min is not defined inclusive is False. :rtype: bool
[ { "docid": "b81235a25227b7c653c5522cf6117927", "score": "0.718618", "text": "def is_exclusive_min\n if not @payload.path_exists(\"min\")\n return false\n end\n\n return @payload.get_path(\"exclusive_min\"){false}\n end", "title": "" } ]
[ { "docid": "6afa0fc5ab6dda0d315cea5a42d63507", "score": "0.7087028", "text": "def match_minimum_size?(width, height, min)\n if ( width && height ) < min\n return false\n end\n\n return true\n end", "title": "" }, { "docid": "f339e6e772a817d9a086f9d9b7493b4d", "score": "0.7...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "d43abd2582fb90fd56b42d6aac5db3ba", "score": "0.0", "text": "def set_terr\n @terr = Terr.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.603186", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6015241", "text": "def ...
e9c3f111083457e8e758c379004e0055
Unsubscribes to the notification email.
[ { "docid": "137be6bdc286ec7a8ed8b79b7318aa14", "score": "0.7448584", "text": "def unsubscribe_to_email(options = {})\n unsubscribed_to_email_at = options[:unsubscribed_to_email_at] || Time.current\n update(subscribing_to_email: false, unsubscribed_to_email_at: unsubscribed_to_email_at)\n en...
[ { "docid": "498f2b1d0966836b9a1b004bd528a854", "score": "0.7731612", "text": "def unsubscribe_to_email\n @subscription.unsubscribe_to_email\n return_back_or_ajax\n end", "title": "" }, { "docid": "402e6f6bcd033fcd52a7e01922c1f796", "score": "0.76917046", "text": "def uns...
76054d69f9b9f9d3d709c1cf2915d405
POST /tipo_clientes or /tipo_clientes.json
[ { "docid": "59b8b27e2e444e992aad6fd261c1bda2", "score": "0.66449684", "text": "def create\n @tipo_cliente = TipoCliente.new(tipo_cliente_params)\n\n respond_to do |format|\n if @tipo_cliente.save\n format.html { redirect_to tipo_clientes_path, notice: \"Tipo de Cliente creado satisfact...
[ { "docid": "29de9e030e9fde3c8ff3d61e25d8f6ae", "score": "0.6818034", "text": "def create\n @clientetipo = Clientetipo.new(params[:clientetipo])\n\n respond_to do |format|\n if @clientetipo.save\n format.html { redirect_to @clientetipo, notice: 'Clientetipo was successfully created.' }\...
ab6dbedff71506c290ef99539ca4e92e
Set the current html value of the element Useful for input elements
[ { "docid": "96e73eb8b9898f80b4fb7eaad444e893", "score": "0.6997231", "text": "def value=(value)\n `#{@element}.value = #{value}`\n end", "title": "" } ]
[ { "docid": "b2ee8af073e57e9eba217993c4129bfc", "score": "0.71489584", "text": "def value=(value)\n `#{@el}.value = #{value}`\n end", "title": "" }, { "docid": "3a9be9766e3aab72ff9ecbdb9d7c200b", "score": "0.707525", "text": "def html=(value)\n `#{@el}.innerHTML = #{value...
13bb21450dc7ea806f45cfdbe615e6ba
Protected: Replace emoji characters (e.g. ':squirrel:') with emoji images
[ { "docid": "93862bb1c24a9a1cb44e1ef07b763eef", "score": "0.6469584", "text": "def emojify(document)\n document.gsub(/:([\\w+-]+):/) do |match|\n emoji = Emoji.find_by_alias($1)\n emoji ? emoji_template(emoji) : match\n end\n end", "title": "" } ]
[ { "docid": "e36d0f3b44cc57587a835e1873c96c7a", "score": "0.84101146", "text": "def replace_emoji(text)\n text.gsub(/:([^\\s:])+:/) do |emoji|\n\n emoji_code = emoji #.gsub(\"|\", \"_\")\n emoji = emoji_code.gsub(\":\", \"\")\n\n if MdEmoji::EMOJI.include?(emoji)\n ...
8caa6af61ce8c880bba14abfadd7133e
Deals with messages directed to agents
[ { "docid": "2f49525cd22f0f7730e73d1de5a81daf", "score": "0.6594207", "text": "def agentmsg(request)\n Log.debug(\"Handling message for agent '#{request.agent}' on collective '#{request.collective}'\")\n\n @agents.dispatch(request, @connection) do |reply_message|\n reply(reply_message, r...
[ { "docid": "b93494472c640c05b12c482b4448e573", "score": "0.69328666", "text": "def messaging; end", "title": "" }, { "docid": "4fd81f21c6ba6db8d86fd7cf8c0cfaf9", "score": "0.68145597", "text": "def handle_message(msg)\n logger.info \"Agent #{name} asked to handle message\"\n ...
61cec97729d7981cadfd3c84995c386a
Helper for processing a single associated object, such as has_one (or belongs_to) associations.
[ { "docid": "12943f95d605494172847fcc22b3230c", "score": "0.0", "text": "def singular_association_diff(left_parent, right_parent, association)\n association = association.to_s #instance_eval doesn't like symbols. What'ev.\n attributes_diff(\n left_parent.instance_eval(associ...
[ { "docid": "75d77826289dc20a7945258fa5e40eac", "score": "0.6653963", "text": "def referenced_one?\n _association && _association.is_a?(Association::Referenced::HasOne)\n end", "title": "" }, { "docid": "e07d6c2fc7eb2b967a83ab76b9660dea", "score": "0.6549114", "text": "def has...
9f358eb61903851bc112f25143769315
Check whether two nodes are neighbours. To include the node's siblings in the matching candidates, pass the `:siblings` option to true.
[ { "docid": "ccb2935cb6f3a686cd8567c65f2c4406", "score": "0.82339865", "text": "def neighbours?(node1, node2, options = {:siblings => false})\n neighbours(node1, options).any? { |set| set.include? node2 }\n end", "title": "" } ]
[ { "docid": "bfa2622221d77fec12f8ba09d6e03585", "score": "0.67650867", "text": "def neighbors?(other_cell)\n @neighbors.include?(other_cell)\n end", "title": "" }, { "docid": "1f09ab298975ac0fe32cd911ac75ddd5", "score": "0.66534793", "text": "def siblings?(node1, node2)\n sib...
09721b175f00ca7628ca032e4a0eae7f
First check it's email. We don't can check user after question and answer Becouse maybe 2 same question and 2 same answer
[ { "docid": "450999d1ae34ac02a9903168fc0a8e36", "score": "0.6071101", "text": "def check_email\n some_error('Sorry but wrong email address') if !@user = User.find_by_email(params[:email])\n end", "title": "" } ]
[ { "docid": "341fd5936e2d7adbff3e69f190ad28b1", "score": "0.72042215", "text": "def check_email_match\n\t\tif provider.blank?\n \t\terrors.add(:email, \"error: los dos correos no son idénticos, por favor, escriba y repita de nuevo su email\") if email != email_repeat\n \tend\n\tend", "title": "" ...
6339673188cebbd26707a4dff9761c90
Complete name but with only initial of last name
[ { "docid": "fecfbb50c880398aaf6344b9548a7074", "score": "0.0", "text": "def shortname\n return \"#{self.first_name} #{self.last_name[0]}.\"\n end", "title": "" } ]
[ { "docid": "458e3d109f6ac98f1939c9f5ed4c84cb", "score": "0.83575183", "text": "def first_name_last_name_initial\n self.first_name + ' ' + self.last_name[0,1]\n end", "title": "" }, { "docid": "f0fd78b3d8ff045293e8b694336f0fa6", "score": "0.83102727", "text": "def get_firstname_la...
cc6e6a86beb117b69870460f18870021
`Usermost_recent_recipe` should return the recipe most recently added to the user's cookbook.
[ { "docid": "7395a81684cf3bed5d196476a8838fec", "score": "0.725421", "text": "def most_recent_recipe\n my_recipes = self.recipe_cards\n my_recipes.sort_by do |rec_card|\n [\n rec_card.date.split(\"/\")[0].to_i,\n rec_card.date.split(\"/\")[1].to_i\n ]\n end[-1]\n end", ...
[ { "docid": "2be968b22b29d8eb09dadc523a117a6b", "score": "0.88177943", "text": "def most_recent_recipe\n recipes.last\n # should return the recipe most recently added to the user's cookbook.\n end", "title": "" }, { "docid": "f2c3028ac9fa0e070c853d846d444560", "score": "0.8113043",...
cc83535972e4eb7b3280ff1d1d47a9cc
send a signup email to the user, pass in the user object that contains the user's email address
[ { "docid": "a5e5c2e8c9a1cfa0cf89e49ed812b4a8", "score": "0.0", "text": "def send_order_email\n\t mail( :to => 'ashley@asiancomco.com',\n\t :subject => 'Order' )\n\t end", "title": "" } ]
[ { "docid": "8a17e19fcf5f535db4bb43c3900d2145", "score": "0.85455173", "text": "def signup_email(user)\n @user = user\n mail(to: @user.email, subject: 'Thanks for signing up for our amazing app')\n end", "title": "" }, { "docid": "9ed7cfc072d96431240fab52612b34de", "score": "0.8514...
06ecfa405875be1c3f6f4c743f8856a7
Convience method as a resource alias for show action. To customize, override the method in your class.
[ { "docid": "0e51801765df0fae3e045cafeb7e5908", "score": "0.0", "text": "def show(params)\n remote_call(\"show\", params)\n end", "title": "" } ]
[ { "docid": "b07d552b4bcb444323a41af90268de5f", "score": "0.7963723", "text": "def show\n \t\tsuper\n \tend", "title": "" }, { "docid": "0577b85915f6e2bec299664c539ec683", "score": "0.7845444", "text": "def show\n super\n end", "title": "" }, { "docid": "0577b85915f6...
d092d8fbc5397c7d77b0839fa99b862f
Create political_force on central site
[ { "docid": "dfc1ec4a9b89cf2dbeb7a1c1cc6e9b75", "score": "0.55002815", "text": "def create_remote(entity)\n log_event(\"[I] Creating remote political_force #{entity.id} (#{entity.uuid})\")\n @entity = entity\n rest(:post, REMOTE_URL, data_for_remote)\n end", "title": "" } ]
[ { "docid": "2299650749e713a4eba5e535ad0047d8", "score": "0.7126905", "text": "def create_local\n uuid = @data.dig(:id)\n\n log_event \"[I] Creating local political_force #{uuid}\"\n\n @entity = PoliticalForce.new(uuid: uuid)\n\n apply_for_update\n\n @entity.save\n @entity\n end", ...
d99dfdd995fe49a94e200615df55ab2f
Outputs the oject provided as XML to the current response stream.
[ { "docid": "0c5a997a1c13933c6cddc1c73b992b41", "score": "0.72734535", "text": "def put_xml(obj = nil, status = 200, append_response = false)\n @performed_render = true\n \n obj.set_pretty_print(true)\n text = obj.to_xml\n \n response.content_type = 'text/xml'\n response.status = sta...
[ { "docid": "185e513f8f086a43b18785c879128c69", "score": "0.72852474", "text": "def to_xml\n @object.marshal_dump.to_xml(:root => :response)\n end", "title": "" }, { "docid": "362f110f9172c99a28b7e57d4440039e", "score": "0.7209089", "text": "def to_xml\n\t\t\ttext = \"\"\n\t\t\t@r...
e84affeb823c1830d5a822531393fa8b
Methods For creating order items
[ { "docid": "37dd3628f3d985a04f702754ecd11427", "score": "0.0", "text": "def confirm_order\n\t\ttotal_price = 0\n\t\tcart_items = self.user.cart_items\n\t\tcart_items.each do |cart_item|\n price = cart_item.quantity * cart_item.product.price\n total_price += price\n self.order_items.build(...
[ { "docid": "d23180ed16bf0a062e5075623ec1edab", "score": "0.7607282", "text": "def create_order_items\n self.cart.cart_items.find_each do |cart_item|\n item = cart_item.item\n @order_item = OrderItem.new(\n item: item,\n qty: cart_item.qty,\n price: item.taxed_price,\n ...
8085e744a207c6a72f8df8054309bf2a
GET /features GET /features.json
[ { "docid": "c414d102301de7ab7ef1556504664e57", "score": "0.0", "text": "def index\n respond_to do |format|\n format.html { render 'shared/index'}\n format.js { render @filter.errors.empty? ? 'shared/index' : 'filter' }\n format.json { render json: @features }\n end\n end", "tit...
[ { "docid": "54315f4db223c2e140a07359096733f2", "score": "0.76739454", "text": "def index\n @features = Feature.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @features }\n end\n end", "title": "" }, { "docid": "4468df9072e261c9e...
8eab70220f50d67913f649e4462f2516
Load the builtin AWS resources
[ { "docid": "d4fd940a12b821d5c752ebfbebf9cce9", "score": "0.75936306", "text": "def load!\n require File.join(File.dirname(__FILE__), 'aws', 'cfn_resources.rb')\n load(AWS_RESOURCES)\n true\n end", "title": "" } ]
[ { "docid": "1dae9bfd1d1779fac4f610cadf9f8611", "score": "0.6678197", "text": "def aws_resources\n nil\n end", "title": "" }, { "docid": "f40faeade7fa186d24c8dfdb44debacf", "score": "0.60062534", "text": "def load_resources\n resource_path = File.join(File.dirname(_...
99057e0dfef982c2a6294ed49c79023b
Create a new instance of this model with the given attributes
[ { "docid": "7e1933e1d8809ed8118b852d2d5d40b2", "score": "0.0", "text": "def initialize(attrs={})\n attrs.stringify_keys!\n\n self.class.defaults.merge((attrs || {}).reject {|k,v| v.nil? }).each do |k,v|\n if self.class.fields[k]\n send(\"#{k}=\", v)\n end\n end\n ...
[ { "docid": "9d479e5091ab8e45e4ca3d991c07b4a4", "score": "0.8223999", "text": "def create(attributes = {})\n model = new(attributes)\n model.save\n model\n end", "title": "" }, { "docid": "f828d652dc659f3d1e37aae4f1a34673", "score": "0.80631673", "text": "def...
9da27a0e8a61f48f1b4e9af713f61bc9
Eg: [0, 0, 0, 1] is treated as 0001 which is the binary representation of 1. Testing: [0, 0, 0, 1] ==> 1 Testing: [0, 0, 1, 0] ==> 2 Testing: [0, 1, 0, 1] ==> 5 Testing: [1, 0, 0, 1] ==> 9 Testing: [0, 0, 1, 0] ==> 2 Testing: [0, 1, 1, 0] ==> 6 Testing: [1, 1, 1, 1] ==> 15
[ { "docid": "c9752feff14bc488a9f5771569750782", "score": "0.6006852", "text": "def binary_array_to_number(arr)\n j = arr.join(\"\").to_i\n temp = j\n dec = 0\n basev = 1\n while temp != 0 do\n ld = temp % 10\n temp = (temp/10).to_i\n dec += (ld * basev)\n basev...
[ { "docid": "1c23f2626528da5461a18c813cea5342", "score": "0.6896478", "text": "def binary_array_to_number(arr)\n arr.reverse!\n sum = 0\n arr.map.with_index do |item, index|\n if item == 1\n if index.zero?\n sum += 1 if item == 1\n else\n sum += (index * 2)\n end\n e...
9ea8417cae653f92f43314dac8f5b693
Process and print server values
[ { "docid": "45ec0edcd9c3d444f390650c6573e5bd", "score": "0.54359514", "text": "def print_servers\n Notify.info('Sites')\n\n @config.get(:servers).each do |server|\n Notify.spit(\" - Name: #{server[:name]}, Address: #{server[:address]}, HTTPS: #{server[:https]}\")\n end\n ...
[ { "docid": "83b6582b9bfd12099468fdddbe37eb58", "score": "0.6624128", "text": "def output\n @server.service.output.each {\n |out|\n type = out.keys[0]\n msg = out.values[0]\n begin\n self.send( \"print_#{type}\", msg )\n rescue...
6c4d37ba240762754509c710936d612e
Convenience method for getting the value of the socket IDENTITY.
[ { "docid": "55d16f9b827c579273f76630a2912d6a", "score": "0.6394103", "text": "def identity\n getsockopt ZMQ::IDENTITY\n end", "title": "" } ]
[ { "docid": "8dd4b676e6b3b66972c9b1d823af0e8b", "score": "0.73603165", "text": "def sockid(socket)\n if socket.kind_of? ZMQ::Socket\n rc = socket.getsockopt(ZMQ::IDENTITY, id=[])\n if ZMQ::Util.resultcode_ok?(rc) and id[0]\n id[0]\n else\n socket.socket.address...
d79a1ff304ac110315da990a73585923
load_and_authorize_resource before_filter :load_permissions GET /client_infos GET /client_infos.json
[ { "docid": "a695eb024e0b4cb7fc2ee53954f13c96", "score": "0.0", "text": "def index\n @client_infos = ClientInfo.all\n end", "title": "" } ]
[ { "docid": "fe2b72025945ba1cacf9f177d5bc3517", "score": "0.7126584", "text": "def show\n authorize @api_client\n end", "title": "" }, { "docid": "471e397483be965eb16d6ee15c157b4a", "score": "0.70440376", "text": "def show\n authorize @permission\n render json: @permission\n...
e4b08629ab1cb47f7d7ba0b7784c970a
Reglas de Negocio deducidas 129 caracteres por linea. TRANSPORTE, lleva el Total del paciente, entre registros. LINEA Paciente. Paciente inicia en: "0\s\s"" DNI: inicia en caracter 20 al 27. Nro. Beneficiacio: 10 digitos Apellido y nombre: arranca en 42 hasta 85 Origen: 86 al 88 Numero Paciente: 89 al 94 Ficha: 96 al 9...
[ { "docid": "9fe68c0cea55854b25cf3d42bc18d12c", "score": "0.0", "text": "def string_number_decimal_host(string)\n decimal_point = (1.to_f.to_s)[1] #Para saber cual es el simbolo decimal en el host\n #gsub(/[.,]/, '.' => '', ',' => '.')\n if decimal_point == \".\"\n #string.sub!(\",\", decimal_poin...
[ { "docid": "a21b1a0c2f1b9d4d06e636ca56dd5ab3", "score": "0.6695875", "text": "def monta_header\n # CAMPO TAMANHO VALOR\n # 001 001 9(001) Identificação do Registro Header: “0” (zero)\n # 002 001 9(001) Tipo de Operação: “1” (um)\n # 009 007 A(007) Identificaç...
9fb70df7b1d021578cb370fc9689eb11
assumes x.y.z all digit version
[ { "docid": "67ca50381acdebdad69bf6d588255863", "score": "0.6655396", "text": "def next_version\n # x.y.z\n v = version.split '.'\n # bump z\n v[-1] = v[-1].to_i + 1\n v.join '.'\nend", "title": "" } ]
[ { "docid": "541de54fde33b0b6212660e5da6f5c68", "score": "0.67268604", "text": "def osgi_version_for(version)\n parts = version.split(/[\\.,-]/)\n result = Array.new(3, 0)\n parts.each_index { |i|\n if (result.size == 3) then\n if (parts[i] =~ /\\d+/) then result[i] = parts[i] else result = re...
30f56c439a47eb6077435d127809a9fe
Returns a plotbands definition for the data source Only if the category column is a date or datetime
[ { "docid": "921fc4abee4d65071217b320cc2ecfce", "score": "0.74186367", "text": "def weekend_plot_bands\n return unless options[:weekend_plot_bands] && data_source.first[category_column].respond_to?(:to_date)\n x_plot_bands = data_source.inject_with_index([]) do |plot_bands, row, index|\n ...
[ { "docid": "6cb79fe17a3e09f6484112fd53613d12", "score": "0.57275563", "text": "def chart_type; end", "title": "" }, { "docid": "8bac1c8446fc812f918f94a0a005daa9", "score": "0.57216924", "text": "def series_type; end", "title": "" }, { "docid": "40afdd2971600fcc2e776a52cbd...
10114980232e9ec173501549372468fd
displays read only version of ratings list
[ { "docid": "fb88aba66548069a8e2226604f744ce3", "score": "0.7652638", "text": "def ratings_readonly(rating)\n if (rating.is_a?(Integer) )\n \trating = Integer(rating)\n else\n\trating = 1\n end\n if(rating <= 5)\n items = ['one','two','three','four','five']\n content = \"\"\n ...
[ { "docid": "529a1f42e1c69ecc8b5e26b89865ad52", "score": "0.7207498", "text": "def show\n @CanEditRatings = has_permissions?(@permissions[:CanEditAllRatings])\n end", "title": "" }, { "docid": "2ef2f638929b6be11864ef6be17f3398", "score": "0.7012125", "text": "def ratings_list \n ...