query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
fd41c9839beb088fe7f8efd67084885a
Add an Item (:item_id) to a section (:section_name)
[ { "docid": "8548fd5299bbaef906216640fc969830", "score": "0.8410226", "text": "def sell_shop_item_section_add(item_id, section_name, params={})\r\n url = api_url \"/sell/shop/items/#{item_id}/add_section\"\r\n req = request_params({currency: @currency, locale: @locale}.merge(params))\r\n l...
[ { "docid": "9a0adb23ce0ebf206bc42d6e81bb2945", "score": "0.6525187", "text": "def sell_shop_section_create (section_name, params={})\r\n url = api_url \"/sell/shop/sections\"\r\n req = request_params(params)\r\n load = MultiJson.dump name: section_name\r\n\r\n feed_or_retry do\r\n ...
b363fcbc2259dadf297e8dccab267533
Otra forma con bloques
[ { "docid": "3664ceb137ad76d4341e33a1e3b17d98", "score": "0.0", "text": "def nuestro_reportar(nombre)\n fp = File.open(nombre, \"w\")\n yield(fp)\nensure\n fp.close\nend", "title": "" } ]
[ { "docid": "3ed098d5223cf9d3220f3ee3387afdeb", "score": "0.61159307", "text": "def borde_completo\r\n\t\tx = 0\r\n\t\to = 0\r\n\t\ttoken = [\"X\", \"X\", \"X\", \"X\", \"X\", \"O\", \"O\", \"O\", \"O\", \"O\"].shuffle\t\r\n\t\t@places.each do |row|\r\n\t\t\trow.each_with_index do |element, index|\r\n\t\...
890e27713e948e5286f082421f7666ee
Don't autocreate issues on failure? Default is `false`. Respects the `BOXEN_NO_ISSUE` environment variable.
[ { "docid": "511554544e46a09d40727960b054f86a", "score": "0.53382653", "text": "def stealth?\n !!ENV[\"BOXEN_NO_ISSUE\"] || @stealth\n end", "title": "" } ]
[ { "docid": "78cd3a3a6e49b0e20d1ba2fc9873bfb8", "score": "0.58604205", "text": "def no_error_report\n false\n end", "title": "" }, { "docid": "de197dfceeb6f499b53b9ab7de264732", "score": "0.58135796", "text": "def report_broken\n @working = false\n end", "title": "...
ac05692fb624b07f66276b61cf27204e
This utility class method is used in this class as well as in GithubWebHook
[ { "docid": "7a8bbfcecff3555e4bc5fac59cd263ef", "score": "0.0", "text": "def fetch_stats_for_commit(sha)\n warn \"get details for repo: #{self.name} sha: #{sha}\"\n \n cache_key = '%s_%s_%s' % [self.parent.github_org, self.name, sha]\n commit_details = simple_cache(cache_key) do\n ...
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.663479", "text": "def private; end", "title": "" }, { "docid": "440deaf2ea35ad72063540b81d37c39d", "score": "0.5543254", "text": "def hook_class_name; end", "title": "" }, { "docid": "2d8d9f0527a44cd0febc5d6cbb3a2...
bce29df35d13541e03d42f664e59ac5d
, :dependent => :destroy
[ { "docid": "b3d14aa54ea17f7c3f4646356b4df5b6", "score": "0.0", "text": "def average_of(predecessors, section)\n predecessor_milestones = gather(predecessors, section)\n gathered_values(section).map do |m| \n m.average_of(predecessor_milestones[m.rollbook_entry_id])\n end\n end", "titl...
[ { "docid": "9e10d0b5053d870d97ff7a231cf2281e", "score": "0.72910047", "text": "def before_destroy\n\n end", "title": "" }, { "docid": "f5a083b079ac793ee5f4a51c61c3832a", "score": "0.7276887", "text": "def after_destroy\n end", "title": "" }, { "docid": "1fc1c66c5cec058b...
cd3ad5e7f5f961de3f33579b38a3885d
=== Build array containing all possible parameter settings. === Internally also build hash for quick checks if an equivalent state is already in there.
[ { "docid": "c327bcebfbca849806a737eb6dd9db21", "score": "0.5482995", "text": "def get_all_distinct_states(params, domain, forbidden_combos, out, fixed_ass)\r\n\tsorted_params = params.sort{|x,y| predecessor(x,y) ? -1 :1}\r\n\r\n\tall_distinct_states = []\r\n\tall_states = Hash.new\r\n\tcurr_state = Hash...
[ { "docid": "715781cda682a3be3b6216515ec35f72", "score": "0.59459996", "text": "def options_hashlist\n @config.inject([]) { |a, option| a << option[1].to_hash }\n end", "title": "" }, { "docid": "884680f4dc1c2e36b1edaeadfb2cdf8f", "score": "0.59111065", "text": "def generate_s...
6b225058371d5854f4080c42747a8156
PUT /renglon_recibo_docs/1 PUT /renglon_recibo_docs/1.json
[ { "docid": "38cbcdd97f846d0c7d6b44a21ac40355", "score": "0.77062404", "text": "def update\n @recibo = Recibo.find(params[:recibo_id])\n @renglon_recibo_doc = @recibo.renglon_recibo_docs.find(params[:id])\n\n respond_to do |format|\n if @renglon_recibo_doc.update_attributes(params[:renglon_...
[ { "docid": "b1b5a63015411708221becae876ecdcb", "score": "0.6886182", "text": "def create\n @recibo = Recibo.find(params[:recibo_id])\n @renglon_recibo_doc = @recibo.renglon_recibo_docs.build(params[:renglon_recibo_doc])\n\n respond_to do |format|\n if @renglon_recibo_doc.save\n #for...
fd38210344ee78af9f48a56ed1f0f87e
Returns true if the message passes all of the filters
[ { "docid": "d3d17d0a69219a271c1be39e178cad61", "score": "0.733851", "text": "def filtered?(message)\n params[:filters].values.all? do |filter|\n regex = Regexp.new(filter)\n message.match(regex)\n end\n end", "title": "" } ]
[ { "docid": "244eb7a5d6832a10bb339211e41da118", "score": "0.65797234", "text": "def all_apply?(filters)\n self.class.all_apply?(filters)\n end", "title": "" }, { "docid": "3f51832fb1cb0aa54232718ae1ba1eea", "score": "0.6338336", "text": "def processable?\n hub.filters.a...
c9852cc00473c295c8237453bfe24f51
Get roles for a client Permissions Needed: ROLES_ADMIN
[ { "docid": "4ff557e4e119b98f47ab5c1104c60dd4", "score": "0.0", "text": "def get_client_roles_with_http_info(client_key, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: AuthRolesApi.get_client_roles ...\"\n end\n # verify the required pa...
[ { "docid": "338cc6846addfd5aa0e58b623156df9b", "score": "0.7799458", "text": "def get_roles\n @client.raw('get', '/config/roles')\n end", "title": "" }, { "docid": "49ebb4505dcb866dc768cba9d663758d", "score": "0.7751059", "text": "def get_roles\n return @client.raw(\"get\"...
10893c993ae27d59f8ae3d5bbc05e2bc
Create an attribute that is just barely invalid.
[ { "docid": "5365d84ab480188954a3b4cd03895f9d", "score": "0.0", "text": "def barely_invalid_string(boundary, length, valid_char)\n if boundary == :max\n invalid_length = length + 1\n elsif boundary == :min\n invalid_length = length - 1\n else\n raise ArgumentError, \"boundary must be :max or ...
[ { "docid": "8feccec9dbd849859c09dc5f5ca55310", "score": "0.68279564", "text": "def be_invalid_with(attribute, *values)\n BeInvalidWith.new(attribute, values)\n end", "title": "" }, { "docid": "01e24cfc2032bc33a34bd78f85de82d0", "score": "0.6464361", "text": "def a...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "687175bc6a46ca749b57db78611588e7", "score": "0.0", "text": "def set_client\n @client = Client.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339844", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6014297", "text": "de...
b69d09c1052e95c31d08f018e13ca707
decrypt artifact, when ruby gpgme version == 1.0.8 (aka 2.0.5) is installed uses gpg commandline program directly
[ { "docid": "45793659aead55e0be47abbb33dee848", "score": "0.7163424", "text": "def decrypt_artifact_compat\n require 'tempfile'\n\n v 'gpg file stat: ' + File.stat(@artifact_gpg.path).inspect\n\n if @verify\n subsection 'Verify artifact', color: :green, prefix: @output_prefi...
[ { "docid": "b20f723282e299282186f310138fcba3", "score": "0.6947622", "text": "def decrypt_artifact_new\n crypto = GPGME::Crypto.new pinentry_mode: GPGME::PINENTRY_MODE_LOOPBACK, password: @gpg_passphrase\n\n if @verify\n subsection 'Verify artifact', color: :green, prefix: @output...
626b4ffcc8e9278dc82ba2b81c70ddd2
A trivial example of reimplementing a while loop using a method. The block condition is evaluated each time around the loop:
[ { "docid": "4a70f017cfc29f04405b152a5b396107", "score": "0.8087935", "text": "def my_while(cond, &body)\n while cond.call\n body.call\n end\nend", "title": "" } ]
[ { "docid": "e9a7454d4bd6ba38661b74d373c601d2", "score": "0.7822892", "text": "def while(&block)\n\t\t\t\t\trepeat &block\n\t\t\t\tend", "title": "" }, { "docid": "bfc0fbd2dc1f24b63d96cff3cc0f0785", "score": "0.7635194", "text": "def while(&blk)\n loop{ !blk[] }\n end", "title...
bb42a79611e6b79198638dc2ff3d2ede
Returns payment source class.
[ { "docid": "0d1369aeeea3308b178344048b17ecb9", "score": "0.73114085", "text": "def payment_source_class\n ::Spree::PaymentSource::PAYONE::PayoneEWalletPaymentSource\n end", "title": "" } ]
[ { "docid": "f0235c34953f7bcd73b0f6cb337ff00e", "score": "0.8272894", "text": "def payment_source_class\n nil\n end", "title": "" }, { "docid": "7f04e87f3a7f477835fdc61a719b9900", "score": "0.74290115", "text": "def payment_source_class\n ::Spree::PaymentSource::PAYON...
402ff821fd31f766ec991e08273b6d6f
reduce 383 omitted reduce 384 omitted
[ { "docid": "9d3917b23da23098b0ae8fd4e89fd514", "score": "0.0", "text": "def _reduce_385(val, _values, result)\n @context.in_argdef = false\n \n result\nend", "title": "" } ]
[ { "docid": "bcc77ea412992f9c87aad138efd40a40", "score": "0.709893", "text": "def _reduce_236(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "1bdc31b5d296ff37d53ddd9c8291239f", "score": "0.70956093", "text":...
d156de5a45b4d3317bb6c2279af16a6d
read the contents of a file in a workspace bucket into memory params +workspace_bucket_id+ (String) => ID of workspace GCP bucket +filename+ (String) => name of file return +StringIO+ contents of workspace file
[ { "docid": "089cb286bcb010ae0e54415153c989c1", "score": "0.8172843", "text": "def read_workspace_file(workspace_bucket_id, filename)\n file = self.get_workspace_file(workspace_bucket_id, filename)\n file_contents = file.download\n file_contents.rewind\n file_contents\n end", "title": ""...
[ { "docid": "e603410cb564c42a2218952c1fb04c30", "score": "0.76603657", "text": "def get_workspace_file(workspace_bucket_id, filename)\n bucket = self.get_workspace_bucket(workspace_bucket_id)\n bucket.file filename\n end", "title": "" }, { "docid": "30efae2c1d855990711d4c52dbe5fb94", ...
f442077a1fbfcfe5319f43137c3e68fd
Runs in O(|E|) time.
[ { "docid": "dce5d6f6f783834a69a5ef241d7f3810", "score": "0.0", "text": "def graph_bfs(source)\n last_edges = {\n source => nil\n }\n\n queue = [source]\n until queue.empty?\n vertex = queue.shift\n\n vertex.out_edges.each do |e|\n to_vertex = e.to_vertex\n\n next if last_edges.has...
[ { "docid": "ba1958a12d523bd63f8d13a97f2ed084", "score": "0.56677365", "text": "def fibSeq(n)\n\ta=[0]\t\t\t\t\t\t# O(1)\n\tn.times do |index|\t\t\t\t# O(n)\n\t\tif index==0\t\t\t\t# O(1)\n\t\t\ta[index]=0\t\t\t# O(1)\n\t\telsif index==1\n\t\t\ta[index]=1\n\t\telse\n\t\t\ta[index] = a[index-1] + a[index-...
1cf0874675ca7827607bde02ca49d76b
pulls out ":symbols" for each path and returns them in array returns array of symbols in arg as string
[ { "docid": "42e13def1bd56e6a673beb801828653a", "score": "0.539843", "text": "def path_parse(string)\n string.scan(/:(\\w+)\\W/).flatten\n end", "title": "" } ]
[ { "docid": "01a75b40f3048691f5dbe7789e546c52", "score": "0.65131545", "text": "def symbols(flat_args)\n strings flat_args.select(&Symbol.method(:===)).map(&:to_s)\n end", "title": "" }, { "docid": "51687aa4e5c20ba40dfdb9da08866210", "score": "0.6466096", "text": "def filter_a...
9f7eb82f0e65a8b06dee6e5c894fef19
view a liability details
[ { "docid": "9be8fe17f03c375030b49cfd485bf728", "score": "0.66924495", "text": "def view_liability\n @liabilities = Liability.find(:all, :conditions => 'is_deleted = 0')\n @currency_type = currency\n end", "title": "" } ]
[ { "docid": "a4c5254633d3fcb253b5fd9e64a8b936", "score": "0.67941815", "text": "def liability_pdf\n @liabilities = Liability.find(:all, :conditions => 'is_deleted = 0')\n @currency_type = currency\n render :pdf => 'liability_report_pdf'\n end", "title": "" }, { "docid": "2af2a9e4b14...
eb902f50174bc68be4034437c31e1984
Give a file and a test path, find the test for the given file in the test path. return nil if the test do not exists.
[ { "docid": "4d6c0f2d93ff7c26611fa54dc11788d1", "score": "0.7485057", "text": "def test_file(file, test_paths)\n test_paths = [] unless test_paths\n test_paths = [test_paths] unless test_paths.is_a?(Array)\n class_name = classname_with_file(file)\n # for each test path...
[ { "docid": "267b93b8a1cacf39ed5e322d7e9da016", "score": "0.6951757", "text": "def find_file_in_path(file, path)\n find_file(path + \"/\" + file)\n end", "title": "" }, { "docid": "c7b7aaf5e2dffbe9b9f2a664a9cb5174", "score": "0.64993757", "text": "def search_for_file(relpa...
c539524a7624d27caa4f1bafda71030e
show the widget, initially in the deactivated (collapsed) state opts => same as initialize's options
[ { "docid": "ee060b7d9d0cb2e8631dffe7172ad7f9", "score": "0.57714564", "text": "def show(opts={})\n @stack_opts ||= {:margin => 0}.merge(opts).merge(@options)\n @slot = app.stack(@stack_opts) { show_item }\n end", "title": "" } ]
[ { "docid": "6bebdbfbf951858171e5049dce9241b1", "score": "0.67444175", "text": "def show()\n self.active = true\n self.visible = true\n end", "title": "" }, { "docid": "6bebdbfbf951858171e5049dce9241b1", "score": "0.67444175", "text": "def show()\n self.active = true\n se...
59e87a10883121369724637a1f0193d9
If you dont understand what call backs are, this method would demonstrate it to you, basically a hello message is printed before the active record object is saved
[ { "docid": "302ddcaeff9e14d995e0bfbefa19645d", "score": "0.0", "text": "def hello\n puts \"Hello\"\n end", "title": "" } ]
[ { "docid": "14f9d10ad7aa3f33071f8f47a2bb02fe", "score": "0.69840515", "text": "def test\n puts \"(model): RUNNING before_save CALLBACK!!!##\"\n end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.6407176", "text": "def callbacks; end", "title": "" ...
d4c2059e4cbbce2d9ddabd233f7842c9
Add a condition under which this Task will be throttled.
[ { "docid": "e4127baaca3c5ebe02c5242c56cd8347", "score": "0.6984959", "text": "def throttle_on(backoff: 30.seconds, &condition)\n self.throttle_conditions += [\n { throttle_on: condition, backoff: backoff },\n ]\n end", "title": "" } ]
[ { "docid": "7881370912d7a186e4d51fc237a6077b", "score": "0.63106567", "text": "def condition=(cond)\n @queue << \"condition #{cond}\"\n end", "title": "" }, { "docid": "87d2d71119b4fd60d088e84ef94dbadd", "score": "0.6233234", "text": "def throttled?(key, threshold_value)\n ...
cc592d6f8a52130b909621a4237143f1
Checking condition "board" to see if all the square spaces have content. If all full => true. Using implicit return here (and in other blocks)
[ { "docid": "009cf26bda5dbd81de8209d6204b4c69", "score": "0.0", "text": "def won?(board)\n WIN_COMBINATIONS.each do|win|\n if (board[win[0]] == 'X' && board[win[1]] == 'X' && board[win[2]] == 'X') || (board[win[0]] == 'O' && board[win[1]] == 'O' && board[win[2]] == 'O')\n return win\n end\n ...
[ { "docid": "2eada7dadc8b263f67531f8326899bc1", "score": "0.8588422", "text": "def board_full?\n @board.each do |row|\n row.each do |col|\n if col == @empty_square\n #stop at first empty space found\n return nil\n end\n end\n end\n return true\n end", ...
94aa927dfda3ef3e485b9266f430b65e
Allow but deprecate public method calls to +meth+, if +meth+ is protected or private. +meth+ can be an array of method name strings or symbols to handle multiple methods at once. If +msg+ is specified, it can be used to customize the warning printed.
[ { "docid": "7f8e802515617af84e1dfa72a9040cdd", "score": "0.7597736", "text": "def deprecate_public(meth, msg=nil)\n include DeprecatePublic\n\n Array(meth).each do |m|\n message = (msg || \"calling #{name}##{m} using deprecated public interface\").dup.freeze\n message_meth = :\"_deprecat...
[ { "docid": "556fb8bc94951175be23796db2aff093", "score": "0.6229144", "text": "def deprecate(meth, message = nil)\n ::Sequel::Deprecation.deprecate(\"#{meth} is deprecated, and will be removed in Sequel 2.0.#{\" #{message}.\" if message}\")\n end", "title": "" }, { "docid": "99ff927e...
24260fc2af2fb4b00c5ccfa18d041d9b
New record, save, (with callbacks & validations if ActiveModel is loaded)
[ { "docid": "29353ec7289e8a3545869229d560472f", "score": "0.0", "text": "def create(*args)\n\t \t new(*args).send :create\n\t \tend", "title": "" } ]
[ { "docid": "977a1b907f6cc220d79cb1a883366fd4", "score": "0.7790911", "text": "def save!\n if new_record?\n _run_create_callbacks { _run_save_callbacks { _save! } }\n else\n _run_save_callbacks { _save! }\n end\n end", "title": "" }, { "docid": "7301a4c530e6b45...
fd725b15a73b289a90bdfc8461921814
"relay_header.distance" token extractor definition
[ { "docid": "898e4845ed8aa92a6103b967b1b90aae", "score": "0.86963886", "text": "def tokenizer_relay_header_distance\n V3::TokenExtractor.new(\n :distance,\n /\\dx\\d{2,3}\\s+(stile|mi|sl|mx)/i,\n 4 # (max size)\n )\n end", "title": "" ...
[ { "docid": "e7083d906aaa63f235d5b46059c6326f", "score": "0.7132642", "text": "def tokenizer_category_header_distance\n V3::TokenExtractor.new(\n :distance,\n /(?<!\\dx)(50 |100 |200 |400 |800 |1500 ) */i,\n / *(stile|mi|do|ra|fa|sl|MX|DF|DS|RN).*/i\n )\n end", "title": "" }, ...
332b5bfa67d635d05860c917bd684466
Process CategorizedBindings by calculating precedence, and then if satisfying the predicates, process the contained bindings.
[ { "docid": "4b8e91e4d51711d67283d659bfdf0be5", "score": "0.72454655", "text": "def bind_CategorizedBindings(o)\n precedences = o.predicates.collect do |p|\n prec = binder.category_precedences[p.categorization]\n\n # Skip bindings if the categorization is not present, or\n # if ...
[ { "docid": "7244e71ecb63653963308ee28e1669e0", "score": "0.48828462", "text": "def calculate_precedence\n self.precedence = 0\n return unless has_context_rules?\n\n context.values.each do |rules|\n rules.values.each do |rule_key|\n self.precedence += 1 if rule_key == \"other\"\n ...
0ab8f84c153394b0c23debaeb640c73a
Return whether lights are on or off
[ { "docid": "09eae29f487efe627cd42d32d2d67e9b", "score": "0.9046383", "text": "def lights_on?\n if @lights == true\n return true\n else\n return false\n end\n end", "title": "" } ]
[ { "docid": "f3a5c0757580df6e83b133e0b9b6ddee", "score": "0.8981382", "text": "def lightsOn?\n @turn_lights_on_off\n end", "title": "" }, { "docid": "30367cb9e6ac50c933bbbd8a544188fc", "score": "0.8920725", "text": "def lights_on?\n @lights_on\n end", "title": "" }, { ...
3ed6ea20577d98452a7bb6e4e3652a78
Default logging identifier is the class name. If log_id() method is redefined by the
[ { "docid": "2a98657a39bd291b3332152411b28311", "score": "0.8077455", "text": "def log_id\n @log_id ||= (self.is_a?(::Module) ? self.name.split(\"::\").last : self.class.name)\n end", "title": "" } ]
[ { "docid": "fb9717386335b82cc302d1dea9a6cc43", "score": "0.7432747", "text": "def log_identifier\n \"(Application:#{id},#{name})\"\n end", "title": "" }, { "docid": "e7ad4e1611f9e294bc154d7d18de2e6f", "score": "0.72592694", "text": "def log_identifier\n \"(Group:#{id},#{name})...
9ed5c07f440e54d87a2aab3112c56ce9
Symbolize all keys recursively within nested hashes and arrays.
[ { "docid": "3bf59cff06a2f9cff27ce752a9026d5f", "score": "0.81292653", "text": "def _symbolize_keys_recursively!(object)\n case object\n when self.class\n object.symbolize_keys!\n when ::Array\n object.each do |i|\n _symbolize_keys_recursively!(i)\n ...
[ { "docid": "b115099eed9006ca1703355ab7a41989", "score": "0.8377431", "text": "def symbolize_keys!(recursive = true)\n\t\tself.map! { |val| val.symbolize_keys! if (recursive && (val.is_a?(Hash) || val.is_a?(Array))); val }\n\tend", "title": "" }, { "docid": "35524a3bd7c58e24cd1db549abf661ef",...
e5c3984eeba2110b25ce8ad6a140b2dd
GET /hills/new GET /hills/new.json
[ { "docid": "840b808575c7f19f742156e82165e902", "score": "0.769361", "text": "def new\n @hill = Hill.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @hill }\n end\n end", "title": "" } ]
[ { "docid": "c6eaceb78d2bc94e0e60a773ac8aa21f", "score": "0.73598087", "text": "def new\n @trail = Trail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trail }\n end\n end", "title": "" }, { "docid": "7a1190f62fb618719c3db52da9c85...
ac4115c23ab305461a10aae7e3168356
Returns the corresponding basic data type in Java
[ { "docid": "ced00b2c7d5aa94842e585bd8e29355c", "score": "0.0", "text": "def only_basic_type(key)\n BasicTypes[key.camelcase(:lower)]\n end", "title": "" } ]
[ { "docid": "ba819dd11965d808d318e66749fc6d1d", "score": "0.71378785", "text": "def raw_type\n JavaType.new(@package, @name)\n end", "title": "" }, { "docid": "78b072bbc7bcbeda1ff2e9242f5cca8b", "score": "0.6980195", "text": "def java_type\n Jrodb::Type.java_type_for(type)\...
e5d7a8ab655c75b4e3f3532bd99af637
Workshop & Event in past
[ { "docid": "c96f6d4ec9b0f3b8132aae2a3b97b2d6", "score": "0.6573547", "text": "def past_activities\n events = self.past_events\n workshops = self.past_workshops\n past_activities = self.past_events.concat(self.past_workshops).sort_by{|e| e[:begin_at]}.reverse\n end", "title": "" } ]
[ { "docid": "8c240c6690e017d9b598668aaadd9bdc", "score": "0.6584651", "text": "def workshop_period\n @event = Event.first\n if (@event.activity_begin_day < DateTime.now && DateTime.now < @event.activity_end_day) || !current_user.adm?\n redirect_to workshops_path\n flash[:info] = \"Worksho...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "fb2d85495d37626c100edc9887dd84b8", "score": "0.0", "text": "def circuit_params\n params.require(type.underscore.to_sym).permit(:user_id, :description, :type, :alarm_time)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whit...
e07972ff79e8c061fb92a8eb959b253e
\Update assignments scores for a given gradebook number/assignment_number [Parameters] gradebook_number required. The specific Aeries Gradebook Number. assignment_number required. The specific Assignment Number. assignment_scores required. Array of AeriesNetApi::Update::AssignmentScoreUpdate [Returns] An array of Aerie...
[ { "docid": "2be92855b95605aff931925c44fd9da2", "score": "0.8705159", "text": "def update_gradebook_scores(gradebook_number, assignment_number, assignment_scores)\n raise ArgumentError unless assignment_scores.is_a?(Array)\n assignment_scores.each_with_index do |item, i|\n raise Argument...
[ { "docid": "48d2c4f223bf3ebd5d1889c2401f9e76", "score": "0.7353168", "text": "def assignments_scores(gradebook_number, assignment_number)\n data = get_data(\"api/v2/gradebooks/#{gradebook_number}/assignments/#{assignment_number}/scores\")\n models = []\n # puts data.first.keys.join(' ')...
36dee7f185b96db07db230bd93a79c0c
GET /collections/1 GET /collections/1.json
[ { "docid": "f3423ab2ac7a04ca83055ffb45266390", "score": "0.62195385", "text": "def show\n respond_to do |format|\n format.html {\n redirect_to collection_documents_path(@collection)\n }\n format.json\n end\n end", "title": "" } ]
[ { "docid": "bb59b7e89fe67c758d096acd3b61f701", "score": "0.7678446", "text": "def collection(slug, options)\n _get(\"v1/collections/\" + slug, options)\n end", "title": "" }, { "docid": "f6ef87ac01c552e73222283f08f0b697", "score": "0.76061696", "text": "def index\n @coll...
adf6e4869a6aafd4eb83a53f29443313
Takes an open Xcodeproj::Project, extracts the settings bundle and updates the specified setting key in the specified file to the specified value. Only valid for title items. Raises on error. :project: An open Xcodeproj::Project, obtained from Xcodeproj::Project.open, e.g. :file: A settings plist file in the Settings.b...
[ { "docid": "a515f8cfe4e4df3000568983bed12e89", "score": "0.78035915", "text": "def update_settings_plist_title_setting(project, file, key, value)\n settings_bundle = project.files.find { |f| f.path =~ /Settings.bundle/ }\n\n raise \"Settings.bundle not found in project\" if settings_bu...
[ { "docid": "c9adf9b38fb37da51d6fbc31e1eaa4d3", "score": "0.79264003", "text": "def update_settings_plist_title_setting(project, bundle_name, file, key, value)\n settings_bundle = project.files.find { |f| f.path =~ /#{bundle_name}/ }\n\n raise \"#{bundle_name} not found in project\" if ...
f6194aef5ce3c3aab62c8991e79678de
given a relative account id, load the Account for the given authenticated user
[ { "docid": "30f5ca997f6396811b54a1be486653d7", "score": "0.76691264", "text": "def find_account(id)\n (@accounts ||= {})[id] ||= @user.accounts.visible.find_by_id_for_user(id)\n end", "title": "" } ]
[ { "docid": "857397dba48bca79b6fcf7bf36295f90", "score": "0.7619191", "text": "def fetch_account(account_id)\r\n fail \"No account with id #{account_id}\" unless account_exists?(account_id)\r\n self.accounts.fetch(account_id)\r\n end", "title": "" }, { "docid": "2c0370fa1845f46da...
8ab62e064adb463ecba22bd56b82ca1e
See ActionController::RequestForgeryProtection for details Scrub sensitive parameters from your log filter_parameter_logging :password
[ { "docid": "78253ffbf1a816ec6ec67230244ad713", "score": "0.0", "text": "def authorized_login_required\n (if current_user.login == \"benoror\"\n true\n else\n flash[:notice] = \"No tienes acceso a esta seccion\"\n false\n end) || access_denied\n end", "title": "" } ]
[ { "docid": "3100f9d0b6167d98e0613f51a93259e6", "score": "0.67790043", "text": "def params_filters\n @params_filters ||= %w(password)\n end", "title": "" }, { "docid": "3100f9d0b6167d98e0613f51a93259e6", "score": "0.67790043", "text": "def params_filters\n @params_filters...
4b2873bf471715b26466eb2dba8d521b
To avoid pottential timeouts on db connection pool, make sure we have the pool bigger than the thread pool
[ { "docid": "6bd46ae43a6afbd58f650f59b904164c", "score": "0.66384846", "text": "def increase_db_pool_size(world = nil)\n if world.nil?\n warn 'Deprecated: using `increase_db_pool_size` outside of Dynflow code is not needed anymore'\n return\n end\n if increase_db_po...
[ { "docid": "e6cb0c5f631fa950c43c1bbdbf9bbd18", "score": "0.7423684", "text": "def connection_pool_maximum_reuse\n super\n end", "title": "" }, { "docid": "419017a328b8e19170c273103c4cffc8", "score": "0.7328387", "text": "def connection_pool_idle_timeout\n super\n end"...
fdd81e30a0d2ce35aa5a84d88681a6ee
Parses an EDST stream and renders it as HTML
[ { "docid": "82da5a952356c9edc5557df194eed1ad", "score": "0.6775793", "text": "def render_stream_to(in_stream, out_stream, **opts)\n options = OpenStruct.new(opts)\n parser_options = options.parser_options || {}\n\n root = EDST.parse in_stream, parser_options\n\n render_doc_to(root, o...
[ { "docid": "084ce907d0825a8f471d74073c7f40fa", "score": "0.62168694", "text": "def parse\n renderer.render(raw_markdown)\n end", "title": "" }, { "docid": "3edcc4d62485806b8b6a988cdb6d95d3", "score": "0.6213033", "text": "def parse_textile\n # text = Pressesend.iso_...
d2beee5d5a305a8ab33e3723fff66769
Admins may accept policies if pending.
[ { "docid": "f5880bcd7837e93d8957bb39fff4a01d", "score": "0.6161652", "text": "def acceptable_by?(user)\n return false unless user.has_role?(:admin, user.unit)\n resource.pending?\n end", "title": "" } ]
[ { "docid": "6ed1c29affa731e2a6c1c92afd2b0bde", "score": "0.67148924", "text": "def admin_access_required\n access_denied unless admin?\n end", "title": "" }, { "docid": "6ed1c29affa731e2a6c1c92afd2b0bde", "score": "0.67148924", "text": "def admin_access_required\n access...
3b27e7f4f3766921caf3e388f6531fe9
a hash with 2 keys, :title and :occupation, with appropriate values output: Prints a greeting using the person's full name and title. approach: join name array save occupation by referencing the key and value from hash ouput string using above values
[ { "docid": "8f2c44affa62fccd16fb0b3a26c8d1f0", "score": "0.72148275", "text": "def greetings(name_array, title_hash)\nfull_name = name_array.join(' ')\ntitle = title_hash.values.join(' ')\nputs \"Hi, #{full_name}. You are the greatest #{title}!\"\nend", "title": "" } ]
[ { "docid": "6d24a9e8e852220b31073660bc142115", "score": "0.8268101", "text": "def greetings(name_arr, occupation_hash)\n full_name = name_arr.join(' ')\n occupation = \"#{occupation_hash[:title]} #{occupation_hash[:occupation]}\"\n puts \"Hello #{full_name}! What's it like to be a #{occupation}?\"\ne...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "7192a875fc2fa7104f43f6776b00ed82", "score": "0.0", "text": "def set_pstaff\n @pstaff = Pstaff.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.6031952", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6015048", "text": "def...
6096972c639785c5f3e576cd9e219a80
Collects all `Occi::Core::Mixin` instances specified in `depends` in one or more other mixins in this model. These instances may not appear in the model itself if it has not been successfully validated yet.
[ { "docid": "fb11b678a13afa1128c8e8dab5bb29f8", "score": "0.730317", "text": "def depended_on_mixins\n depended_on = mixins\n depended_on.collect!(&:depends)\n depended_on.flatten!\n depended_on.reject!(&:nil?)\n depended_on\n end", "title": "" } ]
[ { "docid": "5a1d3cd996a91b0e5b314850291ab6c5", "score": "0.6284616", "text": "def find_dependent(mixin)\n raise ArgumentError, 'Mixin is a mandatory argument' unless mixin\n Set.new(mixins.select { |mxn| mxn.depends?(mixin) })\n end", "title": "" }, { "docid": "7f5bfaa11a9...
1ef4b1b229684afd28f52144b803131d
Returns true when itself has a associated_response
[ { "docid": "11e59affba9a8e221279277e9f540b9c", "score": "0.82053685", "text": "def has_associated_response?\n @associated_responses ||= []\n not @associated_responses.empty?\n end", "title": "" } ]
[ { "docid": "2a4d784d055e6140fe5b8edf8be02051", "score": "0.7313149", "text": "def associated?\n @associated\n end", "title": "" }, { "docid": "c577440db3c60cb789e3850eb29a8b7b", "score": "0.7153157", "text": "def respondent_already_answered?\n sibling_responses.exists?(respond...
18b2d2a02eec4af6ab80254aeda45fec
Writer to make field optional.
[ { "docid": "79102209dbeafcbf46ef732c53b14efb", "score": "0.0", "text": "def optional=(state)\n optional(state)\n end", "title": "" } ]
[ { "docid": "922aead7506fcf01c8cec892dfdf4693", "score": "0.6659171", "text": "def optional!\n self.required = false\n end", "title": "" }, { "docid": "5d2e2f2b18d3b3008105fb063a41f953", "score": "0.66369456", "text": "def optional!\n @optional=true\n end", ...
5c3721f0bf1703b91a003879b2095e09
returns the correct lsb code for the status: 0 program is running or service is OK 1 program is dead and /var/run pid file exists 3 program is not running
[ { "docid": "17fd0f12ae3799634bb31ea71a421bb0", "score": "0.7157345", "text": "def status\n\t\t\t@status ||= begin\n\t\t\t\t\t\t\t\t\t\tif pidfile_exists? and process_running?\n\t\t\t\t\t\t\t\t\t\t\t0\n\t\t\t\t\t\t\t\t\t\telsif pidfile_exists? # but not process_running\n\t\t\t\t\t\t\t\t\t\t\t1\n\t\t\t\t\...
[ { "docid": "d2394811a08a0cb9c8b0429052dd165b", "score": "0.73712265", "text": "def status\n @status = begin\n if pidfile_exists? and process_running?\n 0\n elsif pidfile_exists? # but not process_running\n 1\n ...
f0fec6ecb4aab9ed61e3d6ef9b088210
POST /individual_offers POST /individual_offers.json
[ { "docid": "ceb284d6928d0ec05254e8d7797afe29", "score": "0.72570074", "text": "def create\n @individual_offer = IndividualOffer.new(individual_offer_params)\n\n respond_to do |format|\n if @individual_offer.save\n format.html { redirect_to @individual_offer, notice: 'Individual offer w...
[ { "docid": "119bf335b9c2e639e9a72ecb0fd5f6eb", "score": "0.709303", "text": "def offers body\n post(\"/offers\", body: body.to_json)\n end", "title": "" }, { "docid": "7b3ac98b2b635ed1a61e508fc3bfce8b", "score": "0.6560005", "text": "def create\n @offer = Offer.new(off...
de59c033536df93517004bdb461cdd3e
List all objects assigned with matching scope and tag values Paginated list of all objects assigned with matching scope and tag values. Objects are represented in form of resource reference. Sort option is available only on target_type and target_display_name properties.
[ { "docid": "fba9338ac047b480db1f6fe74ff3601a", "score": "0.5126534", "text": "def list_tagged_objects(opts = {})\n data, _status_code, _headers = list_tagged_objects_with_http_info(opts)\n data\n end", "title": "" } ]
[ { "docid": "a7d2e3c60d44637175532e758c673e03", "score": "0.5547699", "text": "def list\n @objects = @object_class.page params[:page]\n end", "title": "" }, { "docid": "633572da0c05ee5856eebb94db9276a3", "score": "0.5458721", "text": "def list\n @objects = @model.paginate :per_...
76435dd6d5c469088587fce812480654
Good grief this method is a mess
[ { "docid": "3d1c4fcf2eb8636fe42d19b4a358471d", "score": "0.0", "text": "def draw()\n\t\tsystem 'cls'\n\t\tputs \"\\n\\n\"\n\t\talternate = true\n\t\t@cells.reverse.each do |row|\n\t\t\tprint \" \" * size\n\t\t\tif(alternate)\n\t\t\t\t@cells.length.times do |i| print i%2 == 0 ? (\" \" * size).colorize(:b...
[ { "docid": "a9dd648a5d0d2e7d56223e7c753f5e2e", "score": "0.64679426", "text": "def telegraphical()\n end", "title": "" }, { "docid": "bc658f9936671408e02baa884ac86390", "score": "0.6403179", "text": "def anchored; end", "title": "" }, { "docid": "7ec57c3874853e50086feb...
dd0834c855c2a009f4dc3b807ffe25a1
Helper method use this to create a recursive print solution.
[ { "docid": "921084e5ae6c51b815b0002c4c212b99", "score": "0.59771025", "text": "def preorder_print(start, traversal)\n traversal\n end", "title": "" } ]
[ { "docid": "02bba410545b8c9e64f4afa69bb5a0f5", "score": "0.77244544", "text": "def recursive_print(array)\n\nend", "title": "" }, { "docid": "32d875f3ac9b5da1f28fff2a31fb6e9f", "score": "0.7155743", "text": "def recursive_print(result=\"\", node=@head)\n\t\tif node.nil?\n\t\t\treturn...
0370d3f7344ca3e74b69fbc8e2570b5e
check whether only numbers are entered
[ { "docid": "755953452ef9c05fffa02d140efc9d4f", "score": "0.0", "text": "def check_number(num)\n until num.to_i.to_s == num || num.to_f.to_s == num\n puts \"That is not a number. Please try again!\"\n print \"Please enter a number: \"\n num = gets.chomp\n end\n return num.to_f\nend", "t...
[ { "docid": "2dc9f0171eb3b25515955751e9d84cf8", "score": "0.7496645", "text": "def validInput?(input)\n #check if input is a number\n #if not num then return false\n input.each do |val|\n return false if val.to_i == 0 && val != \"0\"\n end\n true\n end", ...
5ec93693a3b9f5c686d4825d6fa934d0
this is used to write code that looks like assignment So instructions can be created without the result (register) set, and this assigns where the reuslt after the fact, but usually in the same line Example (with block b, and variables int,a,b): b.int = a + b a + b actually creates an add instruction while the b.int= a...
[ { "docid": "e4d62940fe0c4583a274ca703a7789f3", "score": "0.0", "text": "def assign left\n @result = left\n self\n end", "title": "" } ]
[ { "docid": "5c683865d61aa608d482c6cbfaed568d", "score": "0.6248937", "text": "def add(x, y)\n z = x + y # Would work without z assignment\nend", "title": "" }, { "docid": "9e1ba3f960ea2cf3e2ef767e76d033c6", "score": "0.6192389", "text": "def sum()\n\ta=1\n\tb=2\n\ta+b\nend", "ti...
4c59826991438898e362be480aec4a10
Modified map function that takes either a proc or block
[ { "docid": "6e5602da5a1761b6db8a7727bff5142b", "score": "0.6243704", "text": "def my_map_mod(p = nil)\n return to_enum(:my_map) unless block_given? || p\n\n result = []\n if block_given?\n if self.is_a? Hash\n my_each { |k,v| result << yield(k, v) }\n else # self is array\n ...
[ { "docid": "0d2448d85ebb5adff1d43087b443ded5", "score": "0.82739335", "text": "def map( &proc ) # this is a wrapper, which saves the given block\n\t\ttraverse( proc )\n\tend", "title": "" }, { "docid": "ad0c8b394034efd2e0c8c05effb6f0c7", "score": "0.80981433", "text": "def my_map_pro...
80fef0861beeb1fe6feab50635ac2281
get users who registered subjects that has this note
[ { "docid": "7d648051a80a9937c73aa8c88ba14a4f", "score": "0.7162037", "text": "def registered_users\n User.select('distinct users.*')\n .joins('INNER JOIN educations ON educations.current_user_id = users.id')\n .joins('INNER JOIN registers ON registers.education_id = educations.id')\n ....
[ { "docid": "bd797c4b59f57a388007c82751fec360", "score": "0.6985919", "text": "def registered_users\n User.select('distinct users.*')\n .joins('INNER JOIN educations ON educations.current_user_id = users.id')\n .joins('INNER JOIN registers ON registers.education_id = educations.id')\n ....
0e09038e889e60db0c9d2f5bf5ad7795
add an error message if nothing is found Dont add the return "not found" as and else as it will break straight after searching the first array.
[ { "docid": "810b84142c0c3abeaf6eb11cf4fd7786", "score": "0.0", "text": "def find_chicken_by_name(name, array)\n for chicken in array\n if chicken[:name] == name\n return chicken\n end\n end\n return \"Not found\"\nend", "title": "" } ]
[ { "docid": "d5a905152a3a48b3f37b0283701a2c43", "score": "0.64826626", "text": "def display_error_message(message)\n message.present? ? message : 'No Records Found.'\n end", "title": "" }, { "docid": "14250a4b4b8bb4f2d31af9163ef022be", "score": "0.6372785", "text": "def search_arr...
2b52b4e7bfd6d422c30dc87f811600bd
Return a single coordinate.
[ { "docid": "bda071a4a91218bb6419643f915e09d1", "score": "0.67403185", "text": "def coordinate(coordinate)\n RubyChessBoard::Coordinate.new(coordinate)\n end", "title": "" } ]
[ { "docid": "aa6deb5bb8191617582b24560dc1f3ca", "score": "0.8122263", "text": "def get_single_coord\n Matrix.two_to_one(@x_location, @y_location, @x_size)\n end", "title": "" }, { "docid": "d22f980e8569daaccfec1d3df22f4798", "score": "0.7714895", "text": "def coordinate; @coordina...
503ac450a23fce15d7a0f310be80242f
initialize, create the instance variable
[ { "docid": "c58e24306d303d133bd41ed5de15dcef", "score": "0.0", "text": "def initialize\n\t\t@movie_user_rating_predictions = Hash.new\n \tend", "title": "" } ]
[ { "docid": "73d8fd895a75b55a07597cbfe0ea1c7c", "score": "0.78809214", "text": "def init\n \n end", "title": "" }, { "docid": "73d8fd895a75b55a07597cbfe0ea1c7c", "score": "0.78809214", "text": "def init\n \n end", "title": "" }, { "docid": "30db4e5d165a...
ada810ed2a0dd465b2bc9296cd66693e
:secret => '779a6e2f0fe7736f0a73da4a7d9f13d4' Allow SSL only logged in with SSL plan feature
[ { "docid": "1b574c311946fec0736ed6e35b58e9fb", "score": "0.6287138", "text": "def ssl_allowed?\n admin_subdomain? #|| (logged_in? && current_account.ssl_allowed?)\n end", "title": "" } ]
[ { "docid": "f5c534863b0e54b05e168624c06c4043", "score": "0.6650205", "text": "def ssl\n conf['dashboard']['ssl']\n end", "title": "" }, { "docid": "e11eb69276820cd88f746953159c0359", "score": "0.6512987", "text": "def client_secret; end", "title": "" }, { "docid": "66...
12435a7d68834e858c3eacd2aaeae319
DELETE /besidets/1 DELETE /besidets/1.json
[ { "docid": "f07fdba30328bb0ba1aaa006189866ec", "score": "0.7150887", "text": "def destroy\n @besidet.destroy\n respond_to do |format|\n format.html { redirect_to besidets_url, notice: 'Besidet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title"...
[ { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.7411405", "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": "...
4bc0738c6b4b118eb6d5b80c4c28ef60
Get default value for parameter. :rtype: str
[ { "docid": "3394ea7042d59d49ed2ca51ef9cb7738", "score": "0.7413398", "text": "def get_default_value\n return @payload.get_path(\"default_value\"){\"\"} \n end", "title": "" } ]
[ { "docid": "504ecb91bac50bd4d7fb2112ac094e43", "score": "0.75878394", "text": "def format_default(param)\n return unless parameter_default?(param)\n\n if param.default.is_a?(String)\n format(\" (default %p)\", param.default)\n else\n format(\" (default %s)\", param...
50f9f185a7e0a4b735aeced6110bd841
Calculates hash code according to all attributes.
[ { "docid": "959a5ee0296c5ae0c5bff13d9bd821ec", "score": "0.0", "text": "def hash\n [__meta, created_at, updated_at, status, subtotal, total, shipping_cost, items_tax_amount, total_items_discount, purchase_day, purchased_at, completed_at, customer, shipping_address, billing_address, currency, shippi...
[ { "docid": "08105588814074a5aed46dbb236c8d02", "score": "0.7916062", "text": "def hash_code; Digest::SHA256.hexdigest(@attributes.values.join); end", "title": "" }, { "docid": "706cbdb4c78e6b67e29589df0a4b1b5c", "score": "0.73138744", "text": "def attr_hash\n md5 = Digest::MD5.n...
d6d51aa40e61d7d7a5eb7072b39e8f88
user joins into a contract GET /join/contract_id
[ { "docid": "5b07de8f45ab798ca6b87b15e54823d8", "score": "0.7731774", "text": "def join\n @contract = Contract.find(params[:contract_id])\n\n # test if person has already joined this contract.\n if has_account_already_joined_the_contract current_account.id, @contract.id\n flash[:notice] = '...
[ { "docid": "59f3746fdc419d1421d942bae407ab2c", "score": "0.6399166", "text": "def set_join_team_contract\n @join_team_contract = JoinTeamContract.find(params[:id])\n end", "title": "" }, { "docid": "efa26bfbcec64ee83ab5eff28a0d9032", "score": "0.6225479", "text": "def join\n ...
956e1785677f7c1be3637a7f018a5f2b
Branch of the code you want to watch in order to build. You must implement this in the classes where you mixin this module
[ { "docid": "e7d639e9d5f21d273a1bee1dab883b20", "score": "0.5871863", "text": "def branch\n raise NotImplementedError\n end", "title": "" } ]
[ { "docid": "84ca4c5e6a4042a9777767eead5f3f7e", "score": "0.64880073", "text": "def branch; end", "title": "" }, { "docid": "d881c837ee688943654740cf6d2576c7", "score": "0.62382734", "text": "def watchers; end", "title": "" }, { "docid": "bcaed1b681735de26008db8b7d825a13",...
3189ca374724ba508c49e9cd088191f4
hack to return "registered variables" and "smart errors"
[ { "docid": "905327e9c15e0a19954ac944a18102ab", "score": "0.57889473", "text": "def method_missing(method_name, *arguments, &block)\n @@variables[method_name] || error(method_name.to_s)\n end", "title": "" } ]
[ { "docid": "14ae7a462c49e9d42a167aea4277067f", "score": "0.6817993", "text": "def put_var_error\nend", "title": "" }, { "docid": "19c7d53d1516eb07179a0ad758f7a9fc", "score": "0.6549261", "text": "def lookup_all_error; end", "title": "" }, { "docid": "37e71f59e6ed62163944f...
7c583af9fecbfe6d54206bd358bdeac1
This method is called by the buffering code when messages need to be written to the logging destination.
[ { "docid": "b1d7ee86e754192144d943926b069579", "score": "0.0", "text": "def canonical_write( str )\n return self if @io.nil?\n str = str.force_encoding(encoding) if encoding && str.encoding != encoding\n @mutex.synchronize { @io.write str }\n self\n rescue StandardError => err\n ...
[ { "docid": "639bb1f2d86c2bcf02f8d4f2e055991b", "score": "0.65090764", "text": "def flush_log_buffer\n @@buffer_enabled = false\n self.log(@@buffer_log)\n @@buffer_log = ''\n end", "title": "" }, { "docid": "8c05519d9982b36ff86fda6042c5eef5", "score": "0....
2c00d1c5f81191a58a5f61040bb57c99
Write site files to the selected bucket
[ { "docid": "5cd7feb5bda60d44ad40cafb4ddbeb1d", "score": "0.74666995", "text": "def write_files\n puts \"Writing #{pluralize('file', site_files.size)}:\" if @verbose\n files_to_invalidate = []\n site_files.each do |file|\n s3_filename = remote_path(file)\n o = @bucket.objects...
[ { "docid": "d9d83889b5e1a1b0055e91af2011d28e", "score": "0.6861543", "text": "def write_to_bucket(client, name)\n filename = SecureRandom.uuid\n begin\n client.put_object({ bucket: name, key: \"#{filename}.txt\" })\n rescue Aws::S3::Errors::AccessDenied, Aws::S3::Errors::Al...
a3502312b684f8bd7e944af2195e6dc1
Returns a Ruby String object.
[ { "docid": "63c80ab59752ef7e6b3bfd934a865858", "score": "0.0", "text": "def fs_fileRead(fobj, len)\n fobj.data.read(len)\n end", "title": "" } ]
[ { "docid": "db34dc6d93f4880af08ce69a7a1a7fbd", "score": "0.69330376", "text": "def to_str\n # Using any other ways of overriding the String itself will lead you all the way from infinite loops to\n # core dumps. Don't go there.\n @string\n end", "title": "" }, { "docid": "e...
f4d6dbbfd3dff28b64966f509afc6999
Return a relation with attributes not specified
[ { "docid": "a6aaae2a9ed55c4df7973463d8232903", "score": "0.0", "text": "def remove(attributes)\n project(header - attributes)\n end", "title": "" } ]
[ { "docid": "6c8d17cc3b339f29e001c048a7f34d3d", "score": "0.70097876", "text": "def allbut(relation, *attributes)\n attributes = relation.header.reject{|a| attributes.include?(a.name)}.collect{|a| a.name}\n project(relation, *attributes)\n end", "title": "" }, { "docid": "b...
303bc892d6fd41c061d1eca203ddbccd
Initialize Base and almacenate user information
[ { "docid": "ab06fc7a7709dcebf9248e8531e1f5a3", "score": "0.0", "text": "def initialize(api_key)\n raise ArgumentError, 'api_key is required' if api_key == nil || api_key.empty?\n Klout.api_key = api_key\n end", "title": "" } ]
[ { "docid": "beabdf38c7bf8850e9cf4e7a6767638d", "score": "0.75179374", "text": "def user_init; end", "title": "" }, { "docid": "100c7eb2ede907e6ebbec762e5a6b073", "score": "0.7266249", "text": "def init\n user_info\n user_id_from_authentication = 1 #replace this with logic from ...
fe895c20e8eab80f882bcf115149b926
gets a line from user, saves as array then parsed in same function that was used to parse arguments
[ { "docid": "a131186e70996b0063220b25edeb38f4", "score": "0.7291656", "text": "def get_line()\n puts \"Enter a line similar to the argument that you passed orignally\"\n print \"Operations:\\n\\t\"\n @ops.each do |a|\n print a, \" \"\n end\n puts\n\t\tSTDOUT....
[ { "docid": "da13195cef34bffdb169aabf8871a7ae", "score": "0.70008576", "text": "def parse_line(line)\n\t\tlog_input(line)\n\n\t\tline.gsub!(/(\\r|\\n)/, '')\n\t\t\n\t\tbegin\n\t\t\treturn args = Rex::Parser::Arguments.from_s(line)\n\t\trescue ::ArgumentError\n\t\t\tprint_error(\"Parse error: #{$!}\")\n\t...
9cf24860434eb148aa20d7862e993c7b
signed_in employer is required list all open jobs of signed_in employer, count inactive job and open jobs and display on this page and link count viewsmatchesapplicantsshortlistremoved
[ { "docid": "86160b00271da782136e38630d8d96d9", "score": "0.7100696", "text": "def employer_index\n @jobs = Job.enable.where(employer_id: current_employer.id, is_active: true).page(params[:page])\n @inactive_job_count = Job.enable.where(employer_id: current_employer.id, is_active: false ).count\n ...
[ { "docid": "03eef8c22879fe857b60e6e1f6f2c92c", "score": "0.7019189", "text": "def employer_show\n authorize @job\n\n @job.job_candidates.includes(:candidate)\n .where(status: JobCandidate.statuses[:submitted])\n .map { |jc| jc.viewed! }\n\n @job_candidates = @job.job_candidates.in...
497b7384752492174ad8b6aaf7b92ca6
A middleware which injects the request into the Rails.logger
[ { "docid": "5a015efd64fb008383493fd12733166d", "score": "0.63340425", "text": "def call(env)\n request = ActionDispatch::Request.new(env)\n Rails.logger.inject_request(request)\n @app.call(env)\n ensure\n ActiveSupport::LogSubscriber.flush_all!\n end", "title": "" } ]
[ { "docid": "6e5cd9eb3ed39ccec1b29745421ff4ad", "score": "0.7456095", "text": "def request_log(request); end", "title": "" }, { "docid": "612c39a10d6e90c6b2708918e6534f30", "score": "0.73876977", "text": "def on_request(env)\n env['sinatra.commonlogger'] = true\n super\n...
6be1bafab876f8166d1ce98517c8da64
GET /cls/1 GET /cls/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "4a80db221c34e8c041f30bcc6b8f1780", "score": "0.6522619", "text": "def index\n @clclasses = Clclass.paginate(page: params[:page], :per_page => 10)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clclasses }\n end\n end", "title": "...
02a2f3a096a27a27a73906668d1f084a
Saves the encounter form image after the doctor has filled in the form using javascript applet
[ { "docid": "c3967d75ae828f1c1daea32635afcbf6", "score": "0.7608232", "text": "def save_encounter_form\n patient = Patient.find(params[:id])\n filename = \"temp#{Time.current.to_i}.png\"\n File.open(filename, \"wb\") do|f|\n f.write(Base64.decode64(params[:image]))\n end\n file = File...
[ { "docid": "aa76cef840edd3827f28f87733e24a8b", "score": "0.5942308", "text": "def add_image_to_document\n frm.div(:id=>\"PostForm:tab1\").button(:value=>\"Add to document\").click\n end", "title": "" }, { "docid": "aa76cef840edd3827f28f87733e24a8b", "score": "0.5942308", "text": ...
a72b1c5398610974b84b0d818d9b3b41
PATCH/PUT /environments/1 PATCH/PUT /environments/1.json
[ { "docid": "01f2b301ca925c96d3951c7cb94a07ec", "score": "0.5392729", "text": "def update\r\n custom_command_params = params[:custom_command]\r\n logger.debug(\"PARAMS OF CUSTOM COMMAND #{custom_command_params.inspect}\")\r\n if !custom_command_params.present?\r\n @custom.update(custom_comm...
[ { "docid": "ab1696248f8b944c98e5ab243a239fe7", "score": "0.7092712", "text": "def update\n @environment = Environment.find(params[:id])\n\n respond_to do |format|\n if @environment.update_attributes(params[:environment])\n format.html { redirect_to @environment, notice: 'Environment wa...
3b4943a16d5ed99cfb0dab4d725ff7dd
HTTP response status as an integer
[ { "docid": "323a7774f1c07cea44b687b06437306f", "score": "0.85451174", "text": "def status\n Integer(http_status) rescue nil\n end", "title": "" } ]
[ { "docid": "6c8bd9f85fd3cefecce7817defb3c2f8", "score": "0.86645067", "text": "def status_code\n http_response.status.to_i\n end", "title": "" }, { "docid": "84bbb3de2b95b9e52b31cf7a63005ed5", "score": "0.8655983", "text": "def status_code\n @http_response.code.to_i\...
c94f3bda06ae651a1cdc95aa040c9e11
Initializes a new game object date the date of the game time the time of the game expected with EDT opponent the opponent name location the location of the game description extra information about the game game_csv the csv text of the game Examples Game.new("04/08/13","12:20:00 PM", "Chicago Cubs", "Wrigley Field") Ret...
[ { "docid": "26ca9d64cda130e4d7bd2816f58f7921", "score": "0.7967035", "text": "def initialize(date, time, opponent, location, description, game_csv)\n @date = date\n @time = time\n @location = location\n @description = description\n @game_csv = game_csv\n\n index = MLBSchedu...
[ { "docid": "586ac60ff168e3747829791df6d132c1", "score": "0.73500717", "text": "def initialize date, location, opponent\n @date = date\n @location = location\n @opponent = opponent\n @time = \"\"\n @game_result = \"\"\n @score_osu = nil\n @score_opponent = nil\n end", "title": "...
3d7194e38d5ca82a91ca9515ef6de03c
Creates a new client with its resource_method.
[ { "docid": "5540a55d6cf26dc7530414572833f5b3", "score": "0.0", "text": "def initialize args = {}\n self.resource = args[:resource] || ''\n end", "title": "" } ]
[ { "docid": "b750a3dc6649361c898be26ab9207ea9", "score": "0.7451706", "text": "def create(resource)\n resource.client = self\n resource.create\n end", "title": "" }, { "docid": "36187d511944215c12765d673e42dad0", "score": "0.7098574", "text": "def create_client!\n ...
be9ec93ea0d2758de26c84513632de41
The Add method should throw an exception when called with an input starting with a separator or containing multiple separators following each other.
[ { "docid": "ed37a82ca2083b3c1b6a47da55f4698e", "score": "0.7469499", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration73\n # Arrange.\n @inputValue = '//[+][!][#]\\n#1+2'\n @errorMessage = \"Number expected ...
[ { "docid": "a4c7a94250afc931f5286d90fbd61f6d", "score": "0.7604002", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration108\n # Arrange.\n @inputValue = '//[sep1][sep2][sep3]\\nsep21sep32'\n @errorMessage = \"...
15ac714e8a2a39f9b41ddb47187525f9
The base path to the API on the Filebound server
[ { "docid": "80028a18cc05e77459eb6c0f4470445d", "score": "0.7299908", "text": "def api_base_uri\n configuration.api_base_uri\n end", "title": "" } ]
[ { "docid": "40b2550f66795081f3d2b8a5d755ab61", "score": "0.788879", "text": "def base\n Pathname.new(\"http://api.stackoverflow.com/0.5/\")\n end", "title": "" }, { "docid": "8e3e3cd25f4c8cd776ea6646f4cfd624", "score": "0.7860177", "text": "def base_path\n @base_pa...
935397029fed4fa68dcfa2ff6ec491e5
Parses a template tag and adds it to the last template or tag on the stack.
[ { "docid": "e12c19a39eccc315407aa0391f3fb3a4", "score": "0.74358875", "text": "def parse_template_tag\n AST::Template.new(\n with_default_options({\n # if there are already templates on the template stack that means\n # this must be an embedded (inline) template.\n ...
[ { "docid": "6f7bdd57455a3a21dde417742b1c67e3", "score": "0.5790465", "text": "def populate_template\n # we set the stack in the constructor b/c that works better for testing\n while token = tokens.advance\n case token\n when Token::LeftBracket\n cmd = handle_command\n ...
acdfd5df33a85e0b1d20016223fde9ab
DELETE /queries/1 DELETE /queries/1.json
[ { "docid": "b0cf9aa8db57230396df7668fc2a5f2c", "score": "0.72419345", "text": "def destroy\n @query.destroy\n respond_to do |format|\n format.html { redirect_to queries_url, notice: 'Query was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": ""...
[ { "docid": "d2375b11675de0e152de07976b50e9c7", "score": "0.7862246", "text": "def delete_request(url, queries)\n results = @@client.delete url, queries\n results.to_json\nend", "title": "" }, { "docid": "f97dd16c73a9bfa64785b6c9e5fa49d8", "score": "0.757057", "text": "def destr...
20bc471a18c01c2e122ad50eae5b4dbb
Double Doubles A double number is a number with an even number of digits whose leftside digits are exactly the same as its rightside digits. For example, 44, 3333, 103103, 7676 are all double numbers. 444, 334433, and 107 are not. Write a method that returns 2 times the number provided as an argument, unless the argume...
[ { "docid": "6cd8b1b691a6780f0ea8f679080291cb", "score": "0.0", "text": "def twice(number)\n string_num = number.to_s\n middle = string_num.size / 2\n left = middle.zero? ? '' : string_num[0..middle - 1]\n right = string_num[middle..-1]\n return number if left == right\n return number * 2\nend", ...
[ { "docid": "fe6467a68692c3df80249d702d44c65f", "score": "0.746493", "text": "def twice(n)\n # if n's length is odd, double the number\n # if n's length is even, check if it's a double number\n # n is a double number if the first half == second half\n # if it's a oduble number, return it as it is, ...
ec701e9f4ba33627ddfbead8c48229bb
Inject private fields as needed
[ { "docid": "2e579d995ad6bfd1d63e55b3ed9d8076", "score": "0.0", "text": "def get_query_fields(initial_fields, private_fields)\n fields = initial_fields\n if private_fields\n private_fields.each do |f|\n fields = fields + \", #{f}__c\" \n end\n end\n ...
[ { "docid": "db8e5986b7dfdf744f7afc5061c57d93", "score": "0.6232679", "text": "def expose(*variables)\n class_eval do\n exposures.merge(variables)\n Array(variables).each do |v|\n attr_reader v\n end\n end\n end", "title": "" }, { "doci...
65145f0208609179afccbfbb1c7536b5
improves a valid p using r
[ { "docid": "49104e31ab8d94e33de8cbe45cc0cb42", "score": "0.590993", "text": "def improve p, r, m\n return generate_variations(p, r).filter { |e| validate m, e }.max { |a, b| score(a) <=> score(b) }\nend", "title": "" } ]
[ { "docid": "533735d1cb4ab7876fc3c432655b7ee5", "score": "0.6459545", "text": "def entrou_invalidez(p)\n\t\tprob_invalidez = @t.probabilidade_invalidez(p)\n\t\tinvalido = Probability.random_sample(1, :Bernoulli, [prob_invalidez])\n\t\tinvalido == 1 ? s = true : s = false\n\tend", "title": "" }, {...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "eee19ac81304bdfb8c63dcf961650ab4", "score": "0.0", "text": "def set_trading_account\n if params[:id]\n @trading_account = TradingAccount.find(params[:id])\n end\n\n if params[:trading_account_id]\n @trading_account = TradingAccount.find params[:trading_account_id...
[ { "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...
bbd53c21661431eb8153cca0aecf6a35
POST /greetings POST /greetings.xml
[ { "docid": "e685557b4488790e70aa4340d5d55a2b", "score": "0.0", "text": "def create\n @greeting = Greeting.new(params[:greeting])\n @greeting.when = Date.today\n\n respond_to do |format|\n if @greeting.save\n format.html { redirect_to(greetings_path)}\n #format.js\n end\n...
[ { "docid": "5bf75c80b6c1afd029c4bd2222278299", "score": "0.60787046", "text": "def call(env)\n body = names.map {|name| \"<meow>#{name}</meow>\" }.join(\"\\n\")\n\n [200, {\"Content-Type\" => \"application/xml\"}, [body]]\n end", "title": "" }, { "docid": "03de12129cbf976ba5b4f83dec82...
373c67de6867046346e3e870b4bbb0b7
Combinations an array of unqiue permutations of participant ids shuffled to randomize the participant order
[ { "docid": "2bc04cb8f8f1ab692c50c308d0b6d24d", "score": "0.5986651", "text": "def mixed_combinations\n combination_generator.mixed_combinations\n end", "title": "" } ]
[ { "docid": "4d7c9bab132c0b9ae1900a466ab3d96d", "score": "0.6975584", "text": "def shuffle_participants\n participants = @party.participants\n shuffled_participants = participants.to_a\n participants.length.times do |i|\n next if i == 0\n random_lesser_index = Random.rand(i)\...
4ceba7af08c6f57798c70028f918a956
Gets the cellularBlockWiFiTethering property value. Indicates whether or not to block syncing WiFi tethering.
[ { "docid": "8d2239b170134ea93148c19e76ba38f4", "score": "0.7807257", "text": "def cellular_block_wi_fi_tethering\n return @cellular_block_wi_fi_tethering\n end", "title": "" } ]
[ { "docid": "5314a8e30f25a37bf63b980eadb1c6e1", "score": "0.6978165", "text": "def cellular_block_wi_fi_tethering=(value)\n @cellular_block_wi_fi_tethering = value\n end", "title": "" }, { "docid": "e8a8f02d01f695381afafa6e88dab61b", "score": "0.67205566", "t...
9435e252372aeccc55e6d82879941928
All articles(Maybe make support for narrowing it down?)
[ { "docid": "4141773700ae94451f613b9c37391e30", "score": "0.65519375", "text": "def list_articles()\n\nend", "title": "" } ]
[ { "docid": "adebfea814d81fec13a25ed701ed4f9e", "score": "0.7560044", "text": "def all_articles\n json = self.class.get(\"#{QUERY1 + PARAMETERS_API}\")\n puts \"QUERY IS: #{QUERY1 + PARAMETERS_API}\"\n response = json['response']\n articles = response['results']\n\n articles.each...
ea576e924e3af566c57bc4b7c36f4352
This method removes a star from an item (message, file, file comment, channel, private group, or DM) on behalf of the authenticated user.
[ { "docid": "bcbae54600ab2e756fc4febcbf22c8da", "score": "0.64978695", "text": "def stars_remove(params = {})\n response = @session.do_post \"#{SCOPE}.remove\", params\n Slack.parse_response(response)\n end", "title": "" } ]
[ { "docid": "888047c0c37fe24a3cd0b63c2b683fd2", "score": "0.65740407", "text": "def remove_from_user(item)\n self.items.delete(item)\n item.owner = nil\n end", "title": "" }, { "docid": "f5889c79c2259db49131e80fa6db9c85", "score": "0.6501285", "text": "def unstar!\n ...
0a73b81a6195ee82d99e19ee806383cb
rule 'simple_factor' => %w[MINUS in_parenthesis]
[ { "docid": "9dff2a6e5f8d1eff5e2d09481ff32f02", "score": "0.547049", "text": "def reduce_simple_factor_2(_production, aRange, _tokens, theChildren)\n negation = CalcNegateNode.new(theChildren[0].symbol, aRange.low)\n negation.children << theChildren[1]\n return negation\n end", "title": "" ...
[ { "docid": "0a391422cb4163969f6425ede9e2daaa", "score": "0.6396753", "text": "def additionsubstractionoperators!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 33 )\n\n type = ADDITIONSUBSTRACTIONOPERATORS\n channel = ANTLR3::DEFAULT_CHANNEL\...
1cfc8726dee2bf3247aa1ab0d15a5165
Hook into native time zone handling check, if any
[ { "docid": "600fbcfd91d6a87c500744a98dda9998", "score": "0.0", "text": "def timeliness_attribute_timezone_aware?(attr_name)\n false\n end", "title": "" } ]
[ { "docid": "50523432755f13b78f291ec15bb8ee37", "score": "0.788111", "text": "def in_time_zone(new_zone = T.unsafe(nil)); end", "title": "" }, { "docid": "50523432755f13b78f291ec15bb8ee37", "score": "0.788111", "text": "def in_time_zone(new_zone = T.unsafe(nil)); end", "title": ""...
12732e417f34d189026099a1d72ea3d0
Area de metodos Metodo para saber si un usuario sigue a otro
[ { "docid": "da2c56c0d8def3d30ebebdb651b907da", "score": "0.0", "text": "def following?(leader)\n leaders.include? leader\n end", "title": "" } ]
[ { "docid": "1cab4beeb20a7deb94a96cabf900d03a", "score": "0.7346321", "text": "def for_users?\n @is_for_user = owner.class.objet_name == 'user' if @is_for_user === nil\n @is_for_user\n end", "title": "" }, { "docid": "165c095c383121046cbfd85bdae46e3d", "score": "0.70442194", ...
d8b5c1f932954ca672b0bdeeac77a86c
Set the value of the FilterValue input for this Choreo.
[ { "docid": "9f51e03f5e25bf98644ce7c5c422fc9d", "score": "0.83912134", "text": "def set_FilterValue(value)\n set_input(\"FilterValue\", value)\n end", "title": "" } ]
[ { "docid": "44fbf9b4ca68b3620f9e305a00b46754", "score": "0.863335", "text": "def set_FilterValue(value)\n set_input(\"FilterValue\", value)\n end", "title": "" }, { "docid": "cf877def36721265c71f61bf3e079de8", "score": "0.7761934", "text": "def set_Filter(value)\n ...
71a26d6d33e6bca5f53249ae7dece977
Metodo Calcular Kcal de los Lipidos
[ { "docid": "f369591ec1c9626ddd9dbad9a0aaf562", "score": "0.7314899", "text": "def kcallipidos\n\t\t\t@lipidos * 9\n\t\tend", "title": "" } ]
[ { "docid": "2be7551fb4a00c4d709f271428f881f6", "score": "0.75827223", "text": "def valorenergeticoKcal\n veKJ=(cgrasas * 9) + (cgrasassa * 9) + (grasasmono * 9) + (grasaspoli * 9) + (hcarbono * 4) + (polialcoholes * 2.4) + (almidon * 4) + (fibra * 2) + (proteinas * 4) + (sal * 6)\n ...
1dd2e7cd9c48332e2b1ec71ec72efbf8
Public: Does the timestamp of the most recent change meet or exceed the specified timestamp? timestamp A Time object. Returns a Boolean.
[ { "docid": "ce11b2935b0a3be49ed5a41d9a53b336", "score": "0.682772", "text": "def up_to_date_for?(timestamp)\n keys.sort.last >= timestamp\n end", "title": "" } ]
[ { "docid": "9b66ac7dffd78f793f66719be5f6e7e9", "score": "0.7526014", "text": "def older_than?(time)\n time > timestamp\n end", "title": "" }, { "docid": "dea7fe22472217de0e21e0667d9d7c33", "score": "0.71666867", "text": "def recent?\n Time.at(timestamp) >= 2.minutes.ag...