query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "bf4007d085a7a2cabbde709ad7071652", "score": "0.0", "text": "def jenis_penyakit_params\n params.require(:jenis_penyakit).permit(:nama)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7497801", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6957249", "text": "def strong_params\n params.require(:request).permit(param_white...
7527c295c7651d34f249900e322b0af3
Returns an Array of String representing the Kernel names inside the Program
[ { "docid": "ff332a5f730ddbdc558a4dba1a6418dc", "score": "0.8383671", "text": "def kernel_names\n if context.platform.version_number < 1.2 then\n return kernels.collect(&:name)\n else\n kernel_names_size = MemoryPointer::new( :size_t )\n error = OpenCL.clGetProgra...
[ { "docid": "750f3b1e8c1e787a540ffe2cdc88acb8", "score": "0.7035176", "text": "def names\n fs = []\n %w( KERNEL NATIVE_KERNEL ).each { |f|\n fs.push(f) if self.include?( self.class.const_get(f) )\n }\n return fs\n end", "title": "" }, { "docid": "f7a4...
1dd30ee48630e44a9f4d3e3780f6e559
Sets the `remove_url` value for the given facet and value.
[ { "docid": "ac4be1e9cabd719bdae48da42a225009", "score": "0.8860375", "text": "def set_facet_remove_url(field, value, url)\n facet = facet_for_field(field)\n if facet != nil\n facet.set_remove_url_for(value, url)\n end\n end", "title": "" } ]
[ { "docid": "bded99f5815d6cac6f24dcf245432240", "score": "0.72485995", "text": "def remove_url=(value)\n @remove_url = value\n end", "title": "" }, { "docid": "3401ecc0ad08c1302708154e32840373", "score": "0.673423", "text": "def remove_company_url(value)\n ...
c254cfa9122b960c604a18922e6943ce
set swtk app locale, so can get the suitable labels
[ { "docid": "03156adf033448d0767309a12ffb0341", "score": "0.69666827", "text": "def set_locale\r\n I18n.locale = extract_locale_from_request\r\n end", "title": "" } ]
[ { "docid": "35827f6b29aea1a214f364a8669cb22e", "score": "0.7949633", "text": "def set_locale\n end", "title": "" }, { "docid": "c5316c393421155dcb3119d6aa255906", "score": "0.74548596", "text": "def apply_locale; end", "title": "" }, { "docid": "00a0b393e5a471c10219fc8f1...
81d843d61af08f5a3bd21fbdb6d8a9c7
def select result = []
[ { "docid": "47f5bd6f6acbc03f30c55c6862ef5495", "score": "0.0", "text": "def select\r\n list = TodoList.new(title)# title is getter method?\r\n each do |todo|\r\n list.add(todo) if yield(todo)# calls #add which appends todo object to @todos(inst var for list)\r\n end\r\n list# returning ...
[ { "docid": "a818e08d8ec1a6ebfc67820064a74914", "score": "0.7501203", "text": "def select_result(results)\n results\n end", "title": "" }, { "docid": "435ec51293e0f5fc7b9e081e4382879f", "score": "0.74077", "text": "def select; end", "title": "" }, { "docid": "1387f...
6ffa9a508592c258648442aa95dd8384
TODO remove unixy deps in gwt shell, compile, and rake
[ { "docid": "2290e832b0549412bb7ed77d4fbe8174", "score": "0.57437515", "text": "def initialize(*runtime_args)\n super(*runtime_args)\n @gwt_client = GwtOnRails::Client.new name\n @gwt_home = args[0]\n @gwt_package = gwt_client.package\n @gwt_entry_point_package = gwt_client.entry_point_pac...
[ { "docid": "3160b982cd1ec19f5813e8dd13f7dcee", "score": "0.638188", "text": "def pre_build\n puts \"pre_build dir=#{`pwd`}\"\n rbvt = RUBY_V\n rbvm = RUBY_V[/^\\d+\\.\\d+/]\n # remove leftovers from previous rake.\n rm_rf \"#{TGT_DIR}/lib\"\n rm_rf \"#{TGT_DIR}/etc\"\n rm_rf \"#{TGT...
a94ab73f8825644966eea48cd17d0d13
GET /watched_movies/1 GET /watched_movies/1.json
[ { "docid": "770fee270da46da20160f4f11d320b9b", "score": "0.7708592", "text": "def show\n @watched_movie = WatchedMovie.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @watched_movie }\n end\n end", "title": "" } ]
[ { "docid": "7c4f7983064e1ac39055c6b362f339d9", "score": "0.76034105", "text": "def watching\n Birdman::Requester.get(\"movies/#{id}/watching\")\n end", "title": "" }, { "docid": "47f76e7086051f39da260d8264bec13a", "score": "0.73207384", "text": "def movies\n get('Movies')\n ...
c41bf37c8473a75f33e3f059f02ed4dd
Locates the service corresponding to the given path.
[ { "docid": "980cb892fbed8b82404a0b198dd93a6e", "score": "0.0", "text": "def service(path)\n if path.nil? || path == ''\n return self\n end\n raise Error.new(\"The path \\\"#{path}\\\" doesn't correspond to any service\")\n end", "title": "" } ]
[ { "docid": "e8e807e295b3bc4c300490e3f7c21425", "score": "0.72740424", "text": "def service(path)\n if path.nil? || path == ''\n return self\n end\n index = path.index('/')\n if index.nil?\n return operating_system_service(path)\n end\n return operating_system_...
3a5dbe98ddad93324c1042afab969fb6
Majority class of a list of classes. If more than one class has the same number of individuals, one of the majority classes is selected randomly.
[ { "docid": "dab73ec0efbcfd7fe26696489cca2f3e", "score": "0.83804536", "text": "def majority_class_in_list(list, classes)\n sizes = classes.map{|c| list.count{|i| i == c}}\n Hash[classes.zip sizes].keep_if{|k,v| v == sizes.max}.keys.sample\n end", "title": "" } ]
[ { "docid": "1a2fd23cc7b9dc950cf36fbf72b399e6", "score": "0.7600592", "text": "def majority_class(ids, value_table, classes)\n sizes = class_sizes(ids, value_table, classes)\n Hash[classes.zip sizes].keep_if{|k,v| v == sizes.max}.keys.sample\n end", "title": "" }, { "docid"...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "771628543857113c05f02be256e4cff7", "score": "0.0", "text": "def set_foo35\n @foo35 = Foo35.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...
158ff23e14162605ec0f1662858a3c7a
Get a list of all the memberships that a specific lifter has
[ { "docid": "48e77fe1e0443450425a413817321b02", "score": "0.6672591", "text": "def all_memberships\n Membership.all.select {|member_info| member_info.member_name == self}\n end", "title": "" } ]
[ { "docid": "8e2b6317b1d23e77215bd38f7734d1eb", "score": "0.7948854", "text": "def lifter_memberships\n Membership.all.select {|membership| membership.lifter == self}\n end", "title": "" }, { "docid": "26efa77fdd1e01b004ee63676445575d", "score": "0.77515817", "text": "def membersh...
6ec5de0d8b7b643219b4d696cdf8df1e
pulls ResourcePath objects out of the file
[ { "docid": "42f47c5583320e6a542fc06b6459942d", "score": "0.6415997", "text": "def resource_paths\n if @resource_paths.nil?\n paths_by_path = {}\n lines.each do |line|\n path_name = ResourcePath.path_from(line)\n paths_by_path[path_name] ||= ResourcePath.new(path_name...
[ { "docid": "a425351210b87f15c2278a0f1b2ca948", "score": "0.6701425", "text": "def resources(path)\n res_path = File.join(fs_path(path), ResourceNode::PATHNAME)\n return [] if (! File.exist? res_path) or (! File.directory? res_path)\n Find.find(res_path).reject { |f| File.directory? ...
6e609ce058a8fbf1c24d270950969b6f
main is the main entry point to this script
[ { "docid": "fb5ad3e7f9a179024e2121d37db99a0f", "score": "0.0", "text": "def main\n # default to help if there isn't anything passed in\n ARGV << '-h' if ARGV.empty?\n options = {}\n op = OptionParser.new do |opts|\n opts.on(\"-u\", \"--user [USERNAME]\", String, \"User to authenticate...
[ { "docid": "e95cfad9c46711f2a05857f5bcaad7b7", "score": "0.8428899", "text": "def main\n\n end", "title": "" }, { "docid": "e95cfad9c46711f2a05857f5bcaad7b7", "score": "0.8428899", "text": "def main\n\n end", "title": "" }, { "docid": "efa7967c369e2852cbce412d93...
e29056fa9bfec8854ea6a676377a987c
Compares the receiver against another object.
[ { "docid": "e9525de570c735c08dd04c89cabe5b81", "score": "0.0", "text": "def <=>(other)\n if other.instance_of? self.class\n return self.filesize <=> other.filesize\n elsif other.instance_of? Fixnum or other.instance_of? Integer or other.instance_of? Float\n return self.filesize <=> other...
[ { "docid": "4a2d15ab25abe56f8fd6a288f0e27276", "score": "0.6867949", "text": "def compare(other)\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "5b93dc4e06a75e4868b0ad50cc8212ae", "score": "0.681021", "text": "def == other\n ...
8a8a56f089dba5044dbacfbca910a187
Executes a request simulating POST HTTP method and set/volley the response
[ { "docid": "571907261eec185afccde9a204e3eb01", "score": "0.0", "text": "def post(action, parameters = nil, session = nil, flash = nil)\n process_action(action, parameters, session, flash, 'POST')\n end", "title": "" } ]
[ { "docid": "c840df2b574d7e45c9a87240d8f7c240", "score": "0.70595974", "text": "def post\n resource.post(request, response)\n end", "title": "" }, { "docid": "c840df2b574d7e45c9a87240d8f7c240", "score": "0.70595974", "text": "def post\n resource.post(request, response)\n ...
2bac991535b1de1ab2de09e3b003b98d
Show Graph for sensors
[ { "docid": "dc0db4a53aebcb86fb71376f3562bd8d", "score": "0.65160173", "text": "def graph\n @sensor = Sensor.friendly.find(params[:sensor_id])\n @tank = @user.tanks.find(params[:tank_id])\n end", "title": "" } ]
[ { "docid": "82791a4e1767f44c055c962d1a253e26", "score": "0.7084189", "text": "def show\n @values = @sensor.values\n end", "title": "" }, { "docid": "db89b569f970ab1e07189d9b670d0bb6", "score": "0.6680015", "text": "def show\n @sensors = @arduino.sensors\n end", "title": "...
fba388f5a9f208e0f53494743d683c0d
POST /fine_prints POST /fine_prints.json
[ { "docid": "a9f402c196c2d8990089a2ea074ca0b3", "score": "0.7081601", "text": "def create\n @fine_print = FinePrint.new(fine_print_params)\n\n respond_to do |format|\n if @fine_print.save\n format.html { redirect_to @fine_print, notice: 'Fine print was successfully created.' }\n ...
[ { "docid": "7c4bc283eac05950169de53b99f2883e", "score": "0.65465254", "text": "def fine_print\n response[\"finePrint\"]\n end", "title": "" }, { "docid": "2c7327cecfc3be796badbb68fb4ac4d2", "score": "0.59988016", "text": "def index\n @fine_prints = FinePrint.all\n end...
430cd8a9a90f756cc091c7e3b8203daf
% recvfrom_nonblock : (!FIXME) > !FIXME
[ { "docid": "9fd6514436987d6926c76eeb6394f305", "score": "0.87105596", "text": "def recvfrom_nonblock(*rest) end", "title": "" } ]
[ { "docid": "a642e8eee3c28a5d643b8eefb91ec290", "score": "0.74538577", "text": "def recvfrom_nonblock(maxlen)\n Socketry::UDP::Datagram.new(*@socket.recvfrom_nonblock(maxlen))\n rescue ::IO::WaitReadable\n :wait_readable\n rescue => ex\n # TODO: more specific exceptions\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "dfb48a0fe4f96d1fb139f5c9c1857e9f", "score": "0.0", "text": "def set_bar_code\n @bar_code = BarCode.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;...
cbcb7a7b500fc253031ca86cdab271cc
Execute Executes the supplied command over the SSH connection.
[ { "docid": "113507786928f345b0dcf37848869dee", "score": "0.7319195", "text": "def exec(command, options={})\n ssh.exec(command, options)\n end", "title": "" } ]
[ { "docid": "7c6717d00effee44d1d0c4de995c3d87", "score": "0.6813788", "text": "def execute_ssh_command(command)\n\t\tresult = ''\n\t\tNet::SSH.start(ip_string, settings.ssh[\"user\"]) do |ssh|\n\t\t\tresult = ssh.exec!(\"cmd /c #{command}\")\n\t\tend\n\t\tresult\n\tend", "title": "" }, { "doc...
d829234ca6953b02ce7e61490f42153f
GET /admin_categories GET /admin_categories.xml
[ { "docid": "5ebd53d80015f173adf2a85272020c21", "score": "0.0", "text": "def index\n @board = \"category\"\n @section = \"index\"\n @menu_on = \"category\" \n \n @categories = Category.all(:gubun => \"template\", :order => [ :priority ])\n \n if params[:level] !=nil and params[:lev...
[ { "docid": "efcb5e10780279c84a4be599091f0268", "score": "0.74558884", "text": "def categories\n call_api('/categories')\n end", "title": "" }, { "docid": "bd7f457291ea26e7a11c69e4c64b3fd9", "score": "0.7328956", "text": "def fetch_categories\n xml = \"Request categories.\"...
13b0b6ce15c8e8fb804c751b378b0391
regexp_generate generate a full length regexp including the arguments detection.
[ { "docid": "92770b3a48ec513715ca1fb2782d1ab8", "score": "0.7299752", "text": "def regexp_generate(source = false)\r\n if source\r\n pattern = SHADOWS_SOURCE_COMMENT_PATTERN\r\n trigger = SHADOWS_SOURCE_COMMENT_TRIGGER\r\n @@argument_indexes_source = []\r\n indexes = @@argument_ind...
[ { "docid": "ac560e087fcff2cce0689c269dd2e73f", "score": "0.7223934", "text": "def regexp_generate_short(regexp)\r\n string = regexp.inspect\r\n string = string.split('\\n')[0]\r\n string = string[1..string.size-2]\r\n return Regexp.new(string)\r\n end", "title": "" }, { "docid":...
acd336a546fc3605ff420849820a2d8b
returns a Fixnum between 0 and 0xFFFF or CharStream::EOF
[ { "docid": "d13b648337a257666d54f8b04d9208b4", "score": "0.0", "text": "def look_ahead(pos)\n offset = @index + pos - 1\n if @buffer.length < offset + 1\n char = @input.read(offset + 1 - @buffer.length)\n @buffer << char if not char.nil?\n e...
[ { "docid": "6a1a782c099c1d7d585c609c5813f01b", "score": "0.6460276", "text": "def get_int\n raise EOFError if @position + 4 > @size\n value = @response[@position, 4].unpack('N*').first\n @position += 4\n return value\n end", "title": "" }, { "docid": "fac3eb08766e18e63...
c70fffdf12d341bcf1b29d000c3702df
GET /events/1 GET /events/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "2d5580b43c7c18bcd8a06713fa4be0f1", "score": "0.75921804", "text": "def show\n\t\tevent_id = params[:id]\n\t\tif event_id.present?\n\t\t\t@event = Com::Nbos::Events::Event.active_events.where(:id => event_id)\n\t\t\trender :json => @event\n\t\telse\n\t\t\trender :json => {status: 400, message...
c86d8239e91bdb70e20ec039231633ec
Marshal dump the user store to the disk
[ { "docid": "4f402a31707ada7a69cbe1b3ae138756", "score": "0.7941337", "text": "def save_store\n File.open('./dump.dat', 'w') { |f| f.print Marshal.dump(@user_store) }\n end", "title": "" } ]
[ { "docid": "3567f7b7ee6d5a074ebdcd0d07c26ec6", "score": "0.6777411", "text": "def saveDataToDisk\n # Save the values of each input\n #[:inPeakUsage, :offPeakUsage, :inPeakAllowance,\n # :offPeakAllowance, :daysLeft, :lastUpdate].each do |attr|\n # self.user.send(attr, self.instance_variabl...
3af3325bfb065467fba342606b540d79
Performs the `LABEL_DETECTION` feature on the image and returns only the first result.
[ { "docid": "b465dbdcc94e6ec23876be91857cb556", "score": "0.5693581", "text": "def label\n labels(1).first\n end", "title": "" } ]
[ { "docid": "76904ac4246ae4ca97ebc33fb358ece0", "score": "0.7184692", "text": "def queryLabels(_request, _response,image)\n call_features=[{\n type: 'LABEL_DETECTION',\n maxResults: 1\n }]\n results=apiRequest(image,call_features)\n _response.status = 200\n _response['Content-Type'] = 'applica...
77cf3fece958d7b16fe37866de7374c7
PUT /news/1 PUT /news/1.json
[ { "docid": "7972c2cdfe1d5c1a5de3af6cd29a8fc3", "score": "0.6456605", "text": "def update\n \n params[:news][:category_news_id] = params[:category]\n @news = News.find(params[:id])\n\n respond_to do |format|\n if @news.update_attributes(params[:news])\n format.html { redirect_to n...
[ { "docid": "96a5810ef4c06e38aeca74b00d877ff2", "score": "0.7179396", "text": "def update\n if @news.update_attributes(news_params)\n render json: @news, status: :ok\n else\n render json: {message: \"Not found\"}, status: :not_found\n end\n end", "title": "" }, { "docid": ...
dd424794b57e885521e52fdd40801468
POST /comments POST /comments.json
[ { "docid": "7a42533cfa71653b98f410a486db435f", "score": "0.0", "text": "def create\n @comment = Comment.create(comment_params)\n respond_to do |format|\n if @comment.save\n format.html { redirect_to @comment.product, notice: 'Comment was successfully created.' }\n format.json { ...
[ { "docid": "7b0a68ee4df9cfc8f7cc619d01d2577d", "score": "0.7546402", "text": "def create\n @comment = @post.comments.create!(comment_params)\n json_response(@comment, :created)\n end", "title": "" }, { "docid": "278b898b0e96dc8518cb54546e69f368", "score": "0.7375142", "t...
b5c2a980460bde997ba074d5542bb10a
Delete Meeting Recordings Delete all recording files of a meeting. Scopes: `recording:write:admin` `recording:write` Prerequisites: Cloud Recording should be enabled on the user's account.
[ { "docid": "96dd0f5054ce3816ec85bca5c87b2db9", "score": "0.7075972", "text": "def recording_delete(meeting_id, opts = {})\n recording_delete_with_http_info(meeting_id, opts)\n nil\n end", "title": "" } ]
[ { "docid": "344db3a0b9a18e7488a3d455fa58322f", "score": "0.66563255", "text": "def recording_delete_one(meeting_id, recording_id, opts = {})\n recording_delete_one_with_http_info(meeting_id, recording_id, opts)\n nil\n end", "title": "" }, { "docid": "80c6b784facabb45da76b5a18bd...
10bc77083a9bcab9ce81a3d55c02939a
Redirect to FRONT_END_BASE_URL on confirmation
[ { "docid": "70218e19333302085c847cad612e210d", "score": "0.6918364", "text": "def after_confirmation_path_for(resource_name, resource)\n\t\tENV[\"FRONT_END_BASE_URL\"] + 'auth/login'\n\tend", "title": "" } ]
[ { "docid": "7b83857ff39016f9f5ed894bd98c178e", "score": "0.76068693", "text": "def after_confirmation_path_for\n apply_mode = 'https://toolbox-dp.herokuapp.com/'\n redirect_to apply_mode, confirm: 'You are being redirected to an external site.'\n end", "title": "" }, { ...
3d2c4be8dea0dad09ca6141f0c3e2d63
POST /post133s POST /post133s.xml
[ { "docid": "eee3ac30af938b4f45f82ee5c13e913d", "score": "0.6431524", "text": "def create\n @post133 = Post133.new(params[:post133])\n\n respond_to do |format|\n if @post133.save\n format.html { redirect_to(@post133, :notice => 'Post133 was successfully created.') }\n format.xml ...
[ { "docid": "fa8fcc23911ab0c33dc007eceacc29f5", "score": "0.6296307", "text": "def post(uri, xml)\r\n req = Net::HTTP::Post.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end", "title": "" }, { "docid": "c78e0b38d566040b...
654b3e5d83d2e188ab12aa94111db280
get all Employee Leave from database and update its leave_count to max_leave count of employeeLeaveType
[ { "docid": "f4205361dc68be01a689b3ca826272f6", "score": "0.6781911", "text": "def update_employee_leave_reset_all\n @leave_count ||= EmployeeLeave.all\n f = EmployeeLeave.leave_reset(@leave_count)\n flash[:notice] = 'Leave count reset successful for all employees' if f == 1\n end", "title"...
[ { "docid": "bd84b2e4aac1f8a25ec23e44b359badb", "score": "0.7303927", "text": "def leave_reset(emp)\n leave_count = EmployeeLeave.where(employee_id: emp.id)\n leave_count.each do |e|\n leave_type = EmployeeLeaveType.find_by_id(e.employee_leave_type_id)\n default_leave_count = leave_type.m...
c62d7d32fead8941eb10ab2a32e2b104
POST /trainruns POST /trainruns.json
[ { "docid": "f32d7461e31e935bf86191b6145ce01a", "score": "0.7130658", "text": "def create\n @trainrun = Trainrun.new(trainrun_params)\n\n respond_to do |format|\n if @trainrun.save\n format.html { redirect_to @trainrun, notice: 'Trainrun was successfully created.' }\n format.json...
[ { "docid": "4d56a65c15364e979cafb206d4e230d6", "score": "0.7018824", "text": "def training_runs\n ensure_full_data!\n Array @gapi_json[:trainingRuns]\n end", "title": "" }, { "docid": "54bd7c018a96d8e71721c93568b2b170", "score": "0.69264346", "text": "def tra...
ef87685d289670a61456720d25782432
Public: validate video's length has at least 10 seconds otherwise, it is likely a error submission Returns true if length > 10s.
[ { "docid": "e9d57c6efcceb7eedde51b135d071df5", "score": "0.7917808", "text": "def length?\n video_length > 10.0\n end", "title": "" } ]
[ { "docid": "cadf7d8570354bbbeefe467feb1ff217", "score": "0.70742697", "text": "def check_song_length\n if self.length > 10 then\n self.errors.add(:length, \"is longer than 10 minutes...Calm down Free Bird.\")\n elsif self.length < 1 then\n self.errors.add(:length, \"is shorter than 1 min...
82246652f790967de14aeec863fd1897
Adds a new WorkbookView
[ { "docid": "c56442e7f88be4a739ff4093b6a3b24c", "score": "0.86403257", "text": "def add_view(options = {})\n views << WorkbookView.new(options)\n end", "title": "" } ]
[ { "docid": "6de4f9f70dfd2576d290b6df1a6c312a", "score": "0.6041266", "text": "def views\n @views ||= WorkbookViews.new\n end", "title": "" }, { "docid": "6437804f011f94ef0ac0a9c29ad63b66", "score": "0.56155604", "text": "def add_view\n super\n end", "title": "" ...
917e8256a3dc7e45882e4318494fb804
Asserts that `hub` will run a specific git command based on certain input. e.g. assert_command "clone git/hub", "git clone git://github.com/git/hub.git" Here we are saying that this: $ hub clone git/hub Should in turn execute this: $ git clone git://github.com/git/hub.git
[ { "docid": "f61fb38d4d51124af975fcd7ffd04d60", "score": "0.7300738", "text": "def assert_command(input, expected)\n assert_equal expected, Hub(input).command\n end", "title": "" } ]
[ { "docid": "f93a51f2763a4bd8dd04b3bb5f2694a1", "score": "0.66968566", "text": "def assert_command_output expected, command\n actual = `#{command}`.strip\n assert_equal expected, actual\nend", "title": "" }, { "docid": "841794abce8962227dd1f81a77ad16de", "score": "0.66357905", "text...
ac9232c0a7b9b23c08c696d8a6de8f17
DELETE /pins/1 DELETE /pins/1.json
[ { "docid": "ef5de8ec8d417b8a0e26d86235f51bf4", "score": "0.6582882", "text": "def destroy\n @sneaker.destroy\n Sneaker.reindex\n respond_to do |format|\n format.html { redirect_to sneaker_url, notice: 'Pin was successfully destroyed.' }\n format.json { head :no_content }\n end\n ...
[ { "docid": "e224b4446639064141c3a2c8ce4624bd", "score": "0.7710341", "text": "def destroy\n @pin = Pin.find(params[:id])\n @pin.destroy\n\n respond_to do |format|\n format.html { redirect_to allpins_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { ...
f98fe8c92bd9a2aadeedaa6910ef70a9
children Get the list of children for this node as a NodeSet
[ { "docid": "6bfee84fb022d90fb04d9103353531fb", "score": "0.7189789", "text": "def children()\n #This is a stub, used for indexing\n end", "title": "" } ]
[ { "docid": "b26b813a2c26324dd445c938347cb07d", "score": "0.86743635", "text": "def children\n return @children ||= NodeSet.new([], self)\n end", "title": "" }, { "docid": "75142c78fe6c86eaeefd4b84446d6ef1", "score": "0.86062485", "text": "def children\n @children...
0bd80f3829cab79ab94e450c21bea15b
Whether or not the Request uses the CONNECT Method
[ { "docid": "bae6942db3e8aa00e725016b2a49aef2", "score": "0.7848024", "text": "def connect?\n method == 'CONNECT'\n end", "title": "" } ]
[ { "docid": "f81e300d00dffc8033696858c5acd3ff", "score": "0.78857905", "text": "def connect?\n method == \"CONNECT\"\n end", "title": "" }, { "docid": "09c3a56fe23bff82037495d21396668f", "score": "0.78268766", "text": "def connect?\n method == CONNECT_METHOD\n end", ...
669b4080b6db84c895577491c7de6600
Default method, subclasses must override this
[ { "docid": "e59da6da39670673c3c07abea8356282", "score": "0.0", "text": "def run\n super\n\n #require_enrichment\n\n uri = _get_entity_name\n\n # request 1\n endpoint = \"#{uri}/wp-content/plugins/wp-file-manager/lib/php/connector.minimal.php\"\n\n headers = {\n \"Use...
[ { "docid": "2290804b238fc95bfd6b38f87c6d2895", "score": "0.77684987", "text": "def override; end", "title": "" }, { "docid": "c294800a6c72a962070b4ca27d34a2fc", "score": "0.7488381", "text": "def default()\n #This is a stub, used for indexing\n end", "ti...
08dafd86b9f4e469896b4b935693533f
ItemFilter with healing mode with null value
[ { "docid": "5125274ef14435256664100f37f56028", "score": "0.71133196", "text": "def test_healingItemNullValue\n f = ItemFilter.new(\"healing\")\n new_list = @usableItems.find_all{|x| f.apply(x)}\n return new_list.size == 0\n end", "title": "" } ]
[ { "docid": "83c5b4fa3d7debea28a3f41cb44d2ffa", "score": "0.6632027", "text": "def test_growthItemNullValue\n f = ItemFilter.new(\"growth\")\n new_list = @usableItems.find_all{|x| f.apply(x)}\n return new_list.size == 0\n end", "title": "" }, { "docid": "df4025f0fbbf416e5f1e37d0622a...
3c644bbe0c587c533a1bf67a2f61d8df
shoot a bullet <<<<<<add special bullets for n == 3 right click
[ { "docid": "eaccd21f95d2e633370a3941a47eef3e", "score": "0.77529556", "text": "def shoot(n)\n\t\t\tif n == 1\n\t\t\t\treturn Bullet.new(@x+24)\n\t\t\telse n == 3\n\t\t\t\tif Canvas.get.special > 0\n\t\t\t\t\tCanvas.get.shootspecial\n\t\t\t\t\treturn GreenBullet.new(@x + 24)\n\t\t\t\telse return Bullet.n...
[ { "docid": "52d06cae480d08941a689dcc60cf4484", "score": "0.6973972", "text": "def shoot()\n #this adda a new bullet object to the ships bullet array with the same position and velocity of the ship\n SoundManager.play(\"pew\")\n for i in 1..@shotCount\n @bullets.push(Bullet.new(Pos.new(@pos...
6afbef185a12e8ebbe928eaad49345f8
verify_library_exists method verifies the library selected exists +selected integer: identifies the library selected seleceted is an actual existing library that is returned credit kyle
[ { "docid": "a5997c7fc8662168a1d0260a66ca958a", "score": "0.85117126", "text": "def verify_library_exists(selected)\n\twhile Library.find_by_id(selected).nil?\n\t\tputs \"\\nNo libraries identified as entered\\n\"\n\t\tshow_all_libraries\n\t\tselected = make_selection.to_i\n\tend\n\tselected\nend", "...
[ { "docid": "c4fbb75239781ce09f1d150f90b33615", "score": "0.67485374", "text": "def check_book_availability_in_library\n\t\tputs \"To check availability of book,\"\n\t\tprint \" Enter Book Id :\"\n\t\ttarget_book_id=gets.to_i\n\t\tif is_book_exist_in_library?(target_book_id)\tthen\n\t\t\tif is_book_avail...
9aff45b39db5de224e0ace3244ffeb02
GET /reimbursement_timesheets/1 GET /reimbursement_timesheets/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "e0b38c5ecc170fe3f0f5d7d51bb2e31a", "score": "0.7542891", "text": "def index\n @reimbursement_timesheets = ReimbursementTimesheet.all\n end", "title": "" }, { "docid": "dc91354e291e73ff1f8fb5b1cfb10cb2", "score": "0.7172527", "text": "def index\n @time_sheets = @use...
59bcf91534e0e54caf87a76bd20024ef
basic check of the config
[ { "docid": "26a4a9d4bf421af8d48e95eecf2ae119", "score": "0.70309746", "text": "def valid_config\n success = false\n \n if $config['sonarr']\n if $config['sonarr']['enable']\n if $config['sonarr']['api_key'] =~ /\\w/ and $config['sonarr']['api_url'] =~ /\\w/\n success = true...
[ { "docid": "209996a3def32ebfb3a01ac2d7d9afb2", "score": "0.780086", "text": "def check\n if @config['name'].nil?\n Utils.fail('in your configuration file: no name given')\n end\n\n if @config['hosts']\n unless @config['hosts'].is_a? Array\n ...
fa34b3a7d52c5e7d4e6677788bd8ff31
Ensures a request is authentic, parses it into a params hash, and transforms it into a list of messages.
[ { "docid": "2395adb4414c2697cc144c8ea0d1477d", "score": "0.0", "text": "def process(raw)\n params = self.class.parse(raw)\n if valid?(params)\n transform(params)\n else\n raise ForgedRequest\n end\n end", "title": "" } ]
[ { "docid": "fe68e4194cddc1ea8fb41a66ad452724", "score": "0.68563735", "text": "def parse_request(env, path_params)\n validate_request!(env, path_params)\n parse_message_hash(env, path_params)\n end", "title": "" }, { "docid": "fe68e4194cddc1ea8fb41a66ad452724", "score"...
08b69110d54e606645913f8cb2c3d461
Uploads an iMessage screenshot
[ { "docid": "4a25c7323cfa162a5492c7c234c7265d", "score": "0.6992949", "text": "def upload_messages_screenshot(app_version, upload_image, device)\n raise \"app_version is required\" unless app_version\n raise \"upload_image is required\" unless upload_image\n raise \"device is required\" un...
[ { "docid": "4eb5174b2d0ec4bc6bae2f81c95aef6d", "score": "0.67917424", "text": "def post(message, link, img) end", "title": "" }, { "docid": "4eb5174b2d0ec4bc6bae2f81c95aef6d", "score": "0.67917424", "text": "def post(message, link, img) end", "title": "" }, { "docid": "65...
46bbc0cffd41803fb89eb2b9f0f2d0a1
We create a diff between the existing orig.tar.gz and the source directory to identify if there have been any updates Using 'diff' allows us to apply this test to all kind of packages
[ { "docid": "919ea66b281e212145a5213a1fa028b7", "score": "0.69055283", "text": "def package_updated?(pkg)\n # Find an existing orig.tar.gz in the build directory\n # ignoring the current version-timestamp\n orig_file_name = Dir.glob(\"#{debian_name(pkg)}*.orig...
[ { "docid": "5318b16e6292792e8f122c84a82b3909", "score": "0.6774501", "text": "def file_diff(package, from, to, file)\n ret = true\n Dir.mktmpdir {|tmpdir| \n files_found = system(\"cd #{tmpdir} && #{osc_cmd} co #{from} #{package} #{file} && mv #{file} #{file}.new && #{osc_cmd} co #{to} #{package} #...
0895c8d60dd5a5c4de24266c87addfc1
POST /rotating_images POST /rotating_images.json
[ { "docid": "20d96ad42424f537c17101261f432e0d", "score": "0.6995028", "text": "def create\n @rotating_image = RotatingImage.new(rotating_image_params)\n\n respond_to do |format|\n if @rotating_image.save\n format.html { redirect_to manager_rotating_images_path, notice: 'Rotating image w...
[ { "docid": "6e22f33d59d04176c4d75205c5aa7074", "score": "0.6975734", "text": "def create\n @rotating_image = RotatingImage.new(params[:rotating_image])\n\n respond_to do |format|\n if @rotating_image.save\n format.html { redirect_to @rotating_image, notice: 'Create rotating image was s...
5c8ad096da4c5ec5b44bd7f683d54eae
Checks if the transaction is locked.
[ { "docid": "a346fec93875ee33c66cdba2ad4f6764", "score": "0.73094416", "text": "def locked?\n locked\n end", "title": "" } ]
[ { "docid": "82d04e6017ea006ee4c174491fd0a0e7", "score": "0.8399597", "text": "def in_a_locked_transaction?\n !locks.blank?\n end", "title": "" }, { "docid": "2e4005f2a8e2db8fcf112e5d277e7638", "score": "0.8393512", "text": "def in_a_locked_transaction?\n !locks.nil...
a6705156d6e942b5ac70b79eaa39da43
Specifies the patterns that match hostnames to visit.
[ { "docid": "aa68f90581cebdeae4dc1b7ae25f7644", "score": "0.61256486", "text": "def visit_hosts\n @host_rules.accept\n end", "title": "" } ]
[ { "docid": "795387c6bcce9680a4c655136918cf96", "score": "0.75406367", "text": "def add_host_match_pattern(opts)\n opts = check_params(opts,[:patterns])\n super(opts)\n end", "title": "" }, { "docid": "11e90886285924f951b300c6273a3981", "score": "0.726832", "text": "def s...
8e79c6bf7138b6ba13a974cbfa536854
List all test users for the app.
[ { "docid": "b2f374c78634e1b3dfdf364f2f7e929b", "score": "0.70501804", "text": "def list(options = {})\n @api.graph_call(test_user_accounts_path, {}, \"get\", options)\n end", "title": "" } ]
[ { "docid": "b163e9f006a45d5848c7c53d982d7e5d", "score": "0.75282764", "text": "def list\n response = @client.get('users')\n verify response,\n forbidden: 'You do not have permission to view the list'\n end", "title": "" }, { "docid": "64a5fabad6696b9341c55818473e710c"...
3ff179e967bd7a7a42c644c8a115a190
Render an active/inactive navigation item for the given link path, title
[ { "docid": "9323a8ad789f152804d90bad2b4d2d0a", "score": "0.7119609", "text": "def site_page_navigation_item(text, path, link_html_opts={}, li_html_opts={})\n li_class = current_page?(path) ? \"active\" : \"\"\n content_tag :li, li_html_opts.merge(:class=>li_class) do\n link_to text.html_safe,...
[ { "docid": "27e4048544c0969dd190ae4fa3849cd4", "score": "0.7744877", "text": "def item title, link\n unless current_page? link\n content_tag :li, link_to(title, link)\n else\n content_tag(:li, :class => :active){\n content_tag :strong, title\n }\n end\n end", "title":...
d81b049951437fc5b2774792a8febbd6
Returns info for a given repository
[ { "docid": "3a110d12cf67a00ac8e19edddf6333d3", "score": "0.80299723", "text": "def get_repo_info(repo, type='g') \n\t\treturn self.fetch(\"repositories/#{type}/#{repo}\")\n\tend", "title": "" } ]
[ { "docid": "cf9ff1a18d7dbd25afd021512d1896e9", "score": "0.77896714", "text": "def get_repository_info(name)\n response = nexus.get(nexus_url(\"service/local/repositories/#{sanitize_for_id(name)}\"))\n case response.status\n when 200\n return response.content\n when 404\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "b5a5c696826aaa89cacfb362ae2aa5c1", "score": "0.0", "text": "def set_complaint\n @complaint = Complaint.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...
5ff9d4fb41018027672e56fff0300f81
POST /pesquisas POST /pesquisas.json
[ { "docid": "fd810cd20cedb73096d67a21a66daf71", "score": "0.59154487", "text": "def create\r\n @pesquisa = Pesquisa.new(pesquisa_params)\r\n\r\n respond_to do |format|\r\n if @pesquisa.save\r\n format.html { redirect_to @pesquisa, notice: 'Pesquisa was successfully created.' }\r\n ...
[ { "docid": "0b7c57f548cfb3f194b3adbddb980589", "score": "0.6695781", "text": "def create\n @requisicao = Requisicao.new(requisicao_params)\n\n respond_to do |format|\n if @requisicao.save\n format.html { redirect_to @requisicao, notice: 'Requisicao was successfully created.' }\n ...
ca0dfa5d10385fbd7de00db20c1dd311
Returns a Competitor, or raises an exception
[ { "docid": "600645432ded43289918e5a1aeac85a8", "score": "0.0", "text": "def find_by(bib_number:)\n registrant = Registrant.find_by!(bib_number: bib_number)\n registrant.competitors.find_by!(competition: competition)\n end", "title": "" } ]
[ { "docid": "160fb2fddf48a7e4437f64fc24038664", "score": "0.61093974", "text": "def competitor_result(competitor)\n raise StandardError.new(\"No Competitor Result Defined\")\n end", "title": "" }, { "docid": "8d5e5caf458e48a45c8c6868a7cc7936", "score": "0.54147243", "text": "def c...
1a7fbb5a5c45bd90cb8955e166264e70
rubocop:enable AbcSize Define path parameter with validation for all routes (including nested routes) param_validation :service_id, from_enum(%w[a b c])
[ { "docid": "39f1a64f97c13e6dc5f12bf80f4802cc", "score": "0.0", "text": "def param_validation(name, rule)\n Validate::Rules.validate_single_param_rule! rule\n (@param_validations ||= {})[name.to_sym] = rule\n end", "title": "" } ]
[ { "docid": "f46a086103a923c16a5b6e353b1d3fea", "score": "0.5801891", "text": "def route_params\n params.require(:route).permit(:service_name, :service_num, :origin, :destination, :total_seats, :duration, :bording_point, :dropping_point)\n end", "title": "" }, { "docid": "ce5001fa3ab4...
af26ea10a71ed019ef896b6376d64c72
GET /jjs GET /jjs.json
[ { "docid": "0e443f791596b4f41bb7b0ae23b82f34", "score": "0.68625015", "text": "def index\n @jjs = Jj.all\n end", "title": "" } ]
[ { "docid": "2b3f74d32b7eea28bc10cffe85ce0c72", "score": "0.6366367", "text": "def json_get\n @content_type = 'text/plain'\n @render_nothing = true\n @rendered_template = true\n @current_layout = nil\n write_json @note if @note\n render :nothing => true\n end", "title": "" }, {...
034721fcb8423d9ed0d1925491544da4
output: a 4 pointed diamond in an nxn grid rules: input always odd ds: string logic: first row: space space star space space spaces: 2 x 2 stars: 1 second row: space star star star space spaces: 1 x 2 stars: 3 third row: star star star star star spaces: 0 x 2 stars: 5 4th == 2nd 5th == 1st spaces starts at number/2 and...
[ { "docid": "32919a4bfe5d4b971b30a4cd714062c1", "score": "0.0", "text": "def build_starray(number)\n starray = []\n spaces = number / 2\n stars = 1\n\n (spaces + 1).times do\n space_string = ' ' * spaces\n star_string = '*' * stars\n starray << (space_string + star_string + space_string)\n ...
[ { "docid": "e6f0c655ee385218b61d569bce027f4c", "score": "0.7781746", "text": "def diamond(n)\n diamond_rows = []\n after_center = false\n stars = 1\n n.times do\n spaces = \" \" * ((n - stars)/2)\n diamond_rows << spaces + ('*' * stars) + spaces\n if after_center\n stars -= 2\n else...
18400516345dabf3548f7383a08f2081
DELETE /shells/1 DELETE /shells/1.json
[ { "docid": "d13bc54cd8e259efed18d6a3cad8b37e", "score": "0.7543606", "text": "def destroy\n @shell.destroy\n respond_to do |format|\n format.html { redirect_to shells_url, notice: 'Shell was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" ...
[ { "docid": "9a0b4c1125585f1f73b40c7d3bdce947", "score": "0.6955541", "text": "def destroy\n @shell_session = ShellSession.find(params[:id])\n @shell_session.destroy\n\n respond_to do |format|\n format.html { redirect_to shell_sessions_url }\n format.json { head :ok }\n end\n end",...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "8dc10f2d043e5408476c0da65495390d", "score": "0.0", "text": "def set_event\n puts \"set_event\"\n @event = Event.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...
b87976e0e140915d22278e4efdb80a11
reserve DOI in string format like "doi:xx.xxx/yyyyy" and return ID string after reserving it. I don't believe DataCite does the reserving thing like EZID, but this kept the interface consistent.
[ { "docid": "4f45e4f0f7f9d10d4e87eb06cf31ba79", "score": "0.7635785", "text": "def reserve_id(doi:)\n doi\n end", "title": "" } ]
[ { "docid": "8202ff3e124955c79a4923fd248a7bf6", "score": "0.7692883", "text": "def reserve_id(doi:)\n if id_exists?\n @resource.identifier.to_s\n else\n ezid_client.create_identifier(doi, status: 'reserved', profile: 'datacite')\n doi\n end\n end", ...
f43c911110a89cd2a74c11f94c8e490a
POST /name_records POST /name_records.xml
[ { "docid": "7917937da13bd51065c7b65a8bbbf800", "score": "0.6665399", "text": "def create\n @name_record = @domain.name_records.new(params[:name_record])\n\n respond_to do |format|\n if @name_record.save\n flash[:notice] = t('name_records.create.notice')\n format.html { redirect_...
[ { "docid": "085cf2cbbc5ace224c6a014feac8849f", "score": "0.5974111", "text": "def create(name=\"Default name\")\n xml_req =\n \"<?xml version='1.0' encoding='UTF-8'?>\n <customer>\n <name>#{name}</name>\n </customer>\"\n\n request = Net::HTTP::Post.new(@url)\n request.add_fiel...
a4f19e976403f0c6b99cfcab0bd54c6a
PATCH/PUT /chef_att_repositories/1 PATCH/PUT /chef_att_repositories/1.json
[ { "docid": "fa70a556988635bc50e17dc798ee8e6e", "score": "0.68077606", "text": "def update\n respond_to do |format|\n if @chef_att_repository.update(chef_att_repository_params)\n format.html { redirect_to @chef_att_repository, notice: 'Chef att repository was successfully updated.' }\n ...
[ { "docid": "3683b6c440447d1a4bd410ecdf1eda27", "score": "0.6537786", "text": "def update\n blacklist = [:pull_requests, :created_at, :updated_at]\n blacklist.each { |field| params[:repo].delete(field) }\n\n @repo = Repo.find(params[:id])\n\n respond_to do |format|\n if @repo.update_attr...
d0bf8def842cf2c9eea86467755650a1
Returns all resource actions
[ { "docid": "d0f157995ceb503aea937a234ff6c452", "score": "0.6884841", "text": "def set_resource_actions\n self.actions[:index] = Action.new(self.entity, :index, :collection, :resource => true)\n self.actions[:new] = Action.new(self.entity, :new, :collection, :resource => true)\n ...
[ { "docid": "b5255aea2cba9c23f9839ad7051cc3bd", "score": "0.84664994", "text": "def resource_actions\n return @resource_actions\n end", "title": "" }, { "docid": "b5255aea2cba9c23f9839ad7051cc3bd", "score": "0.84664994", "text": "def resource_actions\n ...
ce86eed889efd605f9f1d3ee4a5d480c
GET /items/1 GET /items/1.json
[ { "docid": "81fbb6f9be1c98dd95bbe62c3f2ce8d1", "score": "0.0", "text": "def show\n\n end", "title": "" } ]
[ { "docid": "41699dd17c12d7e8d1afd1406f087302", "score": "0.80987954", "text": "def item(id)\n get(\"/item/#{id}.json\")\n end", "title": "" }, { "docid": "eb354ffc8205e277e16c339add996ccd", "score": "0.74948645", "text": "def show\n item = Item.find(params[:id])\n render js...
6ae0eb804e351c15e30549971672da64
Events (overrides of AtX events)
[ { "docid": "0c23142a38b040122697d3f5511d7ed0", "score": "0.0", "text": "def goto_3\n #no-op\n end", "title": "" } ]
[ { "docid": "ff1cb32628977acc28cd1a7e6b85541e", "score": "0.75030416", "text": "def events; end", "title": "" }, { "docid": "ff1cb32628977acc28cd1a7e6b85541e", "score": "0.75030416", "text": "def events; end", "title": "" }, { "docid": "ff1cb32628977acc28cd1a7e6b85541e", ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "b13d78bdee9f23196bc955d5d1103ee8", "score": "0.0", "text": "def set_stream\n @stream = Stream.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60310596", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6014974", "text": "de...
d235d7d7838e63769acf4214caaf8f97
The values of the header must be Strings
[ { "docid": "65139ce29e00eeed34896550dec0a9e4", "score": "0.0", "text": "def test_integer_value\n server_run app: ->(env) { [200, {'Content-Length' => 500}, []] }\n data = send_http_and_read \"GET / HTTP/1.0\\r\\n\\r\\n\"\n\n assert_match(/HTTP\\/1.0 200 OK\\r\\nContent-Length: 500\\r\\n\\r\\n/,...
[ { "docid": "d88b3e28800ca43039b9045f2ed889bb", "score": "0.68304855", "text": "def header=(hdr)\n order_check(hdr)\n hdr.each {|s| raise \"Header must contain strings\" if ! s.kind_of? String }\n @header = hdr\n end", "title": "" }, { "docid": "b97d693fef5d89f06507c9d3d2ab5...
3feb97c42a3fcca479e5020828a5c99e
Pull feeling name, feeling, and dates history from tracker
[ { "docid": "a8ea3bc1ca21e70798b526d2e86bcc84", "score": "0.6699129", "text": "def pull_tracker(db)\n db.execute(\"SELECT tracker.first_name, tracker.last_name, feelings.feeling_name, tracker.enter_date FROM feelings JOIN tracker ON feeling_id = feelings.id;\")\nend", "title": "" } ]
[ { "docid": "1d58d51975fcbe88ff9a349657e8dd75", "score": "0.6430771", "text": "def tracker_history\n tracker_histories&.last\n end", "title": "" }, { "docid": "41ecf077c2083e76041e74233b55f419", "score": "0.64130646", "text": "def gather_history; end", "title": "" }, { ...
0c072b457de64c2f288cb5270a82a1a3
Attempt to process this payment
[ { "docid": "ceca861e18895fafc7f56b32261d6cde", "score": "0.7599909", "text": "def process!\n log_payment(\"Attempting to process payment: #{self}\")\n if valid?\n response = process_payment\n log_payment \"Processing - Received response: Success=#{response.success?} Auth=#{response.autho...
[ { "docid": "5082b3b826693edf9bc9d3c75cc444d2", "score": "0.77610105", "text": "def process\n\t\t\t@payment_gateway.process\n\t\tend", "title": "" }, { "docid": "6c1138baa3ceeb271cfe27a9bf5a4ced", "score": "0.7410656", "text": "def execute\n payment.compute_price and payment.save...
a27041ea7788f349d42cc525ee5589c3
Converts object to a hash. All keys will be symbolized.
[ { "docid": "5c56e2657e4555175668d7d985924549", "score": "0.0", "text": "def to_h\n { red: red, green: green, blue: blue, alpha: alpha, rgb: rgb,\n score: score, pixel_fraction: pixel_fraction }\n end", "title": "" } ]
[ { "docid": "9cad536333d06433fe5fddb3ad34b872", "score": "0.7571068", "text": "def symbolize_keys obj\n Colore::Utils.symbolize_keys obj\n end", "title": "" }, { "docid": "f2332ca6f8c2cf7ad3427cc0f21f72d3", "score": "0.73524207", "text": "def convert\n to_hash(@obj)\n ...
69a15a2d6d433baf2e641c0dad9d1dc1
Kill the TFTP server
[ { "docid": "33c69d4836bc2d6e11332cf99e02fa81", "score": "0.584502", "text": "def cleanup\n\t\t# Cleanup is called once for every single thread\n\t\tif @start_tftp\n\t\t\tif ::Thread.current == @main_thread\n\t\t\t\t# Wait 5 seconds for background transfers to complete\n\t\t\t\tprint_status(\"Providing s...
[ { "docid": "fede496142245943047dc638acf79602", "score": "0.705601", "text": "def kill_server\n if Lsof.running?(7125)\n Lsof.kill(7125)\n end\n end", "title": "" }, { "docid": "6d8ace9dd2f4e6fca26d9a9f734016a4", "score": "0.69315654", "text": "def stop_server\n ...
c43225c28ec94c71fe392a9fbc5c289b
Removes the local repo TODO: clear scratch dir as well
[ { "docid": "e136b81f6fa02ebaeb087d1c1883b30c", "score": "0.0", "text": "def rm\n path = @commander.path_for(:git)\n cmd \"rm -rf #{path}\" if block_given? ? yield(path) : true\n end", "title": "" } ]
[ { "docid": "7749c894f621a28b1741fa00965ccccf", "score": "0.84063154", "text": "def clean\n Dir.rmdir(options.local_repo_path)\n end", "title": "" }, { "docid": "6fa640d36a8087502b0bf4d09b48d3df", "score": "0.83190256", "text": "def delete_local_repository\n # TODO: bac...
0530ef625184cb33196c6b31236df0f7
DELETE /categories/1 DELETE /categories/1.json
[ { "docid": "8a03db493af923c4fb7e5aa9b8c71e6c", "score": "0.0", "text": "def destroy\n @category.destroy\n respond_to do |format|\n format.html do\n redirect_to categories_url,\n notice: 'Category was successfully destroyed.'\n end\n format.json { head :no_c...
[ { "docid": "4142e7c3e1be82e432fdf951ae5785eb", "score": "0.75578415", "text": "def destroy\n @data = @category.delete(params[:id])\n render json: @data\n end", "title": "" }, { "docid": "8e82257a38ec7abcdd74a59519238e96", "score": "0.75373495", "text": "def destroy\n Catego...
5d7e45f7769e8d860d54d074eb3bf57f
TODO: refactor this, inconsistent with other method
[ { "docid": "76ebd2a47ff2bfa03a0381aa5bdd2639", "score": "0.0", "text": "def print_spec(data)\n result = ''\n result << \"#{Emoji.trend(data[:change_amount].to_f)}\"\n result << \" $#{data[:amount]} #{data[:change_amount]} #{data[:change_percent]}\\n\"\n result << \"[dividend] $#{data[:d...
[ { "docid": "b6b2bcc0062aeb115edab7b10cbe6930", "score": "0.59988904", "text": "def desired; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.5950024", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",...
dd289b4e516c4245aeb38e06a66b1e4f
DELETE /constituencies/1 DELETE /constituencies/1.json
[ { "docid": "4517e7ab755a09427257e2ef9b3c29d5", "score": "0.7711277", "text": "def destroy\n @constituency = Constituency.find(params[:id])\n @constituency.destroy\n\n respond_to do |format|\n format.html { redirect_to constituencies_url }\n format.json { head :no_content }\n end\n ...
[ { "docid": "cf26b86c5e7bb7902428cb09c0762934", "score": "0.77004606", "text": "def destroy\n @constituency = Constituency.find(params[:id])\n @constituency.destroy\n\n respond_to do |format|\n format.html { redirect_to constituencies_url }\n format.json { head :ok }\n end\n end", ...
f5da4704f851b48b08808909bfbe9e90
TBD: Should be protected or folded into overridden new method?
[ { "docid": "e5b3727f450ef54e0f31bad83b0eb068", "score": "0.0", "text": "def template_vaccines\n case self.template\n when Templates[0] # U.S. CDC 2011\n return [ \n{ position: 1, name: 'Hepatitis B', short_name: 'HepB', doses_attributes: [\n{ months_scheduled_from_date_of_birth: 0, admini...
[ { "docid": "2290804b238fc95bfd6b38f87c6d2895", "score": "0.7905334", "text": "def override; end", "title": "" }, { "docid": "c3285b979f713395f60cf13edce8a310", "score": "0.7264124", "text": "def methodmissing; end", "title": "" }, { "docid": "e6431ff47476c9014fb64198d5853...
83bcce6016116a4dfe45a98597d2bd70
write comments into the file
[ { "docid": "7d455a9012db38a8b2689efc88c54e67", "score": "0.61585486", "text": "def add_comment(str)\n\t$file.puts \"% \" + str.gsub(/\\n/, \"\\n% \").gsub(/% \\n/, \"%\\n\")\nend", "title": "" } ]
[ { "docid": "935eb1ad3c1678ccd6786d8e512e0956", "score": "0.79709876", "text": "def write_comment(comment)\n end", "title": "" }, { "docid": "1f1fc269b6f073e831a18aea3680f231", "score": "0.7594559", "text": "def write_comment_block file, lines\r\n return unless @options[:write]\r\...
d4f0a59d1aaac0bf8dd9cac7d9f0f7cf
Returns list of servers
[ { "docid": "f44cdb39d26992f939947e1b1276fc18", "score": "0.0", "text": "def all(filters = {})\n data = service.list_servers.body['droplets']\n load(data)\n end", "title": "" } ]
[ { "docid": "261f064a62d585d0be8cad866fcae2ff", "score": "0.86506826", "text": "def get_servers\n puts \"Getting server list\"\n servers = @conn.list_servers\n\n for server in servers.body['servers']\n puts server\n end\n\n return servers.body['servers']\n end", "title": "" }, ...
736cc64107fc21c78fcfc1fa167527f4
GET /imports/1 GET /imports/1.json
[ { "docid": "6eb3ab344d73595cc4b9484db75be02f", "score": "0.66078144", "text": "def show\n @import = Import.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @import }\n end\n end", "title": "" } ]
[ { "docid": "9ccf5ff52f7d3394f7c87e8d67d6d34c", "score": "0.69221675", "text": "def index\n @imports = Import.all\n respond_to do |format|\n format.html\n format.json { render json: ImportsDatatable.new(view_context)}\n end\n end", "title": "" }, { "docid": "986fc55d979a9e...
1637353574f3b486733d06820e17a665
If this product is deleted, remove any recommendations that have it as the recommended product
[ { "docid": "79541f7222cfc99ba839e8531b18ac1f", "score": "0.87342876", "text": "def cleanup_recommendations\n if deleted?\n Spree::Recommendation.where(:recommended_product_id => self.id).destroy_all\n end\n end", "title": "" } ]
[ { "docid": "ce3983c713555aa3704a5a6ef8f8eb8a", "score": "0.6913342", "text": "def destroy\n @recommendation.destroy\n\n redirect_to user_recommendations_path\n end", "title": "" }, { "docid": "2f5b20cfcfe2419770aa12a3e4913369", "score": "0.6850212", "text": "def destroy\n @...
1b3fe5c4e49fecafb796f4ce685d3441
Builds the left side of the quilt
[ { "docid": "77df888dbf28f96f086c4deceb2d0fa0", "score": "0.58027905", "text": "def build_quilt\n\t\t# Output variables used\n\t\tputs \"\\nBuilding quilt...\"\n\t\tputs \"\\n-----------------------------------------\"\n\t\tputs \"Dimensions: #{@needed_columns} columns by #{@needed_rows} rows\"\n\t\tputs...
[ { "docid": "99a56b5a96211debc1bc4e04e5f0f521", "score": "0.6285784", "text": "def left; end", "title": "" }, { "docid": "99a56b5a96211debc1bc4e04e5f0f521", "score": "0.6285784", "text": "def left; end", "title": "" }, { "docid": "99a56b5a96211debc1bc4e04e5f0f521", "sc...
d9b4a1cbb6b121b1e30491692966a84f
Creates a new subscription for this customer
[ { "docid": "bc97be7d5c23b49cc800eab5d51015d0", "score": "0.73463297", "text": "def add_subscription(starts_at, product_code, bank_account_code, setup_fee=0, metadata=nil)\n params = {:starts_at => starts_at, :product_id => product_code, :debtor_bank_account_id => bank_account_code}\n params[:s...
[ { "docid": "be1d6e3a96731beee80854137dcfe8d4", "score": "0.81500584", "text": "def create_subscription\n subscription = nil\n stripe_call do\n local_plan = Plan.active.find(@params[:plan_id])\n return false if local_plan.nil?\n stripe_plan = Stripe::Plan.retrieve(local_plan.stripe_i...
a095de4a741aee933ec91e97036c72b6
Deep clone of the two dimensional matrix
[ { "docid": "8ebd140bb0d9b96dd00e68de430c5f83", "score": "0.82327884", "text": "def matrix_clone\n @matrix_clone ||= matrix.map { |row| row.clone }\n end", "title": "" } ]
[ { "docid": "563a4a873c0aea228498186b0ed316a1", "score": "0.85918707", "text": "def deep_copy\n return Matrix.new(\n @matrix.map{|row| row.map{|e| e.dup}},\n @rownames.map{|e| e.dup},\n @colnames.map{|e| e.dup}\n )\n ...
b5e920420a808675d4f795ecbe571641
Remove bogus :dc_creator values which are probably due to file metadata extraction where the "creator" is actually the creator of the PDF or Word document as opposed to the creator of the source creative work.
[ { "docid": "be53a173dbd74bd5d2691ecae25a12ea", "score": "0.5292728", "text": "def normalize_creator(value)\n if value.is_a?(Array)\n value.flat_map { |v| normalize_creator(v) }.compact.uniq\n else\n BOGUS_CREATOR.find do |match|\n return if match.is_a?(Regexp) ? (value =...
[ { "docid": "b16e1f81b287fb3605f40be69ddb3184", "score": "0.6355294", "text": "def clean_up_creators\n (creators || []).delete_if do |creator|\n %i[first_name last_name uni].all? { |k| creator[k].blank? }\n end\n end", "title": "" }, { "docid": "295308f660e210a181089a0bb3fb4cbf", ...
35335aa5b8bbc3908ac3442791346ee8
Build an instance of UserDefinedMessageInstance
[ { "docid": "b29a5b700f4e05f4af2a3b022f9dfbd9", "score": "0.77115875", "text": "def get_instance(payload)\n UserDefinedMessageInstance.new(@version, payload, account_sid: @solution[:account_sid], call_sid: @solution[:call_sid])\n end", "title": "" } ]
[ { "docid": "a4d8808fac9783abbc600c1944865172", "score": "0.76707834", "text": "def get_instance(payload)\n UserDefinedMessageInstance.new(\n @version,\n payload,\n account_sid: @solution[:account_sid],\n call_sid:...
6bb405b2d13d3d4d7ccf38c70ab2c5ec
PATCH/PUT /patient_records/1 PATCH/PUT /patient_records/1.json
[ { "docid": "ade087ccfbe7a7f4450c64a9ba5f9809", "score": "0.62685996", "text": "def update\n patient_record_params[\"cost_centerable_type\"] = patient_record_params[\"cost_centerable_id\"].split(';').first\n patient_record_params[\"cost_centerable_id\"] = patient_record_params[\"cost_centerable_id\...
[ { "docid": "3cfe273de9488f6a6df534c11225e250", "score": "0.6996315", "text": "def update_patient\n data = get_data\n data.each do |record|\n patient = Patient.find_by_patient_id(record[\"patient_id\"])\n patient.present? ? patient.update(record) : Patient.create(record)\n end\n end",...
8d63c8fed65e8190f5c947d4ec559f5e
GET a specific tag
[ { "docid": "955d8c90e9f4efa1439c8a083bbf58a8", "score": "0.6185376", "text": "def show\n if @tag.present?\n respond_with @tag, status: :ok, location: tags_path(@tag)\n else\n render json: {error: 'Could not find the resource. Check if you are using the right tag_id.'}, status: :not_found...
[ { "docid": "422be937450cae1c92d3f0c438fb5d24", "score": "0.7334496", "text": "def tag\n Tag.find(tag_id)\n end", "title": "" }, { "docid": "6a9352ebe0428558fe19f958f2cfa1a0", "score": "0.7306919", "text": "def get ( tag )\n\t send( \"get #{tag}\" )\n\t rv = nil\n\t each ...
83062a0920059dff1bc19973d2b8b426
GET /audio_channels or /audio_channels.json
[ { "docid": "f294e61296e48afbd2a8e65aacb5345e", "score": "0.71168554", "text": "def index\n @audio_channels = AudioChannel.all\n end", "title": "" } ]
[ { "docid": "f78f058db710c02a3b6244809315cefe", "score": "0.7073358", "text": "def audio_channels\n audio_streams.first.channels unless @invalid or audio_streams.empty?\n end", "title": "" }, { "docid": "a271b00664525e9fa52598baa5ed1da9", "score": "0.69463956", "text": "def au...
d70efec7e778cd7d17b2b71bb6ec0158
integers using the "bubble sort" methodology. ( Difficulty: 3/5
[ { "docid": "d09c5a0f1580f6513d92893f29d0f44a", "score": "0.7248739", "text": "def bubble_sort(arr)\n temp=0\n for i in (0..arr.length-1) \n for j in (1..arr.length-1-i) \n if arr[j-1]>arr[j]\n temp=arr[j]\n arr[j]=arr[j-1]\n ...
[ { "docid": "a32aefdc5c945d1661617100a5ec491c", "score": "0.791603", "text": "def bubble_sort(int_array)\n to_return = int_array\n length = to_return.length\n for i in 0..length-1\n count = 0\n while count < length - 1\n if to_return[count] > to_return[count+1]\n count += 1\n el...
bbf021ed93d90d598cd2099174b2f5f4
Iterate over properties calling block with +name+ and +value+ of property
[ { "docid": "a1fe6be9d8496cf0955977f2f2f517b9", "score": "0.7902716", "text": "def each\n @property.each {|n, v| yield n,v}\n end", "title": "" } ]
[ { "docid": "2cec2ad76f3e08f93bd0526ca7fd07d5", "score": "0.8466097", "text": "def each_property(&block)\n properties.each { |k, v| block.call(k, v) }\n end", "title": "" }, { "docid": "cfe4c75c5fb87d0bb9d2656ebd422ad7", "score": "0.8194596", "text": "def each_property(&block)...
bcad743eee732b0f6f24d81eebe9cd9e
PUT /seguridad/modulos/1 PUT /seguridad/modulos/1.json
[ { "docid": "8393211ece4f5a45e8014c6f8247f8a5", "score": "0.6956256", "text": "def update\n @seguridad_modulo = Seguridad::Modulo.find(params[:id])\n\n respond_to do |format|\n if @seguridad_modulo.update_attributes(params[:seguridad_modulo])\n format.html { redirect_to @seguridad_modul...
[ { "docid": "ae20f8dd47f8a16654993a45ec2de2cc", "score": "0.6940129", "text": "def update\n @modulo = Modulo.find(params[:id])\n\n respond_to do |format|\n if @modulo.update_attributes(params[:modulo])\n format.html { redirect_success(\"Módulo alterado com sucesso!\",:modulos, :index)}\...
74ea3f2578e6972ba49f27da72a65798
GET /pasties/1 GET /pasties/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "703d096d8811ecf4ce403dc7c45f5347", "score": "0.64269537", "text": "def set_pastie\n @pastie = Pastie.find(params[:id])\n end", "title": "" }, { "docid": "6eefb58926ab4b2f49785536f82bb378", "score": "0.62783545", "text": "def show\n @pastes = Paste.order(\"created_a...
d004271e1a28d3c42f4a0594247b4c18
GET /book_lists GET /book_lists.xml
[ { "docid": "60aca765654b0ca547d90e886f8e56a7", "score": "0.0", "text": "def index\n \n breadcrumbs.add 'MY SHELVES'\n \n @shelves = BookList.find_all_by_user_id(current_user.id)\n if(@shelves.size > 0)\n @shelf0 = ListItem.find_all_by_book_list_id(@shelves[0].id).paginate(:page=>1, :...
[ { "docid": "3bdfdd932fec92eae8739ffa22956efc", "score": "0.69776124", "text": "def index\n @lists = List.find(:all)\n\n respond_to do |format|\n format.html\n format.xml { render :xml => @lists }\n end\n end", "title": "" }, { "docid": "7199b1c091a6792bba20df32033c2a3a",...
2dde2a25b118d9445294eb60e1e403b4
Safely dig through the node's attributes based on the specified `path`, with the option to provide a default value in the event the key does not exist.
[ { "docid": "fbd06a5cf1f66f181a31c6aa58990b76", "score": "0.6996469", "text": "def attr_lookup(path, delim: '/', default: nil)\n return default if path.nil?\n\n node_path = path.split(delim)\n # implicit-begin is a function of ruby2.5 and later, but we still\n # support 2.4, so.... un...
[ { "docid": "07116484641aec7b08c88632d07d319e", "score": "0.73300654", "text": "def fetch_attribute(path, default = nil)\n node.dig(*path.split('.')) || default\nend", "title": "" }, { "docid": "a54f46f4045b5ff33c4fc74cf06715fd", "score": "0.6849942", "text": "def get_attribute_from_...
2ba93e7b8218be2ccb3081a404436b34
Create CancelOperation Create a new CancelOperation
[ { "docid": "53e62f97480afb98475b82748430d7a1", "score": "0.712368", "text": "def create_cancel_operation_with_http_info(cancel_operation, opts = {})\n if api_client.config.debugging\n api_client.config.logger.debug 'Calling API: CancelOperation.create_cancel_operation ...'\n end\n...
[ { "docid": "6a4e0c39088529f3bfb055226decba34", "score": "0.79520035", "text": "def create\n data = self.class.create_cancel_operation(self)\n self.id = data.id\n data\n end", "title": "" }, { "docid": "10c5563929be8794b0d521c6d0c382a8", "score": "0.7364773", "text":...
b59d569acc857191b81d11eb0e479253
Takes in a board in some form and returns a _String_ that's well formatted for output to the screen. No `puts` here! The input board will be in whatever form `solve` returns.
[ { "docid": "a0ac34f7f3811dbb30bd002420e5d6b1", "score": "0.0", "text": "def pretty_board(board)\nend", "title": "" } ]
[ { "docid": "1c4faf49e2ca6728498add7d70adcfd4", "score": "0.7828299", "text": "def solve(board)\n sudoku_grid = grid(board)\n solved_board = possibilities(sudoku_grid)\n solved_board.join('')\nend", "title": "" }, { "docid": "a08e013f0a99ac5d5020764d8c0fd498", "score": "0.7511794", ...
58ebedebf467fd0e6f304647caf4aa8b
2fa:generaterecoverycodes Generates (and replaces) recovery codes
[ { "docid": "d2459b37c0f8221cf83cd98e6600d9e7", "score": "0.7250935", "text": "def generate_recovery_codes\n code = Heroku::Auth.ask_for_second_factor\n\n recovery_codes = api.request(\n :expects => 200,\n :method => :post,\n :path => \"/account/two-factor/recovery-code...
[ { "docid": "befc1a4015cc5a94c01b2e60da7c8784", "score": "0.6361657", "text": "def generate_otp_backup_codes\n codes = []\n hashed_codes = []\n number_of_codes = 10\n code_length = 32\n\n number_of_codes.times do\n code = SecureRandom.hex(code_length / 2)\n codes...