query stringlengths 7 6.41k | document stringlengths 12 28.8k | metadata dict | negatives listlengths 30 30 | negative_scores listlengths 30 30 | document_score stringlengths 5 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
returns the count of visible columns based on column names. NOTE: what if no column names gives ??? | def column_count
visible_column_names().count
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ncols\n @colnames.length\n end",
"def count_columns\n fields.size\n end",
"def column_count\r\n assert_exists\r\n arr_cells = cells\r\n return arr_cells.length\r\n end",
"def columns_count\n @columns.size\n end",
"def columns_count\n @values.empty? ? 0 :... | [
"0.73080254",
"0.7107904",
"0.6898772",
"0.6886108",
"0.6841604",
"0.6790589",
"0.67589843",
"0.6656489",
"0.65630984",
"0.6552611",
"0.6425674",
"0.63371474",
"0.6336136",
"0.619328",
"0.61428595",
"0.61328506",
"0.6115696",
"0.61093533",
"0.6105659",
"0.6075087",
"0.6045279... | 0.85858935 | 0 |
yields nonhidden columns (ColumnInfo) and the offset/index This is the order in which columns are to be printed | def each_column
@chash.each_with_index { |c, i|
next if c.hidden
yield c,i if block_given?
}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def visible_column_names\n visible = []\n @chash.each_with_index do |c, ix|\n if !c.hidden\n if block_given?\n yield c.name, ix \n else\n visible << c.name\n end\n end\n end\n return visible unless block_given?\n end",
"def _ca... | [
"0.66282904",
"0.64667326",
"0.6226126",
"0.6144539",
"0.6144539",
"0.6144539",
"0.6051335",
"0.604972",
"0.60314804",
"0.5972126",
"0.5948847",
"0.59092015",
"0.58611375",
"0.58564484",
"0.585576",
"0.58543706",
"0.58256406",
"0.58035064",
"0.57957774",
"0.5789821",
"0.57829... | 0.6988101 | 0 |
for the given row, return visible columns as an array | def visible_columns(row)
visible = []
row.each_with_index do |e, ix|
hid = @chash[ix].hidden
if !hid
if block_given?
yield e, ix
else
visible << e
end
end
end
return visible if !block_given?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_columns_visible\n if columns_visible\n return JSON.parse columns_visible\n else\n return []\n end\n end",
"def get_columns_visible\n columns_visible ? JSON.parse(columns_visible) : []\n end",
"def get_array_by_col()\n\t\tprepare(@dim_i,@dim_j)\n\t\ttmpTab = Array.new\n\t\tfor j ... | [
"0.6800079",
"0.67770416",
"0.64326525",
"0.63399136",
"0.6281308",
"0.6272814",
"0.62722653",
"0.6207757",
"0.6197278",
"0.61805534",
"0.6173692",
"0.61454064",
"0.6128624",
"0.61245334",
"0.61191356",
"0.6100184",
"0.60742474",
"0.60221314",
"0.60187423",
"0.599238",
"0.598... | 0.8342887 | 0 |
This calculates and stores the offset at which each column starts. Used when going to next column or doing a find for a string in the table. | def _calculate_column_offsets
total = 0
coffsets = []
ctr = 0
## ix will have gaps in between for hidden fields
each_column { | c, ix|
v = c.width
coffsets[ctr] = total
ctr += 1
total += v + 2 ## blank space plus separator
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def current_column\n @col_offset\n end",
"def column\n old_pos - start_of_current_line_pos\n end",
"def column\n old_pos - start_of_current_line_pos\n end",
"def column_index(col)\n col.each_codepoint.reduce(0) do |sum, n|\n break sum - 1 if n < A_CODEPOINT # reached a number\n\n ... | [
"0.72847974",
"0.69097686",
"0.69097686",
"0.63683105",
"0.6299307",
"0.622816",
"0.6216673",
"0.6216673",
"0.6216673",
"0.6213201",
"0.612637",
"0.6073526",
"0.60015225",
"0.59757733",
"0.5975064",
"0.59747994",
"0.5966612",
"0.5953448",
"0.59420145",
"0.59420145",
"0.590761... | 0.79618025 | 0 |
Requires session[request.path] to be set to 'shared' or a user to be signed in as same one for which the action is performed. | def correct_user_or_shared_page
if session[request.path] != "shared"
# Run normal callbacks
signed_in_user && correct_user
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def owner_only(user_id)\n if session['user_id'] == user_id\n true\n else\n redirect '/'\n end\nend",
"def require_session_ownership\r\n if session_user.screen_name == params[:screen_name]\r\n @user = session_user\r\n return true\r\n end\r\n\r\n # wrong screen_name in url doesn't match... | [
"0.6771916",
"0.65909594",
"0.64256215",
"0.6393042",
"0.6380926",
"0.6374899",
"0.63572735",
"0.63547885",
"0.6350289",
"0.6337064",
"0.6288977",
"0.62833196",
"0.62702364",
"0.62471616",
"0.6222235",
"0.6213984",
"0.6212755",
"0.6205202",
"0.6182407",
"0.6177145",
"0.617635... | 0.6863033 | 0 |
Users don't have a ribbon on their card | def ribbon
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ribbon_got?(id)\n return @ribbons.include?(id)\n end",
"def test_inactiveBorder\n [@window, @sprite, @bitmap].each{|container|\n uc = UCGraph.new(container, 500, 300, 50, @elements, nil, 100, -100, Font.normal_font,\n Color.hp_gauge_color1, Color.hp_gauge_color2,\n ... | [
"0.58256733",
"0.5720923",
"0.55818325",
"0.5578039",
"0.5519928",
"0.54263926",
"0.54055727",
"0.5401377",
"0.53399915",
"0.53319687",
"0.53024626",
"0.5271457",
"0.52713186",
"0.5212148",
"0.5177438",
"0.51756066",
"0.51498866",
"0.5136888",
"0.5133197",
"0.51257825",
"0.51... | 0.6370088 | 0 |
Public: Initializes a session on the API server and stores the expiry time and the session_id in instance variables Returns the session_id GUID | def initialize_session
response = @soap_client.call :initialize_session
# Without ActiveSupport
# 1.hour.from_now is 3600 seconds from Time.now
@session_expiry_time = Time.now + 3600
@session_id = response.body[:initialize_session_response][:initialize_session_result]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize_session\n response = @savon.call :initialize_session\n # Without ActiveSupport\n # 1.hour.from_now is 3600 seconds from Time.now\n @session_expiry_time = Time.now + 3600\n @session_id = response.body[:initialize_session_response][:initialize_session_result]\n ... | [
"0.8205549",
"0.7366066",
"0.72173154",
"0.7182002",
"0.71672076",
"0.716702",
"0.7028304",
"0.69900715",
"0.6919015",
"0.69127214",
"0.6877575",
"0.6820005",
"0.6818361",
"0.6818361",
"0.6818361",
"0.67341465",
"0.6719797",
"0.66984504",
"0.6683915",
"0.6667034",
"0.66528183... | 0.793872 | 1 |
Public: Calls the 'SignIn' SOAP action username a String which corresponds to a TranscribeMe Portal account username which can be any valid email address password a String which is the portal account password Returns a GUID of the Customer ID | def sign_in(username, password)
# If #login_with is called before we have a session_id instance variable
# then call initialize_session
initialize_session unless session_valid?
# Use Suds to call the 'SignIn' SOAP action
response = @soap_client.call :sign_in,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sign_in(username, password)\n \n # If #login_with is called before we have a session_id instance variable\n # then call initialize_session\n initialize_session unless session_valid?\n\n # Use Savon to call the 'SignIn' SOAP action\n response = @savon.call :sign_in, \n... | [
"0.6435891",
"0.5484796",
"0.54348046",
"0.5424278",
"0.53663397",
"0.5348663",
"0.53032714",
"0.5277281",
"0.5253606",
"0.52351665",
"0.5195412",
"0.5171193",
"0.51522857",
"0.5135205",
"0.5123581",
"0.51164925",
"0.5088182",
"0.5087551",
"0.50824624",
"0.50808567",
"0.50686... | 0.69385266 | 0 |
Public: Calls the 'GetCustomerRecordings' SOAP Action requires the user to be logged in Returns an Array of Hashes of with the properties of recording objects | def get_recordings
# raise 'Login first!' unless @customer_login_id
response = @soap_client.call :get_customer_recordings,
message: { 'wsdl:sessionID' => session_id }
@recordings = response.body[:get_customer_recordings_response][:get_customer_recordings_result][:rec... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_recordings\n # raise 'Login first!' unless @customer_login_id\n\n response = @savon.call :get_customer_recordings, \n message: { 'wsdl:sessionID' => session_id }\n\n # Returns an array of instances of the Recording class\n @recordings = Transcrib... | [
"0.8393711",
"0.74418026",
"0.6205894",
"0.59192604",
"0.58930606",
"0.5873243",
"0.5866161",
"0.5863246",
"0.5837155",
"0.58055586",
"0.5798558",
"0.57962966",
"0.5773887",
"0.5742582",
"0.5711987",
"0.57072693",
"0.57055783",
"0.57048357",
"0.5550881",
"0.55396473",
"0.5539... | 0.8729316 | 0 |
Public: Calls the 'GetUploadUrl' SOAP Action Returns the upload url as a String | def get_upload_url
# raise 'Login first!' unless @customer_login_id
response = @soap_client.call :get_upload_url,
message: { 'wsdl:sessionID' => @session_id }
@upload_url = response.body[:get_upload_url_response][:get_upload_url_result] ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_upload_url\n # raise 'Login first!' unless @customer_login_id\n\n response = @savon.call :get_upload_url, \n message: { 'wsdl:sessionID' => @session_id }\n \n @upload_url = response.body[:get_upload_url_response][:get_uplo... | [
"0.7910738",
"0.7738141",
"0.7604398",
"0.6668465",
"0.653069",
"0.63836884",
"0.6358183",
"0.6320675",
"0.6280919",
"0.6180335",
"0.615021",
"0.61252236",
"0.6000212",
"0.57817954",
"0.57817954",
"0.57817954",
"0.57817954",
"0.57817954",
"0.57347214",
"0.57201344",
"0.569492... | 0.8321389 | 0 |
Public: Calls the 'TranscribeRecording' SOAP Action recording_id a String in GUID format Returns the SOAP response Hash | def transcribe_recording(recording_id)
# initialize_session unless @session.try :valid?
response = @soap_client.call :transcribe_recording,
message: { 'wsdl:sessionID' => @session_id,
'wsdl:recordingId' => recording_id }
respon... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def transcribe_recording(recording_id)\n # initialize_session unless @session.try :valid?\n\n response = @savon.call :transcribe_recording, \n message: { 'wsdl:sessionID' => @session_id, \n 'wsdl:recordingId' => recording_id }\n... | [
"0.785164",
"0.7162867",
"0.70631206",
"0.6783896",
"0.6631659",
"0.65345085",
"0.6409304",
"0.63984877",
"0.6378945",
"0.6236247",
"0.6235441",
"0.61924756",
"0.61735684",
"0.6157637",
"0.61524",
"0.61193633",
"0.6020989",
"0.5894645",
"0.58299625",
"0.57763284",
"0.57245725... | 0.81536764 | 0 |
Public: Calls the 'TranscribeRecordingWithPromoCode' SOAP Action recording_id a String in GUID format promocode a String Returns the SOAP response Hash | def transcribe_recording_using_promocode(recording_id, promocode)
# initialize_session unless @session.try :valid?
response = @soap_client.call :transcribe_recording_using_promocode,
message: { 'wsdl:sessionID' => @session_id,
'... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def transcribe_recording_using_promocode(recording_id, promocode)\n # initialize_session unless @session.try :valid?\n \n response = @savon.call :transcribe_using_promo_code, \n message: { 'wsdl:sessionID' => @session_id, \n ... | [
"0.8100696",
"0.65467256",
"0.6287079",
"0.55218077",
"0.5475904",
"0.527069",
"0.5211421",
"0.51613057",
"0.51164204",
"0.51164204",
"0.50006616",
"0.49446142",
"0.49424493",
"0.4890779",
"0.4884488",
"0.4866192",
"0.48377487",
"0.48356754",
"0.4802964",
"0.48028165",
"0.478... | 0.82682246 | 0 |
Public: Calls the 'GetRecordingInfo' SOAP Action recording_id a String in GUID format Returns the SOAP response Hash | def get_recording_info(recording_id)
@soap_client.call :get_recording_info,
message: { 'wsdl:sessionID' => @session_id,
'wsdl:recordingID' => recording_id }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_recording_info(recording_id)\n response = @savon.call :get_recording_info,\n message: { 'wsdl:sessionID' => @session_id,\n 'wsdl:recordingID' => recording_id }\n response.body[:get_recording_info_response][:get_recording_info_result]\n e... | [
"0.77321714",
"0.7124799",
"0.7103942",
"0.6680091",
"0.654284",
"0.6399653",
"0.6372261",
"0.6351654",
"0.6338941",
"0.6253416",
"0.62393284",
"0.6119873",
"0.61112463",
"0.6082434",
"0.59883547",
"0.59631765",
"0.5927142",
"0.5891637",
"0.5844049",
"0.5837947",
"0.58143103"... | 0.7974899 | 0 |
Public: Calls the 'FinalizeSession' SOAP Action to close the session on the server Returns the SOAP response Hash | def finalize_session
@soap_client.call :finalize_session,
message: { 'wsdl:sessionID' => @session_id }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def finalize_session\n @savon.call :finalize_session, \n message: { 'wsdl:sessionID' => @session_id }\n end",
"def session_close\n begin\n auth.globals[:headers]['Cookie'] = \"SID=\\\"#{session_id}\\\"\"\n auth.call(:close_session)\n rescue Savon::SOAPFaul... | [
"0.7693333",
"0.66729575",
"0.63352805",
"0.6327183",
"0.6279471",
"0.6266235",
"0.60532063",
"0.60104865",
"0.5952604",
"0.59095734",
"0.59029317",
"0.58727735",
"0.58134305",
"0.5778133",
"0.5756415",
"0.5742522",
"0.5734387",
"0.5711704",
"0.5682101",
"0.5673438",
"0.56632... | 0.804677 | 0 |
Private: Checks if the session expiry time has passed Returns a Boolean | def session_valid?
@session_expiry_time > Time.now if @session_expiry_time
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def session_valid?\n @session_expiry_time > Time.now if @session_expiry_time\n end",
"def session_expired?\n ! (Time.now < session[:expire_at])\n end",
"def session_expiry\n reset_session if session[:expiry_time] and session[:expiry_time] < Time.now\n\n session[:expiry_time] = MAX_SESSION... | [
"0.86505353",
"0.85043937",
"0.8485214",
"0.8311907",
"0.82619697",
"0.8126619",
"0.8094892",
"0.79293305",
"0.7837234",
"0.76900136",
"0.7659409",
"0.7656007",
"0.7643836",
"0.76387304",
"0.7625968",
"0.7625725",
"0.76202387",
"0.7606185",
"0.7589389",
"0.7589389",
"0.758164... | 0.87361157 | 0 |
Create the ingredients for the recipe recipe_id: id of the recipe ingredients: list of ingredients for a recipe | def create_ingredient(recipe_id, ingredients)
destroy_ingredients = RecipeIngredient.where(recipe_id: recipe_id)
if !destroy_ingredients.blank?
destroy_ingredients.delete_all
end
ingredients.each do |recipe_ingredient|
ingredient = RecipeIngredient.new
ingredient.recipe_id = recipe_id
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @recipe = Recipe.new(recipe_params)\n if params['ingredients']\n params['ingredients'].each do |ingredient_name|\n @recipe.ingredients << Ingredient.find_by(name: ingredient_name)\n end\n end\n\n @recipe.save \n redirect_to recipes_path\n end",
"def create_ingredient... | [
"0.78298724",
"0.7707803",
"0.76807326",
"0.7543995",
"0.7475863",
"0.74117917",
"0.7281296",
"0.72451466",
"0.71976566",
"0.7173304",
"0.712313",
"0.70645636",
"0.70533687",
"0.70269895",
"0.70242923",
"0.7013806",
"0.6969493",
"0.69605935",
"0.6952212",
"0.6933721",
"0.6919... | 0.83935195 | 0 |
Create the tags for the recipe recipe_id: id of the recipe tags: list of tags for a recipe | def create_tag(recipe_id, tags)
destroy_tags = RecipeTag.where(recipe_id: recipe_id)
if !destroy_tags.blank?
destroy_tags.delete_all
end
tags.each do |recipe_tag|
tag = RecipeTag.new
tag.recipe_id = recipe_id
tag.tag = recipe_tag
tag.save!
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n \tset_tag_list\n\n @recipe = @current_user.recipes.build(params[:recipe])\n @recipe.status = @recipe.get_status\n item_client_ip(@recipe)\n # @recipe.is_draft = params[:is_draft]\n # @recipe.is_draft = @recipe.get_is_draft\n # @recipe.published_at = @recipe.get_published_at\n \n ... | [
"0.6504265",
"0.64722246",
"0.6460168",
"0.6329924",
"0.6221021",
"0.6200165",
"0.61626905",
"0.615402",
"0.600268",
"0.59847164",
"0.5966246",
"0.5955774",
"0.5938593",
"0.5935551",
"0.5929505",
"0.5904022",
"0.586058",
"0.5853507",
"0.58348316",
"0.5789006",
"0.5770832",
... | 0.7807949 | 0 |
Find all recipes matching the parameters recipe_name: name of the recipe recipe_tag: a single tag for a recipe recipe_ingredients: list of ingredients | def get_recipes(recipe_name, recipe_tag, recipe_ingredients)
recipes_ids = Set.new
ingredients_upcase = Set.new
#search by
case
when !recipe_name.blank?
recipes_ids = Recipe.where('UPPER(name) LIKE UPPER(?)', "%#{recipe_name}%").pluck(:id)
when !recipe_tag.blank?
recipes_ids = RecipeTa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def recipeingredientsearch\n @query = params[:search]\n @searchedingredients = params[:searchingredients].split(/, */)\n @searchtest = []\n @searchedingredients.each do |si|\n @searchtest.push(si.downcase)\n end\n \n Ingredient.where(\"lower(name) IN (:searching)\", \n {searching: ... | [
"0.70910263",
"0.70052564",
"0.69439673",
"0.6929965",
"0.69144803",
"0.68493646",
"0.6845398",
"0.67759395",
"0.6760274",
"0.67585033",
"0.67170596",
"0.6716653",
"0.6709615",
"0.667991",
"0.6667788",
"0.6638084",
"0.66001487",
"0.6578361",
"0.6520817",
"0.6519832",
"0.64928... | 0.7930081 | 0 |
Gets the role property value. The role property | def role
return @role
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def role\n @role\n end",
"def get_role\n\t\tself.role\n\tend",
"def role\r\n r = read_attribute(:role)\r\n r.capitalize unless r.nil?\r\n end",
"def get_role\n return case self.role_id\n when 2\n \"User\"\n else\n \"N/A\"\n end\n end... | [
"0.8208447",
"0.81522584",
"0.78307474",
"0.77477396",
"0.7668824",
"0.763459",
"0.74447405",
"0.74383163",
"0.74054605",
"0.7371139",
"0.7263034",
"0.7184341",
"0.7184341",
"0.7183879",
"0.7175226",
"0.71302915",
"0.7122539",
"0.7122539",
"0.706573",
"0.7042955",
"0.7023937"... | 0.84608644 | 0 |
Sets the role property value. The role property | def role=(value)
@role = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_role\n @role = role\n end",
"def role= val\n write_attribute(:role, val.to_s)\n end",
"def role= val\n write_attribute(:role, val.to_s)\n end",
"def role= new_role\n @role = String new_role\n end",
"def set_Role(value)\n set_input(\"Role\", value)\n end",... | [
"0.861649",
"0.8046014",
"0.8046014",
"0.796943",
"0.79629016",
"0.7945792",
"0.78999215",
"0.78999215",
"0.7875896",
"0.7750461",
"0.7684081",
"0.7671929",
"0.7653162",
"0.7516295",
"0.7481412",
"0.7481412",
"0.7481412",
"0.7481412",
"0.7481412",
"0.7481412",
"0.7481412",
... | 0.87294894 | 0 |
Checks if the folder is shared | def shared?
!self.shared_folders.empty?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def shared? \n \t!self.shared_folders.empty? \n\tend",
"def has_share_access?(folder)\n return false if folder.nil?\n return true if self.folders.include?(folder)\n return true if self.shared_folders_by_others.include?(folder)\n \n unless folder.nil?\n folder.ancestors.each do |ancestor_... | [
"0.84485424",
"0.78783685",
"0.7725481",
"0.76962864",
"0.76598984",
"0.7588193",
"0.73082435",
"0.72057045",
"0.71458274",
"0.71205026",
"0.7097011",
"0.6978434",
"0.6955756",
"0.68979573",
"0.6827829",
"0.6822201",
"0.6806507",
"0.67288357",
"0.6699674",
"0.6632166",
"0.661... | 0.8503409 | 0 |
Checks if the folder is public | def public?
!self.public_folders.empty?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def private?\n self.public_folders.empty?\n end",
"def is_public?\n is_public == true && requires_login == false\n end",
"def root_public?\n self.root.public?\n end",
"def is_public?\n @status == \"public\"\n end",
"def is_public?\n @status == \"public\"\n en... | [
"0.81339365",
"0.7830179",
"0.770985",
"0.75022835",
"0.75022835",
"0.7498561",
"0.74536574",
"0.743142",
"0.7347058",
"0.732532",
"0.7320422",
"0.7311843",
"0.73076993",
"0.7279272",
"0.72162926",
"0.7105144",
"0.70732546",
"0.70480096",
"0.69759923",
"0.6965689",
"0.6963718... | 0.8432387 | 0 |
Checks to see if the folder is private. (not public) | def private?
self.public_folders.empty?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_private?\n ! is_public?\n end",
"def is_private?\n ! is_public?\n end",
"def public?\n !self.public_folders.empty?\n end",
"def root_private?\n self.root.private?\n end",
"def is_private?\n is_public == false || (is_public == false && requires_subscription ==... | [
"0.73256844",
"0.73256844",
"0.725405",
"0.72359383",
"0.7198773",
"0.7038912",
"0.70309997",
"0.69863147",
"0.69767743",
"0.6966052",
"0.678988",
"0.67898464",
"0.67678964",
"0.6761252",
"0.6729177",
"0.6721514",
"0.6721514",
"0.6702083",
"0.6671887",
"0.6654216",
"0.6631700... | 0.8238323 | 0 |
Is the root folder public? | def root_public?
self.root.public?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_public_root?\n false\n end",
"def public?\n !self.public_folders.empty?\n end",
"def private?\n self.public_folders.empty?\n end",
"def root_private?\n self.root.private?\n end",
"def root?\n is_root?(@path)\n end",
"def is_root?()\n @rootpath == @path\n end",
"def ro... | [
"0.8766247",
"0.8121792",
"0.77916783",
"0.7780392",
"0.75076646",
"0.74951524",
"0.7491971",
"0.74848545",
"0.7470077",
"0.74284256",
"0.7405733",
"0.73801637",
"0.73181605",
"0.72479516",
"0.7112154",
"0.7112154",
"0.7102775",
"0.7100188",
"0.70814687",
"0.7055447",
"0.7049... | 0.8915485 | 0 |
Is the root folder private? | def root_private?
self.root.private?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_public_root?\n false\n end",
"def root_public?\n self.root.public?\n end",
"def private?\n self.public_folders.empty?\n end",
"def is_root?()\n @rootpath == @path\n end",
"def root?\n \tfolder_id.nil?\n end",
"def public?\n !self.public_folders.empty?\n end",
"def root?... | [
"0.81862265",
"0.8099162",
"0.7788598",
"0.7372862",
"0.7259929",
"0.718087",
"0.7054533",
"0.69742143",
"0.68834984",
"0.68371654",
"0.6778444",
"0.6753355",
"0.6752832",
"0.6751803",
"0.67372376",
"0.6725696",
"0.6725696",
"0.669453",
"0.66662127",
"0.66474575",
"0.6644184"... | 0.85230035 | 0 |
Gather a list of all the email adresses that the folder is shared with | def to_shared_emails
#shared_to = SharedFolder.select("shared_email").find(:all, :conditions => ["folder_id = ?",id])
email_addresses = Array.new
shared_folders.each do |folder|
email_addresses.push(folder.shared_email)
end
email_addresses
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_attendees()\n\t\turl = request.referrer.split(\"/\")\t# Get the URL of where the request CAME from, not the url that was requested.\n redis_key = url[-1].to_s + \":\" + url[-2].to_s + \":emails\";\n\t\tattendees = $redis.lrange(redis_key,0,-1)\n\t\tattendees.uniq!\n\t\tlogger.error \"@@@@@@@@@@@@ AT... | [
"0.6385268",
"0.63238657",
"0.62550944",
"0.61532986",
"0.61196524",
"0.6103077",
"0.6078206",
"0.60718364",
"0.6052476",
"0.5974436",
"0.5963796",
"0.5943543",
"0.5941283",
"0.5931614",
"0.59308434",
"0.58817184",
"0.5877269",
"0.5874378",
"0.5814281",
"0.5814281",
"0.580010... | 0.7708128 | 0 |
Creates a zip file and saves the location and creation time if the zip file location hasn't been saved or the contents of the folder has changed. (needs to be recursive) | def zip
if !FileTest::directory?("/mnt/filebox/assets/zipfile_repository")
Dir::mkdir("/mnt/filebox/assets/zipfile_repository")
end
if self.zipped_file.nil? or !File.file?(self.zipped_file)
logger.info("[ZIP] Creating zipfile for #{self.name}")
self.zipped_file = "/mnt/filebox/assets/zipfi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def assure_created_zip\n FileCreator::createNewZip(self)\n raise \"No file created\" unless File.exists? zip_path\n end",
"def create_zip\n require 'zip'\n zip_files = [self.ground_truth, self.image_sequence, self.config_file]\n if self.acceptable_segmentation_region.present?\n ... | [
"0.7239472",
"0.70792025",
"0.7024762",
"0.68274707",
"0.67925406",
"0.6727761",
"0.66748667",
"0.6664948",
"0.6545483",
"0.64875376",
"0.6445687",
"0.6422431",
"0.63944566",
"0.63851357",
"0.63158125",
"0.63017666",
"0.62593544",
"0.62373346",
"0.621697",
"0.6214626",
"0.620... | 0.74767613 | 0 |
Helper for the zip method which creates the zip stream and calls the zip decender | def _zip
Zip::ZipFile.open(self.zipped_file, Zip::ZipFile::CREATE) do |z|
self._zip_decender(z,self,nil)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def zip\n end",
"def zip\n end",
"def zip_contents; end",
"def zip\n @zip\n end",
"def export_zip\n stringio = Zip::ZipOutputStream::write_buffer do |zip|\n @zip = zip\n export\n end\n @zip = nil\n stringio.rewind\n stringio.sysread\n ... | [
"0.7783591",
"0.77181405",
"0.74728733",
"0.74325013",
"0.7145656",
"0.7026272",
"0.69303775",
"0.6875973",
"0.6838081",
"0.6752139",
"0.67381424",
"0.6706411",
"0.6667544",
"0.665464",
"0.6574031",
"0.65219456",
"0.6328092",
"0.6303474",
"0.62976485",
"0.6291506",
"0.6291268... | 0.77858925 | 0 |
Adds folder assets to the zip object and decends into the subfolders recursively adding their assets as well. | def _zip_decender(zipstream, folder, path)
if path.nil?
path = folder.name
else
path = path + "/" + folder.name
end
zipstream.dir.mkdir(path)
folder.assets.each do |a|
logger.info("[ZIP] Adding #{a.file_name} in #{a.uploaded_file.path}")
zipstream.add("#{path}/#{a.file_n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_files(zip)\n ZipFileGenerator.new(@manifest.base_dir, zip).write\n end",
"def run\n assets.each do |asset|\n next if ::File.directory?(asset)\n\n compress(asset)\n checksum(asset)\n end\n\n generate_manifest\n end",
"def recursively_deflate_direc... | [
"0.61086947",
"0.61060435",
"0.6061464",
"0.6007731",
"0.5917812",
"0.5841199",
"0.58001417",
"0.57991195",
"0.5763088",
"0.57603323",
"0.5631786",
"0.5612169",
"0.55973023",
"0.55808145",
"0.5574935",
"0.557355",
"0.55668014",
"0.55497897",
"0.553511",
"0.5532653",
"0.551064... | 0.72780645 | 0 |
GET /invoicestatuses GET /invoicestatuses.json | def index
@invoicestatuses = Invoicestatus.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @inciting_incidents = IncitingIncident.all\n render json: @inciting_incidents\n end",
"def index\n @instituicoes = Instituicao.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @instituicoes }\n end\n end",
"def index\n @innings... | [
"0.65578556",
"0.63009167",
"0.6275538",
"0.6230005",
"0.62188435",
"0.6171505",
"0.6164612",
"0.6161942",
"0.61527795",
"0.61527795",
"0.61527795",
"0.6145688",
"0.6145688",
"0.6132998",
"0.61025727",
"0.60914516",
"0.6090144",
"0.6076337",
"0.6063787",
"0.6033189",
"0.60184... | 0.6782847 | 0 |
POST /people_terms POST /people_terms.json | def create
@people_term = PeopleTerm.new(people_term_params)
respond_to do |format|
if @people_term.save
format.html { redirect_to @people_term, notice: 'People term was successfully created.' }
format.json { render :show, status: :created, location: @people_term }
else
form... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_terms(params)\n send_get \"add_terms\", params\n end",
"def terms_post(opts = {})\n data, _status_code, _headers = terms_post_with_http_info(opts)\n data\n end",
"def people_term_params\n params.require(:people_term).permit(:person_id, :term_id)\n end",
"def create\n ... | [
"0.69485384",
"0.6921347",
"0.6721231",
"0.64618576",
"0.6352312",
"0.63122314",
"0.6297207",
"0.6260427",
"0.6260427",
"0.6209562",
"0.6202969",
"0.62014294",
"0.61632085",
"0.6136712",
"0.6092729",
"0.60720646",
"0.595872",
"0.5899768",
"0.5899185",
"0.5884864",
"0.58641624... | 0.72865486 | 0 |
PATCH/PUT /people_terms/1 PATCH/PUT /people_terms/1.json | def update
respond_to do |format|
if @people_term.update(people_term_params)
format.html { redirect_to @people_term, notice: 'People term was successfully updated.' }
format.json { render :show, status: :ok, location: @people_term }
else
format.html { render :edit }
forma... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @terms_of_use = TermsOfUse.find(params[:id])\n\n respond_to do |format|\n if @terms_of_use.update_attributes(params[:terms_of_use])\n format.html { redirect_to @terms_of_use, notice: 'Terms of use was successfully updated.' }\n format.json { head :no_content }\n else\n ... | [
"0.6565607",
"0.64583135",
"0.6288723",
"0.6251702",
"0.62307066",
"0.6209012",
"0.6176027",
"0.6058723",
"0.6005997",
"0.5985005",
"0.59744",
"0.5972014",
"0.59538966",
"0.59447366",
"0.59418875",
"0.59028655",
"0.5897313",
"0.5893967",
"0.58514655",
"0.58477306",
"0.5840314... | 0.6949061 | 0 |
DELETE /people_terms/1 DELETE /people_terms/1.json | def destroy
@people_term.destroy
respond_to do |format|
format.html { redirect_to people_terms_url, notice: 'People term was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @go_term = GoTerm.find(params[:id])\n @go_term.destroy\n\n respond_to do |format|\n format.html { redirect_to go_terms_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @privacy_term = PrivacyTerm.find(params[:id])\n @privacy_term.destroy\n\n resp... | [
"0.72060794",
"0.7056147",
"0.69761854",
"0.6898458",
"0.68279845",
"0.6753201",
"0.67426723",
"0.66773164",
"0.6667031",
"0.6649049",
"0.66417456",
"0.6623029",
"0.6619173",
"0.6609529",
"0.6605995",
"0.65991205",
"0.6588154",
"0.6583966",
"0.6578589",
"0.6578589",
"0.657858... | 0.7482181 | 0 |
GET /card_pages GET /card_pages.json | def index
@card_pages = CardPage.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @cards = Card.page(params[:page]).per(7)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cards }\n end\n end",
"def index\n @card = Card.paginate(:page => params[:page], :per_page => 15)\n end",
"def index\n @pages = Page.page param... | [
"0.7591505",
"0.71511203",
"0.7073391",
"0.69458234",
"0.69192123",
"0.6781108",
"0.6764483",
"0.673955",
"0.67163885",
"0.6691314",
"0.66805345",
"0.6664093",
"0.66534734",
"0.66534734",
"0.66534734",
"0.66534734",
"0.66534734",
"0.66534734",
"0.66534734",
"0.66423315",
"0.6... | 0.77419126 | 0 |
POST /card_pages POST /card_pages.json | def create
@card_page = CardPage.new(card_page_params)
respond_to do |format|
if @card_page.save
format.html { redirect_to @card_page, notice: 'Card page was successfully created.' }
format.json { render action: 'show', status: :created, location: @card_page }
else
format.ht... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @card_pages = CardPage.all\n end",
"def create\n @page = Page.new(page_params)\n\n if @page.save\n render json: @page, status: :created, location: @page\n else\n render json: @page.errors, status: :unprocessable_entity\n end\n end",
"def create\n #Each Page could be ... | [
"0.6703475",
"0.66446877",
"0.6527261",
"0.6402437",
"0.63296163",
"0.63077635",
"0.6211319",
"0.6204911",
"0.61955255",
"0.61908674",
"0.61885166",
"0.6173455",
"0.6173455",
"0.6173455",
"0.6173455",
"0.6173455",
"0.6173455",
"0.6169322",
"0.6157733",
"0.6146727",
"0.6108626... | 0.736481 | 0 |
PATCH/PUT /card_pages/1 PATCH/PUT /card_pages/1.json | def update
respond_to do |format|
if @card_page.update(card_page_params)
format.html { redirect_to @card_page, notice: 'Card page was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: 'edit' }
format.json { render json: @card_page... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @page = Page.find(params[:id])\n\n respond_to do |format|\n if @page.update_attributes(params[:page])\n format.json { head :no_content }\n format.xml { head :no_content }\n else\n format.json { render json: @page.errors, status: :unprocessable_entity }\n for... | [
"0.664527",
"0.65790606",
"0.65553373",
"0.65426314",
"0.6520077",
"0.650799",
"0.65025777",
"0.6496636",
"0.64962256",
"0.64962256",
"0.6493549",
"0.6491924",
"0.6478084",
"0.6478084",
"0.6450186",
"0.63840544",
"0.6378237",
"0.637506",
"0.637506",
"0.637506",
"0.6363867",
... | 0.7415093 | 0 |
DELETE /card_pages/1 DELETE /card_pages/1.json | def destroy
@card_page.destroy
respond_to do |format|
format.html { redirect_to card_pages_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @card.destroy\n\n head :no_content\n end",
"def destroy\n # @card = Card.destroy(params[:id])\n # render json: 200\n end",
"def delete_page(id)\n @client.raw('delete', \"/content/pages/#{id}\")\n end",
"def destroy\n @page = Page.find(params[:id])\n @page.destr... | [
"0.7245162",
"0.72355306",
"0.723355",
"0.7231964",
"0.7225608",
"0.7199854",
"0.7173993",
"0.7173993",
"0.7173993",
"0.71704423",
"0.71704423",
"0.71704423",
"0.71704423",
"0.7169213",
"0.7169213",
"0.7169213",
"0.7169213",
"0.7169213",
"0.7169213",
"0.7169213",
"0.7169213",... | 0.8014684 | 0 |
GET /field_definitions GET /field_definitions.json | def index
if params[:step_definition_id]
step_definition = StepDefinition.find(params[:step_definition_id])
if step_definition != nil
@field_definitions = step_definition.field_definitions
else
@field_definitions = []
end
else
@field_definitions = FieldDefinition.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def definitions(key, field=nil)\n begin\n defs = self.definition_schema[key]\n if field.present?\n defs[field]\n else\n defs\n end\n rescue NoMethodError => e\n field_key = field.present? ? \"#{key}/#{field}\" : key\n ErrorTracker.report_exception(e, self.study.use... | [
"0.70758086",
"0.6337163",
"0.6179126",
"0.61459696",
"0.6027708",
"0.5972366",
"0.59629065",
"0.5953797",
"0.59530354",
"0.5900668",
"0.5883962",
"0.5828771",
"0.57892615",
"0.5778741",
"0.5736973",
"0.5733617",
"0.5733617",
"0.5733617",
"0.5733617",
"0.5733617",
"0.572039",... | 0.6603736 | 1 |
POST /field_definitions POST /field_definitions.json | def create
@field_definition = FieldDefinition.new(field_definition_params)
respond_to do |format|
if @field_definition.save
format.html { redirect_to @field_definition, notice: 'Field definition was successfully created.' }
format.json { render :show, status: :created, location: @field_d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n\n step_definition_attributes = step_definition_params\n field_definitions_attributes = step_definition_attributes.delete(\"field_definitions\")\n\n @step_definition = StepDefinition.new(step_definition_attributes)\n @step_definition.field_definitions = FieldDefinition.createFieldDefinition... | [
"0.6650409",
"0.6428674",
"0.63167727",
"0.5891492",
"0.5798324",
"0.57660174",
"0.5747204",
"0.5697241",
"0.5676426",
"0.56692153",
"0.56343377",
"0.56055397",
"0.55115455",
"0.5498918",
"0.544877",
"0.5438454",
"0.5410673",
"0.5372006",
"0.53685665",
"0.5311249",
"0.5295316... | 0.6931197 | 0 |
PATCH/PUT /field_definitions/1 PATCH/PUT /field_definitions/1.json | def update
respond_to do |format|
if @field_definition.update(field_definition_params)
format.html { redirect_to @field_definition, notice: 'Field definition was successfully updated.' }
format.json { render :show, status: :ok, location: @field_definition }
else
format.html { ren... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n\n step_definition_attributes = step_definition_params\n field_definitions_attributes = step_definition_attributes.delete(\"field_definitions\")\n\n FieldDefinition.updateFieldDefinitions(field_definitions_attributes)\n\n respond_to do |format|\n if @step_definition.update(step_definit... | [
"0.6562135",
"0.6268004",
"0.6123477",
"0.6123477",
"0.60710317",
"0.59882385",
"0.597456",
"0.5937513",
"0.5937513",
"0.5863146",
"0.5801755",
"0.57935566",
"0.57839036",
"0.57632226",
"0.5755195",
"0.57141423",
"0.5708985",
"0.5672161",
"0.5616817",
"0.5612955",
"0.55771303... | 0.65656084 | 0 |
DELETE /field_definitions/1 DELETE /field_definitions/1.json | def destroy
@field_definition.destroy
respond_to do |format|
format.html { redirect_to field_definitions_url, notice: 'Field definition was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_field!(field_name); end",
"def DeleteField id\n \n APICall(path: \"ticket_fields/#{id}.json\",method: 'DELETE')\n \n end",
"def delete_field(id)\n delete(\"fields/#{id}\")\n end",
"def test_delete_field\n local_file_name = 'GetField.docx'\n remote_fi... | [
"0.6994925",
"0.67600447",
"0.6716103",
"0.6662268",
"0.66504896",
"0.6497389",
"0.6497389",
"0.6495189",
"0.6476443",
"0.6375809",
"0.63211066",
"0.63173664",
"0.63096696",
"0.63096696",
"0.6283502",
"0.6262463",
"0.6253855",
"0.62296414",
"0.62217116",
"0.62123173",
"0.6203... | 0.74825364 | 0 |
=begin Create one time token to use API. | def create_token
return api_call('request-token',{"apiKey"=> @@_api_key });
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_one_time_token\n @one_time_token =\n JSON::JWT.new(iss: 'try-it-juku-test',\n exp: 5.minutes.since,\n nbf: Time.current,\n sub: { shin_cd: @current_chief.shin_cd })\n .sign(ACCESS_TOKEN_SIGNATURE, :HS2... | [
"0.8003303",
"0.7740658",
"0.73060983",
"0.7283917",
"0.72717005",
"0.7226481",
"0.72062707",
"0.71999466",
"0.71927714",
"0.7190985",
"0.719002",
"0.7186691",
"0.7161049",
"0.714691",
"0.71447974",
"0.7141118",
"0.7110375",
"0.7105321",
"0.70993626",
"0.7097249",
"0.7093375"... | 0.8550086 | 0 |
=begin Convert an array to xml string. | def array_to_xml(hash, xml)
require "active_support/core_ext"
return hash.to_xml(:root => 'queue')
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_xml(a)\n r = \"\"\n if ishash(@a[a])\n r = self.hash_to_xml(a,@a[a])\n elsif isarray(@a[a])\n r = self.array_to_xml(a,@a[a])\n else\n r = \"<#{a}>#{@a[a]}</#{a}>\"\n end\n r \n end",
"def to_xml\n @node.flatten.map(&:t... | [
"0.6696121",
"0.669173",
"0.65800935",
"0.65800935",
"0.64539003",
"0.64539003",
"0.64367825",
"0.64367825",
"0.64367825",
"0.64367825",
"0.64367825",
"0.64367825",
"0.643426",
"0.639226",
"0.6366356",
"0.6366356",
"0.63052046",
"0.62652904",
"0.62152576",
"0.619897",
"0.6195... | 0.6912599 | 0 |
=begin Convert an xml string to array. | def xml_to_array(xml_string)
return Hash.from_xml(xml_string)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def array_from_xml(xml, opts=OPTS)\n node = Nokogiri::XML(xml).children.first\n unless node \n raise Error, \"Malformed XML used\"\n end\n node.children.reject{|c| c.is_a?(Nokogiri::XML::Text)}.map{|c| from_xml_node(c, opts)}\n end",
"def parse_to_array(line_... | [
"0.76040816",
"0.666295",
"0.65903074",
"0.63825923",
"0.6306955",
"0.61723995",
"0.61355793",
"0.6132945",
"0.61137897",
"0.61028665",
"0.5969989",
"0.5931572",
"0.5931572",
"0.5922456",
"0.59220636",
"0.59026235",
"0.58812326",
"0.5865497",
"0.5809855",
"0.5809386",
"0.5790... | 0.8026987 | 0 |
Returns or yields parent breadcrumb (secondtolast in the trail) if it is present. () | def parent_breadcrumb(options = {}, &block)
if block_given?
gretel_renderer.yield_parent_breadcrumb(options, &block)
else
gretel_renderer.parent_breadcrumb(options)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parent_breadcrumb(options = {})\n render(options)[-2]\n end",
"def yield_parent_breadcrumb(options = {})\n if parent = parent_breadcrumb(options)\n yield parent\n end\n end",
"def breadcrumb current\n return [] if current.nil?\n result = Array.new\n result << current\n ... | [
"0.71094614",
"0.7056014",
"0.6413934",
"0.63741654",
"0.63702136",
"0.6329462",
"0.6316898",
"0.6302244",
"0.6295133",
"0.6194351",
"0.61781543",
"0.6129419",
"0.6129419",
"0.59964657",
"0.5981051",
"0.59602785",
"0.5919928",
"0.5919928",
"0.5898388",
"0.5876841",
"0.5874468... | 0.73721915 | 0 |
Write a recursive method that returns the sum of the first n even numbers recursively. Assume n > 0. | def first_even_numbers_sum(n)
return 2 if n == 1
2 * n + first_even_numbers_sum(n-1)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def first_even_numbers_sum(n)\n return 2 if n == 1\n 2 * n + first_even_numbers_sum(n-1)\n end",
"def first_even_numbers_sum(n)\n\nend",
"def first_even_numbers_sum(n)\n\nend",
"def recursion(n)\n if n % 2 ==0\n n\n else\n recursion(n + 1)\nend\nend",
"def even_num_rec(n)\n n = (0...n).to_a... | [
"0.88773525",
"0.8361318",
"0.8361318",
"0.7575595",
"0.7511886",
"0.7442943",
"0.7334038",
"0.73173136",
"0.7249176",
"0.72258985",
"0.72222763",
"0.72195196",
"0.71986216",
"0.7167344",
"0.71563643",
"0.71517795",
"0.71517795",
"0.71517795",
"0.71517795",
"0.7151437",
"0.71... | 0.88209176 | 1 |
GET /abooks GET /abooks.json | def index
@abooks = Abook.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @books = Book.get_avaible_books\n end",
"def index\n @books = Book.all\n render json: @books\n end",
"def index\n @cookbooks = Cookbook.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cookbooks }\n end\n end",
"def index\n... | [
"0.6982796",
"0.6957329",
"0.6949324",
"0.68977684",
"0.6820236",
"0.6779995",
"0.6751502",
"0.67465687",
"0.6721131",
"0.66992205",
"0.6696414",
"0.66711694",
"0.6655469",
"0.6625742",
"0.6621738",
"0.6601952",
"0.6601003",
"0.65989757",
"0.65951073",
"0.658131",
"0.6559724"... | 0.7113232 | 0 |
POST /abooks POST /abooks.json | def create
@abook = Abook.new(abook_params)
respond_to do |format|
if @abook.save
format.html { redirect_to @abook, notice: 'Abook was successfully created.' }
format.json { render :show, status: :created, location: @abook }
else
format.html { render :new }
format.js... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @api_book = Api::Book.new(api_book_params)\n\n if @api_book.save\n render json: @api_book, status: :created, location: @api_book\n else\n render json: @api_book.errors, status: :unprocessable_entity\n end\n end",
"def create\n @book = Book.new(book_params)\n\n if @book.s... | [
"0.6125391",
"0.6040874",
"0.6029674",
"0.58725584",
"0.58690166",
"0.5814412",
"0.5790517",
"0.5739043",
"0.57092375",
"0.5704596",
"0.57025206",
"0.56746817",
"0.56602204",
"0.56549394",
"0.56280553",
"0.56187016",
"0.5566896",
"0.5566896",
"0.5566896",
"0.5566896",
"0.5566... | 0.6885678 | 0 |
PATCH/PUT /abooks/1 PATCH/PUT /abooks/1.json | def update
respond_to do |format|
if @abook.update(abook_params)
format.html { redirect_to @abook, notice: 'Abook was successfully updated.' }
format.json { render :show, status: :ok, location: @abook }
else
format.html { render :edit }
format.json { render json: @abook.e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def patch!\n request! :patch\n end",
"def rest_edit(path, options={}, &blk)\n callback = Proc.new { |*args|\n @object = yield(*args) or pass\n rest_params.each { |k, v| @object.send :\"#{k}=\", v unless k == 'id' }\n\n return 400, @object.errors.to_json unless @object.valid?\n\n @obj... | [
"0.63389295",
"0.62552476",
"0.62552476",
"0.6253487",
"0.6253081",
"0.6228533",
"0.62126774",
"0.6208144",
"0.6187638",
"0.6162022",
"0.61475354",
"0.61317796",
"0.60827076",
"0.6082219",
"0.60683763",
"0.6060259",
"0.6018262",
"0.601791",
"0.6011754",
"0.5998342",
"0.599834... | 0.65643257 | 0 |
DELETE /abooks/1 DELETE /abooks/1.json | def destroy
@abook.destroy
respond_to do |format|
format.html { redirect_to abooks_url, notice: 'Abook was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete\n client.delete(\"/#{id}\")\n end",
"def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"def destroy\n @api_book.destroy\n\n head :no_content\n end",
"def delete(path)\n RestClient.delete request_base+path\n end",
"def de... | [
"0.702121",
"0.6976222",
"0.6811468",
"0.67723113",
"0.676742",
"0.6674516",
"0.6669128",
"0.66688925",
"0.6666575",
"0.6654977",
"0.66456056",
"0.6628885",
"0.66274464",
"0.6623885",
"0.66220206",
"0.661985",
"0.66136426",
"0.6591164",
"0.65891767",
"0.65891767",
"0.65891767... | 0.70690453 | 0 |
author_name knows the name of its author returns nil if the post does not have an author | def author_name
if self.author
self.author.name
else
nil
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def author_name\n self.author ? self.author.name : nil\n end",
"def author_name\n self.posts.first.author_name\n end",
"def author_name\n self.author ? self.author.name : nil \n end",
"def author_name\n self.author.name if author \n end",
"def author_name\n author.full_name if autho... | [
"0.8126534",
"0.8126239",
"0.8073739",
"0.8004891",
"0.7914814",
"0.7884917",
"0.7585794",
"0.74104595",
"0.73815733",
"0.7375413",
"0.73479724",
"0.73479724",
"0.7320386",
"0.7221285",
"0.7148087",
"0.7141909",
"0.71012664",
"0.70949674",
"0.70919853",
"0.708323",
"0.7044326... | 0.81866527 | 0 |
GET /requests/devolutions/products/details/1 GET /requests/devolutions/products/details/1.json | def show
@requests_devolutions_products_detail = Requests::Devolutions::Products::Detail.find(params[:id])
respond_to do |format|
format.html
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n json_response(@api_v1_product)\n end",
"def show\n @requests_transferences_products_detail = Requests::Transferences::Products::Detail.find(params[:id])\n respond_to do |format|\n format.html\n end\n end",
"def show\n @product = Product.find(params[:id])\n json_respo... | [
"0.7218091",
"0.7158551",
"0.70554394",
"0.6978709",
"0.6977609",
"0.69348764",
"0.6933271",
"0.6928328",
"0.6925765",
"0.69160664",
"0.6910675",
"0.6902752",
"0.68951666",
"0.6875545",
"0.6854568",
"0.68179977",
"0.6794714",
"0.67926866",
"0.6785334",
"0.6773074",
"0.6760922... | 0.7594424 | 0 |
GET /requests/devolutions/products/details/new GET /requests/devolutions/products/details/new.json | def new
@requests_devolutions_products_detail = Requests::Devolutions::Products::Detail.new
respond_to do |format|
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @product = Product.new\n\n render json: @product\n end",
"def new\n get_product\n @product_detail = @product.details.new\n end",
"def new\n @product = ProductProduct.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @product }\n ... | [
"0.7427585",
"0.73749167",
"0.7350126",
"0.730964",
"0.730964",
"0.730964",
"0.730964",
"0.730964",
"0.730964",
"0.730964",
"0.730964",
"0.730964",
"0.730964",
"0.730964",
"0.730964",
"0.730964",
"0.730964",
"0.730964",
"0.730964",
"0.730964",
"0.730964",
"0.730964",
"0.7... | 0.7500732 | 0 |
Generate the next round of paths | def next_paths
Operations.list.map do |operation|
new_value = Operations.send(operation, @current_value)
operation_history = @operation_history + [operation]
Path.new(new_value, @target_value, operation_history: operation_history)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def paths(n)\n return nCr(2*(n-1),n)\nend",
"def path(k)\n x = k\n y = 1 - k\n path = []\n direction = 1\n (k*8).times do |i|\n path.push(x.to_s + ';' + y.to_s)\n if direction == 1\n y += 1\n direction = 2 if y == k\n elsif direction == 2\n x -= 1\n direction = 3 if x * (-1) ... | [
"0.6833168",
"0.65635276",
"0.6379017",
"0.63330495",
"0.63083893",
"0.62988335",
"0.6287713",
"0.6273768",
"0.6251025",
"0.61220175",
"0.61073124",
"0.61034083",
"0.60669386",
"0.60412073",
"0.59958404",
"0.5950208",
"0.5924406",
"0.58955294",
"0.58699673",
"0.5850981",
"0.5... | 0.71066934 | 0 |
GET /student_categories GET /student_categories.json | def index
# @student_categories = StudentCategory.all
respond_to do |format|
format.html # index.html.erb
format.json { render json: @student_categories }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n # @student_category = StudentCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @student_category }\n end\n end",
"def get_categories\r\n categories = Taxonomy.get_categories\r\n render json: categories, root: 'cate... | [
"0.6934892",
"0.6927601",
"0.6902103",
"0.674329",
"0.66500926",
"0.64506054",
"0.64237016",
"0.6378067",
"0.63600516",
"0.6348026",
"0.63244313",
"0.63234967",
"0.63000333",
"0.6292553",
"0.62393785",
"0.6192926",
"0.6173628",
"0.61670274",
"0.615083",
"0.6150037",
"0.615003... | 0.77031684 | 0 |
GET /student_categories/1 GET /student_categories/1.json | def show
# @student_category = StudentCategory.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @student_category }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n # @student_categories = StudentCategory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @student_categories }\n end\n end",
"def get_categories\r\n categories = Taxonomy.get_categories\r\n render json: categories, root: 'categories',... | [
"0.7759597",
"0.6814022",
"0.6791496",
"0.66728014",
"0.66453403",
"0.66340023",
"0.6506893",
"0.6480909",
"0.64319426",
"0.6423036",
"0.6359196",
"0.6353617",
"0.6347104",
"0.6327567",
"0.6326933",
"0.6326933",
"0.63242084",
"0.6309942",
"0.6287733",
"0.6257623",
"0.6236738"... | 0.73360837 | 1 |
GET /student_categories/new GET /student_categories/new.json | def new
# @student_category = StudentCategory.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @student_category }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n # @student_category = StudentCategory.new(params[:student_category])\n\n respond_to do |format|\n if @student_category.save\n format.html { redirect_to @student_category, notice: 'Student category was successfully created.' }\n format.json { render json: @student_category, stat... | [
"0.75486434",
"0.7330655",
"0.7260932",
"0.72467655",
"0.72467655",
"0.72467655",
"0.72467655",
"0.72467655",
"0.72467655",
"0.72467655",
"0.72467655",
"0.72467655",
"0.72153485",
"0.7145538",
"0.710887",
"0.7052048",
"0.6957772",
"0.6948832",
"0.6942383",
"0.6942383",
"0.694... | 0.78738594 | 0 |
POST /student_categories POST /student_categories.json | def create
# @student_category = StudentCategory.new(params[:student_category])
respond_to do |format|
if @student_category.save
format.html { redirect_to @student_category, notice: 'Student category was successfully created.' }
format.json { render json: @student_category, status: :create... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @mg_student_category = MgStudentCategory.new(mg_create_student_category_params)\n @mg_student_category.save\n redirect_to '/student_categories'\n\n \n end",
"def index\n # @student_categories = StudentCategory.all\n\n respond_to do |format|\n format.html # index.html.erb\n ... | [
"0.66422796",
"0.65858465",
"0.65275466",
"0.63772106",
"0.6323289",
"0.6309006",
"0.6262785",
"0.62537557",
"0.623655",
"0.61883944",
"0.6133598",
"0.6127766",
"0.6109378",
"0.61086607",
"0.6081514",
"0.60611075",
"0.60261834",
"0.6024759",
"0.6021749",
"0.6009296",
"0.59765... | 0.7259163 | 0 |
PUT /student_categories/1 PUT /student_categories/1.json | def update
# @student_category = StudentCategory.find(params[:id])
respond_to do |format|
if @student_category.update_attributes(params[:student_category])
format.html { redirect_to @student_category, notice: 'Student category was successfully updated.' }
format.json { head :ok }
els... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def UpdateCategory params = {}\n \n APICall(path: 'categories.json',method: 'PUT',payload: params.to_json)\n \n end",
"def update\n json_update(category,category_params, Category)\n end",
"def update_categories(categories, options = {} )\n options.merge!(:docid => self.doci... | [
"0.6710342",
"0.64764243",
"0.6471951",
"0.6228575",
"0.61961347",
"0.61764073",
"0.6159607",
"0.6087562",
"0.6031057",
"0.60020834",
"0.5995422",
"0.59750146",
"0.59722286",
"0.5968835",
"0.5929871",
"0.59199893",
"0.5916816",
"0.5897858",
"0.588357",
"0.58741325",
"0.586639... | 0.70322895 | 0 |
DELETE /student_categories/1 DELETE /student_categories/1.json | def destroy
# @student_category = StudentCategory.find(params[:id])
@student_category.destroy
respond_to do |format|
format.html { redirect_to student_categories_url }
format.json { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @student_category.destroy\n respond_to do |format|\n format.html { redirect_to mg_student_categories_url, notice: 'successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @student.delete\n respond_to do |format|\n format.html { redir... | [
"0.7558042",
"0.7288963",
"0.7162421",
"0.7134572",
"0.7134572",
"0.7134572",
"0.7134572",
"0.7104059",
"0.7089248",
"0.7079892",
"0.7051919",
"0.7047926",
"0.70442444",
"0.70442444",
"0.70442444",
"0.70442444",
"0.70442444",
"0.70442444",
"0.70442444",
"0.70442444",
"0.70327... | 0.7850941 | 0 |
GET /cake_flavors GET /cake_flavors.json | def index
@cake_flavors = CakeFlavor.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def flavors()\n return get_request(address(\"/flavors/detail\"), @token)\t\n end",
"def index\n @flavors = Flavor.all\n end",
"def list_flavors_detail()\n response = dbreq(\"GET\", dbmgmthost, \"#{dbmgmtpath}/flavors/detail\", dbmgmtport, dbmgmtscheme)\n CloudDB::Exception.raise_exception... | [
"0.78807485",
"0.71675557",
"0.70889527",
"0.69904155",
"0.6783881",
"0.670636",
"0.6580068",
"0.652218",
"0.6369831",
"0.6318258",
"0.63060945",
"0.62686247",
"0.6204976",
"0.6161162",
"0.6123502",
"0.61148125",
"0.61148125",
"0.60916233",
"0.6086261",
"0.6080107",
"0.606751... | 0.7617719 | 1 |
POST /cake_flavors POST /cake_flavors.json | def create
@cake_flavor = CakeFlavor.new(cake_flavor_params)
respond_to do |format|
if @cake_flavor.save
format.html { redirect_to @cake_flavor, notice: 'Cake flavor was successfully created.' }
format.json { render :show, status: :created, location: @cake_flavor }
else
form... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @flavor = Flavor.new(flavor_params)\n\n respond_to do |format|\n if @flavor.save\n format.html { redirect_to @flavor, notice: 'Flavor was successfully created.' }\n format.json { render :show, status: :created, location: @flavor }\n else\n format.html { render :new... | [
"0.716318",
"0.70878196",
"0.6626092",
"0.6584757",
"0.65699923",
"0.65650886",
"0.6531805",
"0.6441508",
"0.6396541",
"0.6383742",
"0.629688",
"0.61868054",
"0.60363275",
"0.6026922",
"0.6013406",
"0.6013406",
"0.5935032",
"0.5909869",
"0.5831824",
"0.58270085",
"0.5799477",... | 0.7437367 | 0 |
PATCH/PUT /cake_flavors/1 PATCH/PUT /cake_flavors/1.json | def update
respond_to do |format|
if @cake_flavor.update(cake_flavor_params)
format.html { redirect_to @cake_flavor, notice: 'Cake flavor was successfully updated.' }
format.json { render :show, status: :ok, location: @cake_flavor }
else
format.html { render :edit }
forma... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @flavor = Flavor.find(params[:id])\n\n respond_to do |format|\n if @flavor.update_attributes(params[:flavor])\n format.html { redirect_to @flavor, :notice => 'Flavor was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"... | [
"0.6868971",
"0.67433983",
"0.65769887",
"0.6314366",
"0.6303884",
"0.61911196",
"0.6128536",
"0.6128536",
"0.60558414",
"0.5978746",
"0.5922216",
"0.58937526",
"0.5844243",
"0.58376735",
"0.5712817",
"0.5701882",
"0.5693686",
"0.5693686",
"0.5690351",
"0.5690351",
"0.5690351... | 0.7133959 | 0 |
DELETE /cake_flavors/1 DELETE /cake_flavors/1.json | def destroy
@cake_flavor.destroy
respond_to do |format|
format.html { redirect_to cake_flavors_url, notice: 'Cake flavor was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n compute.delete_flavor(params[:id])\n \n\n respond_to do |format|\n format.html { redirect_to flavors_path }\n format.json { head :ok }\n end\n end",
"def destroy\n @frosting_flavor.destroy\n respond_to do |format|\n format.html { redirect_to frosting_flavors_url, n... | [
"0.7586125",
"0.7065672",
"0.7026094",
"0.6979786",
"0.69694257",
"0.68794614",
"0.68777996",
"0.682137",
"0.6812025",
"0.67566043",
"0.6740801",
"0.66935563",
"0.6620424",
"0.65605843",
"0.6536122",
"0.6529574",
"0.64735293",
"0.6461297",
"0.6457156",
"0.6454956",
"0.6434088... | 0.78703517 | 0 |
POST /product_classifies POST /product_classifies.json | def create
@product_classify = ProductClassify.new(product_classify_params)
respond_to do |format|
if @product_classify.save
format.html { redirect_to :product_classifies, notice: '产品分类添加成功。' }
format.json { render :show, status: :created, location: @product_classify }
else
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_product_classify\n @product_classify = ProductClassify.find(params[:id])\n end",
"def create\n @classified = Classified.new(classified_params)\n respond_to do |format|\n if @classified.save\n format.html { redirect_to @classified, notice: 'Classified was successfully created.' }... | [
"0.6588511",
"0.64679235",
"0.6444138",
"0.639454",
"0.6318923",
"0.61670583",
"0.6091584",
"0.60356516",
"0.6025881",
"0.59911597",
"0.5871508",
"0.58268404",
"0.57872295",
"0.57741004",
"0.5759996",
"0.57037616",
"0.5698544",
"0.56933355",
"0.5682692",
"0.5638086",
"0.56380... | 0.75399023 | 0 |
PATCH/PUT /product_classifies/1 PATCH/PUT /product_classifies/1.json | def update
respond_to do |format|
if @product_classify.update(product_classify_params)
format.html { redirect_to :product_classifies, notice: '产品分类修改成功。' }
format.json { render :show, status: :ok, location: @product_classify }
else
format.html { render :edit }
format.json... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @classified = @user.classifieds.find(params[:id])\n\n respond_to do |format|\n if @classified.update_attributes(params[:classified])\n format.html { redirect_to @classified, notice: 'Classified was successfully updated.' }\n format.json { head :no_content }\n else\n ... | [
"0.6495761",
"0.64660174",
"0.6417053",
"0.6417053",
"0.6367245",
"0.6213753",
"0.6204482",
"0.6203471",
"0.6141329",
"0.61143076",
"0.6112834",
"0.61103654",
"0.60965014",
"0.6057414",
"0.6016075",
"0.6014388",
"0.6007278",
"0.60009414",
"0.5978212",
"0.5961434",
"0.5952793"... | 0.7150328 | 0 |
DELETE /product_classifies/1 DELETE /product_classifies/1.json | def destroy
@product_classify.destroy
respond_to do |format|
format.html { redirect_to product_classifies_url, notice: '产品分类删除成功。' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @item_classification.destroy\n respond_to do |format|\n format.html { redirect_to item_classifications_url, notice: 'Classificação destruída com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @classified = Classified.find(params[:id])\n @classi... | [
"0.7296281",
"0.7187548",
"0.70670295",
"0.70448655",
"0.6991217",
"0.69825363",
"0.69825363",
"0.6793529",
"0.67934847",
"0.67873615",
"0.67498946",
"0.6729379",
"0.6725866",
"0.67251664",
"0.6698137",
"0.6694368",
"0.6680494",
"0.6665016",
"0.66600513",
"0.6656275",
"0.6655... | 0.77087045 | 0 |
function for get the data from ebi | def obtain_data_from_ebi(gene)
address = URI("http://www.ebi.ac.uk/Tools/dbfetch/dbfetch?db=ensemblgenomesgene&format=embl&id=#{gene}")
response = Net::HTTP.get_response(address) # use the Net::HTTP object "get_response" method
record = response.body
entry = Bio::EMBL.new(record)
ac_seq= en... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_data()\t\n\tend",
"def data\n @datas\n end",
"def data; end",
"def data; end",
"def data; end",
"def data; end",
"def data; end",
"def data; end",
"def data; end",
"def data; end",
"def data; end",
"def data; end",
"def data; end",
"def data; end",
"def data\n @dat... | [
"0.69683236",
"0.61620003",
"0.61326593",
"0.61326593",
"0.61326593",
"0.61326593",
"0.61326593",
"0.61326593",
"0.61326593",
"0.61326593",
"0.61326593",
"0.61326593",
"0.61326593",
"0.61326593",
"0.6037133",
"0.60212404",
"0.59691346",
"0.5947631",
"0.5946502",
"0.592463",
"... | 0.74137473 | 0 |
function for creating new features to the EnsEMBL Sequence object | def create_features_ensembl_seq_obj(bioseq,targets)
targets.each do |key,value|
f1 = Bio::Feature.new("target_CTTCTT","#{key[0]}..#{key[1]}")
#im no sure if it is a interior coding exon
f1.append(Bio::Feature::Qualifier.new('interior coding exon', "#{value[0]}"))
f1.append(Bio:... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def append_features(mod) end",
"def create(attributes = {})\n # Automatically set some attributes if possible\n attributes = { seqid: @feature.seqid, source: @feature.source, strand: @feature.strand, attributes: {} }.merge(attributes)\n # FIXME: Handle parent properly\n attrib... | [
"0.6834092",
"0.66804004",
"0.6629771",
"0.63910025",
"0.6382928",
"0.6237313",
"0.6124307",
"0.61200815",
"0.60912836",
"0.6060284",
"0.6051493",
"0.60266775",
"0.6020581",
"0.59700817",
"0.5961888",
"0.59530205",
"0.58957654",
"0.58957654",
"0.58703935",
"0.5856464",
"0.583... | 0.7389561 | 0 |
function for writing in the txt and gff files | def write_gff_files(gene,fo,f1,f2)
bioseq_seq, chr_id, chr_cord = obtain_data_from_ebi(gene)
target_hash = obtain_target_from_seq(bioseq_seq)
create_features_ensembl_seq_obj(bioseq_seq,target_hash)
chr_target_hash=change_cord(target_hash,chr_cord)
if target_hash.empty?
f1.puts "#{gene... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def write_gff(data)\n return nil if data.nil?\n\n extend Experts::ExpertMethods\n\n gff = \"##gff-version 3\\n\"\n source = \".\"\n type = \"match\"\n strand = \"\"\n phase = \".\"\n\n for i in 0...data.length\n start, stop = data[i].hit_from, data[i].hit_to\n start > stop ?... | [
"0.6159946",
"0.6000868",
"0.5961492",
"0.5919155",
"0.59113795",
"0.5909863",
"0.5865894",
"0.58346915",
"0.58346915",
"0.58218765",
"0.5796392",
"0.5786224",
"0.57367265",
"0.5733573",
"0.57301164",
"0.5724152",
"0.57233",
"0.57075727",
"0.5703164",
"0.5697187",
"0.5697043"... | 0.7515963 | 0 |
Is the animal a firefox? | def firefox?
if @type.downcase == "firefox"
return true
else
return false
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def firefox\r\n is_firefox? ? @browser : nil;\r\n end",
"def alien?() is_type?( 'Alien'); end",
"def is_an_animal?()\n\n !is_empty? && @livingbeing.is_a?(Animal)\n end",
"def good_browser?(agent = /Firefox|Safari|Chrome/)\n request.env['HTTP_USER_AGENT'] =~ agent\n end",
"def is_b... | [
"0.59328794",
"0.5897684",
"0.57972246",
"0.5738907",
"0.5717698",
"0.57010293",
"0.5694489",
"0.563446",
"0.5628106",
"0.55973923",
"0.5597209",
"0.5589755",
"0.5580423",
"0.5569155",
"0.5561654",
"0.5522324",
"0.5468275",
"0.54655516",
"0.5463138",
"0.5461635",
"0.54333323"... | 0.7579618 | 0 |
Direct access to right_cloud_stack gem Useful for debugging in irb | def handle
@cloud_stack
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def InstallStack\n\n end",
"def initialize(stack)\n @stack = stack\n super stack.api\n end",
"def stack; end",
"def stack; end",
"def cloudstack?(node)\n node.key?('cloudstack')\n end",
"def __stack\n @stack\n end",
"def InstallStack\n if (@rst... | [
"0.6558407",
"0.61820143",
"0.606619",
"0.606619",
"0.60055935",
"0.59309065",
"0.59278667",
"0.59261876",
"0.5895185",
"0.58719",
"0.5839021",
"0.5808222",
"0.5733102",
"0.57151586",
"0.5682637",
"0.5682637",
"0.5682637",
"0.56542355",
"0.56424844",
"0.56202424",
"0.557086",... | 0.6754284 | 0 |
=== Returns String:: newly created volume id | def volume_create(name)
@log.info "Creating volume #{name} from offering id #{DISK_OFFERING}..."
ret = @cloud_stack.create_volume(name, ZONE, DISK_OFFERING)
id = ret["createvolumeresponse"]["jobid"]
wait_for_job id
vol_id = ret["createvolumeresponse"]["id"]
@log.info "Created volume id: #{vol_id... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def volume_id\n #'2QQBRFJUIUI3M'\n #'AGC6G2PSSUVVD'\n '2QQBRFJUIUI3M'\nend",
"def new_id\n SecureRandom.uuid\n end",
"def create_id(parent)\n \"#{parent}/#{noid_service.mint}\"\n end",
"def id\n new_resource.bucket_name || new_resource.name\n end",
"def new_uuid\n UUIDTools::UUID.... | [
"0.70983297",
"0.6215809",
"0.6198638",
"0.61653876",
"0.60938424",
"0.6071201",
"0.6071201",
"0.60244596",
"0.6013174",
"0.6007021",
"0.6000296",
"0.5984143",
"0.5957065",
"0.5943107",
"0.59272367",
"0.5924147",
"0.59213006",
"0.59052986",
"0.5897565",
"0.5897365",
"0.589091... | 0.710625 | 0 |
Given a list of classes, modules, strings, and symbols, compile a combined list of methods. Classes and modules will be queried for their instance methods; strings and symbols will be treated as methods names. +include_ancestors+ determines whether to include methods defined by class/module ancestors. | def collect_methods(include_ancestors, *methods_or_modules)
methods_or_modules.inject([]) {|methods, method_or_module|
case method_or_module
when Symbol, String
methods << method_or_module.to_sym
when Module # also includes classes
methods.concat(method_or_module.instan... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def child_methods\n literals.select {|lit| lit.kind_of? CompiledMethod }\n end",
"def with_methods\n method_names = @director ? @director.methods_wrapped.map {|m| m.name } : []\n [self.code.methods].flatten.each do |method|\n next if do_not_wrap?(method)\n next if method_n... | [
"0.598585",
"0.59137535",
"0.57419205",
"0.56867117",
"0.5633375",
"0.562813",
"0.55664676",
"0.556154",
"0.55500615",
"0.55165553",
"0.5455936",
"0.54237115",
"0.534861",
"0.5342779",
"0.5341936",
"0.5335852",
"0.5322555",
"0.52851593",
"0.52813",
"0.52327096",
"0.5218546",
... | 0.75555813 | 0 |
POST /pumpers POST /pumpers.xml | def create
@timesheet = Incident.find(params[:incident_id]).timesheet
@pumper = @timesheet.pumpers.build(params[:pumper])
respond_to do |format|
if @pumper.save
format.html { redirect_to(edit_incident_timesheet_path, :notice => 'Pumper was successfully created.') }
else
format.html... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pump\n if event_params(:pump)['event'].present? && event_params(:pump)['event'].start_with?('pump')\n @pump_status = PumpStatus.new event_params(:pump)\n handle_event(@pump_status)\n else\n handle_event_missing(event_params(:name))\n end\n end",
"def post\n resource.post(request... | [
"0.52776605",
"0.5221963",
"0.52193856",
"0.5156656",
"0.50978374",
"0.50968605",
"0.5079734",
"0.50520784",
"0.5052003",
"0.50402105",
"0.50212264",
"0.501424",
"0.50077546",
"0.50070643",
"0.5002505",
"0.49670017",
"0.4966316",
"0.4966118",
"0.4963846",
"0.49554917",
"0.493... | 0.55116343 | 0 |
PUT /pumpers/1 PUT /pumpers/1.xml | def update
@pumper = Pumper.find(params[:id])
respond_to do |format|
if @pumper.update_attributes(params[:pumper])
format.html { redirect_to(incident_timesheet_path, :notice => 'Pumper was successfully updated.') }
format.xml { head :ok }
else
format.html { render :action =... | {
"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 update(id, name=\"Updated Name\", age=\"55\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <person>\r\n <id type='integer'>#{id}</id>\r\n ... | [
"0.593859",
"0.56422377",
"0.5545055",
"0.5525065",
"0.54254895",
"0.5371809",
"0.5352304",
"0.52863914",
"0.52292246",
"0.5166626",
"0.51535314",
"0.51159924",
"0.5077766",
"0.50560397",
"0.5049244",
"0.5030347",
"0.50280684",
"0.5011187",
"0.5009801",
"0.50001967",
"0.49911... | 0.6492535 | 0 |
DELETE /pumpers/1 DELETE /pumpers/1.xml | def destroy
@pumper = Pumper.find(params[:id])
@pumper.destroy
respond_to do |format|
format.html { redirect_to(incident_timesheet_path, :notice => 'Pumper was successfully deleted.') }
format.xml { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @pump_line = PumpLine.find(params[:id])\n @pump_line.destroy\n\n respond_to do |format|\n format.html { redirect_to(pump_lines_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @bail = Bail.find(params[:id])\n# @bail.destroy\n\n respond_to do |format|\n ... | [
"0.6565413",
"0.6254016",
"0.6202946",
"0.6142241",
"0.61337095",
"0.60871947",
"0.6065154",
"0.6047012",
"0.60249954",
"0.6003987",
"0.59886503",
"0.5985449",
"0.59829986",
"0.59601116",
"0.5948457",
"0.5939455",
"0.5933279",
"0.5933271",
"0.5929426",
"0.59246683",
"0.592381... | 0.7027457 | 0 |
Creates a new tape drive. API Key Scope: tape_drives / create | def create_tape_drive_by_tape_library(tape_library_id, tape_drive_body, opts = {})
data, _status_code, _headers = create_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_body, opts)
data
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.create_tape_drive_by_tape_library ...'\n end\n # verify the required parameter 'tape_library_id' is... | [
"0.63021094",
"0.60428596",
"0.59717923",
"0.59068936",
"0.58905965",
"0.58591753",
"0.57933575",
"0.5792216",
"0.5778003",
"0.5736325",
"0.5676669",
"0.5657668",
"0.56458384",
"0.56000763",
"0.55858815",
"0.554533",
"0.5535135",
"0.55304056",
"0.5523044",
"0.5489486",
"0.547... | 0.6305188 | 0 |
Creates a new tape drive. API Key Scope: tape_drives / create | def create_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: TapeDrivesApi.create_tape_drive_by_tape_library ...'
end
# verify the required parameter 'tape_library_id' is set
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_tape_drive_by_tape_library(tape_library_id, tape_drive_body, opts = {})\n data, _status_code, _headers = create_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_body, opts)\n data\n end",
"def create\n @drive_type = DriveType.new(params[:drive_type])\n\n respond... | [
"0.6305188",
"0.60428596",
"0.59717923",
"0.59068936",
"0.58905965",
"0.58591753",
"0.57933575",
"0.5792216",
"0.5778003",
"0.5736325",
"0.5676669",
"0.5657668",
"0.56458384",
"0.56000763",
"0.55858815",
"0.554533",
"0.5535135",
"0.55304056",
"0.5523044",
"0.5489486",
"0.5471... | 0.63021094 | 1 |
Destroys a specific tape drive. API Key Scope: tape_drives / destroy | def destroy_tape_drive_with_http_info(tape_drive_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: TapeDrivesApi.destroy_tape_drive ...'
end
# verify the required parameter 'tape_drive_id' is set
if @api_client.config.client_side_validation && t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @drive_system = DriveSystem.find(params[:id])\n @drive_system.destroy\n\n respond_to do |format|\n format.html { redirect_to drive_systems_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @drive = Drive.find(params[:id])\n @drive.destroy\n redire... | [
"0.66342604",
"0.6464231",
"0.64509064",
"0.6419975",
"0.6409487",
"0.63956195",
"0.635544",
"0.6342606",
"0.6198466",
"0.6121878",
"0.6118441",
"0.6088167",
"0.6083707",
"0.60709596",
"0.6001977",
"0.59700847",
"0.5956643",
"0.5937572",
"0.59049886",
"0.5880119",
"0.58669114... | 0.6995221 | 0 |
Lists all tape drives. API Key Scope: tape_drives / index | def index_tape_drives(opts = {})
data, _status_code, _headers = index_tape_drives_with_http_info(opts)
data
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index_tape_drives_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drives ...'\n end\n # resource path\n local_var_path = '/tape_drives'\n\n # query parameters\n query_params = opts[:query_p... | [
"0.7145547",
"0.60515314",
"0.5932642",
"0.5885706",
"0.5850183",
"0.5777759",
"0.5706362",
"0.55698645",
"0.55423415",
"0.5527133",
"0.5499193",
"0.549044",
"0.54562354",
"0.54384524",
"0.54235816",
"0.53935623",
"0.53863704",
"0.5376855",
"0.53569293",
"0.5346293",
"0.53373... | 0.7762862 | 0 |
Lists all tape drives. API Key Scope: tape_drives / index | def index_tape_drives_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drives ...'
end
# resource path
local_var_path = '/tape_drives'
# query parameters
query_params = opts[:query_params] || {}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index_tape_drives(opts = {})\n data, _status_code, _headers = index_tape_drives_with_http_info(opts)\n data\n end",
"def index\n @edrives = Edrive.all\n end",
"def show_tape_drive(tape_drive_id, opts = {})\n data, _status_code, _headers = show_tape_drive_with_http_info(tape_drive_id, ... | [
"0.7762862",
"0.60515314",
"0.5932642",
"0.5885706",
"0.5850183",
"0.5777759",
"0.5706362",
"0.55698645",
"0.55423415",
"0.5527133",
"0.5499193",
"0.549044",
"0.54562354",
"0.54384524",
"0.54235816",
"0.53935623",
"0.53863704",
"0.5376855",
"0.53569293",
"0.5346293",
"0.53373... | 0.7145547 | 1 |
Displays a specific tape drive. API Key Scope: tape_drives / show | def show_tape_drive(tape_drive_id, opts = {})
data, _status_code, _headers = show_tape_drive_with_http_info(tape_drive_id, opts)
data
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show_tape_drive_with_http_info(tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.show_tape_drive ...'\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation ... | [
"0.70864695",
"0.6920458",
"0.6709053",
"0.66499174",
"0.6584074",
"0.6512679",
"0.65099937",
"0.64887613",
"0.6330771",
"0.6254817",
"0.6240488",
"0.6100785",
"0.6093227",
"0.6079777",
"0.6067794",
"0.60480344",
"0.6000982",
"0.59681743",
"0.5950255",
"0.59392977",
"0.585355... | 0.7678166 | 0 |
Displays a specific tape drive. API Key Scope: tape_drives / show | def show_tape_drive_with_http_info(tape_drive_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: TapeDrivesApi.show_tape_drive ...'
end
# verify the required parameter 'tape_drive_id' is set
if @api_client.config.client_side_validation && tape_dr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show_tape_drive(tape_drive_id, opts = {})\n data, _status_code, _headers = show_tape_drive_with_http_info(tape_drive_id, opts)\n data\n end",
"def show\n @drive_system = DriveSystem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render ... | [
"0.7678166",
"0.6920458",
"0.6709053",
"0.66499174",
"0.6584074",
"0.6512679",
"0.65099937",
"0.64887613",
"0.6330771",
"0.6254817",
"0.6240488",
"0.6100785",
"0.6093227",
"0.6079777",
"0.6067794",
"0.60480344",
"0.6000982",
"0.59681743",
"0.5950255",
"0.59392977",
"0.5853559... | 0.70864695 | 1 |
Updates a specific tape drive. API Key Scope: tape_drives / update | def update_tape_drive(tape_drive_id, tape_drive_body, opts = {})
data, _status_code, _headers = update_tape_drive_with_http_info(tape_drive_id, tape_drive_body, opts)
data
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_tape_drive_with_http_info(tape_drive_id, tape_drive_body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.update_tape_drive ...'\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.cl... | [
"0.712367",
"0.6616173",
"0.66121894",
"0.64104354",
"0.63644916",
"0.6331657",
"0.6293863",
"0.6287805",
"0.6283083",
"0.61423874",
"0.6139561",
"0.609961",
"0.6066486",
"0.6029588",
"0.6025633",
"0.6020363",
"0.5999334",
"0.59709835",
"0.5869823",
"0.5869823",
"0.5855726",
... | 0.68816584 | 1 |
Updates a specific tape drive. API Key Scope: tape_drives / update | def update_tape_drive_with_http_info(tape_drive_id, tape_drive_body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: TapeDrivesApi.update_tape_drive ...'
end
# verify the required parameter 'tape_drive_id' is set
if @api_client.config.client_side_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_tape_drive(tape_drive_id, tape_drive_body, opts = {})\n data, _status_code, _headers = update_tape_drive_with_http_info(tape_drive_id, tape_drive_body, opts)\n data\n end",
"def update\n @drive = @object\n\n respond_to do |format|\n if @drive.update_attributes(params[:drive])\n... | [
"0.68816584",
"0.6616173",
"0.66121894",
"0.64104354",
"0.63644916",
"0.6331657",
"0.6293863",
"0.6287805",
"0.6283083",
"0.61423874",
"0.6139561",
"0.609961",
"0.6066486",
"0.6029588",
"0.6025633",
"0.6020363",
"0.5999334",
"0.59709835",
"0.5869823",
"0.5869823",
"0.5855726"... | 0.712367 | 0 |
unfollow for email notice type Model id Model id key email encode key | def unfollow
return render_404 if params[:type].blank? or params[:id].blank? or params[:key].blank?
email = Encoder.decode(params[:key])
return render_404 if email.blank?
Unfollower.create(:email => email,
:unfollowerable_type => params[:type].capitalize,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unfollow\n return render_404 if params[:type].blank? or params[:id].blank? or params[:key].blank?\n email = Encoder.decode(params[:key])\n return render_404 if email.blank?\n\n Unfollower.create(:email => email, \n :unfollowerable_type => params[:type].capitalize, \n ... | [
"0.7630782",
"0.6792433",
"0.6586819",
"0.6576068",
"0.6387172",
"0.62111574",
"0.6207159",
"0.61068124",
"0.6105808",
"0.60904616",
"0.6076346",
"0.6070551",
"0.60258234",
"0.5998773",
"0.5945903",
"0.5939272",
"0.5929783",
"0.59136593",
"0.58873963",
"0.5886025",
"0.5874274... | 0.77144367 | 0 |
returns true if this element is hydrogen | def h?
return element == "H"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def heptagonal?\n fcache[:heptagonal] ||= (Math.sqrt(40*self +9)+3)%10 == 0\n end",
"def homme?\n !identified? || sexe == 'H'\n end",
"def superShiny?\n return self.superHue.is_a?(Numeric) ? true : false\n end",
"def superShiny?\n return self.superHue.is_a?(Numeric) ? true : false\n end",
"... | [
"0.6151223",
"0.6149595",
"0.5937283",
"0.5937283",
"0.58571696",
"0.5825834",
"0.5710036",
"0.55765086",
"0.556458",
"0.55576277",
"0.5531311",
"0.55295855",
"0.54882056",
"0.5483861",
"0.5454947",
"0.5440434",
"0.5414432",
"0.54050237",
"0.53893125",
"0.5378633",
"0.5378187... | 0.7430685 | 0 |
calculates formal charge (method used to determine structure generation) | def formal_charge
if root?
lewis_electrons = 0
else #if an element is not the root, it is bonded to another element, thus increase the formal charge count by 1
lewis_electrons = 1
end
# if the element has nodes, look at each one
if nodes?
nodes.each { |node|
if node == nil # if the node ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def charge\n subtotal * 0\n end",
"def calMass(mass, charge)\n (mass + (charge.to_f * 1.00727646677)) / charge\n end",
"def calMass(mass, charge)\n (mass + (charge.to_f * 1.00727646677)) / charge\n end",
"def fixed_charges\n 20.0\n end",
"def calculate_charge\n # XXX Need to sele... | [
"0.69689447",
"0.67561746",
"0.67561746",
"0.6714563",
"0.6531566",
"0.63693446",
"0.63424987",
"0.62151253",
"0.61811197",
"0.61771446",
"0.6170233",
"0.6156192",
"0.6137016",
"0.6137016",
"0.611131",
"0.6045495",
"0.60120213",
"0.59990895",
"0.5981662",
"0.59777033",
"0.597... | 0.7276857 | 0 |
returns true if the element can expand its octet (bond to more elements) | def expands?
return PeriodicTable.atomic_number(element) > 13
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def paste_within?(element)\n i = 0\n element.each_byte do |b|\n if b == 32\n i += 1\n end\n end\n return true if i > 1\n end",
"def whole_reg?\n size == parent.size\n end",
"def can_contain?(element)\n false\n end",
"def instruction?\n no... | [
"0.601387",
"0.57836974",
"0.57396716",
"0.5709083",
"0.5543858",
"0.5498715",
"0.5401221",
"0.53878194",
"0.5362449",
"0.53407836",
"0.52675235",
"0.52675235",
"0.52554685",
"0.52554685",
"0.52339303",
"0.5233338",
"0.5202741",
"0.5199725",
"0.5171797",
"0.51586664",
"0.5156... | 0.6616966 | 0 |
read_in returns the file as an array | def read_in
File.foreach(file_name).map(&:chomp)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _read filename\n d = []\n File.open(filename).each { |line|\n d << line\n }\n return d\n end",
"def read_input\n ary = []\n File.open('./input.txt', 'r') do |file|\n file.each do |line|\n ary << line.to_s\n end\n end\n\n ary.freeze\nend",
"def read_input_file(input_path)\n ... | [
"0.7229379",
"0.7203641",
"0.7145829",
"0.7018414",
"0.701738",
"0.6934913",
"0.69124293",
"0.6893728",
"0.68787366",
"0.6861761",
"0.6787055",
"0.6716616",
"0.6702938",
"0.66436106",
"0.6636006",
"0.6630562",
"0.6575508",
"0.65720767",
"0.6569631",
"0.6548059",
"0.65473473",... | 0.7587839 | 0 |
write_out Args write out rows into file | def write_out(rows)
File.open(file_name, 'w') do |f|
f.puts rows
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def write_output\n rows = data_to_rows\n CSV.open(@filename, 'wb') do |csv|\n rows.each {|row| csv << row}\n end\n end",
"def writeOut\n\t\t\n\tend",
"def write_file(*args)\n end",
"def write_csv filename, fields = nil\n\n # By default all fields present in every row of output_data will be... | [
"0.7312231",
"0.65990204",
"0.64542145",
"0.6307653",
"0.6273513",
"0.6248603",
"0.6243873",
"0.6241665",
"0.6222821",
"0.6207732",
"0.61965597",
"0.6190774",
"0.61865544",
"0.6174986",
"0.61245054",
"0.609948",
"0.6091293",
"0.6089851",
"0.6081487",
"0.60417515",
"0.6038694"... | 0.81498796 | 0 |
Assign a ticket to a locker and then add it to the reservation list | def create(ticket)
ticket.assign_available_locker_from(@lockers)
add_ticket(ticket)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_ticket(ticket)\n @reservations[ticket.confirmation_number] = ticket\n end",
"def acquire!(locker)\n self.locked_by = locker\n self.locked_at = Time.now\n save!\n end",
"def set_ticket\n # is this ticket belong to him ?\n @ticket = @current_user.ticket(params[:id])\n end",
"de... | [
"0.7228647",
"0.65922964",
"0.6428284",
"0.6391993",
"0.6381478",
"0.61966723",
"0.6134835",
"0.6131066",
"0.61262554",
"0.6099354",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.... | 0.7773839 | 0 |
Convenience method used by the 'create' method to add a ticket to the reservations list | def add_ticket(ticket)
@reservations[ticket.confirmation_number] = ticket
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create(ticket)\n ticket.assign_available_locker_from(@lockers)\n add_ticket(ticket)\n end",
"def addToTicket\n\t ticket = Ticket.where(table: session[:table_id]).last\n\t if (ticket.nil?) || (ticket.tstatus == 9)\n\t ticket = Ticket.create(table: session[:table_id], \n\t\t\t\t\t\t\t\t\t\tta... | [
"0.73853683",
"0.70694196",
"0.6993661",
"0.67910016",
"0.6787675",
"0.67167544",
"0.6666845",
"0.6625049",
"0.6606425",
"0.65697473",
"0.65582234",
"0.6544546",
"0.6516965",
"0.6441469",
"0.6428814",
"0.63757074",
"0.63674206",
"0.6357647",
"0.6357063",
"0.6324764",
"0.63163... | 0.8438083 | 0 |
Remote a ticket from the the reservation list and free up the locker it used | def remove_ticket(ticket)
@lockers.unassign(ticket)
@reservations.delete(ticket.confirmation_number)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create(ticket)\n ticket.assign_available_locker_from(@lockers)\n add_ticket(ticket)\n end",
"def unassign(ticket)\n send(ticket.bag_size)[ticket.locker_number] = false\n end",
"def sell_ticket(attendee)\n Ticket.new(attendee, self)\n end",
"def free_tile_reservation!(hex, tile)\n... | [
"0.61614525",
"0.6154215",
"0.58809274",
"0.5789264",
"0.5787988",
"0.569142",
"0.56669515",
"0.56580925",
"0.55332184",
"0.5514392",
"0.5508313",
"0.5497386",
"0.54868853",
"0.5471839",
"0.54318106",
"0.5429231",
"0.54168993",
"0.5415598",
"0.5396788",
"0.53890294",
"0.53860... | 0.67043704 | 0 |
Proxy method over to the lockers object to simulate locker rooms being fully occupied | def fill_locker_room_for(locker_type)
lockers.fill_locker_room_for(locker_type)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def block_room\n\t\tself.room.set_occupied\n\tend",
"def lock\n if unlocked_status == false\n raise ArgumentError.new(\"You cannot lock this door - it is already locked\")\n else\n door_hash[:unlocked_status] = false\n end\n end",
"def acquire!(locker)\n self.locked_by = locker\n self... | [
"0.6763779",
"0.6554339",
"0.6551387",
"0.64560276",
"0.6400507",
"0.62908894",
"0.62346727",
"0.61693704",
"0.61508214",
"0.6089578",
"0.60702795",
"0.6055822",
"0.60428035",
"0.6017164",
"0.59920084",
"0.597811",
"0.5945651",
"0.5942091",
"0.59321225",
"0.5927075",
"0.58911... | 0.6746561 | 1 |
Make voice calls through the browser. This web request gets called by Twilio based on your Twilio settings, which can be modified at | def voice
from_number = params['FromNumber'].blank? ? ENV['TWILIO_CALLER_ID'] : params['FromNumber']
twiml = Twilio::TwiML::Response.new do |r|
if params['To'] and params['To'] != ''
r.Dial callerId: from_number do |d|
# wrap the phone number or client name in the appropriate TwiML verb
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def voice\n response = Twilio::TwiML::Response.new do |r|\n r.Say 'Hey there. Congrats on integrating Twilio into your Rails 4 app.', :voice => 'alice'\n r.Play 'http://linode.rabasa.com/cantina.mp3'\n end\n \n render_twiml response\n end",
"def voice\n # Give Twilio the TwiML payload i... | [
"0.6941941",
"0.685278",
"0.671485",
"0.6287461",
"0.62238187",
"0.62175095",
"0.6157951",
"0.6140277",
"0.6009408",
"0.5933411",
"0.59127563",
"0.5902672",
"0.58733183",
"0.5809024",
"0.57945144",
"0.5780976",
"0.5671255",
"0.56499344",
"0.56469446",
"0.5625455",
"0.55781907... | 0.7038924 | 0 |
POST /espetaculos POST /espetaculos.json | def create
@espetaculo = Espetaculo.new(espetaculo_params)
respond_to do |format|
if @espetaculo.save
format.html { redirect_to @espetaculo, notice: 'Espetaculo was successfully created.' }
format.json { render :show, status: :created, location: @espetaculo }
else
format.htm... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @respuesta = Respuesta.new(params[:respuesta])\n\n if @respuesta.save\n render json: @respuesta, status: :created, location: @respuesta\n else\n render json: @respuesta.errors, status: :unprocessable_entity\n end\n end",
"def troca\n @remetente = Sobrevivente.where(id: para... | [
"0.6629244",
"0.6479606",
"0.6433449",
"0.6382739",
"0.63549143",
"0.63375264",
"0.629571",
"0.62704456",
"0.6267636",
"0.62673527",
"0.62503576",
"0.62459356",
"0.62421227",
"0.6222371",
"0.62162644",
"0.6209373",
"0.61993676",
"0.6177276",
"0.6167893",
"0.6167577",
"0.61618... | 0.66372675 | 0 |
GET /insurances/new GET /insurances/new.json | def new
@breadcrumb = 'create'
@insurance = Insurance.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @insurance }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @life_insurance = LifeInsurance.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @life_insurance }\n end\n end",
"def new\n @encounter = Encounter.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { rend... | [
"0.7366726",
"0.73468244",
"0.73156685",
"0.71787214",
"0.7176036",
"0.71592754",
"0.71096146",
"0.7084484",
"0.7068973",
"0.7048612",
"0.70114356",
"0.6992487",
"0.69218963",
"0.68838876",
"0.68780994",
"0.68759686",
"0.6850693",
"0.68302166",
"0.6823267",
"0.6812231",
"0.68... | 0.7853387 | 0 |
POST /insurances POST /insurances.json | def create
@breadcrumb = 'create'
@insurance = Insurance.new(params[:insurance])
@insurance.created_by = current_user.id if !current_user.nil?
respond_to do |format|
if @insurance.save
format.html { redirect_to @insurance, notice: crud_notice('created', @insurance) }
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create(params = {})\n wrapped_params = { insurance: params }\n @client.make_request(:post, 'insurances', MODEL_CLASS, wrapped_params)\n end",
"def create\n #@incident = @quote.incidents.new(incident_params)\n logger.info params[:incident]\n params[:incident].each do |incident|\n @inciden... | [
"0.7151013",
"0.6132172",
"0.59771764",
"0.59539306",
"0.5942133",
"0.59162223",
"0.5895912",
"0.5865056",
"0.579359",
"0.5790205",
"0.57873964",
"0.5753976",
"0.57309014",
"0.5715159",
"0.5672575",
"0.5667512",
"0.5647055",
"0.5643143",
"0.5633308",
"0.5633308",
"0.5629852",... | 0.62235224 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.