query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
fa521f11bf395beeea9eacc1deb75c5e
instance method HOW TO USE instancename.instancemethodname
[ { "docid": "edd7e8ca713e3c5b8c0199b4f8c7977b", "score": "0.0", "text": "def bark\n puts \"WOOF WOOF\"\n end", "title": "" } ]
[ { "docid": "9f5c4700c2055c25e86797fb078a85ae", "score": "0.80816376", "text": "def instance_method\n @instance_method\n end", "title": "" }, { "docid": "17a07ff12e4250e34d093e72e3182123", "score": "0.79955703", "text": "def instance_method\n end", "title": "" }, ...
1fe76e5d187616a47523223c80d37545
Return the regular expression match if the input looks like it could be a Canadian or U.S. phone number. The match has the area code in `match_phone_number[:area_code]`, the exchange (next three digits) in `match_phone_number[:exchange]`, the rest of the number in `match_phone_number[:number]`, and the extension, if an...
[ { "docid": "787e0e11d856c452e0c661ec989d71e1", "score": "0.79425", "text": "def match_phone_number(number)\n /\\A\\s*\\(?\\s*?(?<area_code>\\d{3})\\s*\\)?[-.\\s]*(?<exchange>\\d{3})[-.\\s]*(?<number>\\d{4})([xX\\s]*(?<ext>\\d+))?\\s*\\z/\n .match(number)\n end", "title": "" } ]
[ { "docid": "b185f57fe9cb72dd910311e663f86b35", "score": "0.69269043", "text": "def parse_phone(phone_string)\n if phone_string =~ REGEX_PHONE\n if $2\n area_code = $2\n else\n area_code = $3\n end\n exchange = $4\n number = $5\n extension ...
7aa9d0b5483d8a0f60f924ff0cb49007
Add an extension by local path.
[ { "docid": "d4a187149c244c03e687f30d4bd5535d", "score": "0.7860375", "text": "def add_extension_path(path)\n raise Error::WebDriverError, \"could not find extension at #{path.inspect}\" unless File.directory?(path)\n\n @extension_paths << path\n end", "title": "" } ]
[ { "docid": "22a0a68894d8b3ba72e7548da9b1d976", "score": "0.86985373", "text": "def add_extension(path); end", "title": "" }, { "docid": "bfd9634a63294b142ea84eeb8ae646f2", "score": "0.8459011", "text": "def add_extension(path, name = T.unsafe(nil)); end", "title": "" }, { ...
daa0d58cc06d8438751280ee0f0aa164
GET /jobs/1 GET /jobs/1.json
[ { "docid": "879fa99c3ca7455a541dc4ee336925da", "score": "0.0", "text": "def show\n if current_user.jobs.where(id: @job.id).count == 0\n @job_application = nil\n else\n @job_application = Application.find_by(job_id: @job.id)\n end\n current_user.geocode\n @distance = current_user...
[ { "docid": "c8f7cc0b14cc4ca0decc14ca86f69f5d", "score": "0.7808435", "text": "def get_job(id)\n get(\"1/jobs/#{id}\")\n end", "title": "" }, { "docid": "e0d30cb0880ae58f5dd30199afee732c", "score": "0.7668493", "text": "def get_jobs()\n u = self.build_uri(\"/jobs\")\n...
3c02825ceddeadefd98cf5bd4a1d339f
takes in an argument of a dog's name, sets that argument equal to a variable
[ { "docid": "01edf15b752841f0f5f74953cf5d8826", "score": "0.0", "text": "def name\n @this_dogs_name\n end", "title": "" } ]
[ { "docid": "4a62faa60f652cee9d6fb144bf187480", "score": "0.7152376", "text": "def name= (name_of_dog)\n # @name = name_of_dog\n @name = name_of_dog\n end", "title": "" }, { "docid": "361b47dd048f5f26ec74a680ab23be7c", "score": "0.66663426", "text": "def set_dog\n ...
2e31dc8ccf5d904045b1e6d7f2294a61
Use the destroy method to perform some cleanup before the framework kills this process
[ { "docid": "c3a7e21d1a5f05277c91d508a3db7729", "score": "0.0", "text": "def destroy\n Concord::Utils.log_to_stderr(\"Destructing sentence generator\")\n end", "title": "" } ]
[ { "docid": "3bc319feb064fba4f1c0a0d808c93c27", "score": "0.8476397", "text": "def cleanup\n # Stop external processes etc.\n end", "title": "" }, { "docid": "54935c2590c6a93b4fce9c057d5466b9", "score": "0.7976133", "text": "def cleanup()\n stop(nil, nil)\n end", "titl...
6c614afcf3b9602d730b01059a9f5dea
Same as +deep_merge+, but modifies +self+. source://activesupport//lib/active_support/core_ext/hash/deep_merge.rb23
[ { "docid": "071ea2ae3ae8d98b35fc481101b2f531", "score": "0.78370047", "text": "def deep_merge!(other_hash, &block); end", "title": "" } ]
[ { "docid": "390daf13f00e08cc1ac90e1a7998e484", "score": "0.8044361", "text": "def deep_merge!(hash)\n hash.keys.each do |key|\n if hash[key].is_a?(Hash) && self[key].is_a?(Hash)\n self[key] = self[key].deep_merge(hash[key])\n else\n self[key] = hash[key]\n end...
1fe5a6c860b94e65076646c59e1b6dc4
DELETE /formulas/1 DELETE /formulas/1.json
[ { "docid": "d0f83a8ba7144f71daa23414421f3ac2", "score": "0.7363097", "text": "def destroy\n @formula.destroy\n respond_to do |format|\n format.html { redirect_to formulas_url, notice: 'Formula was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title"...
[ { "docid": "22f900cd3a271f56fe92242aab2fdc88", "score": "0.763541", "text": "def destroy\n @formula = Formula.find(params[:id])\n @formula.destroy\n\n respond_to do |format|\n format.html { redirect_to formulas_url }\n format.json { head :no_content }\n end\n end", "title": ""...
4b733adb2ca96ebc1e34cdd6368e8851
Complete the breakingRecords function below.
[ { "docid": "278530658885a55dfa4f89607a032190", "score": "0.49503174", "text": "def breakingRecords(scores)\n first = [scores[0], scores[0]]\n scores.each_with_object({max: 0, min: 0}) do |score, hash|\n p \"hash: #{hash} score: #{score} first: #{first}\"\n if score < first[1]\n ...
[ { "docid": "dd5f0adfcdbaf2bae719e12609890546", "score": "0.6544601", "text": "def post_process(_records)\n end", "title": "" }, { "docid": "f23082bf26cd5611222ffd30342639d8", "score": "0.59561414", "text": "def process_end_of_record\n return if @non_tabular_record.empty?\n ...
96341b6c20e0a888a1e2c2ea451ff343
POST /stories create new story and new article
[ { "docid": "7730374711c76fbfa69f94e0d344c052", "score": "0.7979002", "text": "def create\n @story = Story.new(create_params)\n\n if @story.save\n render json: @story, status: :created, location: @story\n else\n render json: @story.errors, status: :unprocessable_entity\n end\n end"...
[ { "docid": "7751573fe032d9a31696d23b3b9f35ba", "score": "0.8335613", "text": "def create_new_story!\n self.stories.create!\n end", "title": "" }, { "docid": "c38501d3c08cc58fe625d1015ff866cf", "score": "0.8102031", "text": "def create\n \n\t@story = @univers.stories.build(...
9be9ece8ca40c95cae4866ba5bcb1c06
GET /linkposts/1 GET /linkposts/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "3ed157d2cf65c95d01df4a5f74700b35", "score": "0.7205132", "text": "def index\n @linkposts = Linkpost.all\n end", "title": "" }, { "docid": "938577b7a7771dc9d9fc3b50bcff5de4", "score": "0.6645795", "text": "def show\n @link = Link.find(params[:id])\n paginate_all_...
fb8a4c6c5a89fce48d4e5252a590b4d3
Returns true if the given subscriber is a member of the mailing list.
[ { "docid": "054b06a21aaf71f08004e63c8f08eb4b", "score": "0.7799376", "text": "def member?(sub)\n sub.mailing_lists.each do |mlist|\n if mlist.data(:id) == self.data(:id)\n return true\n end\n end\n\n return false\n end", "title": "" } ]
[ { "docid": "1dae964c638e8f98c5d6f5ed9930c8cc", "score": "0.7290963", "text": "def subscribed_to_mailing_list?(list_name)\n\t\tleid(list_name).present?\n\tend", "title": "" }, { "docid": "bf8358d6795800de153ad13335431ad9", "score": "0.71919405", "text": "def recipient_is_member?\n ...
dc6a47822410929ab3ecacecda683e76
Creates a new filesystem importer that imports files relative to a given path.
[ { "docid": "30e851b5bc7a3c24c48dff0464b9b2b4", "score": "0.0", "text": "def initialize(root)\n @root = File.expand_path(root)\n @real_root = Sass::Util.realpath(@root).to_s\n @same_name_warnings = Set.new\n end", "title": "" } ]
[ { "docid": "f94f680899b37a219411d69db2b5eaf3", "score": "0.6437593", "text": "def import_file(path)\n return Kernel.load(path)\nend", "title": "" }, { "docid": "59ef1f950393d3e0b742b08e96500770", "score": "0.6150335", "text": "def import(path, dest_path='')\n # FIXME : implem...
ed817352a92db2eddbf56d33220d3524
GET /investments/1 GET /investments/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "0cf3b3d0199891db74a0da793b28d69a", "score": "0.78008646", "text": "def index\n @investments = Investment.all\n\n respond_to do |format|\n format.html\n format.json\n end\n end", "title": "" }, { "docid": "aeb53731436fc1a8bfc63fb7826d7612", "score": "0.7705...
7c383874a391d56af0a109f9de17c2ff
Fetch details from github
[ { "docid": "de7887bf7000ead14b4ab45dc9f5bbdd", "score": "0.7186642", "text": "def fetch_details(attr)\n url = attr['href'].text\n if args = url.match('https?://github.com/([^\\/]+)/([^\\/]+)')\n data = @api[\"/repos/#{args[1]}/#{args[2]}\"].get\n github = Yajl::Parser.parse(data....
[ { "docid": "b087bc406a46d291c51c6332fcb9509b", "score": "0.7904158", "text": "def fetch_from_github\n repo, branch, path = Post.parse_github_url self.github\n Environment.github.contents repo, ref: branch, path: path\n end", "title": "" }, { "docid": "e1a7e51952c1668934f3395ad397d1f9"...
23bc6171060f0e1d7708de3e8c162613
The song's audio files, as an array that obeys the JSON format restrictions.
[ { "docid": "faef4ba7ffdb3b27c4abce50876ac6c5", "score": "0.8088697", "text": "def audio_as_json\n @media[:music].map do |entry|\n { :path => audio_path(entry[:ext]), :mime => entry[:mime] }\n end\n end", "title": "" } ]
[ { "docid": "ad61336262b6577936db26f979899cca", "score": "0.7804698", "text": "def asterisk_sound_files\n JSON.parse(Net::HTTP.get(URI.parse(@tropo_agi_config['asterisk']['sounds']['available_files'])))\n end", "title": "" }, { "docid": "ad61336262b6577936db26f979899cca", "score":...
e6bcbd1fcafd9a23f39993950c6f5640
+write+ must be called with a single argument that is a String.
[ { "docid": "073b7cfe1a5dc918f1cbcb64a42b3e7d", "score": "0.0", "text": "def write(str)\n @logger.error str\n end", "title": "" } ]
[ { "docid": "64a1e5451416d6e8b6dd1674888761a1", "score": "0.8593057", "text": "def write(string); end", "title": "" }, { "docid": "e96e75572a65a6d61e1f0b9d5f2a8664", "score": "0.837736", "text": "def write(str); end", "title": "" }, { "docid": "e96e75572a65a6d61e1f0b9d5f2a...
bb3f91d486f65f83206d69d8cfa1868c
Method to verify if a connection was suggested and is twosided pending
[ { "docid": "0d8c99d646e5b6c8ba586783c78c7791", "score": "0.6393827", "text": "def suggested?\n self.from_status==PENDING and self.to_status==PENDING\n end", "title": "" } ]
[ { "docid": "3b3de9e6148be3ff147d90ffd09e1117", "score": "0.6735702", "text": "def connection_valid?\n connection_check_request(method: :connection_check)\n end", "title": "" }, { "docid": "b3cb081ffe32b080cb36dd7af9434afb", "score": "0.6717201", "text": "def check_connect...
e69bdbd52181d595a6419db100cda64e
loggedin user ID who has granted permission to the client
[ { "docid": "470a119712024bf11f36cdf49d8b6b87", "score": "0.725998", "text": "def resource_owner_id\n env['HTTP_X_AUTHENTICATED_USERID']\n end", "title": "" } ]
[ { "docid": "e9e346962158d2428657a87297de9f3f", "score": "0.7463802", "text": "def current_user_id\n @server.current_user_id\n end", "title": "" }, { "docid": "9d33db608e2e01df9bed8d623b43b16e", "score": "0.7437174", "text": "def user_id\n raise \"Implement in Client or Adv...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "29f89757acc7eee7716825e0cdc5c993", "score": "0.0", "text": "def set_hospitalization\n @hospitalization = Hospitalization.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook;...
4cabaeb4f3501cee8258ab6ceedcf737
Returns a hash with three keys actually used by the Autocomplete jQueryui Can be overriden to show whatever you like Hash also includes a key/value pair for each method in extra_data
[ { "docid": "535971f7089d869a4d4b4e9142006b3f", "score": "0.7712669", "text": "def json_for_autocomplete(items, method, extra_data=[])\n items.collect do |item|\n hash = {\"id\" => item.id.to_s, \"label\" => item.send(method), \"value\" => item.send(method)}\n extra_data.each do |datum...
[ { "docid": "5a937bb193e779fe23aeb6fcf8db0698", "score": "0.6684673", "text": "def json_for_autocomplete(items, method)\n #merge with fb friends\n items.collect {|item| {\"id\" => item.id, \"label\" => item.name, \"value\" => item.name,\n \"img\" => item.profile.photo.url(...
abf6ea4204871092a0f39f9950c5ec98
GET /vendors/new GET /vendors/new.json
[ { "docid": "47949d00cc20d24728586352a89d2c9c", "score": "0.0", "text": "def new\n \n @vendor = Vendor.new\n #render :layout =>false\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vendor }\n end\n #render layout: 'none'\n #render :layout...
[ { "docid": "e67756e3e911801baed1b7294d642e59", "score": "0.7855827", "text": "def new\n @vendor = Vendor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vendor }\n end\n end", "title": "" }, { "docid": "e67756e3e911801baed1b7294d6...
0bb5c0c3ad09420685157c38d63d04cf
Search the books, comics, and both via title as the search text
[ { "docid": "a63c848fe8e8afd9c41e056c222048e9", "score": "0.62876415", "text": "def search\n @search_result = Kaminari.paginate_array(Search.new.search_books_and_comics(search_params)).page(params[:page]).per(10)\n end", "title": "" } ]
[ { "docid": "1737cbad818a17a1d95e0cc8d06a9d59", "score": "0.7928481", "text": "def book_search\n\t\tBook.search do\n\t\t\t# Match title or ISBN\n\t\t\tfulltext params[:query] do\n\t\t\t\tif params[:search_for]=='Title' then\n\t\t\t\t\tfields(:title)\n\t\t\t\telsif params[:search_for]=='ISBN' then\n\t\t\t...
5374341fe928e8d8bc121f5c73efe2e3
POST /fav_recipes POST /fav_recipes.json
[ { "docid": "7e1582f89e48902f4b0bf5ddaa1dbbab", "score": "0.7067055", "text": "def create\n @fav_recipe = FavRecipe.new(fav_recipe_params)\n\n respond_to do |format|\n if @fav_recipe.save\n format.html { redirect_to @fav_recipe, notice: 'Fav recipe was successfully created.' }\n ...
[ { "docid": "fedc52b97023ddb87ab6f0e075b610cb", "score": "0.69393593", "text": "def create\n @favorites_recipe = FavoritesRecipe.new(favorites_recipe_params)\n\n respond_to do |format|\n if @favorites_recipe.save\n format.html { redirect_to @favorites_recipe, notice: 'Favorites recipe w...
4b581d12a53d32beda5e5e1f5c4e8f3e
POST /datasets POST /datasets.json
[ { "docid": "ec37d84ed96c6401925fa66930bba83d", "score": "0.0", "text": "def create\n require 'roo'\n require 'roo-xls'\n require 'fileutils'\n \n @dataset = Dataset.new(dataset_params)\n @dataset.active = true\n uploaded_io = params[:dataset][:csv]\n # Path to origi...
[ { "docid": "26d3a99c1c4de3d17ca9ee2835c0d217", "score": "0.68718123", "text": "def create\n @dataset = Dataset.new(params[:dataset])\n\n respond_to do |format|\n if @dataset.save\n format.html { redirect_to @dataset, notice: 'Dataset was successfully created.' }\n format.json { ...
1b11a94e1aa170931ddd58d7fe016504
this flush method is called once at the end of the resource and we're going to do our bulk write in here
[ { "docid": "0518ac1ef6aeb869d2b57bfe00d8391f", "score": "0.0", "text": "def flush_instance\n # if we are adding our changing our servers, just add them here\n if resource[:ensure] == :present\n cmd = <<-EOF\n # Create the portgroup we want on the vswitch we want it on\n Get-Virt...
[ { "docid": "7c6122b2f1233e2018d62c95fe8a9574", "score": "0.70070624", "text": "def flush # :nodoc:\n end", "title": "" }, { "docid": "41eab6dad1c355b97146901cd4387a9a", "score": "0.7006404", "text": "def flush_writes\n sync(:@queued_for_write)\n\n @fog.flush_writes\n...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "b103c0acfc7e1f1cc1428dce02966fd0", "score": "0.0", "text": "def set_articulo\n @articulo = Articulo.friendly.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "d...
dc32246c622dea7ec2bee54eefbb89e7
get attribute array from instance
[ { "docid": "2ef198f25761623bee190e7fdfd21fbc", "score": "0.71842355", "text": "def attrs\n instance_variables.map{|ivar| instance_variable_get ivar}\n end", "title": "" } ]
[ { "docid": "d705a0482b3ef86b1bf8bd3cb746ade8", "score": "0.7635195", "text": "def to_a\n return _attrs.map { |var| instance_variable_get :\"@#{var}\" }\n end", "title": "" }, { "docid": "1d5e68b36b5b0bd8386b3b58d9a817e2", "score": "0.74510884", "text": "def instance_attributes_ar...
a086cdae1bde2487ee8c1b8f06d89d46
An OpenSSL private key or the path to a private key
[ { "docid": "1789ef869764a6a8b37f607f5198e86c", "score": "0.0", "text": "def key\n @agent.key\n end", "title": "" } ]
[ { "docid": "796c072abcc25710a2031765840d0fc9", "score": "0.7801007", "text": "def private_key\n @private_key ||= OpenSSL::PKey::RSA.new(File.read(private_key_file), private_key_password) if private_key_file\n end", "title": "" }, { "docid": "6e671b214fc9385489517d8ef613630c", ...
f3f1737d8846d9fc7b6211df1b0803a1
set common view name
[ { "docid": "f556b604de13dd3363bc00a45aee1ae3", "score": "0.8065012", "text": "def set_common_view_name\n @view_name = \"message_view\"\n @params = params\n end", "title": "" } ]
[ { "docid": "63c42581410c73076776ef7b261feb6b", "score": "0.7418014", "text": "def set_view_name\n\n if !(session[:generic_view_name].nil?)\n\n @view_name = session[:generic_view_name]\n\n else\n\n error_log(\"session[:generic_view_name] was nil\",2)\n\n end\n\n end", "title": "" ...
bef01795dfeb001afc89af5ba4218a62
copy and pasted from 'python' cookbook 'pip' provider, because Chef sucks
[ { "docid": "5c8e4827c0475c76a86fd00252955cbb", "score": "0.75837857", "text": "def pip_cmd\n if (new_resource.respond_to?(\"virtualenv\") && new_resource.virtualenv)\n ::File.join(new_resource.virtualenv,'/bin/pip')\n elsif \"#{node['python']['install_method']}\".eql?(\"source\")\n ::File.join(\...
[ { "docid": "639051406758eb96890fcf9b4eedc356", "score": "0.72154623", "text": "def install\n args = %w{install -q}\n \n env, package = parse_env(@resource[:name])\n \n \n if @resource[:source]\n if String === @resource[:ensure]\n args << \"#{@resource[:source]}@#{@resou...
900c7bd9c0c69bfd944ba88631f11bed
the main exceptionhandling method. decides whether to notify or not, whether to render an error page or not, and to make it happen. == arguments [exception] the exception that was caught. can be nil, but should only be nil if notifications should always be sent, as notification rules are bypassed this case == options [...
[ { "docid": "3f8e078a4149dcfc94d7aa7c1597fa9d", "score": "0.81864065", "text": "def handle_exception(exception, options = {})\n request = options[:request]\n render_errors = options[:render_errors] || false\n proc_name = options[:proc_name] || config[:app_name]\n error_messages = options[:err...
[ { "docid": "12aea4420e85258382da1e09cd0d45e6", "score": "0.71048564", "text": "def rescue_with_handler(exception)\n to_return = super\n if to_return\n verbose = self.class.exception_notifiable_verbose && respond_to?(:logger) && !logger.nil?\n logger.info(\"[RESCUE STYLE] rescue_w...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "a37939cb085e38d3a3872459d42c378b", "score": "0.0", "text": "def article_params\n params.require(:article).permit(:title, :content, :published)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6980957", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6783065", "text": "def strong_params\n params.requi...
23afc151a063ff14c28a0f3bf5a5b661
Program.import_file uses this method to read from TAP file.
[ { "docid": "a97356ef876cd8c88535637724f03c16", "score": "0.57905173", "text": "def read_data(file, args = {})\n\t\t\t\ttap = File.open(file, 'rb') {|f| f.read}\n\t\t\t\tindex = args[:index].to_i\n\t\t\t\tbtype = length = name = nil\n\t\t\t\tbegin\n\t\t\t\t\tsize, tap = tap.unpack('Sa*')\n\t\t\t\t\tchunk...
[ { "docid": "85f4c40d51017880271596d6c82fbe6e", "score": "0.7090156", "text": "def import_from(file)\n raise 'Not implemented'\n end", "title": "" }, { "docid": "5cdd6ec64af27c41303b1ed8887061f9", "score": "0.6802626", "text": "def import(filename)\n File.read(filen...
63a61cf7dbde084af8cb5a992bf2f88b
GET /tickets/1 GET /tickets/1.xml
[ { "docid": "96368494cab05904da6abc8b7056005e", "score": "0.589279", "text": "def show\n @ticket = Ticket.find(params[:id])\n @tickets = Ticket.find(:all, :conditions => [\"event_id = ?\", @ticket.event_id])\n @tickets = @tickets.paginate(:page => params[:page])\n \n #Define breadcrumbs\n ...
[ { "docid": "0dbb966c93405df39e311068038abc8a", "score": "0.7135825", "text": "def index\n @tickets = Ticket.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tickets }\n end\n end", "title": "" }, { "docid": "0e10df41347d0803133...
dc88fcbef91cb4100ea22ae9f5d7bfd3
Extracts Haml files from a path
[ { "docid": "09d9a162dcb8070ec4485e2c2a6eb564", "score": "0.8161095", "text": "def haml_files_from_path(path)\n if Dir.exist?(path) || File.exist?(path)\n runner\n .send(:extract_applicable_files, linter_config, files: [path])\n .select { |file| file.end_with?(HAML_E...
[ { "docid": "c0d82e8d9f510c028b0f40336092d045", "score": "0.644645", "text": "def parseHaml( directory )\n print \"Parsing Haml in \" + directory + \"...\"\n system(%{\n cd #{directory} && \n for f in *.haml; do [ -e $f ] && haml $f ../${f%.haml}.html; done\n })\n puts \"done.\"\nend", "tit...
22f4b9ee246638cba40185eae52314c3
Chris' music shuffle program
[ { "docid": "c46e54ad8c60d562458aedd213ce34f6", "score": "0.65088475", "text": "def music_shuffle filenames\n songs_and_paths = filenames.map do |s|\n [s, s.split('/')] # [song, path]\n end\n tree = {:root => []}\n # put each song into the tree\n insert_into_tree = proc do |branch, song, path|\n...
[ { "docid": "ce94252964756cd4af8e7d2ae36645e9", "score": "0.81745946", "text": "def music_shuffle filenames\n# We don't want a perfectly random shuffle, so let's\n# instead do a shuffle like card-shuffling. Let's\n# shuffle the \"deck\" twice, then cut it once. That's\n# not enough times to make a perfec...
17efac6c4b7f0ec2f1a0b4f410b0da34
Callback fired afer ticket reopened
[ { "docid": "56dfd05fc1cdf9e3a1c0628da4b30925", "score": "0.6382204", "text": "def after_reopen\n if sprint\n log_sprint_activity('reopen', estimated_remaining)\n else\n add_to_backlog\n end\n IssueMailer.delay.issue_reopened(self.id)\n end", "title": "" } ]
[ { "docid": "9c65b6314699755cc1aac4d6ff7168f1", "score": "0.7466279", "text": "def reopen\n data = Storm::Base::SODServer.remote_call '/Support/Ticket/reopen',\n :id => @id,\n :secid => @secid\n ...
d74864da8a4491babe4c3982f739b3f1
Quotes column names for use in SQL queries. source://activerecord//lib/active_record/connection_adapters/postgresql/quoting.rb97
[ { "docid": "4f04807f615094a39f4ec73b8de4690d", "score": "0.81750673", "text": "def quote_column_name(name); end", "title": "" } ]
[ { "docid": "ec6f3e50e036218460721fc72209cbab", "score": "0.8212667", "text": "def quote_column_name(column_name); end", "title": "" }, { "docid": "c006a9abc66d6fe85b677e0167f3b0c2", "score": "0.8144011", "text": "def quoted_column_name\n quote_column_name(column.name)\n e...
6dc7bc88f316a6b0527dcf5c5db765c2
Runs the `stop` lifecycle step. Also runs any callbacks for the step.
[ { "docid": "6e39291479cbab27647cbbbf16e21fba", "score": "0.7547745", "text": "def stop\n return self unless started?\n\n run_step(:stop)\n end", "title": "" } ]
[ { "docid": "a5359fd96e1fcc8c6ba9c9a4d300abbb", "score": "0.7364467", "text": "def stop\n @status = :stop\n @runner.stop\n end", "title": "" }, { "docid": "1f5aa88689bd4fb1365ca63b45d1ed2e", "score": "0.72534394", "text": "def stop\n execute_only(:stop)\n end"...
78cea15025e6b1ea93729f82ee00c51a
reduce 195 omitted reduce 196 omitted
[ { "docid": "bf541c71c98f51681eb536ede20d5f95", "score": "0.0", "text": "def _reduce_197(val, _values, result)\n result = new_call val[1], :\"+@\", s(:arglist)\n result = val[1] if [:int, :float].include? val[1].type\n \n result\nend", "...
[ { "docid": "bcc77ea412992f9c87aad138efd40a40", "score": "0.720447", "text": "def _reduce_236(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "a8f6b114cf0c46f8e2a7e869a4ffdefc", "score": "0.71245265", "text":...
0d13c4720bb0bfc6e80c5596b2891e39
Enable/disable min & max angle limits.
[ { "docid": "fbafc108d9c219fc173c296d678e730e", "score": "0.49300075", "text": "def angular_limits_enabled=(state)\n MSPhysics::Newton::Corkscrew.enable_angular_limits(@address, state)\n end", "title": "" } ]
[ { "docid": "6c4bd9020d88e8d962b54a2f8c9e7574", "score": "0.601228", "text": "def adjust_interval\n if @az_max - @az_min >= 2*Math::PI\n # have come full circle\n @az_min = 0\n @az_max = 2*Math::PI\n else\n @az_max %= 2*Math::PI\n @az_min %= 2*Math::PI\n end\n end", ...
7430267c96005135db2f09808ab07a31
POST /choice_categories POST /choice_categories.json
[ { "docid": "93c06648972662d55f6acc9544a80c5f", "score": "0.7113949", "text": "def create\n @choice_category = ChoiceCategory.new(choice_category_params)\n\n respond_to do |format|\n if @choice_category.save\n format.html { redirect_to @choice_category, notice: 'Choice category was succ...
[ { "docid": "05366d50943b5f0008995b8355c4e6b0", "score": "0.6740284", "text": "def add_categorization_on_form(kapp_slug, body, headers=default_headers)\n raise StandardError.new \"Category properties is not valid, must be a Hash.\" unless body.is_a? Hash\n @logger.info(\"Adding Categorization f...
bfea576195102cca9f2b8b0e2825308a
Update attributes of this invitation. Updates certain attributes of this invitation, and returns the invitation its new state. The following attributes can be updated: allowLaunch invitationEmail postBack expirationDate NOTE: Any attributes not in the above list will not be considered for update.
[ { "docid": "397efac6ed6dc5ea17d9d8551df40dfb", "score": "0.0", "text": "def update_private_invitation_with_http_info(invitation_id, invitation_update_schema, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: InvitationsApi.update_private_invitation ...
[ { "docid": "a9b6a7f6054eb0990b09d10cc1f989ff", "score": "0.6278267", "text": "def update_attributes(attributes={})\n __update_attributes attributes\n save\n self\n end", "title": "" }, { "docid": "36fbe2365d969328decb0208e062c7b1", "score": "0.619899", "text...
df25cd38eb10c586333bbad762ed0289
clicks the new version button
[ { "docid": "1b63ce0643ead8f316305ca6a6513174", "score": "0.88537395", "text": "def version_new\n find_link('New Version').click\n end", "title": "" } ]
[ { "docid": "026055c7ed2ddb8212f235c22acc34d1", "score": "0.8429858", "text": "def version_add_new_click\n @wait.until {@driver.find_element(:css => 'a[href*=\"versions/new\"]').displayed?}\n @driver.find_element(:css => 'a[href*=\"versions/new\"]').click\n end", "title": "" }, { "doci...
4eb133c18ebb60795c752a3e476fd24c
1 => [1] |1| yes 2 => [1, 2] |2| yes 3 => [1, 3] |2| no 2 !> 2 4 => [1, 2, 3] |3| yes 3 > 2 5 => [1, 5] |2| no 2 !> 3 6 => [1, 2, 3, 6] |4| yes 4 > 3 7 |2| 8 => [1, 2, 4, 8] |4| no 4 !> 4
[ { "docid": "871573cb58b5267a35c6b7b8f2d08bc6", "score": "0.0", "text": "def factor_count(num)\n (1..num).count { |n| num % n == 0 }\nend", "title": "" } ]
[ { "docid": "dfb7695ebf299aa8a62f881b7f16ed9c", "score": "0.6167674", "text": "def qs(l)\n return [] if (x,*xs=l).empty?\n less, more = xs.partition{|y| y < x}\n qs(less) + [x] + qs(more)\nend", "title": "" }, { "docid": "7441f4492305c17fa16f4f157e4569e3", "score": "0.5810936", "te...
7affb3484fd2ac6965f8ba764ed5e6dc
GET /featured_items/1 GET /featured_items/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "ab66cbac9fe1b208587aed85c1d79ce1", "score": "0.8032675", "text": "def show\n @featured_item = FeaturedItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @featured_item }\n end\n end", "title": "" }, { "...
2472180539a9a9f549df37896f6c467d
native_write_to(io, encoding, options) Write this Node to +io+ with +encoding+ and +options+
[ { "docid": "f0f88bcec92cf094f95cc4c840290628", "score": "0.8592692", "text": "def native_write_to(io, encoding, options)\n #This is a stub, used for indexing\n end", "title": "" } ]
[ { "docid": "b4f6c5701845ce2a8d2f3e833af67659", "score": "0.7393861", "text": "def write_to(io, *options)\n options = options.first.is_a?(Hash) ? options.shift : {}\n encoding = options[:encoding] || options[0]\n if Nokogiri.jruby?\n save_options = options[:save_with] || opt...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "3fc4152598633fffae23ede978b4d309", "score": "0.0", "text": "def update!(**args)\n @category_entities = args[:category_entities] if args.key?(:category_entities)\n @entity = args[:entity] if args.key?(:entity)\n @frames = args[:frames] if args.key?(:frames)\n ...
[ { "docid": "184b1b1ed771473d3eb9f338c0734c38", "score": "0.73066413", "text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end", "title": "" }, { "docid": "5076c5a88404ae72986f958710f5687a", "score": "0.72631145", "text": "def update...
baf2f9b7e8b0468f59389bc903026b9f
def rebuild_uid(style, old_uid, args)
[ { "docid": "fe83f8ece7a5c32a2641831afb7a2b29", "score": "0.6100511", "text": "def rebuild_uid(file, fingerprint)\n \"#{file.uid}-#{fingerprint}\"\n end", "title": "" } ]
[ { "docid": "b7aede6a8425cf39329193b1ec72e39d", "score": "0.6514995", "text": "def uid=(_arg0); end", "title": "" }, { "docid": "b7aede6a8425cf39329193b1ec72e39d", "score": "0.6514995", "text": "def uid=(_arg0); end", "title": "" }, { "docid": "a3ef3aee7c12c2d7ad89cdd491c1...
0453793b5af7b30ff598517015b0d2ab
Executes our uploaded malicious file
[ { "docid": "07ef8b12521a0311c39c63b8e0766036", "score": "0.67403615", "text": "def exec\r\n print_status(\"#{peer} - Executing #{@fname}...\")\r\n res = send_request_raw({\r\n 'uri' => normalize_uri(@upload_path, @fname),\r\n 'cookie' => 'access=3'\r\n })\r\n if res and res.code...
[ { "docid": "52794bb6d29f6c31feeb9f27c4fb42df", "score": "0.75158757", "text": "def exploit\r\n upload\r\n exec\r\n end", "title": "" }, { "docid": "cb23f01e431a30aab1ed744608d86dd0", "score": "0.74302036", "text": "def upload_exec(sid, filename, malicious_file)\r\n res = up...
80077973815f6c7465a6bdbed838aed0
Public: users associated with a organization result. Examples users => return associated users. Returns associated users for the organization.
[ { "docid": "fa1c93e13810b94db57d0ed71ae57ef4", "score": "0.69974214", "text": "def users\n records do |instance|\n instance['users'] = user.where('organization_id': instance['_id'])\n end\n end", "title": "" } ]
[ { "docid": "0c845ee39d97e5114d23f3a9e4566423", "score": "0.71894187", "text": "def current_organization_users\n endpoint = '/api/org/users'\n @logger.debug(\"Getting organization users (GET #{endpoint})\") if @debug\n get(endpoint)\n end", "title": "" }, { "docid": "5dc467d...
7fd991de87c1289202fe331d56ef6862
Initialize a new Quantity object. Two arguments are required: a value and a unit. The unit can be a an instance of Unit::Base or the label, name, symbol or JScience reference of a known (or derivable through known units and prefixes) unit
[ { "docid": "a2ad9dbf5a97660e3afc1d21ecff7107", "score": "0.73861414", "text": "def initialize(value, unit = nil)\n if value\n @value = Float(value)\n else\n @value = nil\n end\n \n if unit\n @unit = Unit.for(unit)\n else\n @unit = Unit.dimensionl...
[ { "docid": "a8c045579db26302e0d14364039c861d", "score": "0.7732636", "text": "def initialize(unit, quantity)\n unit = UOM::Unit.for(unit) if Symbol === unit\n @quantity = quantity\n @unit = unit\n @unit_alias = unit unless unit == @unit.label\n end", "title": "" }, { "...
3dd4c69fb3a931b1a6a0be5b97afbbc0
GET /user_days GET /user_days.json
[ { "docid": "bf6d21e674e98641d4866f8802eedd45", "score": "0.7203538", "text": "def index\n @user_days = UserDay.all\n end", "title": "" } ]
[ { "docid": "e4ec63cdb29e7cb86b7b37119f882de5", "score": "0.71552277", "text": "def index\n @days = current_user.days.paginate(page: params[:page], per_page: 7)\n end", "title": "" }, { "docid": "e5e01ec985ebba779a8034224e4158ad", "score": "0.6800703", "text": "def index\n @ent...
21218f3df67d8c57eebba496fe1dbe1f
Replace all vowels with a random vowel
[ { "docid": "03d382f7a7947dbc343781afa28dfbc3", "score": "0.8600809", "text": "def change_vowels(word)\n word.scan(/[aeiou]/) do\n word[Regexp.last_match.offset(0).first] = %w(a e i o u)[rand(5)]\n end\n word\n end", "title": "" } ]
[ { "docid": "5765075d3c347535c899cb3e0cb522a5", "score": "0.80440944", "text": "def swap_vowel!\n vowels = %w(a e i o u y)\n self.length.times {|i| self[i] = vowels.shuffle[Kernel.rand(vowels.length)] if vowels.include?(self[i])}\n self\n end", "title": "" }, { "docid": "3b2d041e378...
b56b32c589d8c9d6ba072d299d6796c7
Returns either true or false depending on whether or not the user agent of the device making the request is matched to a device in our regex.
[ { "docid": "d81c0f51396399e827776efe88693c81", "score": "0.6188374", "text": "def is_mobile_browser?\n Handset.is_mobile? request.user_agent\n end", "title": "" } ]
[ { "docid": "fd58802ef7f1b2604dbdee08468a8152", "score": "0.78819495", "text": "def request_device?(device)\n (request.user_agent.to_s.downcase =~ (Mobylette.devices.device(device) || %r{not_to_be_matched_please}) ? true : false)\n end", "title": "" }, { "docid": "ad760f022cf73259f0fa...
3d4a75cf809a0218a5960b38476236a3
QTY02 Id: 380 Name: Quantity Type: R Min/Max: 1/15 Description: Numeric value of quantity
[ { "docid": "a76e2b133a9e240e7c20575ad573e992", "score": "0.0", "text": "def QTY02=(arg)", "title": "" } ]
[ { "docid": "f373aa5181510fae2bbadf8374318423", "score": "0.6970937", "text": "def ts_quantidade_rps value\n\t\t\t\t\t\tBrNfe::Helper.only_number(value).max_size(4)\n\t\t\t\t\tend", "title": "" }, { "docid": "f99f443c49bae47bc52cd8a819d41853", "score": "0.6920024", "text": "def availa...
520920da2a22ae76df617f2e71ef33aa
GET /match_types/1 GET /match_types/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "da9c69cfc923428a3571abbc871858bb", "score": "0.737225", "text": "def index\n @match_types = MatchType.all\n end", "title": "" }, { "docid": "e1aab0e685b40c92b78cf2bbc5d5f7cd", "score": "0.66626704", "text": "def match(type, query, options = {})\n fetch_response(b...
6b525b724032ddc469b939e908e65308
Return all the highlights found in the HTML of the given Nokogiri node
[ { "docid": "9c7a8684a30ccb9c3b27b86620ea9401", "score": "0.7078569", "text": "def extract_highlights(doc)\n highlight_nodes = doc.css('#kp-annotation-location').map {|ea| ea.parent.parent.parent }\n\n highlight_nodes.map do |node|\n id = node['id']\n\n # Highlights (with or without notes) have #...
[ { "docid": "04fd9a9f5bef09585b3f1f72136de038", "score": "0.66423523", "text": "def highlights; end", "title": "" }, { "docid": "04fd9a9f5bef09585b3f1f72136de038", "score": "0.66423523", "text": "def highlights; end", "title": "" }, { "docid": "04fd9a9f5bef09585b3f1f72136d...
e7749fa6b805beade9d247d08e15e554
set_teacher_group calls set_teacher which calls set_teacher, so all functions are related. because in the params we do not have params[:teacher_id]
[ { "docid": "f17539b70bc4b6fc7649817a9dd2217a", "score": "0.0", "text": "def from_submit_button? \n print \"\\n indide from submit button private function \\n\"\n print \"\\n from_submit_button will have the value of #{params[:commit] == 'Submit'}\"\n params[:commit] == \"Submit\"\n end", "...
[ { "docid": "de9e2334d1dbaa390c7d10e6fd93ad6b", "score": "0.7235401", "text": "def set_teacher\n @teacher = Teacher.find(params[:id] || params[:teacher_id])\n end", "title": "" }, { "docid": "72febdc071eef143fc76bb8403ae870c", "score": "0.7175446", "text": "def set_teacher\n ...
cb5337260c466f6fcf7338ee4fca560e
Without that, Simple Form will consider the user model as the object.
[ { "docid": "4e2a3679423dfef02d81b6271955a9a2", "score": "0.0", "text": "def to_model\n self\n end", "title": "" } ]
[ { "docid": "783163e7e3c3a9324403206cfd62bc6a", "score": "0.660751", "text": "def model_class\n User\n end", "title": "" }, { "docid": "ebfa790ae162a30b0409be2f75f3a294", "score": "0.65595394", "text": "def user_model(*args)\n if args.blank?\n const_defined?(:UserModel...
2692ff62c5a83da8b8a7697b648bfa3b
whether the value for key exists in locale (defaults: base_locale)
[ { "docid": "78d8063750892077442588575bacc695", "score": "0.82463324", "text": "def key_value?(key, locale = base_locale)\n !t(key, locale).nil?\n end", "title": "" } ]
[ { "docid": "f7d665a8f4ee65b3a4c839242d537a87", "score": "0.89152974", "text": "def key_has_value?(key, locale = base_locale)\n t(locale_data(locale)[locale], key).present?\n end", "title": "" }, { "docid": "239bb51a5af95d725205653fd5e64f9d", "score": "0.7846264", "text": ...
cb2e7ee8ec32d3861706eda9e84bcc71
return the number that appears most frequently (the mode). For example: if arr contains [10, 4, 5, 2, 4] the output should be 4. If there is more than one mode return the one that appeared in the array first (ie. [5, 10, 10, 6, 5] should return 5 because it appeared first). If there is no mode return 1. The array will ...
[ { "docid": "d22e5a900e4f0cb6f092a7d75a345401", "score": "0.774393", "text": "def SimpleMode(arr)\n i = 0\n largest = 0\n mode = \"\"\n \n while i < arr.length\n if arr.count(arr[i]) > largest\n largest = arr.count(arr[i])\n mode = arr[i]\n end\n i +=1\n end\n largest == 1 ? -1 ...
[ { "docid": "679014b2ad83a0282477b77f68819f1c", "score": "0.8187002", "text": "def mode(array)\n instance = Hash.new(0)\n array.each do |item|\n instance[item] += 1\n end\n most_frequent = instance.values.max\n p instance.collect { |k, v| k if v == most_frequent }.compact\nend", "title": "" ...
8bcef4dae8983f5370ecb4c98a7db621
Checks if an updated or new facebook token is valid by querying the token debug API
[ { "docid": "8bb05e307b8fcb675f600c8bd9df5b7a", "score": "0.7217745", "text": "def valid_token\n unless !value_changed? || token_data(refresh: true).is_valid\n errors.add(\n :value,\n I18n.translate(\n 'fbsync.activerecord.errors.token.invalid_token',\n ...
[ { "docid": "93b9dcfde512e61090d6bf7ddf6d29c2", "score": "0.7442606", "text": "def valid_token?\r\n token = ::AuthToken.where(user_id: decoded_auth_token[:user_id]).newer.first\r\n token&.token == auth_token && token.expire_at >= Time.now if token.present?\r\n end", "title": "" }, { ...
b6ad3d00ab18a50cf64bf3c44d78bd27
POST /users POST /users.json
[ { "docid": "f72c89ce4b5b6640b4c3c4557479ba22", "score": "0.6526114", "text": "def create\r\n @user = User.new(params[:user])\r\n\r\n respond_to do |format|\r\n if @user.save\r\n format.html { redirect_to users_path, notice: 'Os dados do usuário foram salvos com sucesso!' }\r\n f...
[ { "docid": "4794c3e6e2db462f4d8769453efddedd", "score": "0.77179813", "text": "def post_users(users)\n self.class.post('https://api.yesgraph.com/v0/users', {\n :body => users.to_json,\n :headers => @options,\n })\n end", "title": "" }, { "docid": "a3973850c21e121410e2101...
b233fa033a976520a6e1cde64a17dbf7
Load the route metadata from the given json file.
[ { "docid": "a43008560e204c3a11599ec59d7e2d5c", "score": "0.6745624", "text": "def load_routes(file)\n @route_list_names = {}\n\n routes = JSON.parse(File.read(file))\n @route_list = routes.map do |r|\n path = r['path'].freeze\n route = {:path=>path}\n\n ...
[ { "docid": "c05cae9e5e53cff2c868a3e65ef270db", "score": "0.68410856", "text": "def load_json(file)\n # TBD\n end", "title": "" }, { "docid": "9d3a79ea2b087690082cd6898f76fdfa", "score": "0.6549446", "text": "def load_from_json(filename); end", "title": "" }, { "do...
90b75f9e7f54b20d217967b46c65480b
Sets the config pathname to the config directory
[ { "docid": "ea2ce5459422cb00e51eb59f9b0f6515", "score": "0.68193173", "text": "def path_to_configs\n @path_to_configs = Pathname(File.expand_path('../../config/', __FILE__))\n end", "title": "" } ]
[ { "docid": "d3f85f4defa7c231ec0bc856eb159222", "score": "0.7334812", "text": "def set_config_paths\n @config_file_path = \"config/dissect/\"\n end", "title": "" }, { "docid": "f647280982c919057f52fbe23c0afe0f", "score": "0.70113325", "text": "def default_config_path = '.'", ...
c222dda3f1db8a0cb0582b39f30cfce4
Retrieve image with given key from the storage
[ { "docid": "5397a81a81a6c83fd41621ecd24e5bf5", "score": "0.0", "text": "def fetch_data(name, format, size='raw')\n [self::CONTENT_TYPES[format.to_sym], retrieve_image(name, format, size, :fetch)]\n end", "title": "" } ]
[ { "docid": "21fcb208ecba579fb1139bbd52a5ab96", "score": "0.7257286", "text": "def get_image(image_id)\n return @rm.get(image_id)\n end", "title": "" }, { "docid": "b659b82aa8502499dd5e71c147b5088b", "score": "0.70217496", "text": "def image(key)\n return @data[key].clo...
26a784d8f51c31da6838a7550fd1d912
NOT FINAL SOLUTION NEEDS CORRECTION 1st argument is n, the length of the password 2nd argument is password, the string containing the propsed password
[ { "docid": "96245a1eee5212887651e9c088430822", "score": "0.0", "text": "def minimumNumber(n, password)\n\n # Given character sets to check against\n numbers = \"0123456789\"\n lower_case = \"abcdefghijklmnopqrstuvwxyz\"\n upper_case = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n special_characters = ...
[ { "docid": "d28219e5ddd8d321cb48b91e13fc645b", "score": "0.7893763", "text": "def find_password(hashed_password, n)\n password = (\"a\" * n).split(\"\");\n _find_password(hashed_password, password, 0)\n return password.join\nend", "title": "" }, { "docid": "da3f45f200d1b5e9c865389428501af...
1097a7e7758f08d32addfc88ea3fdcab
GET /users GET /users.json
[ { "docid": "8b1dbac81472eff58cb602a4a1473ebb", "score": "0.0", "text": "def index\n @users = User.all\n end", "title": "" } ]
[ { "docid": "9f7c735ace683c5c2b12c914cc9ad8a8", "score": "0.8407736", "text": "def get\n users = User.all.as_json\n render(json: users.as_json, status: :ok)\n end", "title": "" }, { "docid": "543509c6588e2f79a8dbcd1cdcdaf7b9", "score": "0.8360157", "text": "def users\...
ee36a327204f99740125792fa4edd19d
DELETE /counters/1 DELETE /counters/1.json
[ { "docid": "75bfd26679d9696e26f9a881214139bf", "score": "0.7241477", "text": "def destroy\n @counter.destroy\n respond_to do |format|\n format.html { redirect_to counters_url, notice: 'Counter was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title"...
[ { "docid": "53045d31ac869108ac8fb08153891392", "score": "0.698083", "text": "def destroy\n @calorie_counter.destroy\n respond_to do |format|\n format.html { redirect_to calorie_counters_url, notice: 'Calorie counter was successfully destroyed.' }\n format.json { head :no_content }\n e...
922e52d9e23e05edc653613ca57d2499
Removing a property from the propertytable
[ { "docid": "75aebc86296e03712d4e7c2635f0b0df", "score": "0.63240314", "text": "def destroy\n @property = Property.find(params[:id])\n @property.destroy!\n redirect_to display_prop_path\n end", "title": "" } ]
[ { "docid": "ea2e30d3638f5b0294ae0ba6527fd451", "score": "0.7750372", "text": "def delete_property(name)\n properties.delete_if{|attr| attr.property == name}\n end", "title": "" }, { "docid": "eb5f50ad04ad116bdb6147d4572aef43", "score": "0.77125734", "text": "def remove_proper...
e26e14fe23ecc4d4264be264587bd8a8
Bugfix: get code from
[ { "docid": "8b5bc11ce12e8b51753c6d5ebc9fbcbe", "score": "0.0", "text": "def create\n return render_create_error_missing_email unless resource_params[:email]\n\n @email = get_case_insensitive_field_from_resource_params(:email)\n @resource = find_resource(:uid, @email)\n\n ...
[ { "docid": "ef7b02a90f914daf42973579704d462c", "score": "0.80879104", "text": "def get_code\n\t\tend", "title": "" }, { "docid": "a0eab9f44a508c865d46e049a3fa520b", "score": "0.795081", "text": "def do_get_code\n @code\n end", "title": "" }, { "docid": "fc19603813c172...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "20f53d76bb80ae165e54e2130853a300", "score": "0.0", "text": "def roads1_params\n params.require(:roads1).permit(:Sector, :'2011-12', :'2012-13', :'2013-14', :'2014-15', :'2015-16_P', :'2016-17_Q', :'CAGR_2011-16')\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.7121987", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "b32229655ba2c32ebe754084ef912a1a", "score": "0.70541996", "text": "def expected_permitted_parameter_names; end", "title": "...
23485750f360e018f5a10ae97270068d
The period for which the destination table will be partitioned, if any. See [Partitioned Tables](
[ { "docid": "9bb199abd9ccf762d47f21ae7850e801", "score": "0.5565687", "text": "def time_partitioning_type\n @gapi.configuration.query.time_partitioning.type if time_partitioning?\n end", "title": "" } ]
[ { "docid": "5ca4d7dface9073807838089b4d2272c", "score": "0.59116626", "text": "def retention\n case @partition[:period]\n when \"month\"\n @start << @partition[:retain] || 6 # Default to 6 months\n when \"week\"\n @start - ((@partition[:retain] || 4) * 7) # Default to 4 week...
e3baab820e117b7cb06fc0bfbd741f21
allows registered users to skip address step.
[ { "docid": "5beb6f69f2847eeb9723c57f17497c87", "score": "0.6406188", "text": "def handle_express_users\n return if params[:step] == \"address\" || current_user.nil?\n\n unless @checkout.ship_address.valid?\n @checkout.ship_address.attributes = current_user.ship_address.attributes....
[ { "docid": "f60350e63a9783d71cb2a4b289f189bd", "score": "0.7176693", "text": "def force_address_step\n if current_user\n redirect_to landing_page unless current_user.registration_complete?\n elsif current_company\n redirect_to company_landing_page unless current_company.registration_comp...
06d93887e6ef25686b12959d800e0f6d
Baseline implementation for the update_data_attribute_binding REST call
[ { "docid": "eeaa44d36ba7315da1b8eeb88c6c9c84", "score": "0.73784447", "text": "def update_data_attribute_binding request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transco...
[ { "docid": "4794bb4cfbb99b4b7ddf3aaedee6c35f", "score": "0.67873347", "text": "def update_attribute(name, value); end", "title": "" }, { "docid": "6ab587b4ecffe0e8cacbe5e1bc34a344", "score": "0.66515774", "text": "def update_attribute\r\n end", "title": "" }, { "docid": ...
fa9969e57c67ed5bc9e1ef024308254a
DELETE /shuoshuos/1 DELETE /shuoshuos/1.json
[ { "docid": "20db6ee75881dbae3b17f5819831f873", "score": "0.71002746", "text": "def destroy\n @shuoshuo = Shuoshuo.find(params[:id])\n @shuoshuo.destroy\n\n respond_to do |format|\n format.html { redirect_to shuoshuos_url }\n format.json { head :no_content }\n end\n end", "titl...
[ { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.7439819", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": "...
c1b7312fe6103a20b12700d87c900945
Turns a number into an ordinal string used to denote the position in an ordered sequence such as 1st, 2nd, 3rd, 4th. Examples: ordinalize(1) => "1st" ordinalize(2) => "2nd" ordinalize(1002) => "1002nd" ordinalize(1003) => "1003rd" ordinalize(11) => "11th" ordinalize(1021) => "1021st"
[ { "docid": "2414bb751c047f4ab0ad34220d0f9a59", "score": "0.7995376", "text": "def ordinalize(number)\n if (11..13).include?(number.to_i.abs % 100)\n \"#{number}th\"\n else\n case number.to_i.abs % 10\n when 1; \"#{number}st\"\n when 2; \"#{number}nd\"\n when 3; \"#{number}...
[ { "docid": "12e9fef70b6ec4143a330115d0afe9f2", "score": "0.8208892", "text": "def ordinalize(number)\n if (number.to_i==-1)\n\t'last'\n elsif (number.to_i==-2)\n\t'second to last'\n elsif (11..13).include?(number.to_i % 100)\n\t\"#{number}th\"\n else\n\tcase number.to_i % 10\n\t whe...
a3317ad8ec53120984ac14e28af2cf82
POST Doc Used for creating relationships (following) between users The id of a user that is being followed Params auth_token: string id: string or integer
[ { "docid": "944e49e9939cfabd340258609326daa8", "score": "0.72134787", "text": "def create\n relationship =\n Relationship.new(follower_id: current_user.id,\n followed_id: params[:id])\n\n if relationship.save\n expose current_user.reload\n ...
[ { "docid": "7bcaf4f7238b26bd6799ff5402253a6e", "score": "0.7598385", "text": "def follow (other_user)\n active_relationships.create(followed_id: other_user.id)\nend", "title": "" }, { "docid": "12130b0a6a0b538bccaf01de39685037", "score": "0.759266", "text": "def follow!(other_user)\...
6941869991c9a72e2b78a4965664fb81
Regexp.union(PROFANITY_FILTER) => /Fuck|Fucked|Shit|Piss|Pissed|Dick|Asshole|Bastard|Damn|Cunt|coward/ Regexp.union(PROFANITY_FILTER).source => "Fuck|Fucked|Shit|Piss|Pissed|Dick|Asshole|Bastard|Damn|Cunt|coward"
[ { "docid": "692b88f1365c3299bee658380e2620fc", "score": "0.0", "text": "def highlight_blacklisted_words\n params[:comment_text]&.gsub(/(#{Regexp.union(BLACKLISTED_WORDS).source})/i) { |s| \"<<#{s}>>\" }\n end", "title": "" } ]
[ { "docid": "d8b3b7a29e70ce6e8f86776c894dcd21", "score": "0.5871808", "text": "def define_match_any_of\n klass.send(:define_method, :match_any_of) do |tags|\n if tags.empty?\n str(\"\")\n else\n tags.map { |tag| str(tag) }.inject do |tag_chain, tag|\n tag_chain.send :|...
15ae8b364b4f8593329abe435736395a
Returns a list of test cases for a test suite or specific section in a test suite.
[ { "docid": "fd1bbce6e3940dc3b9949c0ddd6b9b5d", "score": "0.0", "text": "def cases(project_id, suite_id, filters = {})\n get(\"get_cases/#{project_id}&suite_id=#{suite_id}\",\n params: {\n section_id: filters[:section_id],\n created_after: filters[:cre...
[ { "docid": "47731c9227e172710624da0fd2bb93a6", "score": "0.71974725", "text": "def test_cases\n test_suites.map(&:test_cases).tap(&:flatten!).select { |test_case| valid_test_method(test_case) }\n end", "title": "" }, { "docid": "79332ec2e02194f4c871861488fde0eb", "score": "0.71657914...
81c8617ba094fbb42786e37a09939658
Turn off debugging. Will now only display errors and fatal messages.
[ { "docid": "81853782aaa9884c49ee12b47447b020", "score": "0.7856478", "text": "def turn_off_debugging\n logger.level = Logger::ERROR\n end", "title": "" } ]
[ { "docid": "19d66fc683894427cbfc9a9b57850ef5", "score": "0.7952167", "text": "def turn_off_debugging!\n @savon_options[:log] = false # disable logging\n @savon_options[:log_level] = :info # changing the log level\n end", "title": "" }, { "docid": "c1f5d5a5835b22469...
d0b3bf6e42e35d4bf3dd61d64c819e25
still under construction it should assign the group with the most positions() ie the largest water group neighbour at the momnet it assigns it the first water neighbours group
[ { "docid": "6517e82cbca91c98718b4e85aaba23e5", "score": "0.62424415", "text": "def group_water(p,loc)\r\n n = check_neighbours(loc)\r\n\tg = -1\r\n\t\r\n\tn.each_with_index do |ni,index|\r\n\t if ni.type.class.to_s == \"Water\"\r\n\t g = index\r\n\t break\r\n\t else\r\n\t g = -1\r\n\t end...
[ { "docid": "0c5493d148ac929e2d989860037c9fa6", "score": "0.6131616", "text": "def pick_position (positions)\n positions.shuffle #shuffle first to avoid always picking leftmost maximum\n .reduce do |p1, p2|\n if combine_heur(p1) > combine_heur(p2)\n then p1\n else p2\n end\n ...
22d3f9fadd68440b18567ede48141918
DELETE /answers/1 DELETE /answers/1.json
[ { "docid": "7e424e988ff941c50c2f6b1e3363193e", "score": "0.7804042", "text": "def destroy\n @answer.destroy\n respond_to do |format|\n format.html { redirect_to answers_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "8732abdd28ba38547ecad9784e4dfc50", "score": "0.7788873", "text": "def destroy\n @answer.destroy\n respond_to do |format|\n format.html\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "16836fb6730939d90031ceefe4035224", "score": "...
ebd2963f005b5a29ef45c8fcfaa19d19
Return player with most points
[ { "docid": "d9604d28555562080e834dfa4878b4fd", "score": "0.76574445", "text": "def most_points_scored\n most_points = 0\n player = \"\"\n game_hash.each do |location, team_data|\n team_data[:players].each do |name, stats| \n if stats[:points] > most_points\n most_points = stats[:points...
[ { "docid": "166cf9200810566b9be21e5ff33aa9d0", "score": "0.8343521", "text": "def most_points_scored\n all_players.max_by{|player,stats| stats[:points]}[0]\nend", "title": "" }, { "docid": "b5ea6fc9b9d12934e1747555b54cfbd4", "score": "0.8257159", "text": "def most_points_scored\n p...
12cf4fb9f452adcd6ce90a313fd94722
has_index? Query whether attribute index(es) exist for object.
[ { "docid": "6f64779916c68df36824667b9b93bbd4", "score": "0.6703652", "text": "def has_index?( *indexes )\n \n has_index = false\n \n indexes.each do |this_index|\n break unless has_index = @indexes.has_key?( index_name )\n end\n \n return has_index\n \n end", "title": "...
[ { "docid": "0da559b215b90424587489777628ca1e", "score": "0.7424609", "text": "def exist?\n @index_info.index_exists?\n end", "title": "" }, { "docid": "491ae1bb0b8d4e7c50660a663ea5ba23", "score": "0.7396594", "text": "def index_exists?\n connection.index_exists?(index_...
1e1d036ef67533e26fbf6bea07792c17
hole 7: pair array shuffler
[ { "docid": "c4adb51443745ded71662079ceb4be18", "score": "0.67382514", "text": "def shuffler(a)\n a.flatten.shuffle.each_slice(2).to_a\nend", "title": "" } ]
[ { "docid": "8a16e285030e39d9de2b78675c3877b8", "score": "0.70291156", "text": "def shuffle\n shuf = @nums.clone\n l = shuf.length\n (0...l).each do |i|\n rand = rand(i...l)\n shuf[i], shuf[rand] = shuf[rand], shuf[i]\n end\n shuf\n end", "title": "" }, { "docid": "...
a4ea5802725874edfda473a76a6a5795
Removes any nondigit character from the values of the given fields
[ { "docid": "721ce702930bdd362a88279b027c6d6b", "score": "0.740529", "text": "def digits(*fields)\n sanitize(*fields) { |value| value.to_s.gsub(/[^0-9]/, '') }\n end", "title": "" } ]
[ { "docid": "4eaa606503ababbbdfd23fc612d8d963", "score": "0.74061507", "text": "def strip_non_digits\n country_code.gsub!(/[^\\d]/, '') unless country_code.blank?\n local_number.gsub!(/[^\\d]/, '') unless local_number.blank?\n extension.gsub!(/[^\\d]/, '') unless extension.blank?\n end"...
cefaca99a11a4cefe622a41764733263
Executes a POST request. Used to create new resources.
[ { "docid": "31f6352f3764b1563d3c0ce97cf08b6a", "score": "0.0", "text": "def post(path, body = '', headers = {})\n req = Net::HTTP::Post.new(path, build_request_headers(headers, :post, self.site.merge(path)))\n req.body = body.to_s\n with_auth { request(:post, path, req) }\n end", "...
[ { "docid": "c840df2b574d7e45c9a87240d8f7c240", "score": "0.8061517", "text": "def post\n resource.post(request, response)\n end", "title": "" }, { "docid": "c840df2b574d7e45c9a87240d8f7c240", "score": "0.8061517", "text": "def post\n resource.post(request, response)\n ...
a5253dfa6f08022d551d3fa77c4d8bb2
GET /expressions/new GET /expressions/new.json
[ { "docid": "5e94c0c4eabc8af45ed638ca9688e1d5", "score": "0.64938647", "text": "def new\n @expression = Expression.new\n @expression.manifestation_url = params[:manifestation_url]\n @work = Work.find(params[:work_id]) if params[:work_id]\n unless @work\n flash[:notice] = \"You should spe...
[ { "docid": "d2b854c30223e159b0a4e3cb21585dc8", "score": "0.7442966", "text": "def new\n @eq = Eq.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @eq }\n end\n end", "title": "" }, { "docid": "568e424df9717de8283a346bcee59ad7", ...
bff2cc92290c9c3bb4ebfa149030066a
Get files for specific dirs
[ { "docid": "ad20a5a61ac9055c76c35721b3256641", "score": "0.66336346", "text": "def file_list\n return Dir[File.join(@dir, '**', FILE_EXT)]\nend", "title": "" } ]
[ { "docid": "009bfece0818ed90e5e2dba88a4352ef", "score": "0.7447845", "text": "def files(dir)\n entries(dir).select do |entry|\n siba_file.file_file?(File.join(dir,entry))\n end\n end", "title": "" }, { "docid": "c0afa0e43ccfcce84658dc9fe2f801ea", "score": "0.7...
26b616eef2a492bca98c6f0fa7fff5ba
helper method turning array into string
[ { "docid": "2cdc3f24ea208c4250a195794a174863", "score": "0.0", "text": "def css_string(css)\n return css unless css.is_a?(Array)\n css.flatten.compact.uniq.join(' ')\n end", "title": "" } ]
[ { "docid": "a4d81ff430a3d2ebd0b6258a09f7a70d", "score": "0.8584371", "text": "def array_to_string(arr)\n arr.join(', ')\n end", "title": "" }, { "docid": "d86bd889590ba6e3884b8ca24047c315", "score": "0.8483832", "text": "def convert_array_to_str(arr)\n return '' unl...
506e5b55819c3181cb064ec36684c776
Takes a given block of XML, loops through and converts it to JSON. If it finds a bit of XML with children it needs to delve further into it'll call itself and keep doing that until it reaches the fartherest branches of the tree
[ { "docid": "4039b5dad5af80e5f805842baaf105fb", "score": "0.6272927", "text": "def convertXML(xml)\n\t\n\t# Start up the JSON string we'll eventually return\n\tjson = \"{\"\n\t\n\t# Start the loop\n\txml.search(\"/\").each do |element|\n\t\t\n\t\t# Only get elements, not text or comments\n\t\tif (element...
[ { "docid": "110b79e4e80f8056dd25d2c40484c36b", "score": "0.60311127", "text": "def process_child_nodes(node); end", "title": "" }, { "docid": "3f86c666b19993a18c4d5e1478c242a7", "score": "0.58890325", "text": "def recursive_each_with_height element, depth, block\n block.call eleme...
f0e15cafebcb7c15f782a509bd7c2a1b
Read stdin into array
[ { "docid": "2feb46530d38931e1f7ca67064dfc49d", "score": "0.8024403", "text": "def readData\n result = []\n while $stdin.gets\n result << $_.chomp\n end\n result\n end", "title": "" } ]
[ { "docid": "7b2223f36f9ce30ba1d786672f570c54", "score": "0.71824735", "text": "def readArray anArray\n\tfor i in 1..anArray.size\n\t\tanArray[i] = gets.to_i\n\tend\nend", "title": "" }, { "docid": "9bcb21742fdd1f2d45d64b36f6a54691", "score": "0.70260334", "text": "def read_stdin\n ...
2234287df96457d75827edbfb5384d5e
Method to convert time zones
[ { "docid": "652136acc35170ae48481e7fc330c6cf", "score": "0.0", "text": "def convert_local_time_to_eastern_timezone(time)\n # Reach through hearing_day for the regional_office timezone\n ro_timezone = if hearing_day.central_office?\n \"America/New_York\"\n ...
[ { "docid": "6121d07943e7f0e03e23e0c93f227c8c", "score": "0.7018747", "text": "def convert_timezone(time, to_timezone, from_timezone, **options)\n converted_time = time + timezone_difference_in_seconds(to_timezone, from_timezone)\n timezone_with_offset(converted_time, to_timezone, options[:...
a3aae82119d0f9cd02182e2791aa8a64
================================================================================= Test if the proces s exists Params: +pid+:: pid of the process
[ { "docid": "f306e4ba7295b8eef39c3b88a972eb9e", "score": "0.7601906", "text": "def process_exists? pid\n Process.kill 0, pid\n true\n rescue Errno::ESRCH\n false\n end", "title": "" } ]
[ { "docid": "fa4829457a49e6c2bd34671842005abf", "score": "0.7875674", "text": "def process_exists?(pid)\n @functions[__method__] ||= AU3_Function.new(\"ProcessExists\", 'S', 'L')\n pid = @functions[__method__].call(pid.to_s.wide)\n pid > 0 && pid\n end", "title": "" }, { "do...
9e63ed48638243f2a7b6b6edd09bd8b4
Sets the defenderFileExtensionsToExclude property value. File extensions to exclude from scans and real time protection.
[ { "docid": "6fa79a51848b72c89fd83e4df78b14ab", "score": "0.8670244", "text": "def defender_file_extensions_to_exclude=(value)\n @defender_file_extensions_to_exclude = value\n end", "title": "" } ]
[ { "docid": "5248ec2869811a2d7fb9e8ede311ddc4", "score": "0.822832", "text": "def defender_file_extensions_to_exclude\n return @defender_file_extensions_to_exclude\n end", "title": "" }, { "docid": "47d21a817abb807363f1344c7f926159", "score": "0.70121104", "t...
90070db82e3a196f2680bac54b9c7556
POST /teachers POST /teachers.json
[ { "docid": "f37f5e1c3a0da34e2e7f1132831d78ef", "score": "0.57147187", "text": "def create\n @teacher = Teacher.new(teacher_params)\n\n respond_to do |format|\n if @teacher.save\n format.html { redirect_to @teacher, notice: 'Teacher was successfully created.' }\n format.json { re...
[ { "docid": "8266b74ca9fcd09b93dc9b4e6b2ac662", "score": "0.67803234", "text": "def teachers()\n require_authentication!\n options = make_options(\"getTeachers\")\n response = self.class.post(\"/WebUntis/jsonrpc.do;jsessionid=#{@session_id}?school=#{@school}\", options)\n raise response[\"err...
c9ab6d584df13d64d327665f45164b9d
calculate the total weight of all users loads sets laundry to this total using default accessor landry=
[ { "docid": "d28768c7f4f9202bb7f6f6e2fc1634e3", "score": "0.7160685", "text": "def laundry\n laundry = loads.pluck(:weight).sum\n end", "title": "" } ]
[ { "docid": "37df1e3f287287e76bb6ba6dea438efb", "score": "0.696182", "text": "def total_lifter_liftable_weight\n lifter_liftable_weight = 0\n #get lifters\n self.lifters.each do |l|\n #add all of their weight\n lifter_liftable_weight += l.lift_total\n end\n lifter_liftable_weight...