query stringlengths 7 6.41k | document stringlengths 12 28.8k | metadata dict | negatives listlengths 30 30 | negative_scores listlengths 30 30 | document_score stringlengths 5 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
DELETE /team_years/1 DELETE /team_years/1.json | def destroy
@team_year.destroy
respond_to do |format|
format.html { redirect_to team_years_url, notice: 'Team year was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @team_year.destroy\n respond_to do |format|\n format.html { redirect_to team_years_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @built_year.destroy\n respond_to do |format|\n format.html { redirect_to built_years_url }\n format.json { hea... | [
"0.7851154",
"0.73274475",
"0.7215139",
"0.7191586",
"0.716026",
"0.7109318",
"0.7105632",
"0.7105632",
"0.7105632",
"0.7105632",
"0.7089488",
"0.7089488",
"0.7089488",
"0.7089488",
"0.7089488",
"0.7089488",
"0.7089488",
"0.7089488",
"0.7089488",
"0.7089488",
"0.7089488",
"... | 0.75810444 | 1 |
Initializes Configuration instance with nil values unless config file was created previously | def initialize
@config = config_from_file || empty_config
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize\n create_config unless File.exists?(config_file)\n load_settings\n set_domain\n end",
"def create_config\n self.config = {} if !self.config\n end",
"def create_config\n self.config = {} if !self.config\n end",
"def _init_configuration\n\t\t# Set defaults\n\t\t@setup =... | [
"0.7210453",
"0.71546143",
"0.71546143",
"0.70793617",
"0.70626146",
"0.70488423",
"0.6986784",
"0.6969369",
"0.681132",
"0.6809749",
"0.67693996",
"0.67334914",
"0.67288727",
"0.6713797",
"0.6652697",
"0.66519606",
"0.6637692",
"0.6631253",
"0.66237146",
"0.6612343",
"0.6612... | 0.80591923 | 0 |
Resets configuration instance to initial values | def reset
@config = empty_config
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset\n Configuration.new\n end",
"def reset\n self.configuration = Configuration.new\n end",
"def reset_config\n config.reset_to_defaults\n end",
"def reset\n @config = Config.new\n end",
"def reset\n @configuration = Configuration.new\n end",
"def reset\n... | [
"0.8442297",
"0.83911383",
"0.8345757",
"0.82853997",
"0.82737195",
"0.82721204",
"0.825779",
"0.8239228",
"0.82293814",
"0.8137434",
"0.8110226",
"0.8109662",
"0.8011063",
"0.7871168",
"0.77363336",
"0.7604266",
"0.75576735",
"0.75576735",
"0.7519718",
"0.75136846",
"0.74923... | 0.85413563 | 0 |
Sets absolute path of cloud path | def cloud_path=(path)
raise Error::InvalidCloudPath unless File.directory?(path)
@config[:cloud_path] = File.expand_path(path)
config_to_file
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def path_set(path)\n absolute_path = (Pathname.new(uri.path) + path).to_s\n rebuild_uri :path => absolute_path\n end",
"def set_path(path)\n path\n end",
"def path=(new_path)\n super\n if new_path[0..0] != '/' # addressable adds a / but scp-style uris are altered by this behavior\n ... | [
"0.65640116",
"0.6447197",
"0.63692504",
"0.6271299",
"0.6270105",
"0.62292993",
"0.6225625",
"0.61635387",
"0.6145113",
"0.61386853",
"0.61344",
"0.6098893",
"0.6085709",
"0.6024676",
"0.60211545",
"0.6008003",
"0.59889364",
"0.59889364",
"0.59889364",
"0.59530973",
"0.59280... | 0.75120026 | 0 |
GET /oauth_tokens/new GET /oauth_tokens/new.xml | def new
@oauth_token = OauthToken.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @oauth_token }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @access_token = AccessToken.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @access_token }\n end\n end",
"def new\n @api_token = ApiToken.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :x... | [
"0.67472833",
"0.64514196",
"0.63993466",
"0.63331604",
"0.62461716",
"0.618578",
"0.61620504",
"0.613908",
"0.61387736",
"0.6074876",
"0.6041273",
"0.6035804",
"0.5994502",
"0.5948608",
"0.5906072",
"0.58988297",
"0.5896042",
"0.589371",
"0.58553654",
"0.58504736",
"0.584907... | 0.76072115 | 0 |
PUT /oauth_tokens/1 PUT /oauth_tokens/1.xml | def update
@oauth_token = OauthToken.find(params[:id])
respond_to do |format|
if @oauth_token.update_attributes(params[:oauth_token])
format.html { redirect_to([:scaffold, @oauth_token], :notice => 'Oauth token was successfully updated.') }
format.xml { head :ok }
else
form... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def exchange_oauth_tokens\n end",
"def update_tokens(oauth_params)\n# binding.pry\n self.oauth_token = oauth_params.credentials.token\n # facebook, google provide this; twitter, linkedin don't\n self.oauth_expires_at = Time.at(oauth_params.credentials.expires_at) if oauth_params.credentials.ex... | [
"0.65999633",
"0.6258865",
"0.6148939",
"0.59960383",
"0.5980706",
"0.58664656",
"0.57274854",
"0.57202005",
"0.56818384",
"0.5681778",
"0.5681412",
"0.56549394",
"0.5645008",
"0.56274855",
"0.55983543",
"0.55884033",
"0.55884033",
"0.5565079",
"0.5562939",
"0.5548942",
"0.55... | 0.64856654 | 1 |
DELETE /oauth_tokens/1 DELETE /oauth_tokens/1.xml | def destroy
@oauth_token = OauthToken.find(params[:id])
@oauth_token.destroy
respond_to do |format|
format.html { redirect_to(scaffold_oauth_tokens_url) }
format.xml { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @access_token = AccessToken.find(params[:id])\n @access_token.destroy\n\n respond_to do |format|\n format.html { redirect_to(access_tokens_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @oauth_remote_access_token = OauthRemoteAccessToken.find(params[:id])\n... | [
"0.71823555",
"0.70962703",
"0.6857149",
"0.68087286",
"0.66814786",
"0.6642044",
"0.65404487",
"0.6453824",
"0.6433901",
"0.6418886",
"0.6412061",
"0.64109045",
"0.6392825",
"0.63533264",
"0.62944674",
"0.6272732",
"0.6258594",
"0.62504417",
"0.6247066",
"0.6230055",
"0.6218... | 0.74273103 | 0 |
Gets the data of a widget GET widget_data | def widget_data
widget = Widget.find(params[:widget_id])
data = widget.get_filtered_dataset false, 10000
render json: {id: widget.id,
visualization: widget.visualization,
name: widget.name,
description: widget.description,
data: data['d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def widget_data\n widget = WidgetService.widget(params[:widget_id])\n render json: {\n id: widget.id,\n dataset: widget.dataset,\n visualization: widget.widget_config,\n name: widget.name,\n description: widget.description,\n metadata: widget.metadata\n }\n end",
"def widg... | [
"0.76490235",
"0.75053275",
"0.698634",
"0.62444645",
"0.6195724",
"0.6006288",
"0.59895575",
"0.5933267",
"0.58755213",
"0.57870096",
"0.562851",
"0.562851",
"0.562851",
"0.56216526",
"0.5617045",
"0.56114966",
"0.56114966",
"0.56114966",
"0.5600424",
"0.5600424",
"0.5567163... | 0.75109273 | 1 |
Get hash of all active root level campuses/ORUs, sorted by ordering in unit_hier table | def getActiveCampuses
return Unit.join(:unit_hier, :unit_id=>:id).
filter(:ancestor_unit=>'root', :is_direct=>1).exclude(:status=>["hidden", "archived"]).
order_by(:ordering).to_hash(:id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unit_hash\n end",
"def roothash\n root_node._hash || recalculate_hash_at(root_node)\n end",
"def lands_hash\n []\n end",
"def index\n @first_level_units = FirstLevelUnit.active.order(:organization_id)\n end",
"def x_get_tree_roots\n u = User.current_user\n user_groups = u.repor... | [
"0.59638363",
"0.5772861",
"0.57499564",
"0.5585494",
"0.5489596",
"0.54625857",
"0.54336286",
"0.5419081",
"0.5408177",
"0.54011816",
"0.53897583",
"0.537059",
"0.533043",
"0.5322176",
"0.53209484",
"0.5305482",
"0.52887946",
"0.52430654",
"0.5200968",
"0.5196734",
"0.518938... | 0.718914 | 1 |
Move pending PDF files to their published location | def movePendingFiles(itemID)
noSplashKey = calcNoSplashKey(itemID)
pvwPfx = getEnv("S3_PREVIEW_PREFIX")
pvwLin = $s3Bucket.object("#{pvwPfx}/#{itemID}/#{itemID}_noSplash_#{noSplashKey}.pdf")
pvwSplash = $s3Bucket.object("#{pvwPfx}/#{itemID}/#{itemID}.pdf")
# If there's no preview file to move, we have nothi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rebuild_pdf\n page_paths = (1..document.page_count).map {|i| \"#{document.slug}_#{i}.pdf\" }\n #`pdftk #{page_paths.join(' ')} cat output #{@pdf}`\n `pdftailor stitch --output #{@pdf} #{page_paths.join(' ')} 2>&1`\n\n if File.exists? @pdf\n asset_store.save_pdf(document, @pdf, access)\n F... | [
"0.6199648",
"0.6034519",
"0.5940353",
"0.5876566",
"0.58104545",
"0.57956475",
"0.5758618",
"0.57388127",
"0.56893677",
"0.5676972",
"0.56698865",
"0.5658122",
"0.562783",
"0.56124794",
"0.5606567",
"0.5584885",
"0.55458784",
"0.55362004",
"0.55171365",
"0.5503927",
"0.54940... | 0.6521535 | 0 |
Uses the same Logger instance as ActiveRecord. | def logger
::ActiveRecord::Base.logger
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize\n ActiveRecord::Base.logger = Logger.new(STDOUT)\n end",
"def setup_database_logger\n ActiveRecord::Base.logger = PuppetHerald.logger\n nil\n end",
"def log_to(stream, colorize=true)\n ActiveRecord::Base.logger = Logger.new(stream)\n ActiveRecord::Base.clear_active... | [
"0.75238466",
"0.69362867",
"0.6859795",
"0.684676",
"0.67984843",
"0.6709869",
"0.6704235",
"0.64878684",
"0.64028716",
"0.64028716",
"0.6385451",
"0.6347033",
"0.6296572",
"0.6265681",
"0.6176897",
"0.61532813",
"0.6151292",
"0.6148919",
"0.61380625",
"0.6129229",
"0.611047... | 0.7409393 | 1 |
Getter (reader) for the job of the person | def job
@job
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def job # this is a getter\n @job\n end",
"def job\n @job\n end",
"def job\n @job\n end",
"def job \n @job\n end",
"def job=(person_job)\n @job = person_job\n end",
"def job\n fetch('games.final_fantasy_xiv.jobs')\n end",
"def job_resource(job... | [
"0.7379256",
"0.68132335",
"0.68132335",
"0.6462181",
"0.6274558",
"0.62360686",
"0.62170976",
"0.60695523",
"0.60430247",
"0.6016825",
"0.59843475",
"0.594709",
"0.59391296",
"0.59321153",
"0.5923242",
"0.5911251",
"0.5880522",
"0.58699405",
"0.585709",
"0.5849762",
"0.58214... | 0.68591297 | 1 |
Adds a pattern to the grammar. | def add_pattern(pattern)
@patterns << pattern
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_pattern( pattern )\n type_check( pattern, Elements::Pattern )\n assert( !name_defined?(name), \"name [#{name}] is already in use\" )\n \n @patterns[pattern.name] = pattern\n end",
"def <<(pattern)\n @patterns << pattern\n end",
"def add pattern\n\t\t\tno... | [
"0.7800182",
"0.7321851",
"0.71719074",
"0.69735104",
"0.6959845",
"0.6906946",
"0.6666397",
"0.6614245",
"0.64810014",
"0.63464284",
"0.622856",
"0.6212766",
"0.62013966",
"0.6123034",
"0.6087397",
"0.60434186",
"0.6042121",
"0.60168535",
"0.60168535",
"0.60168535",
"0.60168... | 0.8067763 | 0 |
Delete all images for a preset | def delete_preset_items(preset)
only_provides(*graphics_mime_types)
raise NotFound unless preset_exists?(preset)
files = Dir.glob(preset_request_path / "**" / "*.{#{graphics_mime_types.join(',')}}")
success = files.all? { |file| FileUtils.rm(file) rescue nil }
cleanup_empty_dirs!(preset_re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_image_files\n [ :original , :medium , :thumb ].each do |size|\n path = image_path(size, true)\n File.delete(path) if path\n end\n end",
"def remove_all_images\n self.cover_image.purge if self.cover_image.attached?\n self.images.each {|image| image.purge} if self.... | [
"0.7357561",
"0.723533",
"0.72171783",
"0.7209806",
"0.7114806",
"0.7089455",
"0.6977054",
"0.6963914",
"0.69578016",
"0.68049896",
"0.6802123",
"0.6690086",
"0.6690086",
"0.6666248",
"0.6600262",
"0.6584008",
"0.65323263",
"0.65041995",
"0.6495861",
"0.649185",
"0.647351",
... | 0.7409171 | 0 |
Return a JSON object with image information add &metadata=true for image metadata add &presets=true for preset url for this image add &relative=true for relative urls instead of absolute | def info(preset, source_path, format)
url_opts = { :storage => params[:storage], :preset => preset, :format => format }
relative_uri = url_for_image(params[:relative_path], url_opts)
absolute_path = Merb.dir_for(:public) / relative_uri
base_url = params[:relative] ? '' : (request.protocol ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_image_metadata\n {}\n end",
"def info(preset, source_uri, format)\n url_opts = { :storage => params[:storage], :preset => preset, :format => format }\n relative_uri = url_for_external_image(params[:relative_path], url_opts)\n absolute_path = Merb.dir_for(:public) / relative... | [
"0.7031549",
"0.6963861",
"0.690066",
"0.68072295",
"0.6803236",
"0.650662",
"0.650662",
"0.64883614",
"0.6450161",
"0.6448246",
"0.638009",
"0.6376391",
"0.6346044",
"0.63023746",
"0.6302329",
"0.6246139",
"0.62407583",
"0.6240012",
"0.6201065",
"0.61896676",
"0.6154038",
... | 0.7020652 | 1 |
Show list of collection_numbers. | def list_all
store_location
query = create_query(:CollectionNumber, :all)
show_selected_collection_numbers(query)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_collection_numbers\n store_location\n query = create_query(:CollectionNumber, :all)\n show_selected_collection_numbers(query)\n end",
"def index_collection_number\n query = find_or_create_query(:CollectionNumber, by: params[:by])\n show_selected_collection_numbers(query, id: params[:id].... | [
"0.8709816",
"0.725367",
"0.6710611",
"0.6710611",
"0.6710611",
"0.66348636",
"0.6567819",
"0.6348846",
"0.63161504",
"0.62489945",
"0.60139245",
"0.59969974",
"0.5952007",
"0.5920297",
"0.5878167",
"0.5842691",
"0.5839256",
"0.58368087",
"0.5832795",
"0.57801336",
"0.5780133... | 0.77661663 | 1 |
Displays matrix of selected CollectionNumber's (based on current Query). | def index_query_results
query = find_or_create_query(:CollectionNumber, by: params[:by])
show_selected_collection_numbers(query, id: params[:id].to_s,
always_index: true)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_collection_numbers\n store_location\n query = create_query(:CollectionNumber, :all)\n show_selected_collection_numbers(query)\n end",
"def index_collection_number\n query = find_or_create_query(:CollectionNumber, by: params[:by])\n show_selected_collection_numbers(query, id: params[:id].... | [
"0.6460874",
"0.6278466",
"0.62218153",
"0.5944385",
"0.5936518",
"0.5780925",
"0.5708219",
"0.5704405",
"0.56857836",
"0.5667396",
"0.56660587",
"0.564561",
"0.5595077",
"0.55877006",
"0.5586388",
"0.5584422",
"0.5560536",
"0.55495554",
"0.5546502",
"0.5539534",
"0.5539534",... | 0.65627915 | 0 |
Display list of CollectionNumbers whose text matches a string pattern. | def pattern
pat = params[:pattern].to_s
if pat.match?(/^\d+$/) &&
(collection_number = CollectionNumber.safe_find(pat))
redirect_to(action: :show, id: collection_number.id)
else
query = create_query(:CollectionNumber, :pattern_search, pattern: pat)
show_selected_collection_numbers(q... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def collection_number_search\n pattern = params[:pattern].to_s\n if pattern.match(/^\\d+$/) &&\n (collection_number = CollectionNumber.safe_find(pattern))\n redirect_to(action: :show_collection_number, id: collection_number.id)\n else\n query = create_query(:CollectionNumber, :pattern_sear... | [
"0.5848781",
"0.5657512",
"0.5413631",
"0.53491294",
"0.5204944",
"0.51298165",
"0.5123133",
"0.5089687",
"0.50189894",
"0.4970566",
"0.49550745",
"0.4914297",
"0.48856968",
"0.48846444",
"0.48842603",
"0.48827785",
"0.48328122",
"0.48108977",
"0.47811553",
"0.47797948",
"0.4... | 0.60422987 | 0 |
Construct path to a temp file with extension that does not exist. | def temp_file(extension)
File.join(@temp_dir, ::SecureRandom.hex(7) + '.' + extension.trim('.', '')).to_s
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def temp (extension)\n path = \"#{FileUtils::Config.tmp_dir}/tmp.#{extension}\"\n id = 1\n while File.exists?(path)\n path = \"#{FileUtils::Config.tmp_dir}/tmp.#{id}.#{extension}\"\n id += 1\n end\n\n path\n end",
"def tempfile_extension\n # comp... | [
"0.7723973",
"0.72646964",
"0.7028215",
"0.6992326",
"0.6967713",
"0.6915021",
"0.6811299",
"0.6806923",
"0.6725388",
"0.6708895",
"0.667166",
"0.66422343",
"0.66182697",
"0.6561769",
"0.6484358",
"0.6471776",
"0.6468908",
"0.6451267",
"0.6446119",
"0.64384913",
"0.6431526",
... | 0.7829178 | 0 |
Construct path to a temp file with full_name as the file name that does not exist. | def temp_file_from_name(file_name)
File.join(@temp_dir, file_name).to_s
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_temp_file\n copy_to_temp_file full_filename\n end",
"def temporary_path(filename)\n Global.temporary_directory + filename\n end",
"def temp_file_path(*args, &block)\n self.class.temp_file_path(prefix_suffix, *args, &block)\n end",
"def temporary_path\n trimmed_name = nam... | [
"0.75720197",
"0.7023003",
"0.6865289",
"0.66909486",
"0.66581476",
"0.66547036",
"0.65833086",
"0.6566178",
"0.6504649",
"0.64994055",
"0.6492267",
"0.649163",
"0.6461044",
"0.6440921",
"0.64176106",
"0.64049876",
"0.63877046",
"0.6385652",
"0.63796854",
"0.6374331",
"0.6350... | 0.7307635 | 1 |
Creates a new audio file from source path in target path, modified according to the parameters in modify_parameters. Possible options for modify_parameters: :start_offset :end_offset :channel :sample_rate | def modify(source, target, modify_parameters = {})
raise ArgumentError, "Source and Target are the same file: #{target}" if source == target
source = check_source(source)
raise Exceptions::FileAlreadyExistsError, "Target exists: #{target}" if File.exist? target
raise Exceptions::InvalidTargetMed... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def path_to_audio(source, options = T.unsafe(nil)); end",
"def audio_tool_segment(extension, audio_tool_method, source, source_info, target, modify_parameters)\n # process the source file, put output to temp file\n temp_file = temp_file(extension)\n send(audio_tool_method, source, source_info, tem... | [
"0.63549167",
"0.61836565",
"0.5811438",
"0.5608412",
"0.5458947",
"0.5405106",
"0.5402392",
"0.53946346",
"0.53143394",
"0.5266525",
"0.5218351",
"0.51692283",
"0.5166357",
"0.5156385",
"0.5035007",
"0.496975",
"0.49628195",
"0.49190572",
"0.4903635",
"0.49012995",
"0.485654... | 0.6792688 | 0 |
Checks whether the sample rate in modify_parameters is allowed | def check_sample_rate(target, modify_parameters = {}, source_info = {})
if modify_parameters.include?(:sample_rate)
sample_rate = modify_parameters[:sample_rate].to_i
# source_info sample_rate_hertz should match modify_parameters original_sample_rate if both are supplied
if source_info.in... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def allow_sample?(sample)\n true\n end",
"def fails_threshold?\n return false if sample_size < options.sample_threshold\n\n failure_rate >= options.rate_threshold\n end",
"def check_for_rate_limits\n rate_limit_remaining < 10\n end",
"def validate_parameters?(op)\n tem... | [
"0.62067306",
"0.6008171",
"0.5981752",
"0.59645313",
"0.58744526",
"0.576425",
"0.5729997",
"0.56960785",
"0.56941897",
"0.5652338",
"0.56425434",
"0.5633678",
"0.56084895",
"0.5589596",
"0.55861557",
"0.5543356",
"0.5520724",
"0.55070496",
"0.5491621",
"0.54824764",
"0.5464... | 0.68153584 | 0 |
Check if a source exists, and is a file. | def check_source(path)
raise Exceptions::FileNotFoundError, 'Source path was empty or nil' if path.nil? || (path.is_a?(String) && path.empty?)
path = Pathname(path)
# Maybe worth resolving symlinks to a realpath, but currently does not cause any failures without
#path = File.realpath(File.readl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def file_exists?(file_path)\n File.exist? @site.in_source_dir(file_path)\n end",
"def exists?\n File.exist? @src_path\n end",
"def check_source_type(source)\n if File.file?(source)\n source_file = IO.readlines(source)\n else\n source_file = source\n end\n source_file\n en... | [
"0.7474867",
"0.7455881",
"0.73092073",
"0.73027885",
"0.7250587",
"0.72069764",
"0.7171997",
"0.7150021",
"0.6964303",
"0.69612825",
"0.6950359",
"0.68988395",
"0.6877554",
"0.68544286",
"0.6844462",
"0.6843495",
"0.68343794",
"0.68332815",
"0.68199444",
"0.6801547",
"0.6781... | 0.7546252 | 0 |
def modify_shntool(source, source_info, target, start_offset, end_offset) | def audio_tool_segment(extension, audio_tool_method, source, source_info, target, modify_parameters)
# process the source file, put output to temp file
temp_file = temp_file(extension)
send(audio_tool_method, source, source_info, temp_file, modify_parameters[:start_offset], modify_parameters[:end_offs... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def chkout_modify_existing_address\n $tracer.trace(__method__)\n #unit_test_no_generate: chkout_modify_existing_address, a.id(\"change_address\")\n return ToolTag.new(a.id(\"change_address\"), __method__, self)\n end",
"def update!(**args)\n @source_node = args[:source_node] if args.key?(:sour... | [
"0.52917683",
"0.52743775",
"0.5214667",
"0.51696545",
"0.5155201",
"0.5088498",
"0.5083458",
"0.5066339",
"0.50416267",
"0.5014668",
"0.50116616",
"0.5011375",
"0.4979833",
"0.4968546",
"0.4968546",
"0.4968546",
"0.49678618",
"0.49620098",
"0.49410185",
"0.49351603",
"0.4920... | 0.622731 | 0 |
Path to previous page, or to index action, or to Index controller | def path_to_back
back_path = request.referer
return back_path if back_path && back_path != request.url
return path_to :index if self.class.actions.include?(:index)
'/'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def previous_page_path; end",
"def path_to_back\n\t\t\t\tback_path = request.referer\n\t\t\t\treturn back_path if back_path && back_path != request.url\n\n\t\t\t\treturn path_to :index if self.class.actions.include?(:index)\n\n\t\t\t\t'/'\n\t\t\tend",
"def prev_page_url\n if @page <= 2\n request.pa... | [
"0.8396007",
"0.78929114",
"0.74985653",
"0.7494035",
"0.7492207",
"0.74730873",
"0.74366516",
"0.7378883",
"0.73510414",
"0.7319236",
"0.72107565",
"0.71732014",
"0.71463734",
"0.7113441",
"0.70962596",
"0.70771265",
"0.70750827",
"0.70405304",
"0.6981507",
"0.69141686",
"0.... | 0.7918677 | 1 |
test klass primary key is integer type. (rails default) | def integer?
primary_key_attribute = klass.attribute_types.select { |name, _| name == User.primary_key }
if primary_key_attribute.key?(klass.primary_key.to_s)
primary_key_attribute[klass.primary_key].type == :integer
else
true
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def primary_key_type\n \"integer PRIMARY KEY\"\n end",
"def primary_key\n fail NotImplementedError\n end",
"def primary_key\n 'id'\n end",
"def force_primary_key(klass)\n # Automatically add an :oid serializable field if none is\n # defined and no other primary key i... | [
"0.76787144",
"0.68917054",
"0.679383",
"0.67665434",
"0.666983",
"0.6607317",
"0.6603807",
"0.6603807",
"0.6603807",
"0.6598008",
"0.6598008",
"0.65802985",
"0.65460473",
"0.652815",
"0.6498675",
"0.6492707",
"0.64908653",
"0.64521515",
"0.64521515",
"0.6449204",
"0.6449204"... | 0.714294 | 1 |
Set default status as pending | def default_status
self.status = "Pending"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_status_to_pending\n self.status = :pending\n end",
"def default\n self.status = \"In Progress\"\n end",
"def pending!\n self.update_attribute(:status, PENDING)\n end",
"def initialize_defaults\n self.status = :pending if status.blank?\n end",
"def set_default_status\n\t self.status... | [
"0.890664",
"0.8050014",
"0.7994992",
"0.7979822",
"0.79019517",
"0.78914595",
"0.7706385",
"0.76559746",
"0.76514643",
"0.7581495",
"0.75709903",
"0.75398946",
"0.7242596",
"0.7174101",
"0.7170677",
"0.7158488",
"0.7154491",
"0.7086234",
"0.7023466",
"0.70218104",
"0.6975077... | 0.8806933 | 1 |
Function to receive message from the subscribed topics. It runs as a forever / infinite loop if it is called with a block. If not, it waits until a message is received and is returned to a the caller If the method is called with a block, it is necessary to create a thread in order to doesn't block the program | def receive_messages_from_subscribed_topics
if block_given?
#@client.get do |topic, message|
get do |topic, message|
yield(topic, message)
end
else
#topic, message = @client.get
topic, message = get
return topic, message
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def receive\n raise \"No subscription to receive messages from\" if (@queue_names.nil? || @queue_names.empty?)\n start = @current_queue\n while true\n @current_queue = ((@current_queue < @queue_names.length-1) ? @current_queue + 1 : 0)\n sleep(@connection_options[:p... | [
"0.7251551",
"0.6592485",
"0.6493758",
"0.6424927",
"0.639926",
"0.632175",
"0.6299793",
"0.6256381",
"0.62466335",
"0.62413186",
"0.6212829",
"0.6198958",
"0.6191155",
"0.61463976",
"0.6142906",
"0.61381257",
"0.61087674",
"0.6067296",
"0.6037293",
"0.59880596",
"0.5987578",... | 0.73206955 | 0 |
GET /file_packages GET /file_packages.json | def index
@file_packages = FilePackage.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_packages!(path)\n response = Api::Request.new do |request|\n request[:sign] = false\n request[:method] = :GET\n request[:path] = \"/shared/packages/#{path}\"\n end.execute!\n\n Object::File.open(path, 'wb') do |file|\n file.write(response)\n end\n\n path... | [
"0.73114324",
"0.64447147",
"0.64288986",
"0.63484",
"0.62861204",
"0.6280573",
"0.6236852",
"0.6086987",
"0.6086987",
"0.6040913",
"0.5989775",
"0.5923256",
"0.5922453",
"0.59156895",
"0.5913825",
"0.5902505",
"0.58908415",
"0.58670866",
"0.57833606",
"0.57811475",
"0.578013... | 0.6837831 | 1 |
POST /file_packages POST /file_packages.json | def create
@file_package = FilePackage.new(file_package_params)
respond_to do |format|
if @file_package.save
@file_to_update_file_package = FileToUpdateFilePackage.new(file_package_id: @file_package.id)
@file_to_update_file_package.save
format.html { redirect_to @file_package, noti... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def upload_packages(packages)\n test_payload.set(:packages, packages)\n end",
"def packagecloud_upload package,\n distro_id = 27,\n user = 'haf',\n repo = 'oss',\n key = ENV['PACKAGECLOUD_KEY']\n puts \... | [
"0.6786094",
"0.62506926",
"0.6163176",
"0.6099638",
"0.59885037",
"0.59805864",
"0.59513044",
"0.5906778",
"0.58689",
"0.58340734",
"0.58201575",
"0.5773152",
"0.5766117",
"0.57558376",
"0.5709619",
"0.5699143",
"0.5694698",
"0.56922674",
"0.5692162",
"0.56901115",
"0.568477... | 0.6455574 | 1 |
PATCH/PUT /file_packages/1 PATCH/PUT /file_packages/1.json | def update
respond_to do |format|
if @file_package.update(file_package_params)
format.html { redirect_to @file_package, notice: 'File package was successfully updated.' }
format.json { render :show, status: :ok, location: @file_package }
else
format.html { render :edit }
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_datapackage\n update_file_in_repo(\"datapackage.json\", create_json_datapackage)\n end",
"def update\n respond_to do |format|\n add_items\n if @package.update(package_params)\n format.html { redirect_to @package, notice: 'Package was successfully updated.' }\n format.jso... | [
"0.63892555",
"0.6339916",
"0.6239994",
"0.6233896",
"0.6231027",
"0.62206364",
"0.61833817",
"0.6156983",
"0.6148451",
"0.61322045",
"0.61322045",
"0.61126095",
"0.6042367",
"0.6004983",
"0.60048884",
"0.59921646",
"0.59844124",
"0.5968783",
"0.5929757",
"0.5925468",
"0.5909... | 0.6755643 | 0 |
DELETE /file_packages/1 DELETE /file_packages/1.json | def destroy
@file_package.destroy
respond_to do |format|
format.html { redirect_to file_packages_url, notice: 'File package was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def b2_delete_file(file)\n\n if parse_files_json(file) == {}\n\n puts \"File not present\"\n\n else\n \n result_hash = convert_json(b2_delete_file_version(file))\n\n if result_hash[\"fileName\"] == file\n puts \"File deleted successfully\"\n else\n puts \"Error deleting... | [
"0.69046885",
"0.6738402",
"0.66752",
"0.66527313",
"0.66178745",
"0.6597381",
"0.6581092",
"0.6562684",
"0.65601075",
"0.65591127",
"0.65501684",
"0.65306365",
"0.6494288",
"0.64899415",
"0.64265627",
"0.64265627",
"0.6426315",
"0.6425916",
"0.64174116",
"0.64077395",
"0.638... | 0.71358496 | 0 |
generates the boolean 'foo?' methods | def build_boolean( sym, val )
#puts "build: #{sym} - value: #{val}"
class_eval(<<-EOS, __FILE__, __LINE__)
def self.#{sym}?
return #{sym} == true
end
def #{sym}?
self.class.#{sym}?
end
EOS
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def true \n \"true\" \n end",
"def falsx\n false\nend",
"def conditionally(*) end",
"def conditionally(*) end",
"def boolify(val)\n\nend",
"def simple?\n true\n end",
"def tagMethod?()\r\n\t\tlang = language()\r\n\t\treturn (@type == \"m\" || @type==\"f\") if (lang == \"java\")\r\n\t\tret... | [
"0.60532326",
"0.6000471",
"0.5960196",
"0.5960196",
"0.58647543",
"0.5859049",
"0.5848478",
"0.5755302",
"0.5749205",
"0.5701487",
"0.5692267",
"0.566558",
"0.56288135",
"0.56187224",
"0.56146973",
"0.55862695",
"0.55812305",
"0.5574115",
"0.5568373",
"0.5568373",
"0.5564456... | 0.6285749 | 0 |
for backwards compatibility Use this in the console to get a list of font families | def family_list
UIFont.familyNames.sort
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def family\n @family ||= family_options.map do |font_name, font_options|\n name = parse_font_name(font_name)\n\n options = font_options.sort.uniq\n\n options.any? ? \"#{name}:#{options.join(',')}\" : name\n end.join('|')\n end",
"def fonts_list\n initiate_librar... | [
"0.7721103",
"0.7646381",
"0.7248035",
"0.71208197",
"0.7064267",
"0.6859368",
"0.6822804",
"0.673041",
"0.6493086",
"0.64282936",
"0.6418485",
"0.63727885",
"0.6327979",
"0.63167113",
"0.6265677",
"0.60898954",
"0.60611916",
"0.60364574",
"0.58241457",
"0.5792614",
"0.575720... | 0.82194227 | 0 |
POST /option_types POST /option_types.json | def create
@option_type = OptionType.new(option_type_params)
respond_to do |format|
if @option_type.save
format.html { redirect_to [:admin, @option_type], notice: 'Option type was successfully created.' }
format.json { render action: 'show', status: :created, location: @option_type }
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_option_types\n option_types = @@config[:option_types]\n puts \"Creating Option Types for UrbanAuto site, #{option_types.length} options found to check.\\n\"\n created = 0\n option_types.each_key do |ot|\n if OptionType.find(:first, :conditions => {:name => option_types[ot][:name]}).nil?... | [
"0.6694878",
"0.66294116",
"0.6534157",
"0.62232006",
"0.6173155",
"0.61378956",
"0.6127454",
"0.607952",
"0.6058712",
"0.5991843",
"0.5991843",
"0.59368944",
"0.59368944",
"0.59297866",
"0.59175724",
"0.59112155",
"0.5828599",
"0.58009946",
"0.57940865",
"0.57836926",
"0.575... | 0.663311 | 1 |
PATCH/PUT /option_types/1 PATCH/PUT /option_types/1.json | def update
respond_to do |format|
if @option_type.update(option_type_params)
format.html { redirect_to [:admin, @option_type], notice: 'Option type was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: 'edit' }
format.json { rende... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @optype.update(optype_params)\n format.html { redirect_to @optype, notice: 'Optype was successfully updated.' }\n format.json { render :show, status: :ok, location: @optype }\n else\n format.html { render :edit }\n format.json { rend... | [
"0.6749418",
"0.63348275",
"0.63348275",
"0.63348275",
"0.6260202",
"0.6237212",
"0.6231222",
"0.621957",
"0.6216383",
"0.6207389",
"0.62027186",
"0.6186684",
"0.6106428",
"0.60838056",
"0.6075666",
"0.6061587",
"0.6027473",
"0.6026208",
"0.6026208",
"0.60025847",
"0.6002207"... | 0.7359586 | 0 |
DELETE /option_types/1 DELETE /option_types/1.json | def destroy
@option_type.destroy
respond_to do |format|
format.html { redirect_to admin_option_types_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @optype.destroy\n respond_to do |format|\n format.html { redirect_to optypes_url, notice: 'Optype was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_option\n option_param = params.permit(:id)\n\n render json: Option.delete_o... | [
"0.72555155",
"0.7196702",
"0.7014768",
"0.7014768",
"0.6964335",
"0.6908677",
"0.6908677",
"0.6908677",
"0.6885596",
"0.6869575",
"0.680564",
"0.6805429",
"0.67807734",
"0.67804116",
"0.67163396",
"0.670153",
"0.66600055",
"0.6659483",
"0.665136",
"0.66480714",
"0.6645412",
... | 0.78709364 | 0 |
It should be possible to change the properties of a file and see stat return a different result | def test_stat_modifications
@client.write(@file, '')
[0745, 0600, 0443].each do |mode|
@client.chmod(@file, mode)
assert_equal mode, @client.stat(@file, refresh: true).mode
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stat() File.stat(path) end",
"def stat\n return @stat unless @stat == :needs_stat\n\n method = :stat\n\n # Files are the only types that support links\n if (self.class.name == :file and self[:links] != :follow) or self.class.name == :tidy\n method = :lstat\n end\n\n @stat = begin\n ... | [
"0.74513924",
"0.6966966",
"0.6775694",
"0.67714196",
"0.6768781",
"0.6612547",
"0.6565932",
"0.6506559",
"0.64949596",
"0.64121807",
"0.6396997",
"0.6312671",
"0.6304778",
"0.6215063",
"0.6145141",
"0.61272573",
"0.6084672",
"0.60452396",
"0.59958494",
"0.59853745",
"0.59707... | 0.7341335 | 1 |
DELETE /venues/1 DELETE /venues/1.json | def destroy
@venue = Venue.find(params[:id])
@venue.destroy
respond_to do |format|
format.html { redirect_to venues_url }
format.json { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @venue = Venue.find(params[:id])\n @venue.destroy\n\n respond_to do |format|\n format.html { redirect_to manage_venues_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @venue = Venue.find(params[:id])\n @venue.destroy\n\n respond_to do |format|\n fo... | [
"0.7531355",
"0.7507718",
"0.7507718",
"0.7507718",
"0.7507718",
"0.74199617",
"0.73949975",
"0.7332596",
"0.72691673",
"0.7267232",
"0.7267232",
"0.7267232",
"0.7267232",
"0.7213395",
"0.7181069",
"0.7181069",
"0.7181069",
"0.7181069",
"0.7181069",
"0.7181069",
"0.7181069",
... | 0.7553671 | 0 |
GET /representant_locataires GET /representant_locataires.json | def index
@representant_locataires = RepresentantLocataire.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_representant_locataire\n @representant_locataire = RepresentantLocataire.find(params[:id])\n end",
"def index\n code = :ok\n currentUser = {\n id: current_user.utilisateur.id,\n fullName: current_user.utilisateur.prenom_nom,\n }\n result = {\n ... | [
"0.6781449",
"0.6759832",
"0.66037405",
"0.65037304",
"0.6470584",
"0.6450522",
"0.6406702",
"0.63737035",
"0.6286927",
"0.6279777",
"0.6248342",
"0.62311316",
"0.6223985",
"0.6162624",
"0.6156933",
"0.6133206",
"0.61002177",
"0.60963047",
"0.6059694",
"0.6055712",
"0.6028329... | 0.7438949 | 0 |
POST /representant_locataires POST /representant_locataires.json | def create
@representant_locataire = RepresentantLocataire.new(representant_locataire_params)
respond_to do |format|
if @representant_locataire.save
format.html { redirect_to @representant_locataire, notice: 'Representant locataire was successfully created.' }
format.json { render :show, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @locataire = Locataire.new(locataire_params)\n\n respond_to do |format|\n if @locataire.save\n format.html { redirect_to @locataire, notice: 'Locataire was successfully created.' }\n format.json { render :show, status: :created, location: @locataire }\n else\n form... | [
"0.6934585",
"0.683579",
"0.6697483",
"0.65379065",
"0.6514345",
"0.6279168",
"0.61742496",
"0.61122274",
"0.61072147",
"0.6098709",
"0.60711867",
"0.6058324",
"0.6048124",
"0.60445356",
"0.6009058",
"0.60075706",
"0.60026723",
"0.59723234",
"0.5935823",
"0.5935774",
"0.59036... | 0.74927706 | 0 |
PATCH/PUT /representant_locataires/1 PATCH/PUT /representant_locataires/1.json | def update
respond_to do |format|
if @representant_locataire.update(representant_locataire_params)
format.html { redirect_to @representant_locataire, notice: 'Representant locataire was successfully updated.' }
format.json { render :show, status: :ok, location: @representant_locataire }
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @locataire.update(locataire_params)\n format.html { redirect_to @locataire, notice: 'Locataire was successfully updated.' }\n format.json { render :show, status: :ok, location: @locataire }\n else\n format.html { render :edit }\n for... | [
"0.69508636",
"0.667888",
"0.666651",
"0.65694505",
"0.6361586",
"0.6287818",
"0.62232465",
"0.6194022",
"0.6186537",
"0.617857",
"0.6177951",
"0.61707234",
"0.6159683",
"0.61385876",
"0.6137698",
"0.61241144",
"0.61150855",
"0.61035407",
"0.6078253",
"0.6064705",
"0.60492337... | 0.7472227 | 0 |
DELETE /representant_locataires/1 DELETE /representant_locataires/1.json | def destroy
@representant_locataire.destroy
respond_to do |format|
format.html { redirect_to representant_locataires_url, notice: 'Representant locataire was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @locataire.destroy\n respond_to do |format|\n format.html { redirect_to locataires_url, notice: 'Locataire was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @representante.destroy\n respond_to do |format|\n format.html { re... | [
"0.7214607",
"0.7100458",
"0.70186627",
"0.6987318",
"0.6980077",
"0.6972117",
"0.6931918",
"0.6896415",
"0.6896415",
"0.6810334",
"0.6778886",
"0.67622614",
"0.6759246",
"0.6756679",
"0.67423075",
"0.673812",
"0.67240137",
"0.672384",
"0.67181313",
"0.6717346",
"0.6704708",
... | 0.78748786 | 0 |
Takes in student test scores | def test_scores(score)
puts "Student scored an #{score}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_score_working\n assert_equal score(\"abcdef\"), (1 + 3 + 3 + 2 + 1 + 4)\n assert_equal score(\"zebra\"), (10 + 1 + 3 + 1 + 1)\n end",
"def create_scores\r\n\r\n end",
"def formulate_score()\n @player_score = @player_score.sort!().reverse!().join().to_i()\n p \"#{@players[0].get_name}'s s... | [
"0.675522",
"0.6718665",
"0.67104703",
"0.66835976",
"0.66569656",
"0.6626291",
"0.661553",
"0.6603737",
"0.6586425",
"0.65722233",
"0.65618414",
"0.6561089",
"0.6553233",
"0.65470177",
"0.6522117",
"0.6501236",
"0.64963305",
"0.6492455",
"0.6467639",
"0.6457709",
"0.6456761"... | 0.81289613 | 0 |
TODO : Rename to 'supplier_specs' | def actual_specs
as = supplier_orders.map(&:actual_specs)
as = as.uniq.compact
as
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def supplier_attrs\n phone_type = FactoryGirl.create :phone_type\n {\n organization_id: @employee.organization_id, \n supplier: FactoryGirl.attributes_for(:supplier, name: 'Test Abc')\n .merge({'addresses_attributes' => {'0' => FactoryGirl.attributes_for(:address, is_prim... | [
"0.67241764",
"0.6601948",
"0.6478085",
"0.6314661",
"0.6265853",
"0.6208211",
"0.61975515",
"0.61923677",
"0.6170389",
"0.6138214",
"0.6109038",
"0.6077419",
"0.5982477",
"0.5971343",
"0.5921968",
"0.58836466",
"0.58827096",
"0.58816284",
"0.5877679",
"0.58732253",
"0.586614... | 0.68637335 | 0 |
tries to get `default_value` from localization_key checks other localizations | def fallback_to_default(localization_key, localization)
localization_key.localizations.where.not(default_value: nil). \
where.not(id: localization.id).first&.default_value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fallback_localization(locale, key_without_locale)\n value = nil\n return nil unless fallbacks = ::Rails.application.config.i18n.fallbacks\n keys = fallbacks == true ? @locale_cache.keys : fallbacks\n keys.map(&:to_s).each do |lc|\n if lc != locale.locale && value.nil?\n nk =... | [
"0.7080433",
"0.6731979",
"0.6715263",
"0.6687734",
"0.6560042",
"0.6535552",
"0.64615655",
"0.63384813",
"0.62794137",
"0.6153515",
"0.61260116",
"0.6116664",
"0.6106073",
"0.610021",
"0.6082364",
"0.60637426",
"0.6042635",
"0.6007414",
"0.6001777",
"0.59968144",
"0.59830344... | 0.85205436 | 0 |
GET /source_pages GET /source_pages.json | def index
@source_pages = SourcePage.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_source\n # must set max nesting. default limit of 20 is too low for selendroid\n JSON.parse @driver.page_source, max_nesting: 9999\n end",
"def index\n @pages = Page.all\n render json: @pages\n end",
"def get_pages(options = nil)\n @client.raw('get', '/content/pages', options)\n end",... | [
"0.69422096",
"0.655444",
"0.6551009",
"0.6504953",
"0.6473319",
"0.64149475",
"0.63961554",
"0.63830733",
"0.6368293",
"0.6299695",
"0.6297939",
"0.6297939",
"0.6297939",
"0.6297939",
"0.6297939",
"0.6297939",
"0.6297939",
"0.62795764",
"0.62692845",
"0.6259181",
"0.6229108"... | 0.7498058 | 0 |
POST /source_pages POST /source_pages.json | def create
@source_page = SourcePage.new(source_page_params)
respond_to do |format|
if @source_page.save
format.html { redirect_to @source_page, notice: 'Source page was successfully created.' }
format.json { render :show, status: :created, location: @source_page }
else
form... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @page_content = PageContent.new(page_content_params)\n @page_content.parse_url(page_content_params[:source])\n\n respond_to do |format|\n if @page_content.save\n format.html { redirect_to action: :index }\n format.json { render json: @page_content, status: :created, locatio... | [
"0.64984274",
"0.63137054",
"0.60895956",
"0.5994911",
"0.5934387",
"0.58606017",
"0.581993",
"0.5813985",
"0.5761937",
"0.574922",
"0.56969917",
"0.56501156",
"0.5624956",
"0.5621818",
"0.5608349",
"0.55928504",
"0.55894256",
"0.5567207",
"0.5566975",
"0.5561011",
"0.553516"... | 0.7266694 | 0 |
PATCH/PUT /source_pages/1 PATCH/PUT /source_pages/1.json | def update
respond_to do |format|
if @source_page.update(source_page_params)
format.html { redirect_to @source_page, notice: 'Source page was successfully updated.' }
format.json { render :show, status: :ok, location: @source_page }
else
format.html { render :edit }
forma... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n if page_params[:body]\n @page.versions << Version.new(body: page_params[:body], title: page_params[:title]).save\n page_params.delete :body\n end\n respond_to do |format|\n if @page.update(page_params)\n format.html { redirect_to controller: \"pages\", action: \"show\", ... | [
"0.63405675",
"0.6305989",
"0.62710017",
"0.6133108",
"0.6094509",
"0.6078191",
"0.60213166",
"0.6012595",
"0.6003819",
"0.6003819",
"0.6003819",
"0.6003819",
"0.59964716",
"0.59912753",
"0.59912425",
"0.59846365",
"0.59803873",
"0.5953242",
"0.5950793",
"0.59464306",
"0.5942... | 0.6900771 | 0 |
DELETE /source_pages/1 DELETE /source_pages/1.json | def destroy
@source_page.destroy
respond_to do |format|
format.html { redirect_to source_pages_url, notice: 'Source page was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_page(id)\n @client.raw('delete', \"/content/pages/#{id}\")\n end",
"def destroy\r\n @page = Page.find(params[:id])\r\n @page.destroy\r\n File.delete(\"#{Rails.public_path}/#{@page.project_id}/#{@page.page_name}.html\")\r\n respond_to do |format|\r\n format.html { redirect_to pages... | [
"0.6957046",
"0.6927541",
"0.67749083",
"0.6774857",
"0.6774857",
"0.6764738",
"0.6729344",
"0.6729344",
"0.6729344",
"0.6729344",
"0.6725345",
"0.67214984",
"0.672082",
"0.6704641",
"0.66959274",
"0.66959274",
"0.66959274",
"0.66959274",
"0.66959274",
"0.66959274",
"0.669592... | 0.7453293 | 0 |
GET /admin/furniture/sets GET /admin/furniture/sets.json | def index
@admin_furniture_sets = Admin::Furniture::Set.all.paginate(page: params[:page])
respond_to do |format|
format.html
format.json { render json: @admin_furniture_sets.map { |i| { value: i.id, text: "#{i.name} #{i.config.to_s}" } }, status: :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_admin_furniture_set\n @admin_furniture_set = Admin::Furniture::Set.find(params[:id])\n end",
"def index\n @attribute_sets = AttributeSet.all\n render json: @attribute_sets\n end",
"def create\n @admin_furniture_set = Admin::Furniture::Set.new(admin_furniture_set_params)\n\n respond... | [
"0.7200095",
"0.6679486",
"0.6573324",
"0.656625",
"0.65635383",
"0.65425754",
"0.65425754",
"0.64392185",
"0.64135927",
"0.6381811",
"0.6368142",
"0.63622004",
"0.6189612",
"0.61712277",
"0.61057353",
"0.6084513",
"0.6066289",
"0.6063458",
"0.6038245",
"0.60076666",
"0.60027... | 0.7806838 | 0 |
POST /admin/furniture/sets POST /admin/furniture/sets.json | def create
@admin_furniture_set = Admin::Furniture::Set.new(admin_furniture_set_params)
respond_to do |format|
if @admin_furniture_set.save
format.html { redirect_to admin_furniture_sets_path, notice: mk_notice(@admin_furniture_set, :name, 'ست مبل', :create) }
format.json { render json: @... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_admin_furniture_set\n @admin_furniture_set = Admin::Furniture::Set.find(params[:id])\n end",
"def create\n @setum = Setum.new(setum_params)\n\n respond_to do |format|\n if @setum.save\n format.html { redirect_to @setum, notice: 'Setum was successfully created.' }\n format... | [
"0.67327774",
"0.6610808",
"0.65066284",
"0.6461349",
"0.64439315",
"0.6375901",
"0.63615215",
"0.6348379",
"0.6286474",
"0.62364656",
"0.6229341",
"0.6219675",
"0.6216336",
"0.6126095",
"0.6113759",
"0.6109354",
"0.60879743",
"0.60840774",
"0.60746795",
"0.6063196",
"0.59824... | 0.73800665 | 0 |
PATCH/PUT /admin/furniture/sets/1 PATCH/PUT /admin/furniture/sets/1.json | def update
respond_to do |format|
if @admin_furniture_set.update(admin_furniture_set_params)
format.html { redirect_to admin_furniture_sets_path, notice: mk_notice(@admin_furniture_set, :name, 'ست مبل', :update) }
format.json { render json: @admin_furniture_set, status: :ok, location: admin_fu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @defset.update(defset_params)\n format.html { redirect_to @defset, notice: 'Defset was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @defset.er... | [
"0.6689169",
"0.6584886",
"0.65191376",
"0.64569855",
"0.64569855",
"0.6429768",
"0.64217395",
"0.6384779",
"0.6360191",
"0.6352287",
"0.6289147",
"0.6262751",
"0.6127498",
"0.60628635",
"0.60487837",
"0.6036398",
"0.60170966",
"0.59799767",
"0.595065",
"0.5946467",
"0.593240... | 0.7071458 | 0 |
DELETE /admin/furniture/sets/1 DELETE /admin/furniture/sets/1.json | def destroy
@admin_furniture_set.destroy
respond_to do |format|
format.html { redirect_to admin_furniture_sets_path, notice: mk_notice(@admin_furniture_set, :name, 'ست مبل', :destroy) }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @defset.destroy\n respond_to do |format|\n format.html { redirect_to defsets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @fabricsofaset.destroy\n respond_to do |format|\n format.html { redirect_to fabricsofasets_url, notice: 'Fabricsofaset wa... | [
"0.73830193",
"0.73089755",
"0.73057306",
"0.72444504",
"0.7239075",
"0.703127",
"0.70215315",
"0.70210385",
"0.6936913",
"0.69265336",
"0.6900119",
"0.6896421",
"0.68360656",
"0.68359584",
"0.6817454",
"0.6797078",
"0.67791826",
"0.6774843",
"0.6769145",
"0.67560476",
"0.674... | 0.7371171 | 1 |
The create_empty_field method creates a twodimensional array. One comprising the rows of the field matrix, and the other the columns. | def create_empty_field
@field_matrix = Array.new(length) { Array.new(width, ' . ') }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_empty(rows, columns)\n @rch = Array.new(rows)\n @gch = Array.new(rows)\n @bch = Array.new(rows)\n \n 0.upto rows-1 do |r|\n @rch[r] = Array.new(columns, 0)\n @gch[r] = Array.new(columns, 0)\n @bch[r] = Array.new(columns, 0)\n end \n end",
"def build_minefield\n ... | [
"0.70820487",
"0.66334695",
"0.6446492",
"0.6395312",
"0.6320942",
"0.6164173",
"0.6158884",
"0.60545313",
"0.6025009",
"0.6024148",
"0.5955401",
"0.59196055",
"0.58140385",
"0.57603955",
"0.57594323",
"0.56994426",
"0.56843936",
"0.56590635",
"0.5637313",
"0.56159085",
"0.56... | 0.8642803 | 0 |
The create_snake method creates a twodimensional array. The inner array consists of the horizontal and vertical location of each snake part. | def create_snake
vertical_position = location[0]
horizontal_position = location[1]
@snake_matrix = Array.new(size) { |part_index| [vertical_position, horizontal_position + part_index] }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generateBoard(snakes, foods)\n board = Hash.new(BLANK_VALUE); # Using a hash because inserts are O(1), and it sets default values for all coordinates\n \n # Process each of the snakes\n snakes.each do |snake|\n id = snake[\"id\"]\n health = snake[\"health_points\"]\n coords ... | [
"0.559691",
"0.5436912",
"0.53852457",
"0.52831507",
"0.5283077",
"0.5275853",
"0.5139459",
"0.50608563",
"0.4997969",
"0.49952617",
"0.49791288",
"0.49766687",
"0.49289423",
"0.49251834",
"0.4895927",
"0.48665184",
"0.4855412",
"0.48459503",
"0.48370662",
"0.48353174",
"0.48... | 0.81987625 | 0 |
The head of the snake is always the first array of the snake matrix. | def locate_head
snake_matrix.first
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def head\n \t@array[0]\n end",
"def create_snake\n vertical_position = location[0]\n horizontal_position = location[1]\n @snake_matrix = Array.new(size) { |part_index| [vertical_position, horizontal_position + part_index] }\n end",
"def locate_body\n snake_matrix[1..-1]\n end",
"def make_firs... | [
"0.6615536",
"0.6392241",
"0.6260439",
"0.6030301",
"0.5941435",
"0.5924791",
"0.5765357",
"0.57424206",
"0.5741144",
"0.5737481",
"0.5735287",
"0.57323253",
"0.57045335",
"0.5687292",
"0.5656422",
"0.56228673",
"0.56228673",
"0.5620292",
"0.5605041",
"0.55769813",
"0.5551065... | 0.805979 | 0 |
The body consists of all the arrays in the snake matrix except the first one. | def locate_body
snake_matrix[1..-1]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def normalize(body)\n lines = body.split(\"\\n\")\n width = lines.first.length\n number_of_syms_to_wrap = (Dimensions::WIDTH - width) / 2\n syms_string = Citizen::DEAD * number_of_syms_to_wrap\n horiz_wrapped = lines.map { |line| syms_string + line + syms_string }\n\n matrix = horiz_w... | [
"0.6045197",
"0.57564586",
"0.56901485",
"0.5560798",
"0.5486362",
"0.54608446",
"0.54469013",
"0.5420796",
"0.535777",
"0.53464717",
"0.5326325",
"0.5324661",
"0.5300899",
"0.5185273",
"0.5157756",
"0.51539254",
"0.5135978",
"0.5132808",
"0.5107401",
"0.508262",
"0.5069615",... | 0.7060849 | 0 |
Inputs a new horizontal location for the head of the snake in order to simulate horizontal movement. | def update_head_horizontal_location(column)
locate_head[1] = column
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def place_snake_head(position, move_over_tunnel)\n snake_part = SnakePart.new(@head)\n @world[@head] = snake_part\n @head = position\n @world[position] = SnakeHead.new(position)\n\t\t\t@world[position].set_over_tunnel(move_over_tunnel)\n @body.unshift @head\n end",
"def drive_north(di... | [
"0.6946604",
"0.6375601",
"0.6283084",
"0.62432504",
"0.6208301",
"0.61988574",
"0.60296035",
"0.597656",
"0.59712136",
"0.5886565",
"0.5885008",
"0.58384776",
"0.5766133",
"0.57548666",
"0.5736572",
"0.573319",
"0.5715742",
"0.5711953",
"0.57048",
"0.5672593",
"0.5661368",
... | 0.65042645 | 1 |
The print_filled_field method first creates an empty field and then adds a snake matrix and an apple to that empty field matrix and prints the result. | def print_filled_field
field.create_empty_field
# Add an apple to the field.
field.field_matrix[apple.vertical_location][apple.horizontal_location] = ' o '
# Add a snake to the field.
snake.snake_matrix.each do |part|
field.field_matrix[part.first][part.last] = ' x '
end
print_field... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_empty_field\n @field_matrix = Array.new(length) { Array.new(width, ' . ') }\n end",
"def printBoard\n\t\tprint(\"#{@field[0].value} | #{@field[1].value} | #{@field[2].value}\\n---------\\n#{@field[3].value} | #{@field[4].value} | #{@field[5].value}\\n---------\\n#{@field[6].value} | #{@field[7].va... | [
"0.661401",
"0.63582236",
"0.5811382",
"0.5731705",
"0.55386865",
"0.5459447",
"0.53989077",
"0.5376416",
"0.53698087",
"0.5324373",
"0.5308976",
"0.5268991",
"0.5263823",
"0.52599996",
"0.52457297",
"0.52441037",
"0.52192646",
"0.5218089",
"0.51920444",
"0.51861054",
"0.5186... | 0.9337237 | 0 |
The animate_game method prints the filled field first, then it allows the user to change the snake's direction, then moves the snake one frame, and finally checks for conditions that change the circumstances of the game. All of this is done repeatedly until the game ends. | def animate_game
begin
Curses.stdscr.keypad = true
Curses.noecho
Curses.curs_set(0)
Curses.timeout = 0
loop do
print_filled_field
# Add a sleep method with a value of 0.1 to prevent the snake from
# moving too fast. Adjust the value of sleep to speed up or slow... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def play_round\n system(\"clear\")\n @board.render\n puts\n full_move = self.get_full_move\n pos = self.get_position(full_move)\n action = self.get_action(full_move)\n while action.downcase == \"e\" && !(self.valid_flip?(pos))\n self.display_unflag_messag... | [
"0.67010206",
"0.65362626",
"0.6392625",
"0.6264252",
"0.6247824",
"0.6225483",
"0.6129233",
"0.61152434",
"0.61150825",
"0.6097484",
"0.6056181",
"0.60507953",
"0.60471624",
"0.6033415",
"0.60294855",
"0.6014623",
"0.6007933",
"0.6002501",
"0.5996959",
"0.5987343",
"0.596147... | 0.8708741 | 0 |
Create query using field parser. Equivalent to Lucene's field:"value" query. Inspired from ActiveFedora::SolrQueryBuilder.field_query. | def field_query(field, value)
"_query_:\"{!field f=#{field}}#{value}\""
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def perform_field_query query, response, scope\n if Array === query\n case query.first\n when :method # a method call\n query.shift\n return eval(query.join('.'))\n when :literal # a literal value\n return query.last\n end\n ... | [
"0.6597149",
"0.6155972",
"0.60944504",
"0.5897008",
"0.58508974",
"0.58476716",
"0.58424956",
"0.5756688",
"0.57141507",
"0.56492513",
"0.56170285",
"0.5539387",
"0.55223775",
"0.551104",
"0.55059355",
"0.54593694",
"0.5440864",
"0.54265296",
"0.5389577",
"0.5385445",
"0.538... | 0.75168353 | 0 |
Create query using join parser, similar to sql join. | def join_query(from, to, field, value)
"_query_:\"{!join from=#{from} to=#{to}}#{field}:\\\"#{value}\\\"\""
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def join(table, field1, field2, join_type = 'INNER JOIN')\n @join = \" #{join_type} #{table} ON #{@from}.#{field1}=#{table}.#{field2}\"\n\n self\n end",
"def join(*args)\n\t\tif args.count > 1\n\t\t\tjoins = args.map { |arg| \"INNER JOIN #{arg} ON #{arg}.#{table}_id = #{table}.id\"}.join(\" \")\n\t\t\trow... | [
"0.6523445",
"0.65155745",
"0.6388709",
"0.63140893",
"0.62682563",
"0.6233941",
"0.6188287",
"0.6070854",
"0.6059934",
"0.59720993",
"0.597065",
"0.59581333",
"0.58965135",
"0.58571875",
"0.5846518",
"0.5829649",
"0.5822159",
"0.5791104",
"0.57683694",
"0.5752367",
"0.572961... | 0.67276204 | 0 |
original `create_format_method` overrides `format` method with metaprogramming | def create_format_method
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def format(format, *arguments); end",
"def create_format_method\n case @style\n when :json; Parseable.create_json_format_method(self)\n when :yaml; Parseable.create_yaml_format_method(self)\n else raise ArgumentError, \"unknown format style '#@style'\" end\n end",
"def format\n rais... | [
"0.7575126",
"0.7554109",
"0.7434239",
"0.7395717",
"0.7335282",
"0.730108",
"0.730108",
"0.73003274",
"0.73003274",
"0.73003274",
"0.73003274",
"0.73003274",
"0.73003274",
"0.73003274",
"0.73003274",
"0.7283679",
"0.7168306",
"0.7146824",
"0.71324587",
"0.70680845",
"0.70426... | 0.8282342 | 0 |
Create an instance of this Awesome class that holds a Ruby value. Like a String, number, or true | def new_with_value(value)
AwesomeObject.new(self, value)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new_value(value)\n AwesomeObject.new(self, value)\n end",
"def initialize(awesome_class, ruby_value=self)\n @awesome_class = awesome_class\n @ruby_value = ruby_value\n end",
"def initialize(value)\n @value = value\n @type = self.class.type\n end",
"def new_with_value(value,... | [
"0.69721514",
"0.67558557",
"0.67395514",
"0.6506494",
"0.6501158",
"0.6481547",
"0.64633673",
"0.63486207",
"0.63295555",
"0.6319684",
"0.6319684",
"0.6260485",
"0.62325317",
"0.62325317",
"0.62325317",
"0.62325317",
"0.62325317",
"0.6215993",
"0.6214941",
"0.6203157",
"0.62... | 0.6865174 | 1 |
POST /minisounds POST /minisounds.json | def create
@minisound = Minisound.new(minisound_params)
respond_to do |format|
if @minisound.save
format.html { redirect_to @minisound, notice: 'Minisound was successfully created.' }
format.json { render :show, status: :created, location: @minisound }
else
format.html { ren... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n post_params = {\n name: params[:name].downcase,\n units: params[:units] || 0\n }\n render json: Ingredient.create!(post_params), status: :created\n end",
"def update\n respond_to do |format|\n if @minisound.update(minisound_params)\n format.html { redirect_to @mini... | [
"0.58708096",
"0.57429695",
"0.56620675",
"0.5588615",
"0.55690855",
"0.5510485",
"0.54372364",
"0.5353957",
"0.5285262",
"0.52763546",
"0.52718407",
"0.5238774",
"0.52199244",
"0.5215001",
"0.51841223",
"0.51752746",
"0.51636684",
"0.51521444",
"0.5150232",
"0.5122446",
"0.5... | 0.6990563 | 0 |
PATCH/PUT /minisounds/1 PATCH/PUT /minisounds/1.json | def update
respond_to do |format|
if @minisound.update(minisound_params)
format.html { redirect_to @minisound, notice: 'Minisound was successfully updated.' }
format.json { render :show, status: :ok, location: @minisound }
else
format.html { render :edit }
format.json { r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @my_ministry = MyMinistry.find(params[:id])\n\n respond_to do |format|\n if @my_ministry.update_attributes(params[:my_ministry])\n format.html { redirect_to @my_ministry, notice: 'My ministry was successfully updated.' }\n format.json { head :ok }\n else\n format.h... | [
"0.5810324",
"0.5779018",
"0.5771261",
"0.57280445",
"0.5701555",
"0.568239",
"0.5679738",
"0.5656366",
"0.56290114",
"0.56186855",
"0.56155884",
"0.5606402",
"0.5595152",
"0.55873173",
"0.55774105",
"0.5574383",
"0.5551537",
"0.5548881",
"0.55415165",
"0.55311704",
"0.551002... | 0.69507194 | 0 |
DELETE /minisounds/1 DELETE /minisounds/1.json | def destroy
@minisound.destroy
respond_to do |format|
format.html { redirect_to minisounds_url, notice: 'Minisound was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @compound = Compound.find(params[:id])\n @compound.destroy\n\n respond_to do |format|\n format.html { redirect_to compounds_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @minicurso = Minicurso.find(params[:id])\n @minicurso.destroy\n\n respond... | [
"0.6557799",
"0.6532743",
"0.6504515",
"0.64920896",
"0.6476177",
"0.6430612",
"0.64197105",
"0.63616014",
"0.6337825",
"0.6337825",
"0.6337825",
"0.6335508",
"0.6318131",
"0.6309",
"0.63047403",
"0.63037443",
"0.6301255",
"0.6278031",
"0.6273764",
"0.6270861",
"0.62663835",
... | 0.73337567 | 0 |
GET /laporan_guru_agama_katolik GET /laporan_guru_agama_katolik.json | def index
@laporan_guru_agama_katolik = LaporanGuruAgamaKatolik.order("created_at DESC").page(params[:daftar_laporan_guru_agama_katolik_page]).per(6)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_laporan_guru_agama_katolik\n @laporan_guru_agama_katolik = LaporanGuruAgamaKatolik.find(params[:id])\n end",
"def laporan_guru_agama_katolik_params\n params.require(:laporan_guru_agama_katolik).permit(:judul, :tautan, :pengguna_id)\n end",
"def create\n @laporan_guru_agama_katolik = ... | [
"0.69260585",
"0.6537066",
"0.6405912",
"0.63501394",
"0.6334183",
"0.6253596",
"0.6247635",
"0.6206109",
"0.61929625",
"0.6157312",
"0.61137056",
"0.60862976",
"0.60839856",
"0.60523677",
"0.60357934",
"0.59848934",
"0.5962379",
"0.5947529",
"0.5932273",
"0.59098387",
"0.589... | 0.7205009 | 0 |
POST /laporan_guru_agama_katolik POST /laporan_guru_agama_katolik.json | def create
@laporan_guru_agama_katolik = LaporanGuruAgamaKatolik.new(laporan_guru_agama_katolik_params)
@laporan_guru_agama_katolik.pengguna_id = current_pengguna.id
respond_to do |format|
if @laporan_guru_agama_katolik.save
format.html { redirect_to @laporan_guru_agama_katolik, notice: 'Lapo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def laporan_guru_agama_katolik_params\n params.require(:laporan_guru_agama_katolik).permit(:judul, :tautan, :pengguna_id)\n end",
"def create\n @data_pendidikan_agama_katolik = DataPendidikanAgamaKatolik.new(data_pendidikan_agama_katolik_params)\n @data_pendidikan_agama_katolik.pengguna_id = curren... | [
"0.7352186",
"0.7144841",
"0.6938219",
"0.6814624",
"0.6757636",
"0.668251",
"0.6607814",
"0.6591382",
"0.65672886",
"0.6493333",
"0.6421687",
"0.6409621",
"0.63728374",
"0.63635546",
"0.63586664",
"0.6349154",
"0.6342618",
"0.6315826",
"0.626483",
"0.62641585",
"0.62149197",... | 0.7780069 | 0 |
PATCH/PUT /laporan_guru_agama_katolik/1 PATCH/PUT /laporan_guru_agama_katolik/1.json | def update
respond_to do |format|
if @laporan_guru_agama_katolik.update(laporan_guru_agama_katolik_params)
format.html { redirect_to @laporan_guru_agama_katolik, notice: 'Laporan guru agama katolik was successfully updated.' }
format.json { render :show, status: :ok, location: @laporan_guru_ag... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @data_pendidikan_agama_katolik.update(data_pendidikan_agama_katolik_params)\n format.html { redirect_to @data_pendidikan_agama_katolik, notice: 'Data pendidikan agama katolik was successfully updated.' }\n format.json { render :show, status: :ok, locat... | [
"0.7039956",
"0.6972694",
"0.6805268",
"0.66803",
"0.6663917",
"0.66434264",
"0.65959215",
"0.65685934",
"0.65548205",
"0.6520739",
"0.6519527",
"0.65147036",
"0.6506645",
"0.64959574",
"0.64880997",
"0.6486782",
"0.6457795",
"0.64471954",
"0.6437101",
"0.64309645",
"0.642018... | 0.7289591 | 0 |
DELETE /laporan_guru_agama_katolik/1 DELETE /laporan_guru_agama_katolik/1.json | def destroy
@laporan_guru_agama_katolik.destroy
respond_to do |format|
format.html { redirect_to laporan_guru_agama_katolik_index_url, notice: 'Laporan guru agama katolik was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @data_pendidikan_agama_katolik.destroy\n respond_to do |format|\n format.html { redirect_to data_pendidikan_agama_katolik_index_url, notice: 'Data pendidikan agama katolik was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @data_kea... | [
"0.7438234",
"0.7408621",
"0.729889",
"0.72764844",
"0.7214719",
"0.72103953",
"0.7210284",
"0.720453",
"0.71473044",
"0.7114095",
"0.71108556",
"0.70795846",
"0.70492226",
"0.70469266",
"0.70319855",
"0.7027935",
"0.7024029",
"0.7016501",
"0.7012847",
"0.7012417",
"0.7011378... | 0.772773 | 0 |
Add given hash or block and return new config object | def add(config_or_block)
self.class.new @config_list + Array.wrap(config_or_block)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_block name, hash\n\t\t\t@blocks ||= {}\n\t\t\t@blocks[name] = hash\n\t\tend",
"def add(name, &block)\n blocks[name.to_sym] = block\n end",
"def ingest_configuration_block!(hash, &block)\n hash.each do |k, v|\n value = if v.is_a?(Hash)\n ingest_configuration_bl... | [
"0.6975591",
"0.6295234",
"0.61010134",
"0.60714036",
"0.6066916",
"0.6050589",
"0.59973544",
"0.5941835",
"0.59062546",
"0.5904485",
"0.5887665",
"0.58731943",
"0.5832744",
"0.5749853",
"0.57388467",
"0.5735011",
"0.5719758",
"0.56737554",
"0.56645495",
"0.56559",
"0.56559",... | 0.72648376 | 0 |
Return a new configuration object bound to the given instance. This instance will be instance_eval'ed with any procs in the config. | def bind(instance)
self.class.new @config_list.dup, instance
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compile\n @config_list.inject({}) do |config, hash_or_proc|\n case hash_or_proc\n when Hash\n config.deep_merge hash_or_proc\n when Proc\n instance or raise InstanceNotBoundError\n c = instance.instance_eval(&hash_or_proc)\n c.is_a?(Hash) || c == ni... | [
"0.6568649",
"0.6433652",
"0.60249954",
"0.5984646",
"0.5959399",
"0.5957815",
"0.5957815",
"0.5894475",
"0.58758414",
"0.5848547",
"0.5848547",
"0.5831501",
"0.58245915",
"0.57777625",
"0.5754851",
"0.57050693",
"0.5634089",
"0.5610126",
"0.55681443",
"0.55339044",
"0.550874... | 0.67852825 | 0 |
Return the compiled config. This will be a hash built by combining added hashes and blocks. | def config
@config ||= compile
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compile\n @config_list.inject({}) do |config, hash_or_proc|\n case hash_or_proc\n when Hash\n config.deep_merge hash_or_proc\n when Proc\n instance or raise InstanceNotBoundError\n c = instance.instance_eval(&hash_or_proc)\n c.is_a?(Hash) || c == ni... | [
"0.70549715",
"0.645971",
"0.62916964",
"0.6029206",
"0.5997004",
"0.5885874",
"0.58523005",
"0.58463794",
"0.5797542",
"0.5766021",
"0.57416266",
"0.56729025",
"0.5577945",
"0.55507797",
"0.5541904",
"0.5541904",
"0.5541904",
"0.55350095",
"0.5531994",
"0.55010206",
"0.54798... | 0.6664828 | 1 |
Order.tax_zone.tax_rates is used here to check if the order is taxable by Tax Cloud. It's not possible check against the order's tax adjustments because an adjustment is not created for 0% rates. However, US orders must be submitted to Tax Cloud even when the rate is 0%. Note that we explicitly use ship_address instead... | def is_taxed_using_tax_cloud?
::Spree::TaxRate.for_address(ship_address).any? { |rate| rate.calculator_type == 'Spree::Calculator::TaxCloudCalculator' }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tax_zone\n # Handle case of shipping across state boundaries first\n return nil if (retailer && (retailer.physical_address.state_id != ship_address.state_id))\n \n # Handle other cases:\n if Spree::Config[:tax_using_retailer_address]\n if retailer\n zone_address = retailer.physical_a... | [
"0.67445195",
"0.64885736",
"0.64810884",
"0.6389201",
"0.6353229",
"0.6327538",
"0.6295835",
"0.62660307",
"0.6210555",
"0.615835",
"0.6079887",
"0.60322136",
"0.59983456",
"0.59750485",
"0.5974582",
"0.59721017",
"0.5966243",
"0.59077084",
"0.58879435",
"0.58596754",
"0.585... | 0.70569694 | 0 |
GET /hands/1 GET /hands/1.json | def show
@hand = Hand.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @hand }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @hands = Hand.all\n end",
"def show\n @hand_state = HandState.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @hand_state }\n end\n end",
"def index\n @economy_hands = EconomyHand.all\n\n respond_to do |format|\n ... | [
"0.67723274",
"0.6753142",
"0.669063",
"0.64312834",
"0.63980657",
"0.63737243",
"0.63526034",
"0.6323537",
"0.6305141",
"0.61993444",
"0.6167534",
"0.6167534",
"0.61538374",
"0.61430097",
"0.6124894",
"0.60230935",
"0.60146844",
"0.59938633",
"0.5981042",
"0.5971092",
"0.596... | 0.7394412 | 1 |
Is this a valid app? | def valid?
App.valid?(path)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def valid_app?(app)\n !!(app =~ APP_REGEX)\n end",
"def valid_apps\n apps.select { |app| app.valid? }\n end",
"def app?\n app_host = Radiant.config['app.host']\n match = unless app_host.blank?\n request.host == app_host\n else\n request.host =~ /^app\\./\n end\n !!match\n ... | [
"0.79393876",
"0.6913875",
"0.68905956",
"0.68200004",
"0.68200004",
"0.68141043",
"0.67631054",
"0.6584829",
"0.65410805",
"0.6536357",
"0.65136474",
"0.6476398",
"0.6451508",
"0.6375936",
"0.6370027",
"0.6357075",
"0.6356346",
"0.634567",
"0.634567",
"0.634567",
"0.63446105... | 0.7342881 | 1 |
Returns the arches for the binary. | def arches
@arches ||= lipo.info
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def nics\n if !@nics[:macs].empty?\n return @nics.reject {|k| k == :macs }\n end\n\n info_nics\n end",
"def system_bins\n %w[\n cal col colcrt colrm\n getopt\n hexdump\n logger look\n mesg more\n nologin\n renice rev\n ... | [
"0.5222067",
"0.5077296",
"0.5006084",
"0.5006084",
"0.49460915",
"0.49194238",
"0.4915931",
"0.4906189",
"0.4901691",
"0.4856426",
"0.4829221",
"0.48280406",
"0.4822663",
"0.4803449",
"0.4722294",
"0.46761513",
"0.46761513",
"0.46694702",
"0.46603346",
"0.46172515",
"0.46104... | 0.5481402 | 0 |
True if the app has been built for the simulator | def simulator?
arches.include?("i386") || arches.include?("x86_64")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def simulator?\n !physical_device?\n end",
"def app_is_installed?\n if installed_app_bundle_dir ||\n simctl.app_container(device, app.bundle_identifier)\n true\n else\n false\n end\n end",
"def is_simulator? uuid\n # Check if UUID is from a device or a simulator\n # Getting a... | [
"0.72491986",
"0.67323536",
"0.6594455",
"0.6532866",
"0.6484054",
"0.63872564",
"0.63567764",
"0.63398707",
"0.633865",
"0.6174636",
"0.6112148",
"0.6102487",
"0.6090419",
"0.60245824",
"0.5986401",
"0.5958775",
"0.5936207",
"0.591218",
"0.5902242",
"0.5862038",
"0.585671",
... | 0.73415387 | 0 |
True if the app has been built for physical devices | def physical_device?
arches.any? do |arch|
arch[/arm/, 0]
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_physical_device\n return @has_physical_device\n end",
"def simulator?\n !physical_device?\n end",
"def has_physical_device\n return @has_physical_device\n end",
"def physical_device?\n if udid.nil?\n stack = Kerne... | [
"0.7209093",
"0.7082249",
"0.7076486",
"0.6745608",
"0.67099816",
"0.6629076",
"0.6607009",
"0.6545895",
"0.65223587",
"0.64753515",
"0.64401746",
"0.64401746",
"0.6433799",
"0.6406859",
"0.6386592",
"0.6385835",
"0.6380059",
"0.6380059",
"0.6361137",
"0.63259614",
"0.6324706... | 0.78236574 | 0 |
Returns the CFBundleVersion of the app as Version instance. Apple docs: CFBundleVersion specifies the build version number of the bundle, which identifies an iteration (released or unreleased) of the bundle. The build version number should be a string comprised of three nonnegative, periodseparated integers with the fi... | def build_version
string = plist_buddy.plist_read("CFBundleVersion", info_plist_path)
begin
version = RunLoop::Version.new(string)
rescue
if string && string != ""
RunLoop.log_debug("CFBundleVersion: '#{string}' is not a well formed version string")
else
Run... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def version\n unless @version\n\n # Extract version information (if available)\n @version = metadata['bundleShortVersionString'] || metadata['bundleVersion'] rescue nil\n\n # Otherwise, use the filename\n unless @version\n @version = filename[FILENAME_VERSION_REGEX, 1]\n ... | [
"0.67691374",
"0.6712796",
"0.66911435",
"0.6355196",
"0.6248604",
"0.6223768",
"0.6180121",
"0.6180121",
"0.61711687",
"0.6122696",
"0.6110176",
"0.6108745",
"0.606516",
"0.6047987",
"0.60398024",
"0.60374045",
"0.5974485",
"0.5974485",
"0.59664965",
"0.5959343",
"0.59451455... | 0.73189855 | 0 |
Return a modified copy with the optimize_model_load setting changed. | def with_optimize_model_load(v)
clone(:optimize_model_load=>v)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def optimize(**options)\n self.dup\n end",
"def reload\n @dirty = []\n @cache = Preference.find_all_by_model_type_and_model_id(@model.class.name, @model.id).index_by(&:key)\n end",
"def reload!\n clear_changes_information\n self.exclude_from_save = false\n end",
"def optimize(**... | [
"0.60557187",
"0.55130506",
"0.5426008",
"0.5413031",
"0.53972054",
"0.53337896",
"0.53113925",
"0.5289714",
"0.520269",
"0.5089417",
"0.50867045",
"0.5060151",
"0.50241834",
"0.4969344",
"0.49685144",
"0.49476632",
"0.49384463",
"0.48527497",
"0.48046607",
"0.48026195",
"0.4... | 0.7943111 | 0 |
module CoversWithCache add Covercache supporting to model | def covers_with_cache
caller_source = caller.first[/[^:]+/]
class_eval do
@covercache_caller_source = caller_source
include Covercache::ModelConcern
extend Covercache::DefiningHelper
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def configure_cache; end",
"def cache; end",
"def cache; end",
"def cache; end",
"def cache; end",
"def cache; end",
"def cache; end",
"def cache; end",
"def cache_store; end",
"def cache_store; end",
"def cache_on?; end",
"def cache_on?; end",
"def add_cache_control; end",
"def try_with_... | [
"0.6357437",
"0.6268477",
"0.6268477",
"0.6268477",
"0.6268477",
"0.6268477",
"0.6268477",
"0.6268477",
"0.6183217",
"0.6183217",
"0.6162457",
"0.6162457",
"0.613618",
"0.59364855",
"0.5872063",
"0.5791188",
"0.57861686",
"0.5727563",
"0.57244796",
"0.57244796",
"0.57216614",... | 0.7835024 | 0 |
Creates elevators, and floors. Places elevators on floors | def initialize(number_of_elevators, number_of_floors, elevator_capacity,elevator_resting_floor)
puts "Setting up #{number_of_elevators} elevators of capacity #{elevator_capacity}"
@elevators = Array.new(number_of_elevators).map{
|elevator| Elevator.new(self, elevator_capacity)
}
puts "Setting up #{number_of_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_elevators\n @elevator_number.times do |i|\n floor_gap = @building.floors / @elevator_number * i\n elevator_list.append(Elevator.new(i, 1 + floor_gap, 1 + floor_gap))\n end\n end",
"def makeElevator\n for elevatorID in 1..@amountOfElevators\n elevator = Elevat... | [
"0.6622997",
"0.595658",
"0.583796",
"0.5836687",
"0.5803129",
"0.58024037",
"0.5646924",
"0.5642245",
"0.5579661",
"0.55448186",
"0.5510128",
"0.54606414",
"0.54572666",
"0.5437396",
"0.5376837",
"0.536339",
"0.53355783",
"0.5248359",
"0.52243024",
"0.5214027",
"0.5171316",
... | 0.62021774 | 1 |
Height of a floor | def floor_height(floor)
floors.index(floor)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_height\n return get_keyword_value(\"FLOOR-HEIGHT\").to_f\n end",
"def height\n (self.width.to_f * (9.to_f/16.to_f)).to_i\n end",
"def height\n\t\tfloors.size\n\tend",
"def height\n bounds[:bottom] - bounds[:top]\n end",
"def height\n bounds[:bottom] - bounds[:top]\n ... | [
"0.76016814",
"0.7161729",
"0.7128195",
"0.7125616",
"0.7125616",
"0.71211076",
"0.7023405",
"0.6970987",
"0.6970987",
"0.69226235",
"0.69115996",
"0.68667585",
"0.6844538",
"0.6835952",
"0.67957497",
"0.67726105",
"0.6755151",
"0.67231405",
"0.6720731",
"0.67199576",
"0.6719... | 0.8416055 | 0 |
Lets a person enter on the first floor | def enter(person)
floors.first.enter(person)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def go_to_next_floor\n puts \"Elevator #{@id}, currently at floor #{@current_floor}, is about to go to floor #{@next_floor}...\"\n puts \"=====================================================================\"\n \n while @current_floor != @next_floor\n if @movement == \"up\"\... | [
"0.63562083",
"0.635385",
"0.6142657",
"0.6062916",
"0.5928961",
"0.590953",
"0.58937776",
"0.58755696",
"0.58755696",
"0.587166",
"0.5847908",
"0.5754528",
"0.5699268",
"0.569354",
"0.56916875",
"0.56616217",
"0.5657832",
"0.56007516",
"0.5596173",
"0.55952674",
"0.5581229",... | 0.6651826 | 0 |
Gets the next floor in some direction. Null if none | def get_next_floor(floor, direction)
index = floor.number
if direction.eql? :UP
return floors[index+1]
end
if index-1 < 0
return nil
end
floors[index-1]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def final_floor\n floors.last\n end",
"def get_floor()\n get_parent(\"FLOOR\")\n end",
"def bottom_floor\n\t\t@flrs.first\n\tend",
"def get_floor()\n get_parent(\"FLOOR\")\n end",
"def direction\n target_floor <=> floor\n end",
"def top_floor\n\t\t@flrs.last\n\tend",
"de... | [
"0.67037153",
"0.6505092",
"0.64765006",
"0.6474116",
"0.6282751",
"0.611801",
"0.60640556",
"0.60640556",
"0.60054207",
"0.59677625",
"0.5936604",
"0.5917364",
"0.58984685",
"0.5876322",
"0.587606",
"0.58666646",
"0.5860661",
"0.5828403",
"0.5820148",
"0.5804088",
"0.5693502... | 0.8604733 | 0 |
Gets all the elevators at a specific floor | def elevators_at_floor(floor)
elevators.select{|elevator| elevator.floor.eql? floor}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def findElevator(currentFloor, direction)\n activeElevatorList = []\n idleElevatorList = []\n sameDirectionElevatorList = []\n for x in @elevatorsList\n if x.status != ElevatorStatus::IDLE #verify if elevator is active and if the request is on the elevator way\n ... | [
"0.61989945",
"0.60879505",
"0.60023636",
"0.5924301",
"0.59242284",
"0.57799935",
"0.5738687",
"0.5737982",
"0.5718558",
"0.5714457",
"0.56575537",
"0.56496394",
"0.5631189",
"0.5606771",
"0.5575505",
"0.55027163",
"0.5501694",
"0.5490602",
"0.547964",
"0.546716",
"0.5457457... | 0.8494632 | 0 |
GET /grid_fs_files GET /grid_fs_files.json | def index
@grid_fs_files = GridFsFile.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def server_get_file(server, path)\n request(\n :path => \"containers/#{server.id}/files\",\n :params => {\n :path => path\n },\n :disable_body_extraction => true\n ).get(:body)\n end",
"def retrieve_cloud_files(files); end",
"def... | [
"0.678743",
"0.6682282",
"0.6661644",
"0.6656341",
"0.6565899",
"0.6529946",
"0.651921",
"0.649803",
"0.6491551",
"0.64717746",
"0.64634776",
"0.6439559",
"0.64311635",
"0.64228505",
"0.6392473",
"0.6389882",
"0.6360968",
"0.6337395",
"0.63345295",
"0.6329733",
"0.62461925",
... | 0.76164234 | 0 |
POST /grid_fs_files POST /grid_fs_files.json | def create
@grid_fs_file = GridFsFile.new(grid_fs_file_params)
respond_to do |format|
if @grid_fs_file.save
format.html { redirect_to @grid_fs_file, notice: 'Grid fs file was successfully created.' }
format.json { render :show, status: :created, location: @grid_fs_file }
else
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def grid_fs_file_params\n params.require(:grid_fs_file).permit(:filename, :contentType, :author, :topic, :uploadDate, :length, :chunkSize, :md5, :contents)\n end",
"def upload_upload(directory:, files:)\n upload_files = {multipart: true}\n files.each {|f| upload_files[f] = File.open(f, 'rb')}\n... | [
"0.6636621",
"0.63503385",
"0.6302368",
"0.6294408",
"0.6288428",
"0.6252721",
"0.6214168",
"0.60876644",
"0.6077244",
"0.60207516",
"0.6014226",
"0.6003097",
"0.596628",
"0.5958198",
"0.59581864",
"0.59304535",
"0.59057724",
"0.589728",
"0.5889487",
"0.58772016",
"0.58749175... | 0.72458696 | 0 |
PATCH/PUT /grid_fs_files/1 PATCH/PUT /grid_fs_files/1.json | def update
respond_to do |format|
if @grid_fs_file.update(grid_fs_file_params)
format.html { redirect_to @grid_fs_file, notice: 'Grid fs file was successfully updated.' }
format.json { render :show, status: :ok, location: @grid_fs_file }
else
format.html { render :edit }
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @treq = Treq.find(params[:id])\n\n respond_to do |format|\n unless params[:treq_files].blank?\n params[:treq_files]['file'].each do |a|\n @treq_file = @treq.treq_files.create!(:file => a, :treq_id => @treq.id)\n end\n end\n if @treq.update_attributes... | [
"0.65749663",
"0.6398018",
"0.6175175",
"0.6155008",
"0.61332405",
"0.59439003",
"0.5939058",
"0.5904782",
"0.5903614",
"0.58958626",
"0.5877881",
"0.5863158",
"0.5862751",
"0.58484066",
"0.58150965",
"0.5811043",
"0.5793143",
"0.57927835",
"0.5784949",
"0.5783114",
"0.577798... | 0.7241136 | 0 |
DELETE /grid_fs_files/1 DELETE /grid_fs_files/1.json | def destroy
@grid_fs_file.destroy
respond_to do |format|
format.html { redirect_to grid_fs_files_url, notice: 'Grid fs file was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete(path)\n path = relativize_path path\n\n Precog.connect self do |http|\n uri = Addressable::URI.new\n uri.query_values = { :apiKey => api_key }\n\n http.delete \"/ingest/v#{VERSION}/fs/#{path}?#{uri.query}\"\n end\n end",
"def destroy\n Rails.logger.debug {\"de... | [
"0.7157098",
"0.71361095",
"0.7060626",
"0.7055122",
"0.7013899",
"0.6991544",
"0.6975205",
"0.69202113",
"0.690333",
"0.68928653",
"0.6870393",
"0.6856543",
"0.6844567",
"0.68409395",
"0.68379027",
"0.6794251",
"0.67801213",
"0.67705613",
"0.6766225",
"0.6760091",
"0.6759447... | 0.76047885 | 0 |
GET /colegios GET /colegios.json | def index
@colegios = Colegio.all
respond_to do |format|
format.html # index.html.erb
format.json { render json: @colegios }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @colegio = Colegio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @colegio }\n end\n end",
"def index\n @cofis = Cofi.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: ... | [
"0.7090613",
"0.6498888",
"0.63951826",
"0.6394206",
"0.6375297",
"0.6312488",
"0.62983924",
"0.6287523",
"0.62526613",
"0.6245438",
"0.6136158",
"0.61013955",
"0.60951555",
"0.60916674",
"0.6083664",
"0.6080305",
"0.60748327",
"0.60748327",
"0.6041572",
"0.60068804",
"0.6003... | 0.7311583 | 0 |
GET /colegios/1 GET /colegios/1.json | def show
@colegio = Colegio.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @colegio }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @colegios = Colegio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @colegios }\n end\n end",
"def show\n @cofi = Cofi.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json:... | [
"0.7288804",
"0.66916096",
"0.6590156",
"0.6460977",
"0.6398999",
"0.63967943",
"0.6394224",
"0.6394224",
"0.63918185",
"0.6380489",
"0.6376027",
"0.63126475",
"0.6306827",
"0.63048637",
"0.63030905",
"0.62984747",
"0.6268256",
"0.62515485",
"0.6215043",
"0.61878717",
"0.6180... | 0.721024 | 1 |
GET /colegios/new GET /colegios/new.json | def new
@colegio = Colegio.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @colegio }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @cofi = Cofi.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cofi }\n end\n end",
"def new\n @concurso = Concurso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @concurso }\n end\n... | [
"0.72199154",
"0.72124135",
"0.7162324",
"0.71566844",
"0.71397537",
"0.7135712",
"0.7070699",
"0.70664847",
"0.7018805",
"0.7009224",
"0.7007303",
"0.69972026",
"0.6995758",
"0.69756794",
"0.6968417",
"0.6968417",
"0.6958663",
"0.69579816",
"0.6957505",
"0.69290185",
"0.6903... | 0.7752958 | 0 |
POST /colegios POST /colegios.json | def create
@colegio = Colegio.new(params[:colegio])
respond_to do |format|
if @colegio.save
format.html { redirect_to @colegio, notice: 'El colegio fue creado satisfactoriamente.' }
format.json { render json: @colegio, status: :created, location: @colegio }
else
format.html ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @cooco = Cooco.new(cooco_params)\n\n respond_to do |format|\n if @cooco.save\n format.html { redirect_to @cooco, notice: 'Cooco was successfully created.' }\n format.json { render :show, status: :created, location: @cooco }\n else\n format.html { render :new }\n ... | [
"0.6581173",
"0.63245475",
"0.6281297",
"0.62565166",
"0.6216938",
"0.61410326",
"0.60923576",
"0.6073309",
"0.599955",
"0.5910125",
"0.58948326",
"0.588624",
"0.5880918",
"0.58761275",
"0.58743167",
"0.5857936",
"0.58545876",
"0.58545876",
"0.58545876",
"0.5844243",
"0.58405... | 0.66267854 | 0 |
PUT /colegios/1 PUT /colegios/1.json | def update
@colegio = Colegio.find(params[:id])
respond_to do |format|
if @colegio.update_attributes(params[:colegio])
format.html { redirect_to @colegio, notice: 'El Colegio fue actualizado satisfactoriamente.' }
format.json { head :no_content }
else
format.html { render ac... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @cooco.update(cooco_params)\n format.html { redirect_to @cooco, notice: 'Cooco was successfully updated.' }\n format.json { render :show, status: :ok, location: @cooco }\n else\n format.html { render :edit }\n format.json { render js... | [
"0.6384609",
"0.6281765",
"0.6131642",
"0.610177",
"0.6059203",
"0.60435486",
"0.602539",
"0.5983885",
"0.59786403",
"0.59494424",
"0.5922892",
"0.59222364",
"0.59169614",
"0.5911498",
"0.58818537",
"0.587853",
"0.5868615",
"0.58615935",
"0.58428544",
"0.58326584",
"0.5822571... | 0.6423569 | 0 |
DELETE /colegios/1 DELETE /colegios/1.json | def destroy
@colegio = Colegio.find(params[:id])
@colegio.destroy
respond_to do |format|
format.html { redirect_to colegios_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete\n client.delete(\"/#{id}\")\n end",
"def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def destroy\n @relogio = Relogio.find(params[:id])\n @relogio.destroy\n\n respond_to do |format|\n format.html { redirect_to relogios_url... | [
"0.71117705",
"0.69486105",
"0.69289356",
"0.6891989",
"0.68611777",
"0.6832602",
"0.6814225",
"0.6810221",
"0.6798149",
"0.6798149",
"0.6798149",
"0.6798149",
"0.67897356",
"0.6765597",
"0.67337847",
"0.6727496",
"0.67198116",
"0.6714012",
"0.6702707",
"0.67006767",
"0.66954... | 0.7389021 | 0 |
POST /occasions POST /occasions.json | def create
@occasion = Occasion.new(occasion_params)
@occasion.administrators << current_user
respond_to do |format|
if @occasion.save
format.html { redirect_to @occasion, notice: 'Occasion was successfully created.' }
format.json { render :show, status: :created, location: @occasion }... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @occasion = Occasion.new(occasion_params)\n\n respond_to do |format|\n if @occasion.save\n format.html { redirect_to [:admin, @occasion], notice: 'Occasion was successfully created.' }\n format.json { render :show, status: :created, location: @occasion }\n else\n f... | [
"0.6580022",
"0.59739643",
"0.5933124",
"0.5897493",
"0.58806145",
"0.5822347",
"0.58212626",
"0.57831347",
"0.5736181",
"0.57309073",
"0.56444377",
"0.56444377",
"0.56444377",
"0.56296945",
"0.5616832",
"0.56151754",
"0.5592407",
"0.55753875",
"0.5573222",
"0.5563943",
"0.55... | 0.63343847 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.