query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
205a11e0ed17c5355edc1ee4193acd33
GET /invoice_ins/1 GET /invoice_ins/1.xml
[ { "docid": "9970548fbf6e3e958ba839db5c6c2b91", "score": "0.6398208", "text": "def show\n @invoice_in = InvoiceIn.find(:first, :conditions => {:id => params[:id], :user_id => session[:user_id]})\n unless @invoice_in\n flash[:notice] = 'Tato faktura neexistuje!'\n redirect_to :action => :i...
[ { "docid": "c9fe3a9ed6324466f18b76353cffc192", "score": "0.71309626", "text": "def simplified_invoice(simplified_invoice_id, options={})\n params = { :klass => Invoicexpress::Models::SimplifiedInvoice }\n\n get(\"simplified_invoices/#{simplified_invoice_id}.xml\", params.merge(options))\n ...
2d07873110b1fe2691d96c684e594071
helper procedure takes in a consolidated cart and an item whose counter field must be incremented
[ { "docid": "fe8e0121877d6ac0b5bddcdb9161fd3c", "score": "0.73187584", "text": "def increment_count(cart, item)\n cart.length.times do |index|\n if cart[index][:item] == item\n cart[index][:count] += 1\n end\n end\n cart\nend", "title": "" } ]
[ { "docid": "be8ae0cb01701ef89827b547b367056c", "score": "0.7265334", "text": "def consolidate_cart(cart)\n\n index = 0\n consolidated_cart = []\n\nwhile index < cart.length do\n consolidated_cart_item = find_item_by_name_in_collection(cart[index][:item], consolidated_cart)\n item_name = cart[index][...
176534ab2ad3f1cb49b7a0207d28d264
Public: Generate a new random manifest path. Manifests are not intended to be accessed publicly, but typically live alongside public assets for convenience. To avoid being served, the filename is prefixed with a "." which is usually hidden by web servers like Apache. To help in other environments that may not control t...
[ { "docid": "75b69349be35d098b3b4e90d419de4ea", "score": "0.70775276", "text": "def generate_manifest_path; end", "title": "" } ]
[ { "docid": "150b10cd90989e8e73e08479ae54f9f1", "score": "0.82111645", "text": "def generate_manifest_path\n \".sprockets-manifest-#{SecureRandom.hex(16)}.json\"\n end", "title": "" }, { "docid": "87a6bda917a5e6cd277902432c6b7c05", "score": "0.75463134", "text": "def generate_...
9b384df5b237682f701310c7b1f5dfaf
Determine if a repo is managed by a team. Requires authentication.
[ { "docid": "d6a833c29c0e0b5b5295c557a3fe5daa", "score": "0.798681", "text": "def team_repo?(id, owner, repo)\n boolean_request :get, \"/teams/#{id}/repos/#{owner}/#{repo}\"\n end", "title": "" } ]
[ { "docid": "ba2c5b4f43f951acad64bcf60ad2094e", "score": "0.68857896", "text": "def change_team?\n raise Pundit::NotAuthorizedError, \"must be logged in\" unless user\n user.admin? || (APP_CONFIG.enabled?(\"user_permission.manage_namespace\") &&\n namespace.team.owners.exists?(us...
33d633bc9d0145a818db4e5b87621dad
Returns the value of attribute id. source://cucumbermessages//lib/cucumber/messages.dtos.rb1593
[ { "docid": "949c5e2dfae7d74d8af81fb7f1f008b6", "score": "0.0", "text": "def id; end", "title": "" } ]
[ { "docid": "fe58cf24252be77de724e98700a5aef0", "score": "0.7607156", "text": "def id # :nodoc:\n @attributes[ 'id' ]\n end", "title": "" }, { "docid": "4b5d6c6ce45f751cfa8a2cbdfbda4d10", "score": "0.75372636", "text": "def id\n @attributes[\"#{self.class.to_s.split('::')...
a933603d4fd20aaa181854242a09399f
Test assertInclude invalid collection:: Collection for assertion value:: Value to assert
[ { "docid": "9516acefdfc432193f704796cebe3f62", "score": "0.8383888", "text": "def assertIncludeInvalidTest collection, value\n assertRaiseKindOf ArgumentError do\n assertInclude collection, value\n end\n end", "title": "" } ]
[ { "docid": "42751e15a28b1979f848f652705f2b0b", "score": "0.8680565", "text": "def assertIncludeTest collection, value\n assertInclude collection, value\n end", "title": "" }, { "docid": "3be4d52f9d958d6dcfbbc6974c4b0f9a", "score": "0.84629524", "text": "def assertInclude coll...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "792358523fca5dee9119a6b02d21bfaa", "score": "0.0", "text": "def set_action\n @action = Action.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...
e9a7d827d005bb3a838ff106fbe583b5
Ensure the position is empty
[ { "docid": "0acd4b7c4afab6e8f6217e44b43a76a2", "score": "0.0", "text": "def position_taken?(index)\n !(@board[index].nil? || @board[index] == \" \")\nend", "title": "" } ]
[ { "docid": "9de5012022b160495852e935f30f30cf", "score": "0.77374285", "text": "def empty?(pos)\n self[pos].empty?\n end", "title": "" }, { "docid": "35ce51d77855e0a455c39c76009db645", "score": "0.7723586", "text": "def empty_slot\n @positions.index {|i| i.nil?} || @posit...
1d165e55f53aa36efd6fe5c8c2543037
PUT /course_types/1 PUT /course_types/1.json
[ { "docid": "f21266174a9c138a7c1f52361dac992c", "score": "0.0", "text": "def update\n respond_to do |format|\n if @sample_business_plan.update(sample_business_plan_params)\n format.html { redirect_to @sample_business_plan, notice: 'Faculty was successfully updated.' }\n format.json ...
[ { "docid": "aabaa23184befa84d6b14988c645512e", "score": "0.7502982", "text": "def update\n @course_type = CourseType.find(params[:id])\n\n respond_to do |format|\n if @course_type.update_attributes(params[:course_type])\n format.html { redirect_to @course_type, notice: 'Course type was...
a4f7ae3283936e83e41920ee8a49db1b
Checks equality by comparing each attribute.
[ { "docid": "520a32febd56d06fa9dbcaf7db6a2157", "score": "0.0", "text": "def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n group == o.group &&\n name == o.name &&\n version == o.version &&\n classifier == o.classifier &&\n filena...
[ { "docid": "153b45ee9e17f104e42417688976c51c", "score": "0.768239", "text": "def compare_attributes(attrs)\n\t\t\t\tattrs.each do |name, value|\n\t\t\t\t\tnext true if compare_attribute(name, value)\n\t\t\t\t\tbreak false\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "6c59827132384193c...
a92e9a744055a6014389122a500cdbe8
Get list of contributor from a repo
[ { "docid": "ba2626d983937d508dbfccd69cb6f027", "score": "0.7941108", "text": "def get_repos_contributor_list(repo_owner, repo_name)\n @res = Net::HTTP.get_response(URI(concat_url('/repos/', repo_owner.to_s,'/',repo_name.to_s,'/contributors')))\n @res = JSON.parse(@res.body).each do |contrib...
[ { "docid": "9ba1639b1991735252c8c4af6b9c6335", "score": "0.8018004", "text": "def get_repo_contributors(repo)\n contributors = []\n response = get_github_api(repo, 'contributors')\n response.each do |contributor|\n contributors << {\n 'name' => contributor['login'],\n ...
fd13cd5233441d0efd27720e7ed94f41
Frame Update (main phase step 1 : action preparation)
[ { "docid": "343aca737d0f04682ee3b06f9d7a1f81", "score": "0.5655968", "text": "def update_phase4_step1\r\n # Hide help window\r\n @help_window.visible = false\r\n # Determine win/loss\r\n if judge\r\n # If won, or if lost : end method\r\n return\r\n end\r\n # If an action forc...
[ { "docid": "b19f36d3f92b5b87a05f053b65cc8bc5", "score": "0.6861093", "text": "def frame_step \n send_cmd(\"frame_step\")\n end", "title": "" }, { "docid": "46a952d2473c173f05e718780472cdc8", "score": "0.6473387", "text": "def next_update_process\n @skip_frame = true\n #...
fbb060bc1e2fac58b890c1b2cf4d5645
Prints a Chef warning message.
[ { "docid": "4ed64c2e6f95062d2d90f17fb8b08c6e", "score": "0.74579626", "text": "def warn(msg)\n Chef::Log.warn(msg)\n end", "title": "" } ]
[ { "docid": "61e6f165bec487ca5cc169d07dfa57d4", "score": "0.7783014", "text": "def warning(msg) $stderr.puts(\"Warning: #{msg}\") end", "title": "" }, { "docid": "61e6f165bec487ca5cc169d07dfa57d4", "score": "0.7783014", "text": "def warning(msg) $stderr.puts(\"Warning: #{msg}\") end",...
d624f2c2fd0806972990eb706aee019e
Automatically assign roles to hosts and create the roles for all the services in a cluster.\n\nAssignments are done based on services and hosts in the cluster, and hardware specifications.\nIf no hosts are added to the cluster, an exception will be thrown preventing any\nrole assignments.\nExisting roles will be taken ...
[ { "docid": "5950770a6de4affd9c0a20d3b1a4c9a8", "score": "0.5884928", "text": "def api_v11_clusters_cluster_name_auto_assign_roles_put_with_http_info(cluster_name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DefaultApi#api_v11_clusters_cluster...
[ { "docid": "f2f6a9796af74faef2f29ba53a43b27e", "score": "0.6565591", "text": "def cluster_roles\n iterate :clusterroles do |r|\n setup_role role_kind: :ClusterRole, role: r\n end\n\n # For cluster roles with aggregation rules create an edge betweeen ...
5fb355ab261ebb76e8f253be6d1888de
function to compare version_a with version_b according to given operator. will try to parse both parameters with versionomy. if parsing fails, it will compare them as string literals.
[ { "docid": "707ca7284afd65c9972cd3a388cce5d2", "score": "0.893489", "text": "def compare_versions_by_operator(version_a, version_b, operator)\n \n # try to parse via versionomy\n begin\n parsed_a = Versionomy.parse(version_a.scan(/\\d\\.?+/).join(''))\n parsed_b = Versionomy.parse(ver...
[ { "docid": "aa2dce1619b51686b141e24567bca7c5", "score": "0.89360213", "text": "def compare_versions_by_operator(version_a, version_b, operator)\n\n # try to parse via versionomy\n begin\n parsed_a = Versionomy.parse(version_a.scan(/\\d\\.?+/).join(''))\n parsed_b = Versionomy.parse(versi...
b4c7cd205259a8a6de8558c4e5142b1f
Returns the entry identified by path and revision identifier or nil if entry doesn't exist in the repository
[ { "docid": "69fb09fa2ed77aea6b7e762a5ef4734a", "score": "0.70009553", "text": "def entry(path=nil, identifier=nil)\n e = entries(path, identifier)\n e ? e.first : nil\n end", "title": "" } ]
[ { "docid": "ebbf27f9a5e4fd0d83515b1a1879f0d2", "score": "0.71121335", "text": "def get_node_entry(path, rev=nil)\n node = repos.get_node(path, rev)\n end", "title": "" }, { "docid": "d3df23f658d31c53e09bedc862426f22", "score": "0.7063565", "text": "def find_entry_by_path(...
c3d686570a07055ef024deae86f5ae7e
GET /ratings/1 GET /ratings/1.json
[ { "docid": "eb84b211bfa0ea8624e424b4b745c5ee", "score": "0.7488328", "text": "def show\n @rating = Rating.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @Rating }\n end\n end", "title": "" } ]
[ { "docid": "22b94507799b4c83b9983d5b40541a99", "score": "0.7917163", "text": "def ratings\n Birdman::Requester.get(\"shows/#{id}/ratings\")\n end", "title": "" }, { "docid": "0dd820d98691a00a506dbb28de14389e", "score": "0.7798128", "text": "def show\n @rating = Rating.find(par...
0ec6cb51775e6ae897f398b121a1de82
Extracts the text from byte offset with given byte length
[ { "docid": "8d3c79e4a3a13608f0055f69c38f9c2f", "score": "0.8767543", "text": "def extract_text(offset, length)\n string.byteslice(offset, length)\n end", "title": "" } ]
[ { "docid": "8054641f394d1e1902a23292b838bfee", "score": "0.86741465", "text": "def extract_text(offset, length)\n end", "title": "" }, { "docid": "6bf2ad78339c3345c2814d35a041caae", "score": "0.83004373", "text": "def extract_text(offset, length)\n string.slice(offset, length)\...
4bdae7a52c195bd3e4ffe327fd35747a
PATCH/PUT /agendas/1 PATCH/PUT /agendas/1.json
[ { "docid": "3cf4d129a1097283120d7bdfa59235bd", "score": "0.5910043", "text": "def update\n respond_to do |format|\n if @agenda.update(agenda_params)\n format.html { redirect_to users_backoffice_agendas_path, notice: 'Agenda was successfully updated.' }\n format.json { render status...
[ { "docid": "f4098f79ff349974de7609a783da0321", "score": "0.68126535", "text": "def update\n respond_to do |format|\n if @agendas.update(agendas_params)\n format.html { redirect_to @agendas, notice: 'Agendas was successfully updated.' }\n format.json { render :show, status: :ok, loc...
107544a5df8c21c9d01119f83ec45ae8
Must impliment a Hash interface
[ { "docid": "df498625e6ee183f5e6b03c66ce31b4e", "score": "0.0", "text": "def store\n Thread.current\n end", "title": "" } ]
[ { "docid": "b78a8c3fbbda0dc6b3ed59f810316f24", "score": "0.81775373", "text": "def hash(*) end", "title": "" }, { "docid": "23cdf6a080837fbe407633be0799ea0e", "score": "0.8121969", "text": "def hash() end", "title": "" }, { "docid": "23cdf6a080837fbe407633be0799ea0e", ...
66b85a9fe62b16998a9ab1a3116f0e27
The Manhattan Method is a heuristic commonly used for calculating h: total of squares moved horizantally and vertically to reach the end from the queued square, ignoring any obstacles or diagonal movements. Then estimate movement cost: total moves 10
[ { "docid": "dcdcb62c80cc9e9be44fd03ee20ae4dc", "score": "0.62167627", "text": "def calculate_h(neighbor)\n n_x, n_y = neighbor\n final_x, final_y = @maze.find_end\n total_moves = ((n_x - final_x).abs + (n_y - final_y).abs)\n total_moves * 10\n end", "title": "" } ]
[ { "docid": "ae3c3d1dfe8212f9f992fe17709f100e", "score": "0.7147312", "text": "def manhattan_distance(tiles_order)\n manhattan_distance = 0\n tiles_order.each_with_index do |x, i|\n next if x == 9 # this skips the blank square.\n array_steps = ((i + 1) - x).abs\n puzzle_steps = (arra...
421f3d7737b4db0eea598d0d709bc7c0
Enables this module so that all calls to +::FileUtils+ will be protected. If +path+ is given, it will be used to set +sandbox_path+ regardless of whether or not this call returns +true+ or +false+. Returns +true+ if activation occurs. Returns +false+ if +activated?+ already +true+.
[ { "docid": "517dd00da5921eb7518ab11f5bbc401a", "score": "0.8452863", "text": "def activate!(path = nil)\n path = path.to_s\n self.sandbox_path = path unless path.empty?\n\n return false if activated?\n\n Object.send(:remove_const, :FileUtils)\n Object.const_set(:FileUtils, self)...
[ { "docid": "4993ea5cd858b64ca4b551016fbe0c98", "score": "0.58459526", "text": "def sandbox_path=(path)\n path = File.expand_path(path.to_s)\n\n # Make the directory unless it already exists\n FileUtils.mkdir_p(path) unless File.exists?(path)\n\n @sandbox_path = Pathname.new(path.to_s...
2bf3d668264c3f017dbb6726579c6cac
:secret => '8ffb6e2a5aa08dbb632fbaab1a328b68' See ActionController::Base for details Uncomment this to filter the contents of submitted sensitive data parameters from your application log (in this case, all fields with names like "password"). filter_parameter_logging :password
[ { "docid": "09ad55efe56ed57d4b991ade977ad4b3", "score": "0.0", "text": "def site_name\n \"Testify\"\n end", "title": "" } ]
[ { "docid": "06087a7dd43c16815eb98477d07d4114", "score": "0.7127662", "text": "def restricted_fields\n [:user_secret_id, :password]\n end", "title": "" }, { "docid": "a837fc0c0916549d3d2f7bb13627a199", "score": "0.6866712", "text": "def hidden_keys\n\t\t[\"password\"]\n\te...
c59d24a0b407024321056af4b91926be
Unpacks the SecurityBufferDesc structure into member variables. We only want to do this once per struct, so the struct is deleted after unpacking.
[ { "docid": "f7c7d0965e5d604d69231ca572d2ece6", "score": "0.6939678", "text": "def unpack\n if ! @unpacked && @sec_buffer && @struct\n dataBufferSize, dType, dataBuffer, tokenBufferSize, tType, tokenBuffer = @sec_buffer.unpack(\"LLPLLP\")\n dataBufferSize, dType, dataBuffer, toke...
[ { "docid": "cdbc727527177f1ac98f1de6aeff6796", "score": "0.72197455", "text": "def unpack\n if ! @unpacked && @sec_buffer && @struct\n dataBufferSize, dType, dataBuffer, tokenBufferSize, tType, tokenBuffer = @sec_buffer.unpack(\"LLPLLP\")\n dataBufferSize, dType, dataBuffer, tok...
fd3909050fadd5c0468cc210163619c7
Time Complexity = O(n) Space Complexity = O(1)
[ { "docid": "df01b9d9c688b581aa0ca1ce7a1d7648", "score": "0.0", "text": "def middle_node(node)\n\tlength = get_length(node,0)\n\tmid = (length%2 == 0 ? (length/2-1) : length/2)\n\t@middle = nil\n\tget_mid(node,mid)\n\t@middle\nend", "title": "" } ]
[ { "docid": "5944c445a0d5d1383cd670cc84d3fc3b", "score": "0.6938838", "text": "def find_dublicate(array)\n sum = 1000000*(1000000+1)/2 # (n*(n+1))/2\n array.each do |el| \n sum -= el\n end\n return sum\nend", "title": "" }, { "docid": "2481cbf165330db256eee896a32c82e4", "score": "0...
748e2c8ae8a2d46c3374cb9a7e7c755a
dajoku_environments = [ Juxtaconfig::DajokuEnvironment.new("greenhouse", "prod", "canary", "use1"), Juxtaconfig::DajokuEnvironment.new("greenhouse", "prod", "prod", "use1"), Juxtaconfig::DajokuEnvironment.new("greenhouse", "prod", "prods2", "use1"), Juxtaconfig::DajokuEnvironment.new("greenhouse", "prod", "prods3", "us...
[ { "docid": "784dc728b77863b510518a9566d15540", "score": "0.60442114", "text": "def juxtapose\n dajoku = Juxtaconfig::Dajoku.new\n\n all_configs = @dajoku_environments.map do |dajoku_environment|\n dajoku_config = dajoku.get_dajoku_config(\n dajoku_environment.application,\n ...
[ { "docid": "0089a39fdafbe88ecf9bbfdaaae9051b", "score": "0.67635745", "text": "def environments\n fetch(:environments, nil) || [fetch(:environment, 'production')]\n end", "title": "" }, { "docid": "b16b2f140b4d93afb2d4529888debcbe", "score": "0.66537386", "text": "def environment...
bacf3eebe2bc2bd34440cd331086e79d
Copy each of the requirements into the dir specified with `dir` or the path specified with the :vendor_dir option. Returns the dir it was vendored to.
[ { "docid": "c96e618a8984b96f45c2c82d0790c117", "score": "0.67126775", "text": "def vendor!(dir = nil, force = false)\n resolve! if paths.empty?\n dir ||= options[:vendor_dir]\n dir ||= 'vendor' # default\n logger.debug \"Vendoring #{paths.length} files to #{dir}\"\n paths.collec...
[ { "docid": "ace21e2aef57e5e321861470a503bafe", "score": "0.6351017", "text": "def do_vendor_package\n src = platform_config.source_vendor_path\n dest = platform_config.vendor_path\n stop_run \"Vendor package destination path #{dest.inspect} is an absolute path.\" if absolute_path?(dest)\n ...
bc552ecbd16a13ba7ebcbedeac36714e
Set a global single named value (gauge)
[ { "docid": "ab9e3457dbc9eb231efcfcfb88010c10", "score": "0.74558216", "text": "def set_gauge(gauge_name, value, tags = {})\n @drivers.each { |d| d.set_gauge(gauge_name.to_s, value, tags) }\n nil\n end", "title": "" } ]
[ { "docid": "1e7170e4b8452ad2679231523c794d67", "score": "0.7421626", "text": "def set(name, value, labels = {}, &block)\n gauge = self.class.prometheus_metric(name, :gauge, &block)\n\n gauge.set(filter_labels(labels), value)\n end", "title": "" }, { "docid": "b8e02abd94689...
8a33a7ae03a77eda9e06fd7db87429e0
puts first_word("Hello World !")
[ { "docid": "b0802c438568dccf40ac4d00e65bf99e", "score": "0.0", "text": "def titleize(string)\n result = \"\"\n\n # POUR CHAQUE MOT CONTENU DANS string => SI LE MOT EST SUPÉRIEUR À 3 LETTRES -> MET EN CAPITAL LA PREMIÈRE LETTRE (capitalize!)\n string = string.split.each{|word| word.capitalize! if w...
[ { "docid": "6bbb9ef6965147092ee3a332e745f336", "score": "0.812186", "text": "def first_word\n # assert_equal \"Hello\", first_word(\"Hello World\")\n # assert_equal \"oh\", first_word(\"oh dear\")\nend", "title": "" }, { "docid": "96688dd9204990fdf1268ba20c01ab08", "score": "0.80063486...
faf5db4bb85e42b97c3009fc427f38e1
This method adds a group of nodes to this topology. nodes = the group of nodes to add. It can be either: a Hash, which contains the mapping 'node name' to '[x,y]'. Each element of this Hash is of the form key="node name" and value="[x,y]" (with value as a String!). Or: an Array, which contains the declaration of a node...
[ { "docid": "52506dc84c20d8a17564b3949e14dcc5", "score": "0.70464367", "text": "def addNodes(nodes)\n # Option 1: 'nodes' is a Hash\n if nodes.kind_of?(Hash) \n nodes.each { |k,v|\n addNode(k,eval(v))\n }\n return\n end\n # Sanity Check\n if ! nodes.kind_of?(Array)\n ...
[ { "docid": "ee5b3a25b57b51cd953c28d3c3fd1290", "score": "0.7101248", "text": "def add_nodes(*nodes)\n nodes.each do |node|\n node = new(*node)\n end\n end", "title": "" }, { "docid": "a0397f06ec87fe92b24f5456d75a5916", "score": "0.6973222", "text": "def ad...
8b2518194170e3b4656b9a487a4f84b7
Allow blind rescues here, since we're absorbing and packaging or reraising exceptions that can be raised from within the individual cops' `investigate` methods.
[ { "docid": "274302fb2a38ba0162f4aa0fa1a9703b", "score": "0.0", "text": "def with_cop_error_handling(cop, node = nil)\n yield\n rescue StandardError => e\n raise e if @options[:raise_error]\n\n err = ErrorWithAnalyzedFileLocation.new(cause: e, node: node, cop: cop)\n @err...
[ { "docid": "a11eb7d0088b221901dbf6d963545574", "score": "0.6952334", "text": "def rescueing; end", "title": "" }, { "docid": "65b47be744db855a555e4d8b4021d4be", "score": "0.6833546", "text": "def ignored_exceptions; end", "title": "" }, { "docid": "95246cbcd815a36fc723809...
f6b5cd0b2e0b995694bcc8cd7f2e76cf
Call this method after moving fack and forth in the history. This method restores the topic and cursor position recorded in the current history entry.
[ { "docid": "101389caa00b3d5263db82ff099f6337", "score": "0.791666", "text": "def restore_from_history\n if current = @history.current\n @topic = current.topic\n _load_topic(topic) do\n @info.yview_moveto current.yview\n set_cursor current.cursor\n end\n end\n end", ...
[ { "docid": "67f07ae97998c19a3e54277f4cf09d0a", "score": "0.6397963", "text": "def restore_cursor_position() set_cursor_position(@event[\"line\"], @event[\"column\"]) end", "title": "" }, { "docid": "09499de3232af5ffa83d5d807620e3e5", "score": "0.6311002", "text": "def rewind\n ...
50f9f185a7e0a4b735aeced6110bd841
Calculates hash code according to all attributes.
[ { "docid": "59b26fa34112ced374c0c44180ef76a6", "score": "0.0", "text": "def hash\n [operation3_d_code, error].hash\n end", "title": "" } ]
[ { "docid": "08105588814074a5aed46dbb236c8d02", "score": "0.7914274", "text": "def hash_code; Digest::SHA256.hexdigest(@attributes.values.join); end", "title": "" }, { "docid": "706cbdb4c78e6b67e29589df0a4b1b5c", "score": "0.73102635", "text": "def attr_hash\n md5 = Digest::MD5.n...
e6553bea7133856a68ec62493ca7493f
Get a wiki page
[ { "docid": "14da0d0c4ecd0cf8391963d85239165e", "score": "0.72462153", "text": "def get_wiki(wiki_id)\n get(\"wikis/#{wiki_id}\")\n end", "title": "" } ]
[ { "docid": "91d3aec9f1edf211275a755a257596d9", "score": "0.77908367", "text": "def get_wiki_page\n @wiki = @context.wiki\n\n @page_name = params[:wiki_page_id] || params[:id] || (params[:wiki_page] && params[:wiki_page][:title])\n if(params[:format] && !['json', 'html'].include?(params[:format]...
8abf5569fc3bf896a2b1afece434c7c1
Returns the human readable name that is used in error messages. The default is determined from the target_model. To change the target name either set the constant TargetName to the correct name in your test class or use the target_name= method. The constant definition takes presence over the attribute. Example: class I...
[ { "docid": "2858aabd132946dc1fa9fb1bf147e084", "score": "0.71180415", "text": "def target_name(*args)\n if args.blank?\n (const_defined?(:TargetName) ? const_get(:TargetName) : (@target_name || target_model.name.underscore.titleize)).to_s\n else\n self.target_name = args.first\n ...
[ { "docid": "8630d4c6d843cf0c7a7318bdbfded13b", "score": "0.7047684", "text": "def target_name(target_name = nil)\n @target_name = target_name unless target_name.nil?\n \n return 'default' if @target_name.nil?\n @target_name\n end", "title": "" }, { "docid": "...
f785defc614a5625652ff250f039f29d
Retain existing meta values that will not be recalculated when reprocessing a subset of styles
[ { "docid": "c1e349306c61f39201c35edb06f4cb9c", "score": "0.5709858", "text": "def merge_existing_meta_hash(meta)\n return unless (original_meta = instance.send(\"#{name}_meta\"))\n meta.reverse_merge! meta_decode(original_meta)\n end", "title": "" } ]
[ { "docid": "ad7e2ddf118c20537b97abc751a10f4c", "score": "0.5976374", "text": "def processor_options\n original_processor_options.merge!(:style => name)\n end", "title": "" }, { "docid": "7c0eb64d9639fa46d022e7b9be0dadab", "score": "0.5911574", "text": "def reg...
384130683d94f5ec74a51317266ca15f
Returns the value of attribute quiet. source://pry//lib/pry/pry_class.rb23
[ { "docid": "2a335cefcb4e78e018f4eb76bf5c5287", "score": "0.58162504", "text": "def quiet; end", "title": "" } ]
[ { "docid": "7b2c68cd27ed49330545ac37d6fc202f", "score": "0.658188", "text": "def quiet\n @options[:quiet]\n end", "title": "" }, { "docid": "75f3a5618ec30c8bfadee94dac831e70", "score": "0.6575674", "text": "def quiet? ; @quiet ; end", "title": "" }, { "docid": "ec...
bf9187ed1cf78a5a2bd666c9b4a53694
Holding Spots in a String
[ { "docid": "028cdc711709521f6b692fddcabde4da", "score": "0.0", "text": "def hi(name = \"world\")\r\n puts \"hello #{name.capitalize}!\"\r\nend", "title": "" } ]
[ { "docid": "dfb4e75e3dd2955682e77d745f89c754", "score": "0.5884176", "text": "def spinWords(string)\r\n \r\nend", "title": "" }, { "docid": "130ad0b0c913dc04fca90108029c90fd", "score": "0.5837401", "text": "def process_coordinates(string)\n [string[0..1], string[3..4]]\n end", ...
82d97fee559c63305c2cef13c07bd5e4
returns a list of attributes that should be ignored in the merge a function so it can be easily overriden
[ { "docid": "a48f13fadb4d8d8726084e8e4b1a017d", "score": "0.8007436", "text": "def ignored_merge_attributes\n IGNORED_ATTRIBUTES\n end", "title": "" } ]
[ { "docid": "e8de5f363bd6b0464aa656924793f2c2", "score": "0.7355734", "text": "def merge_attribute_names\n attribute_names - MERGE_INDIFFERENT_ATTRIBUTES\n end", "title": "" }, { "docid": "e2ee9094ca8b13808267c285e1a3ad4c", "score": "0.7037787", "text": "def ignore_attributes(*a...
053de546852609cefd5a6a37409a6324
GET /complaints/new GET /complaints/new.json
[ { "docid": "ea2fd3e1a971a989870c043755382702", "score": "0.7658043", "text": "def new\n @complaint = Complaint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @complaint }\n end\n end", "title": "" } ]
[ { "docid": "0513ac96d3ad9b070cae32c5ee4a631a", "score": "0.7777195", "text": "def new\n @complaint = Complaint.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @complaint }\n end\n end", "title": "" }, { "docid": "4831...
c993527a46d40c2344940b4d865b4645
GET /contracts/1 or /contracts/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "f3bfec2b9bd23369873e7d7f86660512", "score": "0.7556704", "text": "def contracts(contracts = {}); JSON[Api::get_contracts(contracts, self)]; end", "title": "" }, { "docid": "00707ec2ced1e68a378e7de218abfed3", "score": "0.7502138", "text": "def show\n begin\n contra...
8f6a530404f67bf38d41401fdbf623f7
Ratio of L1 attended questions to L2 attended questions to L3 questions attended Personal best is obtained calculating the highest value obtained using eqn ((L1attended/L1total)100 + (L2attended/L2total) 10 (L3attended/L3total))
[ { "docid": "8e6caa250870083ce39e7cfe53a15dd5", "score": "0.64866537", "text": "def strategy\n temp = {}\n #format temp[L1:L2:L3] = index\n current_user.reports.each do |report|\n l1 = (report.l1_attended.to_f/(report.l1_total.to_f.nonzero? || 1 ))*100\n l2 = (report.l2_attended.to_f/(...
[ { "docid": "78fc3c135ef69fe99ccb8285f7701deb", "score": "0.6569307", "text": "def one_question_score(last_n=nil)\n answers = survey_questions.map(&:survey_answers).flatten\n answers = answers[last_n * -1, last_n] if last_n && answers.size >= last_n\n count = answers.size.to_f\n positive = an...
a2b47fe71adace6e3d7ffe5a7b134c6e
A progress meter that shows the fraction of expected submissions. A progress meter should not be shown for assignments that have no metrics and/or for courses that have no students.
[ { "docid": "ffb9bd2ee93d8a0b4bca806e0a625a01", "score": "0.7519905", "text": "def submission_count_meter_tag(submittable)\n total = submittable.student_submissions.index_by { |submission|\n [submission.subject_id, submission.deliverable_id] }.length\n expected = submittable.expected_submiss...
[ { "docid": "e7caf35f7bcce898b31e8fdf67751b77", "score": "0.73541915", "text": "def progress\n (PROGRESS_FIELDS.reject{ |f| send(f).blank? }.count.to_f/\n PROGRESS_FIELDS.count.to_f*100).ceil\n end", "title": "" }, { "docid": "287cd0402308e854e47adc536d6d3244", "score": "0.727375...
3313c962de3a00f4b02d1d349023598a
Returns all buttons of type Reset source://mechanize//lib/mechanize/form.rb86
[ { "docid": "fc52c2d0483125eb4e3d84b03e4b03f6", "score": "0.47248113", "text": "def resets; end", "title": "" } ]
[ { "docid": "c8f7821d7796bf12e8cfe6eae303d097", "score": "0.697713", "text": "def resets\n @resets ||= buttons.select { |f| f.class == Reset }\n end", "title": "" }, { "docid": "c7a7fb6079dd294e92c6f9d8e8dbb71d", "score": "0.59238464", "text": "def reset_button?(button_name); ...
d7c5e5de5708804c78772ff7f5030fa6
Starts a flattened block.
[ { "docid": "761b26a8da284202dfa737f1d32885f5", "score": "0.64052606", "text": "def start_flat(in_tag)\n # @flat_spaces is the number of indentations in the template\n # that forms the base of the flattened area\n if in_tag\n @to_close_stack.push([:flat, true])\n else\n ...
[ { "docid": "f30f9758a4faf2dd58046ea7ab35f46d", "score": "0.62154305", "text": "def start_new_block\n if (@block_buffer)\n add_block(@block_buffer)\n @block_buffer = nil\n end\n end", "title": "" }, { "docid": "770bc090a5af0ba4df35818b94a28c18", "score": "0.5950...
04b53a86807e5d911172893273be30a1
Fetch code from asset store and unpack for local usage
[ { "docid": "d7ca3629e2671635033259e0cc2bafd8", "score": "0.74941903", "text": "def fetch_code(payload)\n repository_path = File.join(\n working_directory,\n payload[:id],\n payload.get(:data, :code_fetcher, :asset)\n )\n if(File.directory?(repository_path)...
[ { "docid": "a0930e297bf3a384176f6d90525bb4f2", "score": "0.66362303", "text": "def fetch_code()\n if @attributes.key?(:file)\n if (out = fetch_external_code(@attributes)).nil?\n $stderr.puts(\"Failed to load external code for code chunk at #{self.location_string}\")\n @content\n ...
13c69fcecf54a3a811721664fbade9dd
GET /professors/1 GET /professors/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "4923a5b404511aadf3947a05b73a9eea", "score": "0.66284746", "text": "def grab_professors\n professor_size = User.where(:professor => true).length\n current_offset = (params[:payload][:pagenumber] - 1)*10\n direction = params[:payload][:direction]\n\n respond_to do |...
7e09a76664146022a56955b8280938cf
GET /rules/1 GET /rules/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "fa7409697a875ad63baf31a1685b67a0", "score": "0.7145896", "text": "def index\n @rules = Rule.all\n render_for_api :public, :json => @rules\n end", "title": "" }, { "docid": "72d9c6bbaa62be7cb8b4ac687f2b2d63", "score": "0.7025985", "text": "def show\n render json:...
863c5d1f1f66f0d2f61e21c620bbe0fc
Returns the relative time in words with timezone correction
[ { "docid": "cf47a528d871361fcf22adf8e675f4bc", "score": "0.67764556", "text": "def relative_word_time(time)\n now = Time.now\n if time - now > 0\n 'in ' + distance_of_time_in_words(time, now)\n elsif now - time > 7.days\n 'on ' + l(time, format: :short)\n else\n distance_of_ti...
[ { "docid": "a7954c4e406a9a2fb631dcd222acba1d", "score": "0.7280617", "text": "def format_relative_time(time)\n distance_of_time_in_words_to_now(time, include_seconds: true)\n end", "title": "" }, { "docid": "a83a97922cf3447609d0779a65211231", "score": "0.6242616", "text": "def fo...
6ba068bf34a3e88604ee2b379af2b526
DELETE /repairs/1 DELETE /repairs/1.json
[ { "docid": "4a995543bc132b92718d28e9a68ea67d", "score": "0.0", "text": "def destroy\n @repair = Repair.find(params[:id])\n @repair.destroy\n\n respond_with(@repair)\n end", "title": "" } ]
[ { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.70568335", "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": ...
fe39b726f6100cbd7436a24cd7a0cab5
this method check if the color feature of three cards meet the requirement
[ { "docid": "8be1f3c4c2e23524a8c6035a751ba2d5", "score": "0.72693896", "text": "def colorfillter (cards, i, j, k)\n fit = (cards[i][3]== cards[j][3])&&(cards[i][3]==cards[k][3])&&(cards[j][3]== cards[k][3])||(cards[i][3]!= cards[j][3])&&(cards[i][3]!=cards[k][3])&&(cards[j][3]!= cards[k][3])\n re...
[ { "docid": "3c9e99c7723662f21b7ca2a3f34b6556", "score": "0.7612761", "text": "def checkSetColor(cardDeck, x, y, z)\n\tcolorCheck = 0;\n\tif (cardDeck[x].color == cardDeck[y].color and cardDeck[z].color == cardDeck[y].color) or ((cardDeck[x].color != cardDeck[y].color) and (cardDeck[x].color != cardDeck[...
11c6734c93aeb69685e94c8be72b3ac2
GET /leaves GET /leaves.json
[ { "docid": "f76cb47d38e1e3d7ea14d2b8c5e50847", "score": "0.6989909", "text": "def index\n @leaves = Leave.all\n end", "title": "" } ]
[ { "docid": "d10e72c0b40e5a078022af9b8b25536e", "score": "0.74482197", "text": "def index\n @leaves = current_user.leaves\n end", "title": "" }, { "docid": "20467d8a3a4b11cd7841df5b63e49b24", "score": "0.70971364", "text": "def index\n @leave = current_user.leaves.all\n end", ...
e12d3ade19d17214592896170a2d06d3
=> true big o analysis O(n!)
[ { "docid": "bcd886f271b13822cd31b51131aa0f7b", "score": "0.0", "text": "def second_anagram?(str1, str2)\r\n arr = str2.split(\"\")\r\n str1.each_char.with_index do |char, i| # O(n)\r\n idx = arr.find_index(char) # O(n)\r\n arr.delete_at(idx) if !idx.nil? # O(1)\r\n end\...
[ { "docid": "00ee2a773f8c3653a5307eecd31539c8", "score": "0.6853982", "text": "def solution(a)\n check_array = a.group_by{|n| n }\n (1..100001).each do |idx|\n return idx unless check_array[idx]\n end\nend", "title": "" }, { "docid": "833ecef7188a1e8cf1e813b867d0591f", "score": "0.6...
6bd09c1b91b4186e46a08b52c4309b3f
display prompt and get the command from the user
[ { "docid": "062ae6ed12105d2b069b07f77408b985", "score": "0.731845", "text": "def _getCommand\n print @gameName + ' >> '\n return gets\n end", "title": "" } ]
[ { "docid": "a537bb20d39c0cb589cac56ec97331b5", "score": "0.8287183", "text": "def read_command(prompt); end", "title": "" }, { "docid": "09b11a4eaf4331e40ef39cc5eb4b1ecd", "score": "0.826901", "text": "def prompt_user\n puts \"Please enter a command:\"\n command = gets.strip\n ret...
2125b7b86f18a91918682e8aa3198037
Verify if a domain name is ranked in the Forbes 2000. Returns true if a file is found matching the domain; false otherwise.
[ { "docid": "82d4ca50ced1253b6afc79e9819cab07", "score": "0.69364864", "text": "def ranked?(domain)\n domain = cleanse_domain(domain)\n File.exists?(File.expand_path(__FILE__+\"/../data/2012/#{domain}.toml\"))\n end", "title": "" } ]
[ { "docid": "b4b9629d2570b35260a03926e7b87f3b", "score": "0.6103842", "text": "def valid?\n # Ensure it's a valid domain\n return false unless PublicSuffix.valid?(domain)\n\n # check using public suffix's standard logic\n rule = PeerReview.list.find domain\n return true if !rule.nil? && ru...
da74f708beebc84962e1c6f99e91f983
GET /campaigns GET /campaigns.json
[ { "docid": "d80d4202b2229d8bd23fa0a0e87d6783", "score": "0.7472087", "text": "def index\n @campaigns = Campaign.all\n end", "title": "" } ]
[ { "docid": "72b190ff4ca249af6f70a1203c574d9f", "score": "0.87294376", "text": "def get_campaigns\n get('/fcb30500-7b98-476f-810d-463a0b8fc3df')\n end", "title": "" }, { "docid": "5799619765be2031d6b4a1e3ca6883fb", "score": "0.8427211", "text": "def get_campaigns()\n exec_g...
888b6d39913f2bbe915c1f5e564c041e
GET /links/1 GET /links/1.json
[ { "docid": "c479bdce2ce4161eaa7c0bfc93cd296c", "score": "0.6781963", "text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @link }\n end\n end", "title": "" } ]
[ { "docid": "7cfb07429eaf563a23d64e3a21ee1b8a", "score": "0.7350112", "text": "def index\n render json: @links\n end", "title": "" }, { "docid": "7ce84e43569762e01760f0f42a6b201a", "score": "0.7120274", "text": "def index\n links = all_links\n render json: { success: true, l...
1ad6f3982cca10bef8802714cbcf9dec
match /(.)/, react_on: :notice, method: :doConnect
[ { "docid": "244eb8c03f153bfae2fcd416f3e6be69", "score": "0.0", "text": "def check_privledges(user)\n if Channel(\"#debug\").opped?(user) or Channel(\"#Situation_Room\").opped?(user)\n return true\n else\n return false\n end\n end", "title": "" } ]
[ { "docid": "2eaef1d8a6f9a4856e878548698ee71a", "score": "0.60651547", "text": "def say_connect_message\n end", "title": "" }, { "docid": "e2f4f3ff6f89de1dda62c0716cef2a7f", "score": "0.5966881", "text": "def send_matched\n respond method: 'match'\n end", "title": "" }, ...
aeaaed027e881bb8b617e1b64ecc219a
zonal_spectrum: Graph of kx^4 phi^2 vs kx for ky=0 Options: t: float, value of time at which to plot (e.g. t: 2.45) t_index: The (1based) time index
[ { "docid": "73e2cde426d6ddaef5f19289e4093b64", "score": "0.5735022", "text": "def zonal_spectrum_graphkit\nend", "title": "" } ]
[ { "docid": "14241e8d568c3596b6b84f4ce21a8f18", "score": "0.52694523", "text": "def plot_tricont; end", "title": "" }, { "docid": "fd39dbdf940578c01de6947b1216426f", "score": "0.51930606", "text": "def kxy_spectrum_graphkit\nend", "title": "" }, { "docid": "caf17c1d2298bda...
b5c2441c970f9c9008109b0b157254fb
Loads person's identity from Objects. ==== Description sav file in campaign directory (from entry name) ==== Syntax person loadIdentity name ==== Parameters +person+ Object +name+ String ==== Returns Boolean ==== Multiplayer This command doesn't work in Multiplayer ==== See Also Official Wiki: ==== Examples ====== Exam...
[ { "docid": "2c427d6b0320a5621f65ba8a08dbe06f", "score": "0.70477206", "text": "def loadIdentity _obj, _args\n \"_obj loadIdentity _args;\" \n end", "title": "" } ]
[ { "docid": "a0b12a35dd48dff21df3f98df51801be", "score": "0.60107636", "text": "def load(filename)\n # Note: Must get a first name and last name\n # Note: Phone should be formatted (###) ###-####\n # Note: Assume you'll always have a valid id\n # Return true \n raise \"Not implemented\"\n ...
49f60b83d0c649f277fbfd172bccbb46
assert two values are equal
[ { "docid": "5131c946938f52624b58b3d1c1045cce", "score": "0.0", "text": "def assert_equal(expected, actual)\n if expected.is_a?(String) && actual.is_a?(String)\n ex_bin = expected.dup.force_encoding('BINARY')\n act_bin = actual.dup.force_encoding('BINARY')\n\n assert(ex_bin == act_bin,\...
[ { "docid": "fc009218ca0f247c13dc9d365a8e0d4a", "score": "0.8257953", "text": "def equal(expected); end", "title": "" }, { "docid": "83c74cf1b2f4905f2d9f4738dab0ade6", "score": "0.8244187", "text": "def assert_equal(value, other)\n flunk(\"#{value.inspect} != #{other.inspect}\") un...
79fcba56617a94c06b3919b884ab8b44
Internal: This method is responsible for filling in the gaps between plotted points to produce a smooth continous curve.
[ { "docid": "8839bae9e553fc8b1bfe76e94bbc3283", "score": "0.54979223", "text": "def fill_empty_y(x, x_end, y_start, y_end, canvas)\n if x < x_end\n if x <= 0\n y_fill_start = yield(x) + 1\n y_fill_end = yield(x - 1) - 1\n else\n y_...
[ { "docid": "7f68cd3fdd4c464f896015af23752f35", "score": "0.5820617", "text": "def smooth\n if @options.has_key?(:dot_values) && @options[:dot_values] != false\n dot_size = @options.has_key?(:dot_size) ? @options[:dot_size].to_f : 2\n else\n dot_size = 0\n end\n step ...
b6ad3d00ab18a50cf64bf3c44d78bd27
POST /users POST /users.json
[ { "docid": "6101ba3edd90cb1e72a0e1d1e8ce7c71", "score": "0.0", "text": "def create\n @user = User.new(user_credentials)\n\n if @user.save\n @user.profile = Profile.new(profile_credentials)\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors,...
[ { "docid": "24c5e44d772da89269600975eeebdfda", "score": "0.7192418", "text": "def create\n @user = User.new(user_params)\n @user.save\n json_response(@user, :created)\n end", "title": "" }, { "docid": "6e1490da4a56756e02c8de2a503a156e", "score": "0.7186364", "text": "def cr...
76aba4c023012b8a927b4ce6cec03a9d
Returns a ActiveRecord::Relation with lists accessible for the user.
[ { "docid": "0f1ca85de20dc017903d20bcbcb1d6a1", "score": "0.7197994", "text": "def accessible_lists\n List.accessible_for(self)\n end", "title": "" } ]
[ { "docid": "54d6d50a86d232a8fb5ba4bb742a279c", "score": "0.6971561", "text": "def list\n response = site[resource[:user]].get\n decode response.body\n end", "title": "" }, { "docid": "6ce2c00c4f33d4b11693fc0d73292b70", "score": "0.69692564", "text": "def get_user_list\n\...
8448620c1746d3d0cfef52005fa6bcbc
Retrieve a single page of SimInstance records from the API. Request is executed immediately.
[ { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.0", "text": "def get_page(target_url); end", "title": "" } ]
[ { "docid": "b8e566eeef3134716865c97ea0ba7653", "score": "0.60334057", "text": "def index\n # Get the records for the entity.\n begin\n @parcel = get_paginated_records_for(\n :for => Instance,\n :entity => params[:entity_id],\n :start_index => params[:start_index],\n :max_r...
f26cfa4a9983482f9fa735900626d5cd
Return all deliveries for this object
[ { "docid": "ef278d62c518d541a51b9433e3d6ce9e", "score": "0.8270189", "text": "def deliveries\n @deliveries ||= begin\n @database.select('deliveries', :where => {:message_id => self.id}, :order => :timestamp).map do |hash|\n Delivery.new(self, hash)\n end\n end\...
[ { "docid": "a043a2df88ccacb0a1d3c00a979b9981", "score": "0.76938516", "text": "def deliverables\n return Deliverable.where(project_id: @project.id)\n end", "title": "" }, { "docid": "9f94c32afdd1fd39d50ee0372fe52a55", "score": "0.7154604", "text": "def getDeliverables\n re...
64b39304a5f3c6fbbd6852bf24851c53
saves the event to db
[ { "docid": "6cd0dee6ef81b1157ecea2aab37a92bb", "score": "0.0", "text": "def invite_all_members\n @society = Society.find(params[:society_id]) \n @event = Event.find(params[:event_id])\n @user = User.find(session[:user_id])\n \n if !@society.has_admin(@user.id) or !(@so...
[ { "docid": "f316420072ed54bb65498992ab19c184", "score": "0.7567673", "text": "def save_to_events\n Event.create({\n :id => @id,\n :title => title,\n :group_name => group_name,\n :time => time,\n :address => address,\n :location => location,\n :link => link,\n :...
2b40b1d276da6b04372307e3dea22a95
send HTTPS GET request and return instance of Itrp::Response
[ { "docid": "6dd3ff88f9523b0c9df78c45dfd7637e", "score": "0.0", "text": "def get(path, params = {}, header = {})\n _send(Net::HTTP::Get.new(expand_path(path, params), expand_header(header)))\n end", "title": "" } ]
[ { "docid": "44168c833807f52c53e985503140284d", "score": "0.73718333", "text": "def httpsRequest (url)\n\turi = URI.parse(url)\n\thttp = Net::HTTP.new(uri.host, uri.port)\n\thttp.use_ssl = true\n\thttp.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\trequest = Net::HTTP::Get.new(uri.request_uri)\n\tresponse = ...
803806fe08b5ceea7d547a5d25a3f37c
_index__1_filter_get_genre _index__1_filter_get_categories(filter_genre) Return => Array
[ { "docid": "f3c8a4bc7fa7b0b3bb85e730640eab2f", "score": "0.8452548", "text": "def _index__1_filter_get_categories(filter_genre)\n \n filter_categories = []\n \n if filter_genre != nil\n # Get: filter_genre\n _filter_category = params['fil...
[ { "docid": "d3264b37f1178277fcbd9086e034a335", "score": "0.66707116", "text": "def genres\n to_array search_by_itemprop 'genre'\n end", "title": "" }, { "docid": "d7b0b4c4fa809885e5098652c7bd3d0e", "score": "0.63737166", "text": "def get_categories\n metadata['catgry'].col...
d3a4724302037d1a4d5461dafd6cd5b4
I worked on this challenge with: Austin Dorff. I spent [0.75] hours on this challenge. Complete each step below according to the challenge directions and include it in this file. Also make sure everything that isn't code is commented in the file. 0. Pseudocode What is the input? array, min_size for the array, value opt...
[ { "docid": "d58c8c56cd40389858f053e5de503431", "score": "0.79470134", "text": "def pad!(array, min_size, value = nil) #destructive\n diff = min_size - array.length\n if (diff > 0)\n while (diff > 0)\n array.push(value)\n diff -= 1\n end \n end\n p array\nend", "title": "" }...
[ { "docid": "e04e36ed7563a2412a77f8470793c7e7", "score": "0.83915365", "text": "def pad!(array, min_size, value = nil) #destructive\n if min_size <= array.length\n return array\n elsif min_size > array.length\n solution_array = array\n times_to_pad = min_size - array.length\n times_to_pad.t...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "d054b3e0d95a91f97388c0b46d0f1d76", "score": "0.0", "text": "def set_attribute\n @banner = Banner.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...
b774ba8da9c112ec91eac971c3d5019d
POST /leagues POST /leagues.json
[ { "docid": "d35ac6f76773797f240e56deb062f9ce", "score": "0.60080093", "text": "def create\n @league = League.new(params[:league])\n\n if @league.save\n redirect_to @league, notice: 'League was successfully created.'\n else\n render action: \"new\"\n end\n end", "title": "" }...
[ { "docid": "e42c24d4cdea4b76bd5b7dcf000c9f70", "score": "0.67970383", "text": "def create\n @league = League.new(params[:league])\n\n respond_to do |format|\n if @league.save\n format.html { redirect_to @league, notice: t(\"controllers.leagues.create.success\") }\n format.json {...
0fdb91ebdb8c69acc53e3b241b1b3e0e
Instantiate a new topping. name The String name of the topping. Returns a new Topping object.
[ { "docid": "d7697c8a5e1b439d61a759c31cb2dfe6", "score": "0.0", "text": "def initialize(name, vegetarian: false)\n @name = name\n @vegetarian = vegetarian\n end", "title": "" } ]
[ { "docid": "54797cecb7ea3fcb5b12de1c101164fb", "score": "0.6252617", "text": "def create\n @topping = Topping.new(params[:topping])\n\n respond_to do |format|\n if @topping.save\n flash[:notice] = 'Topping was successfully created.'\n format.html { redirect_to(@topping) }\n ...
ef1b50be7e9b0a07ee84b70943e8b699
Perform XOR of two hex strings
[ { "docid": "e27c518a99fec74759954fe9f81cfff6", "score": "0.8383744", "text": "def hex_XOR(hex1, hex2)\n bin1 = hexToBin(hex1)\n bin2 = hexToBin(hex2)\n \n #XOR result in binary\n xorBin = \"\"\n \n for i in 0..bin1.length-1 do\n xorBitResult = bin1[i].to_i ^ bin2[i].to_i\n ...
[ { "docid": "ca9eb1f8f2488b4140ce0d2fa7bd3784", "score": "0.87638295", "text": "def xor_hex(a, b)\n raise \"Unequal buffers passed.\" if a.length != b.length\n (a.hex ^ b.hex).to_s(16)\nend", "title": "" }, { "docid": "692290b1416223659b1fedd106a11027", "score": "0.84764683", "text"...
865186c32b6b39f42c6c82c11fc6a17d
Enroller view to see enrolled subjects and button to enroll new subjects
[ { "docid": "af85c40e72e7e23f0ef5c60d3be66d69", "score": "0.0", "text": "def index\n @enrolled_patients = current_user.enrolled_patients.eager_load(:jurisdiction)\n redirect_to(root_url) && return unless current_user.can_create_patient?\n end", "title": "" } ]
[ { "docid": "996299e6cdde117de6e20d89932e2c98", "score": "0.709302", "text": "def active_subjects_management\n @school = current_user.get_managed_school\n @subjects = @school.all_active_subjects\n \n add_breadcrumb \"Select the subject\", 'active_subjects_management'\n end", "title": "" ...
302bb099b75cb1ad2add65a63e24d4bc
Returns an array of length of the number of degrees of freedom set in +Database.new+ with the coordinates of the center of mass in a specific time. [time]Selects the time. The allowed range is 0 to to the number of timesteps set in +Database.new+ minus 1.
[ { "docid": "9d4fbdc29d3c5d0f577591ce142b8f16", "score": "0.559561", "text": "def get_center_of_mass(time)\n\t\tcheck_time(time)\n\n\t\tm = @m.inject(:+)\n\t\tpvs = (0..@n-1).map { |i| self.get_coords(i,time) }\n\n\t\t(0..@dof-1).map do |q|\n\t\t\t(0..@n-1).inject(0) {|sum,n| sum + @m[n] * pvs[n][q]} / m...
[ { "docid": "313c74ec69e259c6517d6cfa7154218c", "score": "0.53501105", "text": "def get_coords(particle, time)\n\t\tcheck_particle(particle)\n\t\tcheck_time(time)\n\n\t\t(0..@dof-1).map do |i|\n\t\t\t@data[time][@n*i + particle]\n\t\tend\n\tend", "title": "" }, { "docid": "6f3f5a26f745225bde2...
0484b2da22502d9385cb12df4a20961b
returns whether or not the index stores data with revision info
[ { "docid": "7f7255fea8a70404b1a74b85ae761922", "score": "0.0", "text": "def inline?; false; end", "title": "" } ]
[ { "docid": "002226e0e3c19327a5cf1af0f4ca43f8", "score": "0.6598399", "text": "def index_valid?\n timestamp = File.open(@index_path, 'rb') { |f| read_int(0, f) }\n timestamp == @data_timestamp\n rescue\n false\n end", "title": "" }, { "docid": "35e5dbc5495fabe520278490c0f...
e5f2706f954c13a3d2147594551a2d26
Validate the attached image is image/jpg, image/png, etc
[ { "docid": "43d45d62b2cad46f17570a1efe0a2ff1", "score": "0.0", "text": "def pretty_name\n self.name + ' (' + self.japanese_name + ')'\n end", "title": "" } ]
[ { "docid": "94d3194ef0077359e31f03c390fb7a3a", "score": "0.81522477", "text": "def correct_image_type\n if image.attached? && !image.content_type.in?(%w(image/jpeg image/gif image/png))\n errors.add(:image, :blank, message: I18n.t(\"validates.image_format\"))\n end\n end", "title": "" ...
7ede72aca90f7e8a3d396b70672434d3
Will add a user to a group with member privileges
[ { "docid": "37ad7800502ea4fd15bc77beacbacccf", "score": "0.73642254", "text": "def add_group_as_member(group)\n self.groups.push group\n end", "title": "" } ]
[ { "docid": "92865b2deba4da39174f2b9da74f1905", "score": "0.8158298", "text": "def add_user_to_group(user, group)\n\t\t\tend", "title": "" }, { "docid": "0ee875bd631ecea192d3d31a7c75f5c6", "score": "0.80321646", "text": "def add_user_member(user, group)\n ids = users_by_group_id(gr...
e686cf9103ecd50d612884046712ccec
Internal: Send any unknown methods to the template. This is done so you don't have to access them through h. Examples class XxxPresenter "mallard" end ... end
[ { "docid": "b9bf5692039e7b8764463a0d9c83083b", "score": "0.57986045", "text": "def method_missing(*args, &block)\n @template.send(*args, &block) if @template\n end", "title": "" } ]
[ { "docid": "1fbcb9f96a6efb312c5ac8f1e7f47713", "score": "0.65762603", "text": "def method_missing *args, &block\n @template.public_send *args, &block\n end", "title": "" }, { "docid": "cd956040f9439e65037247a454c81a1f", "score": "0.6151982", "text": "def method_missing(_method, *...
ce03e253e5d26a5420023571f17ab52e
DELETE /gps/1 DELETE /gps/1.xml
[ { "docid": "459ef1590b609141a0e6f3bcd8081e2c", "score": "0.6979258", "text": "def destroy\n @gp = Gp.find(params[:id])\n @gp.destroy\n\n respond_to do |format|\n format.html { redirect_to(gps_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
[ { "docid": "822ddea2e45bf78350003645efcbdb54", "score": "0.6514967", "text": "def delete uri, args = {}; Request.new(DELETE, uri, args).execute; end", "title": "" }, { "docid": "df26116eb86dbadafed7137f9e3c2f9e", "score": "0.6443188", "text": "def delete!\r\n return nil unless exi...
f100c8ba4361c1e850c82460e37765d1
Gets the secretText property value. Readonly; Contains the strong passwords generated by Azure AD that are 1664 characters in length. The generated password value is only returned during the initial POST request to addPassword. There is no way to retrieve this password in the future.
[ { "docid": "28fc5c5a8954ec64c190f3e9e146b27a", "score": "0.82880867", "text": "def secret_text\n return @secret_text\n end", "title": "" } ]
[ { "docid": "5a33a03424688ed2d6bf375bf61ecf1b", "score": "0.7523798", "text": "def secret_text=(value)\n @secret_text = value\n end", "title": "" }, { "docid": "6ba999e90a22bb4d7b23324ec98c8af4", "score": "0.6978441", "text": "def secret\n @secret ||...
c6c852fe756a94971741d1d1238e21ec
find a named scope which may be relative to any point in the ancestry of the current scope. Return the properties for that scope.
[ { "docid": "3d528f21bd2fbdf2596336594acda4e9", "score": "0.0", "text": "def find(name)\n name = resolve(name)\n prefix = active\n while prefix.pop\n result = @seen[prefix + name]\n return result if result\n end\n {}\n end", "title": "" } ]
[ { "docid": "d8a1cedd63c38457b68cc3dc49aedf21", "score": "0.6587656", "text": "def scoped_by( *scope )\n scope = scope.length == 1 ? scope.first : scope\n sub_map = @map.get( expand_key( scope ) ) || {}\n Properties.new( sub_map )\n end", "title": "" }, { "docid": "da5eb2048...
66e9261b87085d381ac1b5aa167a391b
How many recipes are there in total?
[ { "docid": "4984a3b101cfd66d6905178f4cc8110c", "score": "0.0", "text": "def recipes\n db_connection do |conn|\n conn.exec(\"SELECT * FROM recipes\").to_a\n end\nend", "title": "" } ]
[ { "docid": "d68724722cf4b948d2272d3bd5ada2f2", "score": "0.78006816", "text": "def number_ingredients(perfect_10_recipe)\n return perfect_10_recipe.size\nend", "title": "" }, { "docid": "fba3203dc19232c9335df90c5654d97d", "score": "0.77883345", "text": "def number_of_calories\n ...
d9bbadbdf336ca0995c54351415bac8c
Execute a single test in a FitNesse TableTable.
[ { "docid": "1392385ae4d14da7db51f47d337541c6", "score": "0.5902934", "text": "def do_table(table)\n # If the digest of this table already exists in @output files,\n # simply return the results that were already generated.\n existing = @@output_files[table_digest(table)]\n if existing...
[ { "docid": "9cb771854607fc4abeb08527e0612bd6", "score": "0.56330967", "text": "def run_test \n \n test_table = make_test_table(\"ml-100k/u1.test\")\n @testdata = MovieTest.new(test_table)\n end", "title": "" }, { "docid": "9eced433510b413e1e1c5ee3f2068...
4dcb885125c9519d2611abac74325067
get all photosets for a user
[ { "docid": "8071d51d83085351b62486fbac0bb308", "score": "0.7200494", "text": "def get_sets\n @client.get_sets(flickr_user_id) do |set|\n photoset = photosets.find_or_initialize_by_flickr_photoset_id(set[:id])\n photoset.update_attributes(set)\n end\n end", "title": "" } ]
[ { "docid": "e930fd081d674c2f3da5c73101ff39f7", "score": "0.83020204", "text": "def photosets\n PhotoSet.api_query( 'photosets.getList', @client, :user_id => id )\n end", "title": "" }, { "docid": "8e7e64b0b28dd925324979a7ebe47acd", "score": "0.74174106", "text": "def get_sets...
47d05dd60ab4f255f759cc9ccf21991e
GET /absences/new GET /absences/new.json
[ { "docid": "1f7681e554fe414bd741e2e8cc245483", "score": "0.7857366", "text": "def new\n @absence = Absence.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @absence }\n end\n end", "title": "" } ]
[ { "docid": "97da7c6b8200daf60970ea8b29425277", "score": "0.71542805", "text": "def new\n @evidence = Evidence.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @evidence }\n end\n end", "title": "" }, { "docid": "3c21748f7dd0239d03b4...
1c916e5728ebca85c46839d80a24b3dc
Since it's chronologically ordered and belongs to the user.
[ { "docid": "a10de89b9b8b34dd9e2d612640011dc4", "score": "0.0", "text": "def shout_feed\n ShoutFeed.new self_and_followed_user_ids\n end", "title": "" } ]
[ { "docid": "4269b6662cb58654f6333eae5c78ff9e", "score": "0.6757222", "text": "def complete_order\n @user = User.find(session[:user_id])\n end", "title": "" }, { "docid": "81822d22a804e9cd09720a7565eaeb9c", "score": "0.6369", "text": "def related_object; @user end", "title":...
a3bfed34b81a7987a85114cf4ef74368
registration_success_url returns the url to redirect to if registering the tool proxy is successful
[ { "docid": "0db8c18a89796fd0d892a73d6452b188", "score": "0.7839601", "text": "def registration_success_url(tp_guid)\n \"#{registration_request.launch_presentation_return_url}?status=success&tool_proxy_guid=#{tp_guid}\"\n end", "title": "" } ]
[ { "docid": "4b934334c3571fedab9d6a827937d155", "score": "0.78844804", "text": "def registration_success\r\n permanent_redirect_to register_success_url\r\n end", "title": "" }, { "docid": "59864866290f490d8e9c58d804c2e1f2", "score": "0.70239794", "text": "def check_registration\n ...
1f4530fc9084aace7b942f48b90454d4
PUT /deliverables/1 PUT /deliverables/1.xml
[ { "docid": "66c76860ed943b6dd82edd0e1e9e9e7b", "score": "0.54004174", "text": "def update\n person = Person.find(params[:person_id])\n person_teams = person.teams\n @deliverable = Deliverables.find(params[:id])\n submitter_team = @deliverable.team\n\n if person.is_staff || (person_teams ...
[ { "docid": "ffe577e7df547369e3ab767064ed7189", "score": "0.6373082", "text": "def update\n @deliverable = Deliverable.find(params[:id])\n\n respond_to do |format|\n if @deliverable.update_attributes(params[:deliverable])\n flash[:notice] = 'Deliverable was successfully updated.'\n ...
9fd3f9df0dc8b1d1f593245cc3d18267
If your adapter is stateless you can get away with just sending your message from this method rather than implementing the whole set.
[ { "docid": "e357ef75c2047f6d2f7fd77ae3f79f1a", "score": "0.0", "text": "def send(message)\n end", "title": "" } ]
[ { "docid": "2b029703345b6779a165704ac95fbf49", "score": "0.5879482", "text": "def sending data\r\n @adapter.sending data\r\n end", "title": "" }, { "docid": "d363caefe61e3a4850d8c5b44a7dc7cb", "score": "0.5872235", "text": "def call\n raise NotImplementedError, 'Implem...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "2f4cb38c81e310654b49a828e65174dc", "score": "0.0", "text": "def update!(**args)\n @model_evaluation = args[:model_evaluation] if args.key?(:model_evaluation)\n end", "title": "" } ]
[ { "docid": "150fa2bdc1fc43d28ac45e2278a1f797", "score": "0.7012263", "text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "t...
4b0781f99f0774a1ea10226c7fc3f528
sends the new user details to admin Template => app/views/send_mail/new_user_account parameter => user object
[ { "docid": "a841b66bc002fae5c303c131915b45a8", "score": "0.8281368", "text": "def new_user_account(user)\n @user = user\n mail(:to => ADMIN_EMAILS, :bcc => DEVELOPER_EMAILS, :subject => \"New Account created : #{user.first_name}\")\n end", "title": "" } ]
[ { "docid": "1b0eb25fe779052eaf16117100dff029", "score": "0.8233775", "text": "def new_user(user)\n @user = User.last\n @thisAdmin = \"delivery@nextpakk.com\"\n\n mail(:to => \"#{@thisAdmin}\", subject: \"New NextPakk User.\")\n end", "title": "" }, { "docid": "e9547b654dfd0fc8b79b1...
b0a8187e3dc346cc37b062369df19580
This endpoint is deprecated.
[ { "docid": "9a75d3dabd8546148b16550d54ddfa83", "score": "0.0", "text": "def get_project_device_session_junit_using_get_with_http_info(device_session_id, project_id, run_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AdminApi.get_project_devic...
[ { "docid": "77b0c109415e0f3e761fd3df7d4dff39", "score": "0.7556771", "text": "def deprecated; end", "title": "" }, { "docid": "77b0c109415e0f3e761fd3df7d4dff39", "score": "0.7556771", "text": "def deprecated; end", "title": "" }, { "docid": "77b0c109415e0f3e761fd3df7d4dff...
2e98b076165d4710dcb329cd28668725
Method: constructor Arguments: database (string) name of the migration's database
[ { "docid": "916d8d973a4f71e905c746f9dbc6daea", "score": "0.6803051", "text": "def initialize(database)\n\n if File.exists?(\"./db/\" + database + \".db\")\n puts \"database #{database} already exists. opening...\".green\n @dbr = SQLite3::Database.open(\"./db/\" + database + \".db\")\n...
[ { "docid": "8aad4016a82b2099fff512d4b96db397", "score": "0.7783028", "text": "def initialize(database)\n @database = database\n end", "title": "" }, { "docid": "8aad4016a82b2099fff512d4b96db397", "score": "0.7783028", "text": "def initialize(database)\n @database = datab...
d8063ecb10ab4b0638ed75587e3e2473
GET /post_flags GET /post_flags.json
[ { "docid": "543883a298d2c0b356d20632d308b135", "score": "0.68570936", "text": "def index\n @post_flags = PostFlag.all\n end", "title": "" } ]
[ { "docid": "05e3673ac97e0413166f208c4e58509b", "score": "0.7746992", "text": "def flags\n get(\"#{url}/flags\")\n end", "title": "" }, { "docid": "05e3673ac97e0413166f208c4e58509b", "score": "0.7746992", "text": "def flags\n get(\"#{url}/flags\")\n end", "title": ...
72718cdbf13c18ce3566d3f6984a9395
GET /sp_company_infos/1 GET /sp_company_infos/1.json
[ { "docid": "4d473c7e10ff4674bf80a5bee4cc92c3", "score": "0.80152977", "text": "def show\n @sp_company_info = SpCompanyInfo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sp_company_info }\n end\n end", "title": "" } ]
[ { "docid": "507a0be1dce99bb9e986822632e27fa5", "score": "0.7610785", "text": "def company_information(params)\n get('company-information',params)\n end", "title": "" }, { "docid": "6475f9c783bba260e7421cf2182ba666", "score": "0.75615305", "text": "def index\n @companie...
24d36feac544f2fee8035586d3852054
attr_get_sb4(attr_type, strict = true) Gets the value of an attribute as `sb4' datatype.
[ { "docid": "43e9b625003414d8caf0b1e166e24d40", "score": "0.8623605", "text": "def attr_get_sb4(attr_type, strict = true)\n #This is a stub, used for indexing\n end", "title": "" } ]
[ { "docid": "87079c8e8bc779c2596ed6b4284d69f8", "score": "0.73607135", "text": "def attr_get_sb8(attr_type, strict = true)\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "749508e08c35f6eb73ccee703923f6d4", "score": "0.7330621", "text": "def attr_get_u...
198a0328d5068a508920ecaa2af551df
roulette wheel selection for questions, depending on correct answer ratio by user. Implementation by Jakub Hampl. Returns array of question_ids.
[ { "docid": "812290e445b3e1bd41041f8435222bbc", "score": "0.7746114", "text": "def select_random_roulette(question_ids, n, user)\n logger.debug \"### roulette selection\"\n probs = wrong_ratio_for(question_ids, user)\n\n selected = []\n (n*INCREASE_FACTOR).to_i.times do\n break if probs....
[ { "docid": "82cd42b8957d0af5525bd92a553637eb", "score": "0.63188595", "text": "def survivor_roulette_wheel_selection\n\t selected = Population.new\n selected_fitness = []\n\t\tsum = @current_fitness.inject(0.0){ |res, item| res + item }\n\t\tif sum == 0 \n\t\t # there is no hypothesis in population...
31a653210e05c517c38694089a48e58c
Return the program name with the front URI and the parent's front URI.
[ { "docid": "54fb59fa8f10c99468b9b929a0552edc", "score": "0.7984231", "text": "def program_name\n additions = []\n\n # front server URI\n if model[:front]\n additions << \"front: %s\" % model[:front].uri\n end\n\n # parent front server URI\n if model[:pa...
[ { "docid": "97627e187d5d3297a3ec3d067cc30dbd", "score": "0.709598", "text": "def program_name\n @program_name || File.basename($0)\n end", "title": "" }, { "docid": "3e3c83d8c52302e3f0b28dfda750103c", "score": "0.69951195", "text": "def program_name\n program.name if p...