query stringlengths 7 9.55k | document stringlengths 10 363k | metadata dict | negatives listlengths 0 101 | negative_scores listlengths 0 101 | document_score stringlengths 3 10 | document_rank stringclasses 102
values |
|---|---|---|---|---|---|---|
set the schedule as inactive (kinda of delete it) | def setInactive
self.update_attribute(:end_active_at, DateTime.now - 1.minute)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def disable\n admin_only do\n handle_recurring_schedule_failure 'disable', 'disabled' do\n # get the schedule object to be disabled.\n @test = get_test_with_rescue\n @test.active = nil\n @test.save!\n end\n redirect_to action: \"index\"\n end\n end",
"def unschedule\r\n i... | [
"0.660496",
"0.6542165",
"0.64737517",
"0.64187944",
"0.64089084",
"0.63907045",
"0.63865834",
"0.63838214",
"0.6215918",
"0.6193541",
"0.6175287",
"0.6153415",
"0.61463314",
"0.61463314",
"0.612563",
"0.61003274",
"0.6097641",
"0.60695654",
"0.60602826",
"0.5994032",
"0.5987... | 0.65547127 | 1 |
Return the current logged in username. | def username
response = get 'v1/market/private/user/username.json'
response[:username]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_username\n @user_name ||= self.user.username\n end",
"def current_user_name\n logged_in? ? (user_name(current_user_id) || current_user_id) : nil\n end",
"def user_username\n if self.user != nil\n self.user.username\n end\n end",
"def string_username\n CaseInsens... | [
"0.8468469",
"0.8302197",
"0.81750333",
"0.8040615",
"0.7953156",
"0.7938333",
"0.79277164",
"0.79260933",
"0.78911954",
"0.7888102",
"0.78618485",
"0.77948165",
"0.7771885",
"0.7769177",
"0.7746243",
"0.76707506",
"0.7654127",
"0.76538897",
"0.7633293",
"0.76301247",
"0.7613... | 0.72305536 | 49 |
Return the current logged in email address. | def email_address
response = get 'v1/market/private/user/email.json'
response[:email]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def email\n (@session[:current_user_details] || {})[:email]\n end",
"def me_user_email\n email = Email.find_primary(me).take if auth?\n email.email || ''\n end",
"def get_useremail()\n email = nil\n git_user_email = %x(git config user.email).strip\n email = git_user_email if git_u... | [
"0.8399334",
"0.83256274",
"0.82597697",
"0.8223617",
"0.7894504",
"0.7885804",
"0.7824782",
"0.7818323",
"0.7717989",
"0.76120365",
"0.76120365",
"0.75991946",
"0.7501167",
"0.74950176",
"0.7448361",
"0.7448361",
"0.7440689",
"0.7401813",
"0.73996234",
"0.73818237",
"0.73727... | 0.71884453 | 31 |
Retrieve information about a user. | def user_information(username)
response = get "v1/market/user:#{username}.json"
response[:user]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_user_info\n response = send_method(:get_user_info)\n user_from(response)\n end",
"def user_info\n response = from_server \"api/user.json\"\n response.data\n end",
"def get_user_info\n get(\"/api/v1/oauth_user_info.json\")\n end",
"def get_user_info(user)\n if us... | [
"0.86762273",
"0.8345303",
"0.8176553",
"0.8121085",
"0.79798824",
"0.78839564",
"0.77523303",
"0.7684491",
"0.7645323",
"0.76193017",
"0.7606617",
"0.7593977",
"0.75910556",
"0.7581551",
"0.75036395",
"0.7470414",
"0.7427205",
"0.7424319",
"0.7411673",
"0.7392343",
"0.733256... | 0.7832102 | 6 |
Find badges for a user. | def badges_for_user(username)
response = get "v1/market/user-badges:#{username}.json"
response[:'user-badges']
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def badges(user_id: '-')\n return get(\"#{API_URI}/#{PROFILE_API_VERSION}/user/#{user_id}/badges.json\")\n end",
"def badges\n get(\"user/#{user_id}/badges.json\")\n end",
"def badges(options={})\n get('/user_badge', options)\n end",
"def badges(id)\n get(\"users/#{id}/badg... | [
"0.78773445",
"0.7613429",
"0.72986996",
"0.7257249",
"0.7142821",
"0.70736796",
"0.6588264",
"0.6379599",
"0.6214791",
"0.6193804",
"0.61089796",
"0.59106946",
"0.58672756",
"0.5829829",
"0.5637001",
"0.5625826",
"0.5574686",
"0.5549229",
"0.5526664",
"0.5433903",
"0.5387077... | 0.7952129 | 0 |
Find items by a single user based on marketplace. | def user_items_by_site(username)
response = get "v1/market/user-items-by-site:#{username}.json"
response[:'user-items-by-site']
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def search_by_user(user)\n # d = db\n transaction do\n d.select { |_, v| v[:user] == user }\n end\n end",
"def find_by_user(client, user: required(\"user\"), workspace: required(\"workspace\"), options: {})\n params = { workspace: workspace }.reject { |_,v| v.nil? || Array(v).em... | [
"0.648871",
"0.61292255",
"0.610452",
"0.6027122",
"0.60142154",
"0.6002811",
"0.5956876",
"0.59553874",
"0.59482074",
"0.59252876",
"0.5911572",
"0.59102464",
"0.588989",
"0.58607554",
"0.584605",
"0.5840936",
"0.5840396",
"0.58073103",
"0.57736564",
"0.57588303",
"0.5750775... | 0.6501125 | 0 |
Find all new items for user based on a marketplace. | def new_items_for_user(username, sitename)
raise Envato::InvalidSiteName unless marketplace_names.include? sitename
response = get "v1/market/new-files-from-user:#{username},#{sitename}.json"
response[:'new-files-from-user']
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def feed_items\n # Following users\n following_user_ids = \"SELECT followed_id FROM relationships\n WHERE follower_id = :user_id\"\n # Following Tags\n following_tag_ids = \"SELECT tag_id FROM tag_follows\n WHERE user_id = :user_id\"\n # Following tag's i... | [
"0.6023096",
"0.5739385",
"0.5562332",
"0.55500114",
"0.55344826",
"0.54793364",
"0.54522824",
"0.5451346",
"0.5442407",
"0.5433652",
"0.54334986",
"0.54018414",
"0.53915536",
"0.5290779",
"0.5288997",
"0.5281393",
"0.527529",
"0.5266963",
"0.52580225",
"0.5252533",
"0.524834... | 0.65492696 | 0 |
Breakdown a users sales based on month. | def sales_per_month
response = get 'v1/market/private/user/earnings-and-sales-by-month.json'
response[:'earnings-and-sales-by-month']
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_monthly(user)\n weeks = get_calendar(user)\n ret = {\n '01' => 0,\n '02' => 0,\n '03' => 0,\n '04' => 0,\n '05' => 0,\n '06' => 0,\n '07' => 0,\n '08' => 0,\n '09' => 0,\n '10' => 0,\n '11' => 0,\n '12' => 0\n ... | [
"0.640086",
"0.63520414",
"0.6327773",
"0.6317694",
"0.6256589",
"0.62173945",
"0.60382235",
"0.59575677",
"0.5845607",
"0.5806844",
"0.5791221",
"0.57600045",
"0.57464075",
"0.57354254",
"0.5715706",
"0.5715122",
"0.5680918",
"0.56787455",
"0.56756973",
"0.566112",
"0.565856... | 0.7071074 | 0 |
Get the current user statement. | def user_statement
response = get 'v1/market/private/user/statement.json'
response[:statement]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def current_user\n\n sql = \"SELECT * FROM users WHERE id = $1;\"\n \n results = run_sql(sql, [session[:user_id]]) \n return results.first\n end",
"def current_user\n select_value(<<~SQL.squish, \"SCHEMA\")\n SELECT SYS_CONTEXT('userenv', 'session_user') FROM dual\n SQL\n ... | [
"0.6978634",
"0.69378936",
"0.6421363",
"0.6327919",
"0.62573993",
"0.61917335",
"0.61510605",
"0.6137188",
"0.60869527",
"0.6051322",
"0.6030262",
"0.59958935",
"0.59958935",
"0.5987161",
"0.5957113",
"0.5948124",
"0.5948124",
"0.59389746",
"0.593767",
"0.592784",
"0.5920803... | 0.7187033 | 0 |
The "timeslist" stores an array of decimal numbers representing the time in seconds for a worker duration time. Whenever the "timeslist" exceeds the stipulated max length it is going to remove 25% of the last values inside the array. | def release_cache_allocation(redis, timelist_length)
max_timelist_length = Sidekiq::Statistic.configuration.max_timelist_length
if timelist_length > max_timelist_length
redis.ltrim(@keys.timeslist, 0, (max_timelist_length * 0.75).to_i)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_times(event)\n\t\tevent.times.each do |t|\n\t\t\tif t[1].to_i-t[0].to_i < event.length\n\t\t\t\tevent.times.delete(t)\n\t\t\tend\n\t\tend\n\tend",
"def most_free_time(arr)\n free_times = []\n arr = arr.map do |event|\n start_time, end_time = event.split('-')\n [time_to_minutes(start_time), tim... | [
"0.6160547",
"0.5871985",
"0.5698223",
"0.564392",
"0.5537809",
"0.55005515",
"0.54997134",
"0.54442644",
"0.5414609",
"0.5391899",
"0.53420776",
"0.53092986",
"0.5277082",
"0.52710587",
"0.52708876",
"0.52680224",
"0.5242377",
"0.5241167",
"0.5240105",
"0.5217934",
"0.519152... | 0.5494094 | 7 |
constructor popSize: members in population solution: array of bytes representing solution arg: additional parameters, such as string, word, ect. => This is useful, because depending on what type of data we're searching for, we can narrow down the gene length | def initialize(popSize=0,solution,args)
#set desired
@@elitism = args[:elitism]
@@mutationRate = args[:mutationRate]
Fitness::setSolution(solution)
@mutationNum = 0
@population = Population.new(popSize,true,{:data =>args[:data]},Fitness)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(popSize=0,solution=[],args= {})\n\t\tif popSize==0\n\t\t\tpopSize=100\n\t\tend\n\t\tif !solution.empty? && solution.is_a?(Array)\n\t\t\t@PopulationHandler = PopulationHandler.new(popSize,solution,args)\n\t\t\tputs \"Population Handler created\"\n\t\t\tputs \"Population Size: #{popSize}\"\n\t\t\tputs... | [
"0.67137986",
"0.6202784",
"0.6049411",
"0.6019852",
"0.59689593",
"0.5698155",
"0.5631447",
"0.56107306",
"0.55970496",
"0.5582112",
"0.55564934",
"0.55499625",
"0.553702",
"0.55129075",
"0.54652643",
"0.54348737",
"0.54183775",
"0.5382112",
"0.53614974",
"0.53614974",
"0.53... | 0.67410225 | 0 |
crossover heh, genetics joke below | def breed(xx,xy)
#x,y are parent genes
x = xx.genes
y = xy.genes
geneLength = Fitness::geneLength
#offspring
z = Array.new(geneLength)
# bit returns true or false randomly when sampled
bit = [true,false]
count = 0
while count < geneLength
if bit.sample
z[count] = x[count]
else
z[count] = y[count]
end
count+=1
end
offspring = Population::createMember(z)
offspring.fitness =Fitness::getFitness(z.join())
return offspring
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cherty_hottish(define, henchboy, systematically_youthen)\n sprag_squamaceous(demilitarize)\n osiridean_seedily(coopering_frenzelite, columellia)\n end",
"def king_richard_iii; end",
"def mixgenes( mgenes, sgenes ) ## returns babygenes\n ## note: reverse genes strings (in kai) so index 0 is t... | [
"0.59347844",
"0.5621788",
"0.5465388",
"0.54503626",
"0.5357019",
"0.5343498",
"0.5335991",
"0.53165025",
"0.52779514",
"0.5262449",
"0.52537465",
"0.5250839",
"0.523483",
"0.5174462",
"0.51702744",
"0.51432186",
"0.51346135",
"0.5128135",
"0.51277333",
"0.5114139",
"0.51038... | 0.0 | -1 |
fight for fitness and glory. Winners get to breed | def compete(population,size=5)
#fight to the death
competition = Population.new(size,false)
size.times do
competition.addMember(population.getRandomMember())
end
return competition.getFittest
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fight (game)\n @state.fight(self, game)\n end",
"def battle\n # Runden auf 0 setzen, continue auf true (Für die Schleife)\n round = 0\n continue = true\n victory = false\n # Bilde Arrays mit allen nötigen Werten für den Kampf\n turn_fleet = build_array(@attacker, @attacker_fleet)\n t... | [
"0.71260923",
"0.711013",
"0.7103374",
"0.6968889",
"0.6915633",
"0.6858511",
"0.6849031",
"0.67684984",
"0.67621857",
"0.6755314",
"0.6733031",
"0.67050546",
"0.6702012",
"0.669596",
"0.667046",
"0.66464204",
"0.6623142",
"0.6607663",
"0.65761817",
"0.65279776",
"0.65090704"... | 0.0 | -1 |
Iterate through all elements in nums Try if hash_table has the key for pop If not, set up key/value pair In the end, there is only one element in hash_table, so use popitem to get it 2 | def single_number(nums)
result = {}
nums.each do |n|
# delete in ruby is slow... this one isn't as fast as mine
result[n].nil? ? result[n] = n : result.delete(n)
end
result.shift.first
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pop_values()\n value_hash.values.each { |val_vec| val_vec.pop }\n end",
"def drops(number)\n#Iterating through de prime_drops hash thanks to the Public Instance Method .each_with_object\n prime_drops.each_with_object(\"\") {|(prime, drop), drops|\n#While we iterate we check the number looking for the ... | [
"0.57777625",
"0.5756144",
"0.5665419",
"0.56167895",
"0.56075037",
"0.5581523",
"0.5580626",
"0.5571361",
"0.55547184",
"0.5500372",
"0.5496856",
"0.54590255",
"0.54457533",
"0.54456484",
"0.5438338",
"0.5430839",
"0.54292667",
"0.5394167",
"0.53863055",
"0.5330129",
"0.5305... | 0.5987485 | 0 |
Time complexity: O(n + 1? idk about .delete()) Space: O(n) Math solution 2 (A + B + C) (A + A + B + B + C) = C 3 | def single_number(nums)
2 * nums.uniq.reduce(:+) - nums.reduce(:+)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def solution(a)\n accessed = Array.new(a.size + 1, nil)\n caterpillar_back = 0\n count = 0\n\n a.each_with_index do |x, caterpillar_front|\n if accessed[x] == nil\n accessed[x] = caterpillar_front\n else\n new_caterpillar_back = accessed[x] + 1\n first_part_size = caterpi... | [
"0.641257",
"0.62326336",
"0.6130321",
"0.6128333",
"0.6127051",
"0.5954614",
"0.5940014",
"0.5918606",
"0.59178686",
"0.5907201",
"0.5906092",
"0.58871794",
"0.58857304",
"0.5877406",
"0.5864017",
"0.58618265",
"0.5848513",
"0.5846755",
"0.5837095",
"0.5834333",
"0.58334404"... | 0.0 | -1 |
Time complexity: O(n + n) = O(n) Space complexity: O(n + n) = O(n). the set needs space for the elements in nums Ruby bitwise XOR If we take XOR of zero and some bit, it will return that bit a ^ 0 = a If we take XOR of two same bits, it will return 0 a ^ a = 0 a ^ b ^ a = (a ^ a) ^ b = 0 ^ b = b So we can XOR all bits together to find the unique number. For each bit in the binary representation of the operands, a bitwise XOR will get a 1 bit if one of the corresponding bits in the operands is 1, but not both, otherwise the XOR will get a 0 bit. Here's an example: 5 is 101, 6 is 110, 5 ^ 6 = 011 = 3 5 ^ 5 = 0 4 The first element in the array is taken as the memo and the second element is taken as the num. memo takes the result of the comparison, compares to the 3rd element, and so on. the idea is that the pairs of integers will cancel out with XOR, leaving only the number of interest e.g. 5 ^ 5 ^ 6 ^ 7 ^ 7 => 6 | def single_number(nums)
nums.reduce(:^) # { |memo, num| memo ^ num }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_duplicates(a)\n len=a.length\n n=len-2\n xor= 0\n x,y=0,0 #variables to store duplicates\n \n #xor of all numbers from 1 to n\n for i in 1..n \n xor^=i\n end\n #xor of all array elements\n for i in 0...len \n xor^=a[i]\n end\n #Ri... | [
"0.75167465",
"0.692845",
"0.6776778",
"0.67381006",
"0.67377204",
"0.67156535",
"0.6705688",
"0.6654707",
"0.6635193",
"0.65842426",
"0.6580074",
"0.6577946",
"0.6534031",
"0.6515348",
"0.648503",
"0.64838165",
"0.64497906",
"0.64448565",
"0.6423581",
"0.64231586",
"0.642260... | 0.6234756 | 34 |
Initialize a new `Metadata` object | def initialize(name: nil, istreams: [], ostreams: [])
self.name = name
self.istreams = istreams
self.ostreams = ostreams
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(metadata)\n @metadata = metadata\n end",
"def initialize()\n @metadata = Hash.new()\n return self\n end",
"def initialize(metadata = YAMLMetadata.new)\n @metadata = metadata\n end",
"def initialize(metadata, fields = {})\n @metadata = JSON.parse(metadata).me... | [
"0.8099518",
"0.7998378",
"0.78235877",
"0.73209095",
"0.71387964",
"0.70273036",
"0.7008813",
"0.7001572",
"0.69312155",
"0.6864706",
"0.6780098",
"0.6764959",
"0.67156583",
"0.6656389",
"0.6653615",
"0.66287243",
"0.66151905",
"0.6614583",
"0.6594828",
"0.6551262",
"0.64699... | 0.0 | -1 |
Initialize a new `ComputationContext` | def initialize(computation)
self.computation = computation
self.transaction = ::Concord::Thrift::ComputationTx.new
self.transaction.records = []
self.transaction.timers = {}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize\n self.context = Context.new\n end",
"def execution_context\n initialize_context!(Object.new)\n end",
"def context\n @_context ||= begin\n ptr = MemoryPointer::new( Context )\n error = OpenCL.clGetProgramInfo(self, CONTEXT, Context.size, ptr, nil)\n erro... | [
"0.67508054",
"0.6748989",
"0.6230816",
"0.62093514",
"0.6085821",
"0.60184884",
"0.5963008",
"0.594317",
"0.59255344",
"0.5908465",
"0.5908465",
"0.58722246",
"0.58580136",
"0.58410996",
"0.5771573",
"0.57637465",
"0.57637465",
"0.5732501",
"0.57064855",
"0.5701131",
"0.5690... | 0.6336505 | 2 |
Produce a record on `stream` with `key` and `value` | def produce_record(stream, key, value)
r = ::Concord::Thrift::Record.new
r.meta = ::Concord::Thrift::RecordMetadata.new
r.key = key
r.data = value
r.userStream = stream
transaction.records.push(r)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def put_record(stream, key, value)\n raise NotImplementedError\n end",
"def pipe_to(stream)\n message = ''\n create_stream() unless stream_exists?(stream)\n message = yield if block_given?\n body = update_message_body(message)\n resp = kinesis.put_record p... | [
"0.7422537",
"0.5717523",
"0.5650316",
"0.5506762",
"0.5304431",
"0.523678",
"0.5233242",
"0.5233242",
"0.51531154",
"0.51312",
"0.5099948",
"0.50368774",
"0.5036391",
"0.49827924",
"0.4939345",
"0.49281946",
"0.4886866",
"0.4886866",
"0.48497495",
"0.48435447",
"0.4841184",
... | 0.7958232 | 0 |
Set a timer to trigger a callback in the future | def set_timer(key, time)
transaction.timers[key] = time
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def timer(milliseconds, &callback)\n # Implement in subclass\n end",
"def schedule(time, callback); end",
"def timer(timeout,options={},&callback)\n bot.timer.add_timer(:timestamp=>Time.now+timeout.to_i, :requestor=>options[:requestor]||name,&callback)\n end",
"def timer(callback = nil, &blk)... | [
"0.72811586",
"0.71235293",
"0.7055587",
"0.7055117",
"0.6755316",
"0.6696654",
"0.66893315",
"0.65120184",
"0.6504822",
"0.64899915",
"0.6413648",
"0.6413648",
"0.6413648",
"0.6413648",
"0.6391655",
"0.63417935",
"0.6336033",
"0.6336033",
"0.6336033",
"0.6336033",
"0.6327021... | 0.58679426 | 43 |
Retrieve a binary blob stored in the proxy state | def get_state(key)
computation.get_state(key)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save2blob()\n url = URI.parse(getUrl)\n h = Net::HTTP.start(url.host, url.port) do |http|\n resp, data = http.get(url.path + '?' + url.query)\n return data\n end\n end",
"def blob\n generate\n storage.get(path).body\n end",
"def blob; end",
"def blob; end",
"def to_blob\n ... | [
"0.6810621",
"0.6716295",
"0.65735465",
"0.65735465",
"0.6542191",
"0.6491445",
"0.64849716",
"0.64771134",
"0.63948447",
"0.6391976",
"0.6391976",
"0.6391976",
"0.6391976",
"0.6391976",
"0.6391976",
"0.6376434",
"0.6330468",
"0.6316375",
"0.62938255",
"0.6266625",
"0.6249661... | 0.0 | -1 |
Store a binary blob, identified by a key, in the proxy state | def set_state(key, value)
computation.set_state(key, value)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def write(key, value)\n key.freeze if key.is_a? String\n\n @memory_store[key] = value\n @file_store.transaction do\n @file_store[key] = value\n end\n end",
"def storeSerialised( handle, key, klass )\n s = Marshal.dump( klass )\n handle[ key ] = s;\nend",
"d... | [
"0.6259867",
"0.61232007",
"0.61055636",
"0.61055636",
"0.61033887",
"0.60126525",
"0.5987791",
"0.5929911",
"0.5909976",
"0.58571386",
"0.58549505",
"0.5834682",
"0.5834682",
"0.570967",
"0.5664677",
"0.5619842",
"0.5606173",
"0.55977577",
"0.559244",
"0.5567842",
"0.5550051... | 0.0 | -1 |
Initialize a new `Computation` and register it with the proxy | def initialize(handler: nil, proxy_host: nil, proxy_port: nil)
self.handler = handler
self.proxy_host = proxy_host
self.proxy_port = proxy_port
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new(*constructor_args)\n @proxy.new do |*call_args|\n @worker.new(constructor_args, @job, &@block).call(call_args, @context)\n end\n end",
"def initialize(computation)\n self.computation = computation\n self.transaction = ::Concord::Thrift::ComputationTx.new\n self.... | [
"0.612914",
"0.6006112",
"0.58804315",
"0.55033314",
"0.53794134",
"0.5330355",
"0.52628416",
"0.5190672",
"0.5173242",
"0.51452124",
"0.5121439",
"0.5121163",
"0.51166016",
"0.5113001",
"0.51019245",
"0.50968313",
"0.50710595",
"0.5068734",
"0.5068734",
"0.506155",
"0.505527... | 0.0 | -1 |
Process records from upstream. Wraps the user method in transactions, which are returned to the proxy upon completion. | def boltProcessRecords(records)
txs = []
records.each do |record|
ctx = ComputationContext.new(self)
log_failure do
handler.process_record(ctx, record)
end
txs.push(ctx.transaction)
end
txs
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def process *args, &block\n raise \"override the process method in your implementation: it should process each record.\"\n end",
"def process_with_payu\n process_purchase\n end",
"def process_transaction(trans, volume = trans.volume)\n # Fetch Portfolio of involved parties (buyer and seller)... | [
"0.58849883",
"0.57768244",
"0.54928666",
"0.5474429",
"0.5464763",
"0.54029953",
"0.5368554",
"0.5363739",
"0.5359235",
"0.5335334",
"0.52973145",
"0.5286358",
"0.52395815",
"0.5234661",
"0.5228884",
"0.5219611",
"0.5217118",
"0.51980644",
"0.51750386",
"0.51679695",
"0.5163... | 0.5456627 | 5 |
Process a timer callback from the proxy. Wraps the user method in a transaction, which is returned to the proxy upon completion. | def boltProcessTimer(key, time)
ctx = ComputationContext.new(self)
log_failure do
handler.process_timer(ctx, key, time)
end
ctx.transaction
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def timer(timeout,options={},&callback)\n bot.timer.add_timer(:timestamp=>Time.now+timeout.to_i, :requestor=>options[:requestor]||name,&callback)\n end",
"def finalized_plan_event(transaction, proxy); end",
"def timer\n rescuer do\n Timeout.timeout(ttl) { yield }\n end\n end",
"def ti... | [
"0.5476667",
"0.5414996",
"0.5308264",
"0.5299317",
"0.51228255",
"0.51091546",
"0.50555134",
"0.5002299",
"0.4982722",
"0.498127",
"0.49794996",
"0.49671572",
"0.4945523",
"0.49429312",
"0.49390447",
"0.49390447",
"0.49390447",
"0.49390447",
"0.4881811",
"0.48604032",
"0.485... | 0.5548104 | 0 |
The initialization function, called when the framework is ready to start sending the computation records. Wraps the user method in a transaction, which is returned to the proxy upon completion. | def init
ctx = ComputationContext.new(self)
log_failure do
handler.init(ctx)
end
ctx.transaction
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(computation)\n self.computation = computation\n self.transaction = ::Concord::Thrift::ComputationTx.new\n self.transaction.records = []\n self.transaction.timers = {}\n end",
"def setup\n set_par_price\n make_certificates_available\n create_transaction\n... | [
"0.6197945",
"0.61652875",
"0.61225367",
"0.60193354",
"0.5948263",
"0.58906764",
"0.58843607",
"0.58569413",
"0.5829021",
"0.5798062",
"0.5790211",
"0.5790211",
"0.5762776",
"0.5762776",
"0.5756683",
"0.5756683",
"0.57310486",
"0.5699439",
"0.56978106",
"0.56777555",
"0.5675... | 0.72102404 | 0 |
The class destructor, use this method to perform any cleanup before the proxy kills the process this instance resides in. | def destroy
log_failure do
handler.destroy
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stop!\n self.class.cleanup!(:pid => @sudo_pid, :socket => @socket)\n @proxy = nil\n end",
"def teardown\n Process.kill('KILL',@pid)\n end",
"def shutdown\n shutdown_proxy\n exit_thread\n super\n end",
"def close!\n _close\n @clean_proc.call\n ObjectSp... | [
"0.7218145",
"0.7097898",
"0.6955957",
"0.67301124",
"0.67030853",
"0.66489",
"0.6558154",
"0.65223634",
"0.6521523",
"0.64924544",
"0.64924544",
"0.64924544",
"0.64924544",
"0.64438206",
"0.64438206",
"0.6423641",
"0.64176726",
"0.64139134",
"0.6410862",
"0.63859314",
"0.637... | 0.0 | -1 |
Retrieve a binary blob stored in the proxy state | def get_state(key)
proxy.getState(key)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save2blob()\n url = URI.parse(getUrl)\n h = Net::HTTP.start(url.host, url.port) do |http|\n resp, data = http.get(url.path + '?' + url.query)\n return data\n end\n end",
"def blob\n generate\n storage.get(path).body\n end",
"def blob; end",
"def blob; end",
"def to_blob\n ... | [
"0.6810824",
"0.67158085",
"0.65718204",
"0.65718204",
"0.65417856",
"0.6490886",
"0.648429",
"0.6477422",
"0.6394587",
"0.63911885",
"0.63911885",
"0.63911885",
"0.63911885",
"0.63911885",
"0.63911885",
"0.6375687",
"0.63331854",
"0.6315418",
"0.6293909",
"0.62672865",
"0.62... | 0.0 | -1 |
Store a binary blob, identified by a key, in the proxy state | def set_state(key, value)
proxy.setState(key, value)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def write(key, value)\n key.freeze if key.is_a? String\n\n @memory_store[key] = value\n @file_store.transaction do\n @file_store[key] = value\n end\n end",
"def storeSerialised( handle, key, klass )\n s = Marshal.dump( klass )\n handle[ key ] = s;\nend",
"d... | [
"0.62603575",
"0.61220354",
"0.61051315",
"0.61051315",
"0.61026686",
"0.60126024",
"0.5987433",
"0.59291893",
"0.5908089",
"0.58582526",
"0.5855919",
"0.5833741",
"0.5833741",
"0.5708418",
"0.5665019",
"0.56210124",
"0.5606915",
"0.5598862",
"0.55907345",
"0.556864",
"0.5549... | 0.5331013 | 45 |
allows users to show their individual address information based on their user id | def show
user = User.find(params[:id])
render json: user.address
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @user = User.find(params[:id])\n @address = @user.address || Address.new\n \n respond_to do |format|\n format.html # show.html.erb\n end\n end",
"def show\n @address = current_user.addresses.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n ... | [
"0.7939871",
"0.78729117",
"0.7737967",
"0.77083284",
"0.7403518",
"0.7371526",
"0.7371526",
"0.7359308",
"0.7356225",
"0.73513573",
"0.7276466",
"0.72709596",
"0.72709596",
"0.72358954",
"0.7220212",
"0.7137535",
"0.70764905",
"0.7036032",
"0.700668",
"0.6998792",
"0.6995277... | 0.7389067 | 5 |
allows users to update address information | def update
user = User.find(params[:id])
if user.address.update(address_params)
render status: :ok
else
render status: :unprocessable_entity #was :bad_request
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def edit_address\n traveller = Traveller.find(params[:pk])\n address = params[:value]\n\n coordinates = GoogleAPIGeocoder.do_geocode(address)\n\n if coordinates.nil?\n render json: {success: false, msg: 'Unable to find the location of the given address. Please check that it is correct.'}\n else... | [
"0.79523236",
"0.79081094",
"0.7890272",
"0.7873885",
"0.78191274",
"0.7731957",
"0.77282935",
"0.77171177",
"0.7712302",
"0.7662275",
"0.7648914",
"0.7622569",
"0.76196766",
"0.7610492",
"0.76064456",
"0.76033616",
"0.7598274",
"0.75687027",
"0.75624585",
"0.75400907",
"0.75... | 0.77593267 | 5 |
defines the permitted parameters that can be inputted | def address_params
params.require(:address).permit(:street, :suburb, :state, :postcode)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def valid_params?; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def check_params; true; end",
"def valid_params_request?; end",
"def permitted_params\n declared(params, include_missing: false)\n end",
"def permitted_pa... | [
"0.72998637",
"0.7266968",
"0.7178188",
"0.71122015",
"0.7051836",
"0.6958611",
"0.6958611",
"0.69330776",
"0.689223",
"0.6827",
"0.68039495",
"0.6722076",
"0.6698462",
"0.6698462",
"0.6698462",
"0.6698462",
"0.6698462",
"0.6698462",
"0.6698462",
"0.6698462",
"0.6665949",
"... | 0.0 | -1 |
Pass the url to the RSS feed you would like to keep tabs on by default this will request the rss from the server right away and fill the tasks array | def initialize(url, refresh = true)
self.pics = []
self.url = url
self.refresh if refresh
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fetch\n @jobs = fetch_rss(url, Sources::STACKOVERFLOW)\n end",
"def initialize(url, refresh = true)\n self.tasks = []\n self.url = url\n self.refresh if refresh\n end",
"def scrape_tasks(url)\n tasks = []\n doc = Nokogiri::HTML(open(url))\n doc.css(\"li.task_event\").each do |node|... | [
"0.67619574",
"0.66635495",
"0.6576879",
"0.64510477",
"0.62617916",
"0.6113688",
"0.6113044",
"0.6090623",
"0.60790443",
"0.60670173",
"0.59725815",
"0.5923344",
"0.5922108",
"0.5905358",
"0.58835614",
"0.5875817",
"0.5856877",
"0.5826789",
"0.5818325",
"0.5797949",
"0.57960... | 0.0 | -1 |
This method lets you refresh the tasks int the tasks array useful if you keep the object cached in memory and | def refresh
open(@url) do |http|
parse(http.read)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tasks=( array )\n @tasks = array\n update_internal_task_lists()\n end",
"def refresh(*managers)\n @iterator.each do |iter|\n task = iter[0]\n if task.done?\n removal_time = @done_tasks[task]\n if not removal_time\n @done_tasks[task] = Time.now + TASK_REMOVAL_T... | [
"0.7222479",
"0.6934714",
"0.690522",
"0.68356204",
"0.67352945",
"0.6627029",
"0.6627029",
"0.6597282",
"0.6597282",
"0.6597282",
"0.6487773",
"0.6436789",
"0.6405407",
"0.6363743",
"0.63490933",
"0.6324891",
"0.63235146",
"0.63204193",
"0.62680507",
"0.62630826",
"0.6244139... | 0.0 | -1 |
Asserts that the request has been redirected to the specified url. | def assert_redirected_to(url)
assert_equal(url, responses.first.location)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def assert_redirected_to(url)\n assert [301, 302].include?(@integration_session.status),\n \"Expected status to be 301 or 302, got #{@integration_session.status}\"\n\n assert_url url, @integration_session.headers[\"Location\"]\n end",
"def assert_redirected_to(url, message=nil)\n assert_res... | [
"0.81954974",
"0.80881244",
"0.74768996",
"0.738156",
"0.73555833",
"0.7233924",
"0.7090405",
"0.7052969",
"0.70433927",
"0.7002601",
"0.69074434",
"0.6830566",
"0.6822",
"0.6742068",
"0.67251766",
"0.65992767",
"0.6558291",
"0.65293366",
"0.64743644",
"0.6421921",
"0.6409780... | 0.8786609 | 0 |
Asserts that the specified cookie has been set to the specified value. | def assert_cookie(name, value)
assert cookies[name.to_s]
assert_equal value, cookies[name.to_s]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_cookie(name, value)\n test_cookies[name] = value\n end",
"def assert_cookie(name, pat, message=nil)\n assert_match pat, @cookies[name], message\n end",
"def set_WithCookie(value)\n set_input(\"WithCookie\", value)\n end",
"def cookie=(val)\n @xmlrpc.cookie = val\n... | [
"0.73221475",
"0.6829366",
"0.66600424",
"0.64230716",
"0.63613164",
"0.6349922",
"0.63215524",
"0.627164",
"0.626359",
"0.6192877",
"0.61041784",
"0.61041784",
"0.6070704",
"0.60611427",
"0.604766",
"0.60050315",
"0.5986121",
"0.594535",
"0.591734",
"0.5901529",
"0.5901268",... | 0.8278769 | 0 |
Asserts that there is no cookie set for the specified cookie | def assert_no_cookie(name)
assert !cookies[name.to_s]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def assert_no_session\n assert_nil @cookies[\"camping_sid\"], \n \"A session cookie was sent although this should not happen\"\n end",
"def cookie_test\n\t\tif cookies[\"cookie_test\"].blank?\n\t\t\tlogger.warn(\"=== cookies are disabled\")\n\t\t\trender :template => \"shared/cookies_required\"\n\... | [
"0.79016745",
"0.7114096",
"0.6766862",
"0.6756039",
"0.67066807",
"0.6616807",
"0.64259046",
"0.6383399",
"0.633417",
"0.62969947",
"0.6286759",
"0.61462235",
"0.61324775",
"0.61206853",
"0.6081937",
"0.60798013",
"0.6018382",
"0.60078233",
"0.596126",
"0.5927276",
"0.589790... | 0.84439355 | 0 |
uses one char of each string at a given starting point given b852fe780d104254823cf8749c401153 should get 4212870 | def decrypted_place_in_queue(encrypted_place_in_queue)
return encrypted_place_in_queue[ 30..30 ] + encrypted_place_in_queue[ 3..3 ] + encrypted_place_in_queue[ 11..11 ] +
encrypted_place_in_queue[ 20..20 ] + encrypted_place_in_queue[ 7..7 ] + encrypted_place_in_queue[ 26..26 ] +
encrypted_place_in_queue[ 9..9 ]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_char_summery(string, count)\n string[0..count]\n end",
"def substrings_at_start(str)\n str.each_char.map.with_index do |char, index|\n str[0..index]\n end\nend",
"def substrings_at_start(string)\n results = []\n\n string.chars.each_with_index do |char, index|\n results << string.chars[0..... | [
"0.6932621",
"0.68905",
"0.6767006",
"0.6749849",
"0.66960794",
"0.669067",
"0.6660333",
"0.6595196",
"0.6526488",
"0.65249115",
"0.65224165",
"0.64914",
"0.64843196",
"0.6481589",
"0.6477352",
"0.6477352",
"0.6470632",
"0.64453954",
"0.64212626",
"0.64153993",
"0.63935626",
... | 0.0 | -1 |
TODO add timestamp check | def verify_md5_hash?(url, expected_hash, secret_key)
url_no_hash = "#{url[ 0..-33 ]}#{secret_key}"
actual_hash = Digest::MD5.hexdigest(url_no_hash)
return (expected_hash == actual_hash)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def timestamp; end",
"def timestamp; end",
"def timestamp; end",
"def timestamp; end",
"def timestamp; end",
"def timestamp; end",
"def timestamp=(_arg0); end",
"def timestamp=(_arg0); end",
"def timestamp=(_arg0); end",
"def timestamp=(_arg0); end",
"def date() updated; end",
"def tim... | [
"0.7535297",
"0.7535297",
"0.7535297",
"0.7535297",
"0.7535297",
"0.7535297",
"0.6830647",
"0.6830647",
"0.6830647",
"0.6830647",
"0.6411448",
"0.6351457",
"0.6238869",
"0.62087655",
"0.620513",
"0.620513",
"0.620513",
"0.620513",
"0.61418706",
"0.6095786",
"0.60408103",
"0... | 0.0 | -1 |
Resize the original and singing images to 40% of their size and put them side by side. | def create_side_by_side_example
# Resize the original image to 40% of the size.
Commander.run!("convert #{@dir}/original.miff",
"-resize 40%",
"#{@dir}/original_smaller.miff")
# Resize the singing image to 40% of the size.
Commander.run!("convert",
Songster.output_folder.join("#{@fname}-singing.gif").to_s,
"-resize 40%",
"#{@dir}/singing_smaller.miff")
# Put two closed mouth side by side.
Commander.run!("convert",
"#{@dir}/original_smaller.miff #{@dir}/original_smaller.miff",
"+append",
"#{@dir}/sidebyside_closed.miff")
# Put a closed and opened mouth side by side.
Commander.run!("convert",
"#{@dir}/singing_smaller.miff",
"+append",
"#{@dir}/sidebyside_opened.miff")
Commander.run!("convert -loop 0 -delay 30",
"#{@dir}/sidebyside_closed.miff #{@dir}/sidebyside_opened.miff",
Songster.debug_folder.join("#{@fname}-sidebyside.gif").to_s)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resizeImages\n # For each of the 9 images\n for counter in (1..9)\n pngName = \"./images/\" + counter.to_s() + \".png\"\n image = Magick::Image.read(pngName).first\n # Make the new image 25% larger\n thumb = image.scale(1.25)\n thumb.write(pngName)\n end\n end",
"def square... | [
"0.64996207",
"0.61344165",
"0.6075757",
"0.5939927",
"0.59258044",
"0.5881704",
"0.5853281",
"0.57856125",
"0.5709361",
"0.56782377",
"0.5576887",
"0.54959357",
"0.5482878",
"0.54644835",
"0.54620826",
"0.54474014",
"0.5436985",
"0.54361",
"0.5413226",
"0.5411866",
"0.541123... | 0.673461 | 0 |
Create a crop of the mouth upper lip with black padding on the bottom | def create_mouth_top_crop(mouth)
crop_size = "#{mouth.width}x#{mouth.height+5}"
crop_location = "+#{mouth.left_x}+#{mouth.top}"
Commander.run!("convert #{@dir}/original.miff",
"-fill black -stroke black",
"-draw \"path '",
# Start line at the top left point
" M #{mouth.left}",
# Draw a curve to the right point.
" C #{mouth.center_x},#{mouth.center_y+5}",
" #{mouth.center_x},#{mouth.center_y+5}",
" #{mouth.right}",
# Draw a straight line to a point below the right point.
" L #{mouth.right_x},#{mouth.bottom+5}",
# Draw a straight line to a point below the left point.
" L #{mouth.left_x},#{mouth.bottom+5}",
# Close the figure so it can be filled.
" Z",
"'\"",
"-crop #{crop_size}#{crop_location}",
"#{@dir}/top.miff")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_mouth_bottom_crop(mouth)\n crop_size = \"#{mouth.width}x#{mouth.chin_height+mouth.opening_size}\"\n crop_location = \"+#{mouth.left_x}+#{mouth.middle}\"\n\n Commander.run!(\"convert #{@dir}/original.miff\",\n \"-fill black -stroke black\",\n\n \"-dr... | [
"0.73364794",
"0.7249829",
"0.6041177",
"0.59402835",
"0.59192324",
"0.58334166",
"0.5828233",
"0.578291",
"0.5733175",
"0.56458044",
"0.5579374",
"0.5560588",
"0.55474705",
"0.5534056",
"0.5444852",
"0.54284036",
"0.54114944",
"0.5406679",
"0.5357712",
"0.5355284",
"0.534625... | 0.74008954 | 0 |
Create a crop of the mouth bottom lip with black padding on the top | def create_mouth_bottom_crop(mouth)
crop_size = "#{mouth.width}x#{mouth.chin_height+mouth.opening_size}"
crop_location = "+#{mouth.left_x}+#{mouth.middle}"
Commander.run!("convert #{@dir}/original.miff",
"-fill black -stroke black",
"-draw \"path '",
# Start line at the top left point
" M #{mouth.left}",
# Draw a curve to the right point
" C #{mouth.center_x},#{mouth.center_y+5}",
" #{mouth.center_x},#{mouth.center_y+5}",
# Finish line at the right point.
" #{mouth.right}'",
"\"",
# Add black padding to adjust how big the mouth opens.
"-gravity northwest -background black",
"-splice 0x#{mouth.opening_size}+0+#{mouth.middle}",
# Crop to get the results.
"-crop #{crop_size}#{crop_location}",
"#{@dir}/bottom.miff")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_mouth_top_crop(mouth)\n crop_size = \"#{mouth.width}x#{mouth.height+5}\"\n crop_location = \"+#{mouth.left_x}+#{mouth.top}\"\n\n Commander.run!(\"convert #{@dir}/original.miff\",\n \"-fill black -stroke black\",\n\n \"-draw \\\"path '\",\n ... | [
"0.729578",
"0.7122948",
"0.59803075",
"0.57959604",
"0.5711049",
"0.5654403",
"0.5654206",
"0.5593234",
"0.5569859",
"0.55124867",
"0.54715115",
"0.5461746",
"0.54123026",
"0.53917235",
"0.5382463",
"0.53485173",
"0.5310281",
"0.53098184",
"0.5307977",
"0.53079116",
"0.53010... | 0.72931176 | 1 |
Merge the top and bottom part of the mouth to create the opened mouth. | def merge_top_and_bottom_of_mouth
Commander.run!("convert #{@dir}/top.miff #{@dir}/bottom.miff",
"-append #{@dir}/opened_mouth.miff")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def merge_opened_mouth_on_canvas(mouth)\n Commander.run!(\"composite\",\n \"#{@dir}/opened_mouth.miff #{@dir}/opened_mouths.miff\",\n \"-gravity northwest -geometry +#{mouth.x}+#{mouth.y}\",\n \"#{@dir}/opened_mouths.miff\")\n end",
"def create_... | [
"0.756299",
"0.67998385",
"0.6741661",
"0.6539761",
"0.56384194",
"0.5429254",
"0.54279655",
"0.5200727",
"0.5188147",
"0.512879",
"0.5097356",
"0.5087007",
"0.5022179",
"0.5021614",
"0.4989712",
"0.4989712",
"0.4972248",
"0.49684033",
"0.48795733",
"0.48489606",
"0.4842336",... | 0.7797932 | 0 |
Put the opened mouth over the original image. | def merge_opened_mouth_on_canvas(mouth)
Commander.run!("composite",
"#{@dir}/opened_mouth.miff #{@dir}/opened_mouths.miff",
"-gravity northwest -geometry +#{mouth.x}+#{mouth.y}",
"#{@dir}/opened_mouths.miff")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset(window)\n\t\t# put the horse back in the center\n\t\t@x = window.width / 2 - @image.width / 2\n\t\t@y = window.height / 2 - @image.height / 2\n\tend",
"def move_party_horn\n\t\tif face_left?\n\t\t\t@party_horn.x = @x + \n\t\t\t\t\t\t\t(TILE_WIDTH/4 - PartyHorn::PARTY_HORN_TILE_WIDTH)\n\t\telse\n\t\t\t@... | [
"0.62050015",
"0.5834073",
"0.58287716",
"0.55790573",
"0.5568584",
"0.5531366",
"0.5516264",
"0.54942805",
"0.5431468",
"0.54175085",
"0.537942",
"0.5318694",
"0.5318694",
"0.53106004",
"0.5254725",
"0.5225934",
"0.51849735",
"0.5170199",
"0.5152548",
"0.51484066",
"0.512300... | 0.7124058 | 0 |
Build a gif of the original image and the image with opened mouths | def animate_into_gif
animate = Commander.new("convert -loop 0 -delay 30")
animate << "#{@dir}/original.miff #{@dir}/opened_mouths.miff"
animate << Songster.output_folder.join("#{@fname}-singing.gif").to_s
animate.run!
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gifify\n\tframes = 50\n gif = ImageList.new\n\tframes.times do |i|\n\t gif.concat(ImageList.new(\"tempImages/image#{i}.png\"))\n\tend\n\tgif.delay = 20\n\tgif.ticks_per_second = 50 \n\tgif.write(\"DOORCAPTURE.gif\")\n end",
"def update_gif\r\n @gif_handle.update(bitmap)\r\n end",
"def images_... | [
"0.7335512",
"0.69443727",
"0.6922631",
"0.68361676",
"0.6663437",
"0.6235565",
"0.6148943",
"0.60807765",
"0.60747105",
"0.6072982",
"0.6059988",
"0.60149586",
"0.60052985",
"0.599802",
"0.595314",
"0.58922875",
"0.58846265",
"0.5877651",
"0.5875413",
"0.5846837",
"0.5839506... | 0.7667655 | 0 |
characterizes the file_node passed into this service Default options are: save: true | def characterize(save: true)
persister.save(resource: @file_node) if save
@file_node
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def characterize(save: true)\n new_file = original_file.new(file_characterization_attributes.to_h)\n @file_node.file_metadata = @file_node.file_metadata.select { |x| x.id != new_file.id } + [new_file]\n @persister.save(resource: @file_node) if save\n @file_node\n end",
"def characterize(save: true)\... | [
"0.755723",
"0.746301",
"0.7454837",
"0.700791",
"0.68411684",
"0.6710213",
"0.66900915",
"0.65963703",
"0.65521705",
"0.64750093",
"0.64697015",
"0.6324699",
"0.5674666",
"0.5599572",
"0.5593694",
"0.547304",
"0.5461711",
"0.5461711",
"0.54408675",
"0.54296196",
"0.54084045"... | 0.81046796 | 0 |
Stub function that sets this service as valid for all FileNode types | def valid?
true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def before_create_file(path, data, parent_node, modified)\n return true unless parent_node.is_a?(ICalendar)\n\n validate_i_calendar(\n data,\n path,\n modified,\n @server.http_request,\n @server.http_response,\n true\n )\n true\n ... | [
"0.52635056",
"0.52221715",
"0.5153194",
"0.51494724",
"0.5107459",
"0.51017064",
"0.51017064",
"0.50477225",
"0.50262296",
"0.5017123",
"0.50135064",
"0.50090563",
"0.49955106",
"0.49599892",
"0.4921181",
"0.49167255",
"0.48984262",
"0.48855683",
"0.48624456",
"0.48543337",
... | 0.0 | -1 |
Close tarantool connection. All active requests will be terminated. | def disconnect
mutex.synchronize do
_disconnect
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def close()\n @connection.disconnect\n @connection = nil\n end",
"def close\n @io.close\n @tar.close\n end",
"def close()\n\t\t@connection.disconnect\n\t\t@connection = nil\n\tend",
"def close_connection\n @connection.finish\n end",
"def close\n @connection_manager.cl... | [
"0.69550216",
"0.6894442",
"0.6847734",
"0.6729387",
"0.6703665",
"0.6670604",
"0.6650103",
"0.6587051",
"0.658403",
"0.6572945",
"0.6572945",
"0.65638936",
"0.6535572",
"0.65249056",
"0.65249056",
"0.65018827",
"0.6495419",
"0.6483082",
"0.6465666",
"0.6464458",
"0.64626133"... | 0.0 | -1 |
list of challenges including open/closed status & pagination | def index
@challenges = Challenge.all params[:filters], params[:page]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def all\n challenges = Challenge.all(@oauth_token, params[:open], \n params[:technology] ||= nil, \n params[:platform] ||= nil, \n params[:category] ||= nil, \n enforce_order_by_params(params[:order_by], 'end_date__c'),\n params[:limit] ||= 50,\n params[:offset] ||= 0)\n # merg... | [
"0.69211173",
"0.6767194",
"0.67391765",
"0.6728214",
"0.67092866",
"0.6653258",
"0.6653258",
"0.6653258",
"0.6653258",
"0.6651063",
"0.66446704",
"0.65798146",
"0.63403565",
"0.62897265",
"0.6289674",
"0.6275492",
"0.6266861",
"0.6266861",
"0.61835396",
"0.6165022",
"0.61098... | 0.6850811 | 1 |
rss feed based upon the selected platform, technology & category | def feed
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rss\n @title = t('titles.news', brand: website.brand_name)\n @description = website.value_for(\"default_meta_tag_description\")\n @news = News.all_for_website(website)\n respond_to do |format|\n format.xml # render rss.xml.builder\n end\n end",
"def build_rss\n ::RSS::Maker.make('2.0... | [
"0.6276439",
"0.6149912",
"0.6087195",
"0.60237586",
"0.5969577",
"0.59670365",
"0.5881391",
"0.5862641",
"0.58618206",
"0.5844047",
"0.5839787",
"0.5821244",
"0.5810483",
"0.57724756",
"0.57552576",
"0.57498163",
"0.57227665",
"0.57014585",
"0.56920326",
"0.56768554",
"0.566... | 0.52250844 | 87 |
BEGIN Grant users administrative privileges | def manage_users
@users = User.all
respond_to do |format|
format.json {
render :json => @users.as_json(:only => [:id, :username, :firstname, :lastname, :email], :methods => [:avatar_url])
}
format.html {
render 'manage_users'
}
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def grant_system_admin_privileges(user)\n can :manage, AccountPlan\n end",
"def require_admin\n grant_access?(\"index\", \"users\")\n #position?('admin')\n end",
"def authorize_as_admin\n create_admin_user\n login_into_alchemy\n end",
"def grant_privileges(config)\n print \"Ple... | [
"0.6232591",
"0.6229489",
"0.62078214",
"0.6202992",
"0.61756426",
"0.59826195",
"0.59616613",
"0.5947145",
"0.5887757",
"0.5880907",
"0.5848691",
"0.58329165",
"0.5822338",
"0.5817",
"0.5815245",
"0.5802619",
"0.57931274",
"0.57920265",
"0.57896996",
"0.577335",
"0.57626075"... | 0.0 | -1 |
END Grant users administrative privileges | def become_user
return unless current_user.admin?
respond_to do |format|
format.html
format.js {
# Check if user to become is an admin. If so, then redirect.
render :js => "window.location.href='" + api_admin_home_path + "'" and return if User.find_by_email(params[:email]).admin?
# Sign in as user and redirect
sign_in(:user, User.find_by_email(params[:email]), { :bypass => true })
render :js => "window.location.href='" + home_index_path + "'"
}
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def auto_elevate!\n add_role :superuser\n end",
"def require_admin\n grant_access?(\"index\", \"users\")\n #position?('admin')\n end",
"def require_admin_privileges\n\t\tredirect_to root_path unless is_global_admin?\n\tend",
"def notadmin\n\tprint_error(\"You need admin privs to run this!\")\n\tpr... | [
"0.6656823",
"0.6646341",
"0.6579562",
"0.65202165",
"0.6469432",
"0.6466289",
"0.6462393",
"0.64079165",
"0.6405331",
"0.6405331",
"0.639928",
"0.63782775",
"0.63649017",
"0.63567185",
"0.632375",
"0.6320614",
"0.62797403",
"0.62760764",
"0.62760764",
"0.62734944",
"0.627148... | 0.0 | -1 |
we would arrive here if there is a second step in the reserve process, only for issn enabled listings | def update
@reserver = @reservation.reserver
@billing = @reserver.billing_info || @reserver.billing_infos.create
@billing.update_attributes params[:billing_info]
@response = @reservation.process_new_tenant @billing
if IssnAdapter.no_fatal_error?(@response['sErrorMessage']) && @reserver.save
@reservation.update_attribute :status, 'paid' if @response['sErrorMessage'].blank?
send_notices
render :json => { :success => true, :data => render_to_string(:partial => 'reservations/step3') }
else
render :json => { :success => false, :data => (@response['sErrorMessage'].blank? ? model_errors(@reserver) : @response['sErrorMessage']) }
end
#rescue => e
# render :json => { :success => false, :data => e.message }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reserve(req)\n # Check the services priority\n match = @svcList.select{|s| s.name == req.service}\n if match == nil || match[0] == nil\n $Logger.error \"Unable to find service #{req.service}\"\n return\n end\n service = match[0]\n ... | [
"0.6252134",
"0.59533507",
"0.5916143",
"0.5832942",
"0.58034635",
"0.5744903",
"0.57438976",
"0.57395625",
"0.5625031",
"0.5606467",
"0.5595131",
"0.5583125",
"0.55628395",
"0.5554263",
"0.55448586",
"0.55231",
"0.5518247",
"0.550055",
"0.5492148",
"0.54594415",
"0.54423594"... | 0.0 | -1 |
Required for letting ERB know of the existence of variables. | def get_binding
binding
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate_variable_definitions!\n return unless grafana_dashboard[:dashboard][:templating]\n\n return if grafana_dashboard[:dashboard][:templating][:list].all? do |variable|\n query_params[:\"var-#{variable[:name]}\"].present?\n end\n\n raise_error 'All Grafana variables must be defin... | [
"0.63035524",
"0.62274516",
"0.61799663",
"0.61141264",
"0.5984898",
"0.5958079",
"0.59247535",
"0.5900749",
"0.5898745",
"0.58501303",
"0.58456445",
"0.5814581",
"0.5805446",
"0.5805446",
"0.5730663",
"0.5726861",
"0.5700144",
"0.5683919",
"0.5661244",
"0.565974",
"0.5641687... | 0.0 | -1 |
Parses and assigns variables from config.yaml | def information_generator()
# We need the config.yaml file. Load it in.
File.exist?(@relative_path + '/config.yaml') ?
config = YAML.load_file(@relative_path + '/config.yaml') :
logger.fatal("Could not locate config file: #{config}") && abort
# Do the variable jig.
@access_key = config['keys']['access']
@secret_key = config['keys']['secret']
@def_region = config['region']
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load config_file\n YAML.load_file(config_file).each do |parameter,value|\n instance_variable_set( \"@#{parameter}\", value )\n end\n end",
"def load_vars\n config = YAML.load_file(@config_file)\n @dev_port = config[\"development\"][\"port\"] ||= @default_dev_port\n @dev_pid = config[\"developm... | [
"0.72689384",
"0.7165393",
"0.7107731",
"0.68241304",
"0.6692438",
"0.666565",
"0.65412366",
"0.6505321",
"0.6492628",
"0.63593924",
"0.6269982",
"0.6265594",
"0.6239999",
"0.62008214",
"0.61940646",
"0.61854464",
"0.61854464",
"0.61793256",
"0.61633873",
"0.6124876",
"0.6116... | 0.0 | -1 |
This method determines what role was provided by user input and which template should be used. | def determine_role()
templates = []
Dir.foreach(File.join(@relative_path, '..', 'blueberry', 'templates')) do |item|
next if item == '.' or item == '..'
templates << item.gsub(".erb", '').downcase # + "\n"
end
templates.join
template_folder = "/templates/"
if templates.include?(@role.downcase)
template_path = File.join(@relative_path, template_folder, @role + '.erb')
else
logger.fatal "Unable to find role: #{@role}. Try options --list to verify it exists."
abort
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def handle_role_def(role_def)\n if role_def.is_a? Hash\n app_type = role_def[:app_type]\n self.role_name = role_def[:role_name]\n self.for_user = role_def[:for_user]\n else\n self.role_name = role_def\n end\n\n self.app_type_id = if app_type\n Admin::AppType.... | [
"0.63387823",
"0.6185178",
"0.61661524",
"0.6097327",
"0.5907389",
"0.5847887",
"0.5812435",
"0.5806212",
"0.577569",
"0.57585496",
"0.5751642",
"0.5709563",
"0.567694",
"0.5663513",
"0.562555",
"0.562555",
"0.5595641",
"0.5591923",
"0.5576684",
"0.5565431",
"0.5546345",
"0... | 0.709624 | 0 |
Update variables in provided template. | def generate_template()
file_name = @hostname + '.tf'
check_file_exists(file_name)
template_path = determine_role()
template = File.read(template_path)
renderer = ERB.new(template, nil, '-')
open(file_name, 'w') { |f|
f.puts renderer.result(self.get_binding)
f.close
}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update!(**args)\n @deidentify_template = args[:deidentify_template] if args.key?(:deidentify_template)\n @inspect_template = args[:inspect_template] if args.key?(:inspect_template)\n end",
"def update!(**args)\n @deidentify_template = args[:deidentify_template] if args.key?(... | [
"0.71169126",
"0.71169126",
"0.6879675",
"0.6847859",
"0.6834008",
"0.6828902",
"0.67268366",
"0.67225343",
"0.66063327",
"0.6455532",
"0.6449829",
"0.6449829",
"0.6440274",
"0.6367196",
"0.6360587",
"0.6335289",
"0.6316196",
"0.6290611",
"0.6252233",
"0.62279",
"0.6198995",
... | 0.0 | -1 |
Check if a provided file_name exists. If not, create. If yes, abort. | def check_file_exists(file_name)
if File.exist?(file_name)
logger.fatal "#{file_name} already exists."
abort
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ensure_exists(filename)\n puts(\"Couldn't find: #{filename}\") and exit unless FileTest.exist?(filename)\n end",
"def ensure_exists(filename)\n return if FileTest.exist?(filename)\n\n puts(\"Couldn't find: #{filename}\") and exit\n end",
"def checkForFileExistence(fileName)\n raise \"... | [
"0.7400038",
"0.7385261",
"0.7219889",
"0.718316",
"0.7165819",
"0.71417445",
"0.711582",
"0.69836485",
"0.69578105",
"0.6855474",
"0.68459594",
"0.6822345",
"0.6792273",
"0.6753589",
"0.67385584",
"0.67188907",
"0.6717922",
"0.66920435",
"0.6664985",
"0.6645683",
"0.66287386... | 0.7515807 | 0 |
Runs terraform plan to validate the manifest. | def deploy_instance(path)
Dir.chdir(path){
%x[#{'terraform plan'}]
}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pre_execute_checks(plan = @opts.get(:plan))\n validate_terraform_installed\n ensure_plan_exists plan\n tf_show(plan)\n say 'The above changes will be applied to your environment.'\n exit unless agree 'Are you sure you want to execute this plan? (y/n)'\n end",
"def run_... | [
"0.6711906",
"0.5714419",
"0.5712143",
"0.56716156",
"0.5624202",
"0.5571267",
"0.5516078",
"0.54607767",
"0.5451067",
"0.5430642",
"0.5408361",
"0.5398637",
"0.5327612",
"0.5293587",
"0.5272796",
"0.5120308",
"0.50909543",
"0.5080317",
"0.5075382",
"0.5039708",
"0.5013737",
... | 0.4727043 | 47 |
GET /trips GET /trips.json | def index
@trips = Trip.all
render json: @trips
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def trips\n get '/gtfs/trips'\n end",
"def trips\n flight = Flight.where(\"id = ?\", params[:id]).take\n if flight.nil?\n render :json => {errors: \"404\"}, :status => 404\n else\n respond_with( flight.trips )\n end\n end",
"def trips\n @trip_requests = current_user.trip_req... | [
"0.8200744",
"0.8043299",
"0.7953297",
"0.7923607",
"0.7489528",
"0.7489528",
"0.7489528",
"0.7489528",
"0.7489528",
"0.7489528",
"0.7489528",
"0.74752015",
"0.7470604",
"0.7454113",
"0.7362034",
"0.73261654",
"0.7307701",
"0.7276205",
"0.7276205",
"0.726057",
"0.71996105",
... | 0.80000377 | 3 |
GET /trips/1 GET /trips/1.json | def show
render json: @trip
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def trips\n flight = Flight.where(\"id = ?\", params[:id]).take\n if flight.nil?\n render :json => {errors: \"404\"}, :status => 404\n else\n respond_with( flight.trips )\n end\n end",
"def index\n @trips = Trip.all\n\n render json: @trips\n end",
"def index\n @trips = Trip.all... | [
"0.7947233",
"0.77829236",
"0.77829236",
"0.7737289",
"0.77232826",
"0.76186705",
"0.7444222",
"0.7314744",
"0.7267888",
"0.7267888",
"0.7267888",
"0.7267888",
"0.7267888",
"0.7267888",
"0.7267888",
"0.71649575",
"0.7133354",
"0.7085653",
"0.7082653",
"0.70761305",
"0.7050620... | 0.66436434 | 41 |
POST /trips POST /trips.json | def create
@trip = Trip.new(user_id: current_user.id)
@trip.start_point = Station.find_by(uid: params[:station_id])
#Defined current user and updated credits. This change may cause issues.
@current_user = current_user
@current_user.credits = (@current_user.credits - 1)
if @trip.save
@current_user.save
#This is where the change ends
render json: @trip.attributes.merge(station: @trip.start_point.attributes), status: :created, location: @trip
else
render json: @trip.errors, status: :unprocessable_entity
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def trips\n get '/gtfs/trips'\n end",
"def create\n trip = current_user.trips.new(trip_params)\n if trip.save\n render json: {\n status: :created,\n trip: trip\n }\n else\n render json: {\n status: 500,\n errors: trip.errors.full_messages\n }\n ... | [
"0.7208045",
"0.70307076",
"0.6864295",
"0.68321437",
"0.6772133",
"0.6772133",
"0.6692161",
"0.66867685",
"0.664916",
"0.6610407",
"0.6559959",
"0.6522311",
"0.6514665",
"0.6384032",
"0.63697636",
"0.6347624",
"0.6323213",
"0.6318997",
"0.6318997",
"0.6318997",
"0.6318997",
... | 0.0 | -1 |
PATCH/PUT /trips/1 PATCH/PUT /trips/1.json | def update
@trip = Trip.find(params[:id])
if @trip.end_point = Station.find_by(uid: params[:station_id])
render json: @trip.attributes.merge(station: @trip.end_point.attributes), location: @trip
else
render json: @trip.errors, status: :unprocessable_entity
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n if @trip.update_attributes(params[:trip])\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n... | [
"0.6753958",
"0.6746517",
"0.6706538",
"0.6706538",
"0.6702033",
"0.66963506",
"0.6536128",
"0.64736634",
"0.64628583",
"0.6445016",
"0.6445016",
"0.64286584",
"0.64213836",
"0.63920105",
"0.6363639",
"0.6358378",
"0.6349523",
"0.6347771",
"0.6331375",
"0.6331375",
"0.6331375... | 0.60384494 | 38 |
DELETE /trips/1 DELETE /trips/1.json | def destroy
@trip.destroy
head :no_content
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to find_trips_url }\n format.json { head :no_content }\n end\n end",
"def delete\n @trip = Trips.find_trip( params[ :id ])\n end",
"def destroy\n @trip = Trip.find(par... | [
"0.74139965",
"0.7404978",
"0.73848724",
"0.73848724",
"0.73744804",
"0.73744804",
"0.73744804",
"0.7304089",
"0.72812295",
"0.7253545",
"0.7253545",
"0.7253545",
"0.71911055",
"0.71911055",
"0.71911055",
"0.71823096",
"0.7141681",
"0.71213615",
"0.7002363",
"0.690559",
"0.68... | 0.6919063 | 19 |
GET /master/specs/1 GET /master/specs/1.xml | def show
@master_spec = Master::Spec.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @master_spec }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @master_spec = Master::Spec.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @master_spec }\n end\n end",
"def specs_url\n \"http://#{@host}/#{SPECS_ARCHIVE_FILE}\"\n end",
"def show\n @specification = Specification.find(par... | [
"0.5969229",
"0.5894081",
"0.58925503",
"0.58811957",
"0.5809886",
"0.5751717",
"0.57088244",
"0.5664951",
"0.5643978",
"0.5584736",
"0.55566347",
"0.55167085",
"0.55149746",
"0.5472753",
"0.5438112",
"0.541631",
"0.54162216",
"0.53945076",
"0.53545535",
"0.53439003",
"0.5333... | 0.66035926 | 0 |
GET /master/specs/new GET /master/specs/new.xml | def new
@master_spec = Master::Spec.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @master_spec }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @specification = Specification.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @specification }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => new_vurl }\n end\n ... | [
"0.67625713",
"0.6704832",
"0.6476256",
"0.6459433",
"0.6417115",
"0.6395765",
"0.6299874",
"0.62626505",
"0.6258952",
"0.6258943",
"0.6188972",
"0.61699307",
"0.6156262",
"0.6153337",
"0.61510324",
"0.6143918",
"0.6141141",
"0.6125987",
"0.61139834",
"0.6112314",
"0.6110646"... | 0.71503454 | 0 |
POST /master/specs POST /master/specs.xml | def create
@master_spec = Master::Spec.new(params[:master_spec])
respond_to do |format|
if @master_spec.save
format.html { redirect_to(@master_spec, :notice => 'Spec was successfully created.') }
format.xml { render :xml => @master_spec, :status => :created, :location => @master_spec }
else
format.html { render :action => "new" }
format.xml { render :xml => @master_spec.errors, :status => :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def submit_report(json, cookbookname)\n data = File.read(json)\n uri = URI.parse($SPEC_ENDPOINT)\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = uri.scheme == \"https\"\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Post.new(\"/api/reports\")\n request.add_fi... | [
"0.5847994",
"0.5658567",
"0.5361486",
"0.5327027",
"0.53061795",
"0.5244435",
"0.5230415",
"0.5190378",
"0.5181827",
"0.5166815",
"0.5148998",
"0.513836",
"0.5131548",
"0.5130455",
"0.51065415",
"0.50868356",
"0.50819963",
"0.50566936",
"0.5020518",
"0.5010084",
"0.5005596",... | 0.6442089 | 0 |
PUT /master/specs/1 PUT /master/specs/1.xml | def update
@master_spec = Master::Spec.find(params[:id])
respond_to do |format|
if @master_spec.update_attributes(params[:master_spec])
format.html { redirect_to(@master_spec, :notice => 'Spec was successfully updated.') }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @master_spec.errors, :status => :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end",
"def put(uri, xml)\r\n req = Net::HTTP::Put.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end",
"def tes... | [
"0.64990985",
"0.62210554",
"0.6115232",
"0.60151887",
"0.5976467",
"0.5941422",
"0.59266657",
"0.5835868",
"0.57190835",
"0.56962234",
"0.5635543",
"0.56301236",
"0.5626566",
"0.56115407",
"0.55938125",
"0.55379415",
"0.54916644",
"0.5470896",
"0.5440586",
"0.541428",
"0.538... | 0.64523923 | 1 |
DELETE /master/specs/1 DELETE /master/specs/1.xml | def destroy
@master_spec = Master::Spec.find(params[:id])
@master_spec.destroy
respond_to do |format|
format.html { redirect_to(master_specs_url) }
format.xml { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end",
"def netdev_resxml_delete( xml )\n top = netdev_resxml_top( xml )\n par = top.instance_variable_get(:@parent)\n par['delete'] = 'delete'\n end",
"def delete_data(index_name)\n uri = @client.make_uri(\"/#{... | [
"0.6665547",
"0.6332672",
"0.62881094",
"0.6220732",
"0.6220732",
"0.62166125",
"0.6187354",
"0.618502",
"0.6128621",
"0.6082107",
"0.60667366",
"0.606662",
"0.6064507",
"0.60605204",
"0.60419977",
"0.60294765",
"0.6011616",
"0.5998494",
"0.59954184",
"0.59954184",
"0.599276"... | 0.70528185 | 0 |
GET /sales GET /sales.json | def index
@sales = Sale.all
render json: @sales
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @sales = @saleService.all_to_json().as_json;\n end",
"def show\n render json: @invoice, methods: [:sales]\n end",
"def show\n render json: @sale\n end",
"def index\n @sales = Sale.all\n end",
"def index\n @sales = Sale.all\n end",
"def index\n @sales = Sale.all\n e... | [
"0.81421864",
"0.7505555",
"0.734486",
"0.7266149",
"0.7266149",
"0.7266149",
"0.7266149",
"0.7266149",
"0.7266149",
"0.7266149",
"0.72475237",
"0.72210985",
"0.7124364",
"0.70870465",
"0.70870465",
"0.70577073",
"0.7030278",
"0.7018311",
"0.7000222",
"0.695755",
"0.6918693",... | 0.8167744 | 0 |
GET /sales/1 GET /sales/1.json | def show
render json: @sale
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @sales = Sale.all\n\n render json: @sales\n end",
"def index\n @sales = @saleService.all_to_json().as_json;\n end",
"def show\n render json: @invoice, methods: [:sales]\n end",
"def show\n @sale = Sale.find(params[:id])\n\n respond_to do |format|\n format.html # show... | [
"0.7997595",
"0.7861047",
"0.738936",
"0.73351467",
"0.73351467",
"0.7176229",
"0.7145493",
"0.7095389",
"0.70836246",
"0.70836246",
"0.70836246",
"0.70836246",
"0.70836246",
"0.70836246",
"0.70836246",
"0.69917196",
"0.6968056",
"0.6920125",
"0.6917463",
"0.688621",
"0.68622... | 0.73710763 | 3 |
POST /sales POST /sales.json | def create
@sale = Sale.new(sale_params)
if @sale.save
render json: @sale, status: :created, location: @sale
else
render json: @sale.errors, status: :unprocessable_entity
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n instance = Sale.new(sale_params)\n\n if instance.save\n render json: { msg: instance }, status: :created\n else\n render json: { msg: instance.errors }, status: :unprocessable_entity\n end\n end",
"def create\n @sale = Sale.new(sale_params)\n @sale.user... | [
"0.6976473",
"0.69668937",
"0.6917975",
"0.6917975",
"0.6917975",
"0.6904136",
"0.68784654",
"0.68595415",
"0.6855698",
"0.6855698",
"0.6838506",
"0.6753126",
"0.67094505",
"0.67054194",
"0.6683496",
"0.66826385",
"0.65999943",
"0.6558466",
"0.65480006",
"0.654032",
"0.649690... | 0.73994184 | 0 |
PATCH/PUT /sales/1 PATCH/PUT /sales/1.json | def update
@sale = Sale.find(params[:id])
if @sale.update(sale_params)
head :no_content
else
render json: @sale.errors, status: :unprocessable_entity
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @sale = Sale.find(params[:id])\n\n respond_to do |format|\n if @sale.update_attributes(params[:sale])\n format.html { redirect_to @sale, notice: 'Sale was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n... | [
"0.65441173",
"0.65441173",
"0.65149",
"0.6514514",
"0.6514514",
"0.6472801",
"0.6440159",
"0.636378",
"0.6363627",
"0.6348585",
"0.63309866",
"0.6330706",
"0.6330706",
"0.6330706",
"0.6330706",
"0.6330706",
"0.6330706",
"0.6330706",
"0.6314734",
"0.6274482",
"0.6261295",
"... | 0.68390846 | 0 |
DELETE /sales/1 DELETE /sales/1.json | def destroy
@sale.destroy
head :no_content
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @sale = Sale.find(params[:id])\n @sale.destroy\n\n respond_to do |format|\n format.html { redirect_to sales_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sale = Sale.find(params[:id])\n @sale.destroy\n\n respond_to do |format|\n format.h... | [
"0.7543942",
"0.7543942",
"0.7525767",
"0.7521719",
"0.7521719",
"0.72487503",
"0.7212534",
"0.7173833",
"0.7173833",
"0.7173833",
"0.7173833",
"0.7173833",
"0.7173833",
"0.7173833",
"0.7173833",
"0.7173833",
"0.71368027",
"0.71094704",
"0.7079158",
"0.7075881",
"0.70758647",... | 0.7151653 | 16 |
GET /pesos GET /pesos.xml | def index
@pesos = Peso.find(:all)
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @pesos }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @peeps = Peep.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @peeps }\n end\n end",
"def index\n @pagos = Pago.find(:all)\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pag... | [
"0.68850297",
"0.6617565",
"0.65939",
"0.65918356",
"0.63723797",
"0.63382316",
"0.6282804",
"0.6265331",
"0.6242772",
"0.6152604",
"0.6128321",
"0.61254776",
"0.60904086",
"0.60746497",
"0.6066335",
"0.605559",
"0.6047051",
"0.60396016",
"0.60325354",
"0.60206825",
"0.600512... | 0.71547824 | 0 |
GET /pesos/1 GET /pesos/1.xml | def show
@peso = Peso.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @peso }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @pesos = Peso.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pesos }\n end\n end",
"def index\n @peeps = Peep.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @peeps }... | [
"0.6677637",
"0.6426573",
"0.6210616",
"0.61761934",
"0.6127416",
"0.61191845",
"0.6109071",
"0.6105923",
"0.6090318",
"0.59915113",
"0.59711814",
"0.5955033",
"0.5937388",
"0.59240735",
"0.5921882",
"0.5879788",
"0.58701456",
"0.5864058",
"0.58522826",
"0.5846265",
"0.584538... | 0.61061406 | 7 |
GET /pesos/new GET /pesos/new.xml | def new
@asignaturas = Asignatura.find(:all)
@peso = Peso.new
if !params[:id].nil?
@asignaturas = Asignatura.find_all_by_id(params[:id])
end
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @peso }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => new_vurl }\n end\n end",
"def new\n @nossos_servico = NossosServico.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nossos_servico }\n end\n... | [
"0.71352416",
"0.71166426",
"0.7100698",
"0.7100698",
"0.6975216",
"0.6911657",
"0.68823665",
"0.68492174",
"0.6799263",
"0.67971045",
"0.67512035",
"0.67460877",
"0.67408305",
"0.6739663",
"0.671748",
"0.66977686",
"0.66948956",
"0.6690016",
"0.66811204",
"0.6667047",
"0.666... | 0.0 | -1 |
POST /pesos POST /pesos.xml | def create
@peso = Peso.new(params[:peso])
p params[:peso]
respond_to do |format|
if @peso.save
flash[:notice] = 'Peso was successfully created.'
format.html { redirect_to(@peso) }
format.xml { render :xml => @peso, :status => :created, :location => @peso }
else
format.html { render :action => "new" }
format.xml { render :xml => @peso.errors, :status => :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @pessoa = Pessoa.new(params[:pessoa])\n\n respond_to do |format|\n if @pessoa.save\n flash[:notice] = 'Pessoa was successfully created.'\n format.html { redirect_to(@pessoa) }\n format.xml { render :xml => @pessoa, :status => :created, :location => @pessoa }\n els... | [
"0.5834183",
"0.5735111",
"0.57249564",
"0.5712944",
"0.568782",
"0.55784583",
"0.5570673",
"0.5525284",
"0.5525211",
"0.54763055",
"0.5461402",
"0.54522914",
"0.5448426",
"0.54192966",
"0.53675365",
"0.53547615",
"0.5323479",
"0.5317466",
"0.52981263",
"0.5286932",
"0.527443... | 0.5883147 | 0 |
PUT /pesos/1 PUT /pesos/1.xml | def update
@peso = Peso.find(params[:id])
respond_to do |format|
if @peso.update_attributes(params[:peso])
flash[:notice] = 'Peso was successfully updated.'
format.html { redirect_to(@peso) }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @peso.errors, :status => :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def put(uri, xml)\r\n req = Net::HTTP::Put.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end",
"def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end",
"def res... | [
"0.6661412",
"0.664163",
"0.5964857",
"0.5961045",
"0.5849469",
"0.5831766",
"0.58210844",
"0.5813749",
"0.5797514",
"0.57647663",
"0.5675787",
"0.5674316",
"0.5646873",
"0.56171507",
"0.5595597",
"0.55874884",
"0.55798835",
"0.5577576",
"0.5573669",
"0.55506444",
"0.55295277... | 0.5655564 | 12 |
DELETE /pesos/1 DELETE /pesos/1.xml | def destroy
@peso = Peso.find(params[:id])
@peso.destroy
respond_to do |format|
format.html { redirect_to(pesos_url) }
format.xml { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end",
"def netdev_resxml_delete( xml )\n top = netdev_resxml_top( xml )\n par = top.instance_variable_get(:@parent)\n par['delete'] = 'delete'\n end",
"def delete()\n response = send_post_request(@xml_api_del... | [
"0.6671789",
"0.661132",
"0.6493594",
"0.64110684",
"0.6334526",
"0.63034177",
"0.6281847",
"0.628123",
"0.62612796",
"0.62409",
"0.62383366",
"0.62358946",
"0.6210749",
"0.6186779",
"0.6173958",
"0.61483586",
"0.61473674",
"0.6144997",
"0.6136554",
"0.6125848",
"0.6107607",
... | 0.6451022 | 3 |
POST /api/login This action handles a POST request for login if the user data is right it will respond the request with an auth token and the user data as JSON | def authenticate_user
user = User.where(email: params[:email]).first
if user.password == params[:password]
render json: payload(user)
else
render json: {errors: ['Invalid Password']}, status: :unauthorized
end
rescue NoMethodError
render_not_found "Email not registered"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def login\n @user = User.authenticate credentials[:email], credentials[:password]\n if @user # serializer makes it easier to return json, in this case the token\n render json: @user, serializer: LoginUserSerializer, root: 'user'\n else\n head :unauthorized # if authentication case this is execut... | [
"0.81219393",
"0.79458225",
"0.79458225",
"0.7886533",
"0.7785839",
"0.7766426",
"0.7722319",
"0.7700962",
"0.76733536",
"0.76645887",
"0.7624446",
"0.75697726",
"0.74979335",
"0.74785095",
"0.7459051",
"0.74497986",
"0.74497986",
"0.7445827",
"0.7438828",
"0.74110883",
"0.74... | 0.0 | -1 |
GET /api/ping This action is used just to check if the service is alive | def ping
render json: {logged_in: true, user: current_user.id}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ping\n return true unless active? && heartbeat_path.present?\n\n resp = http_get(uri: \"#{api_base_url}#{heartbeat_path}\")\n resp.present? && resp.code == 200\n end",
"def ping\n return true unless active && heartbeat_path.present?\n\n resp = http_get(uri: \"#{api_bas... | [
"0.8104569",
"0.80859345",
"0.80433947",
"0.8007063",
"0.79521704",
"0.7846848",
"0.7734219",
"0.76513505",
"0.7620497",
"0.7562051",
"0.7559663",
"0.75245416",
"0.7430376",
"0.74293625",
"0.7420223",
"0.7329871",
"0.7303183",
"0.72903526",
"0.7264185",
"0.7261014",
"0.723906... | 0.63123935 | 80 |
Reads given number of bytes with an optional timeout | def read_fully(count, timeout = nil)
value = ''
begin
loop do
value << read_nonblock(count - value.bytesize)
break if value.bytesize >= count
end
rescue EOFError
# JRuby specific fix via https://github.com/jruby/jruby/issues/1694#issuecomment-54873532
IO.select([self], nil, nil, timeout)
retry
rescue *READ_RETRY_EXCEPTION_CLASSES
if IO.select([self], nil, nil, timeout)
retry
else
raise Timeout::Error, "IO timeout when reading #{count} bytes"
end
end
value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def timed_read(length = nil, wait = def_read_timeout, opts = {})\n if (wait and wait > 0)\n Timeout.timeout(wait) {\n return read(length, opts)\n }\n else\n return read(length, opts)\n end\n end",
"def read_timeout=(sec); end",
"def read_timeout; end",
"def read_timeout; end",... | [
"0.77515435",
"0.7417895",
"0.7264305",
"0.7264305",
"0.7264305",
"0.7264305",
"0.7264305",
"0.7264305",
"0.7264305",
"0.7264305",
"0.72280395",
"0.7190883",
"0.7177787",
"0.7177787",
"0.7177787",
"0.71326977",
"0.7122137",
"0.7007506",
"0.6994811",
"0.6972871",
"0.6943312",
... | 0.7133221 | 15 |
and determine if it is an acceptable sequence by either returning the string true or false. The str parameter will be composed of + and = symbols with several letters between them (ie. ++d+===+c++==a) and for the string to be true each letter must be surrounded by a + symbol. So the string to the left would be false. The string will not be empty and will have at least one letter. | def all_letters(str)
# Use 'str[/[a-zA-Z]*/] == str' to let all_letters
# yield true for the empty string
str[/[a-zA-Z]+/] == str
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def decide string\n @current_state = @start_state\n string.each_char do |c|\n if !@alphabet.include? c then\n return false\n end\n transition = false\n @transition_rules.each do |rule|\n if rule.input_char === c && rule.current... | [
"0.7180241",
"0.7093229",
"0.69580936",
"0.6824745",
"0.6745694",
"0.6710106",
"0.6622905",
"0.66172737",
"0.6574937",
"0.65705025",
"0.65278745",
"0.6479232",
"0.64635676",
"0.6460873",
"0.64479464",
"0.64079344",
"0.64004344",
"0.6399191",
"0.63957524",
"0.63809025",
"0.637... | 0.0 | -1 |
before_action :set_kloop, only: [:kloop] before_action :set_kloop, only: [:kloop] before_action :set_kloop, only: [:kloop] | def kloop
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def before_action \n end",
"def preloop\n end",
"def before_run; end",
"def pre_loop; end",
"def action_hook; end",
"def before_bootstrap; end",
"def postloop\n end",
"def before_bootstrap\n end",
"def before\n end",
"def post_loop; end",
"def kopal_layout_before_page_fron... | [
"0.62606055",
"0.61961037",
"0.6096894",
"0.6020932",
"0.5954378",
"0.586444",
"0.5850464",
"0.5824824",
"0.574142",
"0.56976867",
"0.569165",
"0.56908166",
"0.56829125",
"0.5653636",
"0.56353396",
"0.55980605",
"0.5558376",
"0.55526406",
"0.5550697",
"0.550531",
"0.5495044",... | 0.6304675 | 0 |
Path to the "home" directory for the tests | def home_path
result = tmp_path.join("home")
FileUtils.mkdir_p(result)
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def home_path\n File.expand_path(\"~\")\n end",
"def home\n @home ||= File.expand_path('~')\n end",
"def home(user=nil)\n File.expand_path(Dir.home(user))\n end",
"def work_dir\n AYTests.work_dir\n end",
"def default_test_base_path\n File.join(kitchen_root, Kitchen::DEF... | [
"0.7896779",
"0.763959",
"0.75113726",
"0.7429605",
"0.7404336",
"0.7370275",
"0.734122",
"0.73298526",
"0.73093563",
"0.7283261",
"0.7244976",
"0.72113353",
"0.7143765",
"0.7136335",
"0.70532644",
"0.70117176",
"0.6924994",
"0.6874664",
"0.6782933",
"0.67555016",
"0.6669151"... | 0.80462754 | 0 |
Cleans all the test temp paths | def clean_paths
FileUtils.rm_rf(tmp_path)
FileUtils.mkdir_p(tmp_path)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clean_up\n FileUtils.rm_rf @temp_root\n end",
"def clear\n raise \"unsafe test stage directory -- #{Dir.pwd}\" unless /#{Dir.tmpdir}/ =~ Dir.pwd\n Dir['*'].each do |path|\n FileUtils.rm_r(path)\n end\n end",
"def clean_tests\n puts \"Removing generated tests from '#{Settings[:... | [
"0.7960962",
"0.7735496",
"0.7696412",
"0.76498467",
"0.75925183",
"0.75817835",
"0.753316",
"0.74772394",
"0.74495965",
"0.7394642",
"0.7344968",
"0.7343906",
"0.7326218",
"0.7322757",
"0.7306103",
"0.7286782",
"0.71753603",
"0.71587837",
"0.71212155",
"0.71131825",
"0.70882... | 0.8034484 | 0 |
HEADER ATTRIBUTES sets the types, and fields we can have processing based on line. | def initialize(args)
self.fields = []
raise "no text provided" unless args[:text]
if args[:text]
args[:text].split(/\|/).each do |field|
self.fields << field
end
end
detect_type
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse_header(line)\n case line\n when /^#%checkm/\n match = /^#%checkm_(\\d+)\\.(\\d+)/.match line\n @version = \"#{match[1]}.#{match[2]}\" if match\n when /^#%eof/\n @eof = true\n when /^#%fields/\n list = line.split('|')\n list.shift\n ... | [
"0.7158671",
"0.6814251",
"0.67607427",
"0.6586612",
"0.6395828",
"0.6366807",
"0.6364845",
"0.63492525",
"0.6332957",
"0.625593",
"0.62114173",
"0.616929",
"0.61192423",
"0.6030263",
"0.6030263",
"0.60243523",
"0.60147315",
"0.6013139",
"0.6000098",
"0.5984581",
"0.59844637"... | 0.0 | -1 |
Get a single user | def user(user=nil)
if user
get("/users/#{user}", {}, 3)
else
get("/user", {}, 3)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_user(user_id)\n return User.find(user_id)\n end",
"def retrieve(user_id:)\n User.new get_request(\"users/#{user_id}\").body.dig(\"user\")\n end",
"def user(id = 'self')\n get(\"users/#{id}\").user\n end",
"def get(user_id)\n User.find user_id\n end",
"def get_user(id)\n ... | [
"0.8438886",
"0.8203915",
"0.8077506",
"0.80690503",
"0.79840463",
"0.7983078",
"0.79479164",
"0.7943967",
"0.79149514",
"0.7910885",
"0.7866714",
"0.7854816",
"0.78389114",
"0.78370005",
"0.78252226",
"0.7809548",
"0.7793258",
"0.7791225",
"0.77765685",
"0.77507347",
"0.7748... | 0.743144 | 47 |
Update the authenticated user | def update_user(options)
patch("/user", options, 3)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_user\n end",
"def update\n if current__user.isAdmin || current__user == @user\n if @user.update(user_update_params)\n # setToken\n # UserNotifierMailer.send_signup_email(@user).deliver\n render :show, status: :ok\n else\n render jso... | [
"0.821561",
"0.79548657",
"0.79492974",
"0.79178166",
"0.7905321",
"0.78437024",
"0.78396714",
"0.7821266",
"0.7804185",
"0.7783493",
"0.77081215",
"0.7701761",
"0.7695824",
"0.76957476",
"0.76924604",
"0.7688464",
"0.7686972",
"0.76818967",
"0.76792693",
"0.7676387",
"0.7665... | 0.74866927 | 59 |
Not yet supported: get a single key, update an existing key | def keys(options={})
get("/user/keys", options, 3)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def updateKey; @key = getKey; self end",
"def new_key(old_key)\n key_store[old_key] || old_key\n end",
"def update\n if @key.update(key_params)\n render json: @key\n else\n render json: @key.errors, status: :unprocessable_entity\n end\n end",
"def set_key\n @key = Key.find(params[:... | [
"0.7417697",
"0.68909425",
"0.6802164",
"0.6772694",
"0.67699873",
"0.6767558",
"0.6647971",
"0.6647971",
"0.66438013",
"0.6562377",
"0.6562377",
"0.6562377",
"0.6562377",
"0.65022016",
"0.6500539",
"0.64465487",
"0.63860345",
"0.63802797",
"0.6363611",
"0.6360637",
"0.631947... | 0.0 | -1 |
Update properties of this object | def update!(**args)
@clusters = args[:clusters] unless args[:clusters].nil?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ... | [
"0.701199",
"0.69196975",
"0.69196975",
"0.69196975",
"0.69196975",
"0.69196975",
"0.6739846",
"0.6709455",
"0.6709455",
"0.6698214",
"0.6698214",
"0.6698214",
"0.6698214",
"0.6619038",
"0.65719074",
"0.65380937",
"0.6519628",
"0.63961416",
"0.63910294",
"0.63910294",
"0.6335... | 0.0 | -1 |
Update properties of this object | def update!(**args)
@name = args[:name] unless args[:name].nil?
@description = args[:description] unless args[:description].nil?
@initial_node_count = args[:initial_node_count] unless args[:initial_node_count].nil?
@node_config = args[:node_config] unless args[:node_config].nil?
@master_auth = args[:master_auth] unless args[:master_auth].nil?
@logging_service = args[:logging_service] unless args[:logging_service].nil?
@monitoring_service = args[:monitoring_service] unless args[:monitoring_service].nil?
@network = args[:network] unless args[:network].nil?
@cluster_ipv4_cidr = args[:cluster_ipv4_cidr] unless args[:cluster_ipv4_cidr].nil?
@self_link = args[:self_link] unless args[:self_link].nil?
@zone = args[:zone] unless args[:zone].nil?
@endpoint = args[:endpoint] unless args[:endpoint].nil?
@initial_cluster_version = args[:initial_cluster_version] unless args[:initial_cluster_version].nil?
@current_master_version = args[:current_master_version] unless args[:current_master_version].nil?
@current_node_version = args[:current_node_version] unless args[:current_node_version].nil?
@create_time = args[:create_time] unless args[:create_time].nil?
@status = args[:status] unless args[:status].nil?
@status_message = args[:status_message] unless args[:status_message].nil?
@node_ipv4_cidr_size = args[:node_ipv4_cidr_size] unless args[:node_ipv4_cidr_size].nil?
@services_ipv4_cidr = args[:services_ipv4_cidr] unless args[:services_ipv4_cidr].nil?
@instance_group_urls = args[:instance_group_urls] unless args[:instance_group_urls].nil?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ... | [
"0.70132464",
"0.6920457",
"0.6920457",
"0.6920457",
"0.6920457",
"0.6920457",
"0.6739106",
"0.67094105",
"0.67094105",
"0.6698272",
"0.6698272",
"0.6698272",
"0.6698272",
"0.66193163",
"0.6571397",
"0.65391916",
"0.65189683",
"0.63971996",
"0.6391746",
"0.6391746",
"0.633559... | 0.0 | -1 |
Update properties of this object | def update!(**args)
@machine_type = args[:machine_type] unless args[:machine_type].nil?
@disk_size_gb = args[:disk_size_gb] unless args[:disk_size_gb].nil?
@oauth_scopes = args[:oauth_scopes] unless args[:oauth_scopes].nil?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ... | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328... | 0.0 | -1 |
Update properties of this object | def update!(**args)
@username = args[:username] unless args[:username].nil?
@password = args[:password] unless args[:password].nil?
@cluster_ca_certificate = args[:cluster_ca_certificate] unless args[:cluster_ca_certificate].nil?
@client_certificate = args[:client_certificate] unless args[:client_certificate].nil?
@client_key = args[:client_key] unless args[:client_key].nil?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ... | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328... | 0.0 | -1 |
Update properties of this object | def update!(**args)
@cluster = args[:cluster] unless args[:cluster].nil?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ... | [
"0.701199",
"0.69196975",
"0.69196975",
"0.69196975",
"0.69196975",
"0.69196975",
"0.6739846",
"0.6709455",
"0.6709455",
"0.6698214",
"0.6698214",
"0.6698214",
"0.6698214",
"0.6619038",
"0.65719074",
"0.65380937",
"0.6519628",
"0.63961416",
"0.63910294",
"0.63910294",
"0.6335... | 0.0 | -1 |
Update properties of this object | def update!(**args)
@name = args[:name] unless args[:name].nil?
@zone = args[:zone] unless args[:zone].nil?
@operation_type = args[:operation_type] unless args[:operation_type].nil?
@status = args[:status] unless args[:status].nil?
@status_message = args[:status_message] unless args[:status_message].nil?
@self_link = args[:self_link] unless args[:self_link].nil?
@target_link = args[:target_link] unless args[:target_link].nil?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ... | [
"0.70132464",
"0.6920457",
"0.6920457",
"0.6920457",
"0.6920457",
"0.6920457",
"0.6739106",
"0.67094105",
"0.67094105",
"0.6698272",
"0.6698272",
"0.6698272",
"0.6698272",
"0.66193163",
"0.6571397",
"0.65391916",
"0.65189683",
"0.63971996",
"0.6391746",
"0.6391746",
"0.633559... | 0.0 | -1 |
Update properties of this object | def update!(**args)
@update = args[:update] unless args[:update].nil?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ... | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328... | 0.0 | -1 |
Update properties of this object | def update!(**args)
@desired_node_version = args[:desired_node_version] unless args[:desired_node_version].nil?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ... | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328... | 0.0 | -1 |
Update properties of this object | def update!(**args)
@operations = args[:operations] unless args[:operations].nil?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ... | [
"0.701199",
"0.69196975",
"0.69196975",
"0.69196975",
"0.69196975",
"0.69196975",
"0.6739846",
"0.6709455",
"0.6709455",
"0.6698214",
"0.6698214",
"0.6698214",
"0.6698214",
"0.6619038",
"0.65719074",
"0.65380937",
"0.6519628",
"0.63961416",
"0.63910294",
"0.63910294",
"0.6335... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.