query
stringlengths
7
9.55k
document
stringlengths
10
363k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Get infra segment port by ID Get detail information on an infra segment port by giving ID.
def get_infra_segment_port_with_http_info(segment_id, port_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_segment_port ...' end # verify the required parameter 'segment_id' is set if @api_client.config.client_side_validation && segment_id.nil? fail ArgumentError, "Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_segment_port" end # verify the required parameter 'port_id' is set if @api_client.config.client_side_validation && port_id.nil? fail ArgumentError, "Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_segment_port" end # resource path local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'SegmentPort') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsPortsApi#get_infra_segment_port\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_port(id)\n if port_valid?(id)\n @port[id]\n else\n raise RuntimeError, \"port (#{id}) does not exist for #{self}\"\n end\n end", "def get_infra_segment_port(segment_id, port_id, opts = {})\n data, _status_code, _headers = get_infra_segment_port_with_http_i...
[ "0.679937", "0.65083134", "0.65083134", "0.6380113", "0.61166555", "0.5807281", "0.5807281", "0.57703", "0.56931674", "0.56918156", "0.56918156", "0.5658188", "0.5658188", "0.5649823", "0.5649823", "0.5646096", "0.5618963", "0.5616427", "0.5542724", "0.5542724", "0.55405664",...
0.6429541
4
Get infra segment port by ID Get detail information on an infra segment port by giving ID.
def get_infra_segment_port_0(segment_id, port_id, opts = {}) data, _status_code, _headers = get_infra_segment_port_0_with_http_info(segment_id, port_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_port(id)\n if port_valid?(id)\n @port[id]\n else\n raise RuntimeError, \"port (#{id}) does not exist for #{self}\"\n end\n end", "def get_infra_segment_port(segment_id, port_id, opts = {})\n data, _status_code, _headers = get_infra_segment_port_with_http_i...
[ "0.679937", "0.65083134", "0.65083134", "0.6429541", "0.6429541", "0.6380113", "0.5807281", "0.5807281", "0.57703", "0.56931674", "0.56918156", "0.56918156", "0.5658188", "0.5658188", "0.5649823", "0.5649823", "0.5646096", "0.5618963", "0.5616427", "0.5542724", "0.5542724", ...
0.61166555
6
Get infra segment port by ID Get detail information on an infra segment port by giving ID.
def get_infra_segment_port_0_with_http_info(segment_id, port_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_segment_port_0 ...' end # verify the required parameter 'segment_id' is set if @api_client.config.client_side_validation && segment_id.nil? fail ArgumentError, "Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_segment_port_0" end # verify the required parameter 'port_id' is set if @api_client.config.client_side_validation && port_id.nil? fail ArgumentError, "Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_infra_segment_port_0" end # resource path local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'SegmentPort') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsPortsApi#get_infra_segment_port_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_port(id)\n if port_valid?(id)\n @port[id]\n else\n raise RuntimeError, \"port (#{id}) does not exist for #{self}\"\n end\n end", "def get_infra_segment_port(segment_id, port_id, opts = {})\n data, _status_code, _headers = get_infra_segment_port_with_http_i...
[ "0.6799415", "0.6509573", "0.6509573", "0.6429739", "0.6429739", "0.61182874", "0.58084065", "0.58084065", "0.577086", "0.5693864", "0.56919456", "0.56919456", "0.56591517", "0.56591517", "0.56495345", "0.56495345", "0.5646159", "0.56193", "0.5616971", "0.55428857", "0.554288...
0.6380637
5
Get Tier1 segment port by ID Get detail information on a Tier1 segment port by giving ID.
def get_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {}) data, _status_code, _headers = get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port ...'\n end\n # verify the required parameter 'tier_1_id' i...
[ "0.6672503", "0.66418344", "0.6600694", "0.65811145", "0.63239557", "0.6299877", "0.6252428", "0.62009776", "0.6066235", "0.60572195", "0.6037117", "0.5935328", "0.5934927", "0.5934858", "0.5934156", "0.5844328", "0.58353436", "0.58300275", "0.5798993", "0.57891256", "0.57439...
0.68667036
1
Get Tier1 segment port by ID Get detail information on a Tier1 segment port by giving ID.
def get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port ...' end # verify the required parameter 'tier_1_id' is set if @api_client.config.client_side_validation && tier_1_id.nil? fail ArgumentError, "Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port" end # verify the required parameter 'segment_id' is set if @api_client.config.client_side_validation && segment_id.nil? fail ArgumentError, "Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port" end # verify the required parameter 'port_id' is set if @api_client.config.client_side_validation && port_id.nil? fail ArgumentError, "Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port" end # resource path local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'SegmentPort') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsPortsApi#get_tier1_segment_port\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers...
[ "0.68667036", "0.68667036", "0.66418344", "0.6600694", "0.65811145", "0.63239557", "0.6299877", "0.6252428", "0.62009776", "0.6066235", "0.60572195", "0.6037117", "0.5935328", "0.5934927", "0.5934858", "0.5934156", "0.5844328", "0.58353436", "0.58300275", "0.5798993", "0.5789...
0.6672503
2
Get Tier1 segment port by ID Get detail information on a Tier1 segment port by giving ID.
def get_tier1_segment_port_0(tier_1_id, segment_id, port_id, opts = {}) data, _status_code, _headers = get_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers...
[ "0.68675846", "0.68675846", "0.66726923", "0.6641988", "0.65814173", "0.6325217", "0.6301012", "0.6253712", "0.62022257", "0.6068872", "0.6058283", "0.6038137", "0.5936513", "0.5935968", "0.5935382", "0.59346473", "0.58421206", "0.5835746", "0.5832592", "0.5799486", "0.579209...
0.6601945
4
Get Tier1 segment port by ID Get detail information on a Tier1 segment port by giving ID.
def get_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port_0 ...' end # verify the required parameter 'tier_1_id' is set if @api_client.config.client_side_validation && tier_1_id.nil? fail ArgumentError, "Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port_0" end # verify the required parameter 'segment_id' is set if @api_client.config.client_side_validation && segment_id.nil? fail ArgumentError, "Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port_0" end # verify the required parameter 'port_id' is set if @api_client.config.client_side_validation && port_id.nil? fail ArgumentError, "Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port_0" end # resource path local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'SegmentPort') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsPortsApi#get_tier1_segment_port_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end", "def get_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers...
[ "0.68674576", "0.68674576", "0.6672248", "0.6641533", "0.6601669", "0.6324243", "0.6301627", "0.625437", "0.62011814", "0.6068168", "0.60575575", "0.60373956", "0.5936771", "0.59356433", "0.59348065", "0.5934063", "0.58414364", "0.5835128", "0.583184", "0.57998693", "0.579051...
0.658089
5
List infra segment ports List all the ports for an infra.
def list_infra_segment_ports(segment_id, opts = {}) data, _status_code, _headers = list_infra_segment_ports_with_http_info(segment_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inports\n all_ports :in\n end", "def index\n @dev_ports = DevPort.all\n end", "def index\n @port_services = PortService.all\n end", "def index\n @ports = Port.all\n end", "def san_network_ports\n if san_nics.length == sans.length \n san_nics.map {|x| x.port_name }\n else\...
[ "0.6304615", "0.61906093", "0.6108234", "0.60806197", "0.6078126", "0.60616904", "0.60574394", "0.5943002", "0.5907624", "0.5829457", "0.58202255", "0.580119", "0.57458794", "0.5739639", "0.573062", "0.56523323", "0.55792624", "0.55573446", "0.55300856", "0.5516732", "0.54317...
0.6585313
1
List infra segment ports List all the ports for an infra.
def list_infra_segment_ports_with_http_info(segment_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports ...' end # verify the required parameter 'segment_id' is set if @api_client.config.client_side_validation && segment_id.nil? fail ArgumentError, "Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports" end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports, must be smaller than or equal to 1000.' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports, must be greater than or equal to 0.' end # resource path local_var_path = '/infra/segments/{segment-id}/ports'.sub('{' + 'segment-id' + '}', segment_id.to_s) # query parameters query_params = {} query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil? query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil? query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil? query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'SegmentPortListResult') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_infra_segment_ports\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_infra_segment_ports(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_with_http_info(segment_id, opts)\n data\n end", "def list_infra_segment_ports(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_with_http_info(segment_id,...
[ "0.6585313", "0.6585313", "0.6304615", "0.61906093", "0.6108234", "0.60806197", "0.6078126", "0.60616904", "0.60574394", "0.5943002", "0.5907624", "0.5829457", "0.58202255", "0.580119", "0.57458794", "0.5739639", "0.573062", "0.56523323", "0.55792624", "0.55573446", "0.553008...
0.53637207
28
List infra segment ports List all the ports for an infra.
def list_infra_segment_ports_0(segment_id, opts = {}) data, _status_code, _headers = list_infra_segment_ports_0_with_http_info(segment_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_infra_segment_ports(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_with_http_info(segment_id, opts)\n data\n end", "def list_infra_segment_ports(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_with_http_info(segment_id,...
[ "0.6585313", "0.6585313", "0.6304615", "0.61906093", "0.6108234", "0.60806197", "0.6078126", "0.60574394", "0.5943002", "0.5907624", "0.5829457", "0.58202255", "0.580119", "0.57458794", "0.5739639", "0.573062", "0.56523323", "0.55792624", "0.55573446", "0.55300856", "0.551673...
0.60616904
7
List infra segment ports List all the ports for an infra.
def list_infra_segment_ports_0_with_http_info(segment_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports_0 ...' end # verify the required parameter 'segment_id' is set if @api_client.config.client_side_validation && segment_id.nil? fail ArgumentError, "Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports_0" end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports_0, must be smaller than or equal to 1000.' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling PolicyNetworkingConnectivitySegmentsPortsApi.list_infra_segment_ports_0, must be greater than or equal to 0.' end # resource path local_var_path = '/global-infra/segments/{segment-id}/ports'.sub('{' + 'segment-id' + '}', segment_id.to_s) # query parameters query_params = {} query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil? query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil? query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil? query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'SegmentPortListResult') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_infra_segment_ports_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_infra_segment_ports(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_with_http_info(segment_id, opts)\n data\n end", "def list_infra_segment_ports(segment_id, opts = {})\n data, _status_code, _headers = list_infra_segment_ports_with_http_info(segment_id,...
[ "0.6584873", "0.6584873", "0.63043344", "0.6189929", "0.6107027", "0.6079997", "0.6078611", "0.606136", "0.60575294", "0.59425247", "0.5907358", "0.583002", "0.58196825", "0.580064", "0.5745751", "0.5739763", "0.5730383", "0.5651597", "0.55790615", "0.5557052", "0.55295897", ...
0.5328547
32
List Tier1 segment ports List all the ports for a Tier1 segment.
def list_tier1_segment_ports(tier_1_id, segment_id, opts = {}) data, _status_code, _headers = list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_tier1_segment_ports_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segment_ports_0_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debuggin...
[ "0.6994915", "0.6221761", "0.6121615", "0.60014147", "0.59671587", "0.5894916", "0.57975626", "0.5783449", "0.5721173", "0.5714401", "0.57119435", "0.564467", "0.564467", "0.5567651", "0.5560343", "0.5478147", "0.54590434", "0.5425581", "0.54168046", "0.5408152", "0.5402787",...
0.73961496
0
List Tier1 segment ports List all the ports for a Tier1 segment.
def list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports ...' end # verify the required parameter 'tier_1_id' is set if @api_client.config.client_side_validation && tier_1_id.nil? fail ArgumentError, "Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports" end # verify the required parameter 'segment_id' is set if @api_client.config.client_side_validation && segment_id.nil? fail ArgumentError, "Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports" end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports, must be smaller than or equal to 1000.' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports, must be greater than or equal to 0.' end # resource path local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s) # query parameters query_params = {} query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil? query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil? query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil? query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'SegmentPortListResult') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_tier1_segment_ports\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_tier1_segment_ports(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def list_tier1_segment_ports_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segme...
[ "0.73961496", "0.6994915", "0.6121615", "0.60014147", "0.59671587", "0.5894916", "0.57975626", "0.5783449", "0.5721173", "0.5714401", "0.57119435", "0.564467", "0.564467", "0.5567651", "0.5560343", "0.5478147", "0.54590434", "0.5425581", "0.54168046", "0.5408152", "0.5402787"...
0.6221761
2
List Tier1 segment ports List all the ports for a Tier1 segment.
def list_tier1_segment_ports_0(tier_1_id, segment_id, opts = {}) data, _status_code, _headers = list_tier1_segment_ports_0_with_http_info(tier_1_id, segment_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_tier1_segment_ports(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts = {})\n if @api_client.config.debugging\n ...
[ "0.73961496", "0.6221761", "0.6121615", "0.60014147", "0.59671587", "0.5894916", "0.57975626", "0.5783449", "0.5721173", "0.5714401", "0.57119435", "0.564467", "0.564467", "0.5567651", "0.5560343", "0.5478147", "0.54590434", "0.5425581", "0.54168046", "0.5408152", "0.5402787"...
0.6994915
1
List Tier1 segment ports List all the ports for a Tier1 segment.
def list_tier1_segment_ports_0_with_http_info(tier_1_id, segment_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_0 ...' end # verify the required parameter 'tier_1_id' is set if @api_client.config.client_side_validation && tier_1_id.nil? fail ArgumentError, "Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_0" end # verify the required parameter 'segment_id' is set if @api_client.config.client_side_validation && segment_id.nil? fail ArgumentError, "Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_0" end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_0, must be smaller than or equal to 1000.' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling PolicyNetworkingConnectivitySegmentsPortsApi.list_tier1_segment_ports_0, must be greater than or equal to 0.' end # resource path local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s) # query parameters query_params = {} query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil? query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil? query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil? query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'SegmentPortListResult') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsPortsApi#list_tier1_segment_ports_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_tier1_segment_ports(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segment_ports_with_http_info(tier_1_id, segment_id, opts)\n data\n end", "def list_tier1_segment_ports_0(tier_1_id, segment_id, opts = {})\n data, _status_code, _headers = list_tier1_segme...
[ "0.73965734", "0.69955516", "0.6222411", "0.60023457", "0.5965747", "0.5896025", "0.5795441", "0.57811743", "0.5718091", "0.57126063", "0.57095695", "0.5646011", "0.5646011", "0.55688214", "0.55582154", "0.547859", "0.54564196", "0.5423515", "0.54148567", "0.5406033", "0.5400...
0.6122332
3
Patch an infra segment port Create an infra segment port if it does not exist based on the IDs, or update existing port information by replacing the port object fields which presents in the request body.
def patch_infra_segment_port(segment_id, port_id, segment_port, opts = {}) patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts) nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_segment_port ...'\n end\n # verify the required parameter 'segme...
[ "0.664973", "0.664973", "0.662917", "0.6542741", "0.649528", "0.649528", "0.6400293", "0.637784", "0.6031174", "0.60145444", "0.59648347", "0.59648347", "0.5906005", "0.5906005", "0.58422637", "0.5786168", "0.5729818", "0.57155526", "0.57020277", "0.5692224", "0.5689798", "...
0.6765491
1
Patch an infra segment port Create an infra segment port if it does not exist based on the IDs, or update existing port information by replacing the port object fields which presents in the request body.
def patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_segment_port ...' end # verify the required parameter 'segment_id' is set if @api_client.config.client_side_validation && segment_id.nil? fail ArgumentError, "Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_segment_port" end # verify the required parameter 'port_id' is set if @api_client.config.client_side_validation && port_id.nil? fail ArgumentError, "Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_segment_port" end # verify the required parameter 'segment_port' is set if @api_client.config.client_side_validation && segment_port.nil? fail ArgumentError, "Missing the required parameter 'segment_port' when calling PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_segment_port" end # resource path local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(segment_port) auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsPortsApi#patch_infra_segment_port\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch_infra_segment_port(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_infra_segment_port(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_with_http_info(segme...
[ "0.67659867", "0.67659867", "0.6629633", "0.6542348", "0.6495142", "0.6495142", "0.64018244", "0.6377367", "0.60335255", "0.60168886", "0.59638894", "0.59638894", "0.5906643", "0.5906643", "0.5844488", "0.57846606", "0.5729075", "0.57158774", "0.57021433", "0.5691512", "0.569...
0.6650553
3
Patch an infra segment port Create an infra segment port if it does not exist based on the IDs, or update existing port information by replacing the port object fields which presents in the request body.
def patch_infra_segment_port_0(segment_id, port_id, segment_port, opts = {}) patch_infra_segment_port_0_with_http_info(segment_id, port_id, segment_port, opts) nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch_infra_segment_port(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_infra_segment_port(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_with_http_info(segme...
[ "0.6764421", "0.6764421", "0.66494536", "0.66494536", "0.66286886", "0.6494407", "0.6494407", "0.64019126", "0.637683", "0.60324186", "0.6015857", "0.5963122", "0.5963122", "0.59069395", "0.59069395", "0.5843229", "0.5784217", "0.57292145", "0.5715677", "0.57020575", "0.56916...
0.65411717
5
Patch an infra segment port Create an infra segment port if it does not exist based on the IDs, or update existing port information by replacing the port object fields which presents in the request body.
def patch_infra_segment_port_0_with_http_info(segment_id, port_id, segment_port, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_segment_port_0 ...' end # verify the required parameter 'segment_id' is set if @api_client.config.client_side_validation && segment_id.nil? fail ArgumentError, "Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_segment_port_0" end # verify the required parameter 'port_id' is set if @api_client.config.client_side_validation && port_id.nil? fail ArgumentError, "Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_segment_port_0" end # verify the required parameter 'segment_port' is set if @api_client.config.client_side_validation && segment_port.nil? fail ArgumentError, "Missing the required parameter 'segment_port' when calling PolicyNetworkingConnectivitySegmentsPortsApi.patch_infra_segment_port_0" end # resource path local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(segment_port) auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsPortsApi#patch_infra_segment_port_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch_infra_segment_port(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts)\n nil\n end", "def patch_infra_segment_port(segment_id, port_id, segment_port, opts = {})\n patch_infra_segment_port_with_http_info(segme...
[ "0.6763732", "0.6763732", "0.66494226", "0.66494226", "0.6541392", "0.64953655", "0.64953655", "0.6400876", "0.63778764", "0.6032902", "0.6015575", "0.59633845", "0.59633845", "0.5906623", "0.5906623", "0.5843207", "0.57849133", "0.5729158", "0.5714489", "0.57009923", "0.5691...
0.6628931
4
Patch a Tier1 segment port Create a Tier1 segment port if it does not exist based on the IDs, or update existing port information by replacing the port object fields which presents in the request body.
def patch_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {}) patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts) nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_tier1_segment_port ...'\n end\n # verify the required param...
[ "0.7169536", "0.7166977", "0.71280086", "0.69106746", "0.68360215", "0.68137985", "0.67047143", "0.6367438", "0.63607687", "0.6309049", "0.6309049", "0.6254311", "0.6152272", "0.57754004", "0.57699335", "0.5726195", "0.5702035", "0.5686311", "0.5637342", "0.5602462", "0.56024...
0.69880193
4
Patch a Tier1 segment port Create a Tier1 segment port if it does not exist based on the IDs, or update existing port information by replacing the port object fields which presents in the request body.
def patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_tier1_segment_port ...' end # verify the required parameter 'tier_1_id' is set if @api_client.config.client_side_validation && tier_1_id.nil? fail ArgumentError, "Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.patch_tier1_segment_port" end # verify the required parameter 'segment_id' is set if @api_client.config.client_side_validation && segment_id.nil? fail ArgumentError, "Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.patch_tier1_segment_port" end # verify the required parameter 'port_id' is set if @api_client.config.client_side_validation && port_id.nil? fail ArgumentError, "Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.patch_tier1_segment_port" end # verify the required parameter 'segment_port' is set if @api_client.config.client_side_validation && segment_port.nil? fail ArgumentError, "Missing the required parameter 'segment_port' when calling PolicyNetworkingConnectivitySegmentsPortsApi.patch_tier1_segment_port" end # resource path local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(segment_port) auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_tier1_segment_port ...'\n end\n # verify the required param...
[ "0.71666825", "0.712756", "0.69874674", "0.69874674", "0.6909951", "0.68357044", "0.68134946", "0.67042327", "0.6366846", "0.6360169", "0.63080263", "0.63080263", "0.62536114", "0.6151043", "0.57748175", "0.5769342", "0.57255197", "0.57017475", "0.5686247", "0.56371486", "0.5...
0.7169248
0
Patch a Tier1 segment port Create a Tier1 segment port if it does not exist based on the IDs, or update existing port information by replacing the port object fields which presents in the request body.
def patch_tier1_segment_port_0(tier_1_id, segment_id, port_id, segment_port, opts = {}) patch_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts) nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_tier1_segment_port ...'\n end\n # verify the required param...
[ "0.71684194", "0.716586", "0.71267116", "0.69879246", "0.69879246", "0.68352413", "0.68130374", "0.6703795", "0.6365272", "0.6358633", "0.6309356", "0.6309356", "0.6252", "0.61525935", "0.5773224", "0.5767777", "0.57239", "0.57007545", "0.56862766", "0.5636347", "0.5602766", ...
0.69105345
5
Patch a Tier1 segment port Create a Tier1 segment port if it does not exist based on the IDs, or update existing port information by replacing the port object fields which presents in the request body.
def patch_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_tier1_segment_port_0 ...' end # verify the required parameter 'tier_1_id' is set if @api_client.config.client_side_validation && tier_1_id.nil? fail ArgumentError, "Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.patch_tier1_segment_port_0" end # verify the required parameter 'segment_id' is set if @api_client.config.client_side_validation && segment_id.nil? fail ArgumentError, "Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.patch_tier1_segment_port_0" end # verify the required parameter 'port_id' is set if @api_client.config.client_side_validation && port_id.nil? fail ArgumentError, "Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.patch_tier1_segment_port_0" end # verify the required parameter 'segment_port' is set if @api_client.config.client_side_validation && segment_port.nil? fail ArgumentError, "Missing the required parameter 'segment_port' when calling PolicyNetworkingConnectivitySegmentsPortsApi.patch_tier1_segment_port_0" end # resource path local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(segment_port) auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsPortsApi#patch_tier1_segment_port_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.patch_tier1_segment_port ...'\n end\n # verify the required param...
[ "0.71695304", "0.7166947", "0.6988407", "0.6988407", "0.6911057", "0.6836256", "0.6814012", "0.67047155", "0.6367757", "0.63610816", "0.63100046", "0.63100046", "0.62544256", "0.6153126", "0.57759106", "0.57704246", "0.57265", "0.5702354", "0.5685563", "0.56376857", "0.560171...
0.7127818
2
GET /subscriptions GET /subscriptions.json
def index @subscriptions = current_user.subscriptions.select{|s| s.manga !=nil && s.manga.display_name != nil && s.manga.name!=nil}.sort_by{|s| s.manga.display_name} respond_to do |format| format.html # index.html.erb format.json { render json: @subscriptions } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subscriptions\n url = url_with_api_version(@base_url, 'subscriptions')\n resp = rest_get(url)\n JSON.parse(resp.body)[\"value\"]\n end", "def all_subscriptions\n get(url_(\"subscription\"))\n end", "def list_subscriptions(user)\n get(\"/#{user}/lists/subscriptions...
[ "0.8178023", "0.8074406", "0.79446816", "0.76912534", "0.7649479", "0.7582659", "0.75117826", "0.74919003", "0.7431205", "0.7413858", "0.7406451", "0.7406451", "0.7404672", "0.738646", "0.73743445", "0.73743445", "0.73651445", "0.7320728", "0.7301819", "0.72662437", "0.726576...
0.6472775
87
GET /subscriptions/1 GET /subscriptions/1.json
def show @subscription = current_user.subscriptions.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @subscription } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subscriptions\n url = url_with_api_version(@base_url, 'subscriptions')\n resp = rest_get(url)\n JSON.parse(resp.body)[\"value\"]\n end", "def list_subscriptions(user)\n get(\"/#{user}/lists/subscriptions.json\")\n end", "def all_subscriptions\n get(url_(\"subscripti...
[ "0.7863251", "0.75726175", "0.7567996", "0.74486554", "0.734854", "0.73362416", "0.73362416", "0.72566754", "0.7242567", "0.7242567", "0.7242567", "0.7242567", "0.7234481", "0.7231595", "0.7203714", "0.71969527", "0.71899897", "0.7187209", "0.71870315", "0.711318", "0.7095060...
0.7584557
2
GET /subscriptions/new GET /subscriptions/new.json
def new @subscription = current_user.subscriptions.new respond_to do |format| format.html # new.html.erb format.json { render json: @subscription } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { ren...
[ "0.7998553", "0.7998553", "0.7998553", "0.7998553", "0.7998553", "0.7978949", "0.79177266", "0.76547056", "0.74179745", "0.73993707", "0.73714405", "0.73714405", "0.73714405", "0.7319926", "0.7289597", "0.72751695", "0.72751695", "0.72686833", "0.722522", "0.72178036", "0.721...
0.82933676
0
POST /subscriptions POST /subscriptions.json
def create @subscription = current_user.subscriptions.new manga = Manga.find(params[:manga_id]) @subscription.manga_id=manga.id respond_to do |format| if @subscription.save format.html { redirect_to mangas_path, notice: 'Successfully subscribed to '+ manga.display_name.to_s} format.json { render json: @subscription, status: :created, location: @subscription } else format.html { render action: "new" } format.json { render json: @subscription.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n megam_rest.post_subscriptions(to_hash)\n end", "def post body=nil, headers={}\n @connection.post \"subscriptions.json\", body, headers\n end", "def create\n @subscription = Subscription.new(subscription_params)\n\n if @subscription.save\n render json: @...
[ "0.7878452", "0.78267294", "0.7648211", "0.7545708", "0.7432098", "0.7428383", "0.7351888", "0.7329232", "0.7227739", "0.7155769", "0.7136345", "0.7112945", "0.71125585", "0.7020447", "0.7004615", "0.69523484", "0.6893254", "0.68890435", "0.6831791", "0.68234247", "0.6818618"...
0.66208965
31
PUT /subscriptions/1 PUT /subscriptions/1.json
def update @subscription = current_user.subscriptions.find(params[:id]) respond_to do |format| if @subscription.update_attributes(params[:subscription]) format.html { redirect_to @subscription, notice: 'Subscription was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @subscription.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @subscription = Subscription.get(params[:id])\n @subscription.update(params[:subscription])\n respond_with(@subscription.reload)\n end", "def update\n @subscription = Subscription.find(params[:id])\n\n if @subscription.update(subscription_params)\n head :no_content\n else\n ...
[ "0.73311466", "0.7281468", "0.72590774", "0.70495903", "0.6968479", "0.69529593", "0.69452065", "0.69452065", "0.69452065", "0.68587536", "0.68458587", "0.68379724", "0.68211967", "0.68088424", "0.6798248", "0.6798027", "0.6798027", "0.674952", "0.67362535", "0.67362535", "0....
0.7120728
3
DELETE /subscriptions/1 DELETE /subscriptions/1.json
def destroy @subscription = current_user.subscriptions.find(params[:id]) manga = Manga.find(@subscription.manga_id) @subscription.destroy respond_to do |format| format.html { redirect_to mangas_url, notice: 'Successfully unsubscribed to '+ manga.display_name.to_s} format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete options={}, headers={}\n @connection.delete \"subscriptions.json\", options, headers\n end", "def destroy\n subscription = current_user.subscriptions.find(params[:id])\n subscription.destroy!\n\n render json: { status: 'success'}\n end", "def delete_subscriptions\n end", ...
[ "0.8083839", "0.7971518", "0.7749676", "0.77227986", "0.76973474", "0.76788694", "0.76788694", "0.76788694", "0.76788694", "0.766344", "0.75745755", "0.75494754", "0.75242066", "0.7512467", "0.74898785", "0.74766344", "0.74766344", "0.74766344", "0.74766344", "0.74766344", "0...
0.7328218
29
END CONFIG Print Message
def pp(message) puts "[#{NAME}] #{message}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def logoutConfig(conf)\n\tif conf[:saveDirs].empty?\n\tputs \"no Directories specified in #{Kconfig}\"\n\texit 1\nend\nputs 'backing up Directories:'\nconf[:saveDirs].each { |e|\tputs e}\n\nunless conf[:exFiles].empty?\nputs \"\\nexcluding all Files like:\"\n\tconf[:exFiles].each { |e| puts e}\nend\nunless conf[:...
[ "0.633585", "0.631836", "0.59957033", "0.58420956", "0.5725633", "0.57101995", "0.5704497", "0.56041825", "0.55995107", "0.5522435", "0.5471395", "0.5446423", "0.5441272", "0.5427403", "0.5410598", "0.539425", "0.5305412", "0.52961475", "0.5268462", "0.5265129", "0.52420586",...
0.0
-1
Get all messages and mark them as read. args: imap object and imap folder name
def markMail(imap, folder) pp "MARKED #{folder}.." message_ids = imap.uid_search("ALL") imap.uid_store(message_ids, "+FLAGS", [:Seen]) imap.expunge end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_messages_via_imap\n\timap = Net::IMAP.new(server,port,usessl)\n\timap.login(mailid,password)\n\timap.select(folder)\n\tsince = included.blank? ? \"1-Jan-2000\" : included.yesterday.to_date.strftime(\"%e-%b-%Y\")\n\timap.uid_search([\"SINCE\",since]).each do |msg_id|\n\t\tnext unless mailmessages.find_by_u...
[ "0.8045776", "0.69213146", "0.6893285", "0.66984016", "0.66798705", "0.6635894", "0.6570545", "0.6560365", "0.64427227", "0.6433573", "0.64103264", "0.6405727", "0.6385271", "0.63177586", "0.629245", "0.629245", "0.6258488", "0.6251408", "0.6226226", "0.6223255", "0.61852163"...
0.6507441
8
Get all messages and delete them. args: imap object and imap folder name
def delMail(imap, folder) pp "Emptying #{folder}.." message_ids = imap.uid_search("ALL") imap.uid_store(message_ids, "+FLAGS", [:Deleted]) imap.expunge end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_messages\n @connection.select('INBOX')\n @connection.search(['ALL']).each do |message_id|\n msg = @connection.fetch(message_id,'RFC822')[0].attr['RFC822']\n begin\n process_message(msg)\n rescue\n handle_bogus_message(msg)\n end\n # Mark messag...
[ "0.715117", "0.68141574", "0.674943", "0.67229223", "0.6708495", "0.66098094", "0.6487989", "0.6344507", "0.6304122", "0.62503076", "0.6232955", "0.6195238", "0.61682206", "0.60330945", "0.5964698", "0.5903679", "0.5897541", "0.5870347", "0.5858864", "0.5800321", "0.5775095",...
0.7870711
0
Get the current folder size and the loop until the number of messages increases. Display the subject of each new email recieved while in the loop.
def watchMail(imap, folder) # Loop for checking message increase in the folder begin imap.select(folder) # Get the current folder size fsize = imap.status(folder, ["MESSAGES"]) csize = fsize["MESSAGES"] loop do fsize = imap.status(folder, ["MESSAGES"]) if fsize["MESSAGES"] > csize message_ids = imap.uid_search("ALL") uid = message_ids.last email = imap.uid_fetch(uid, "ENVELOPE")[0].attr["ENVELOPE"] pp "[#{email.from[0].name}] #{email.subject}" csize = fsize["MESSAGES"] else sleep(10) end end rescue => e exit(1) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mailCount count_type=nil\n # Init the email count to start fresh every time this is called\n total_count = 0\n\n # Get the total count of emails in the Exchange inboxes\n exch_count = exchangeMailCount\n total_count += exch_count\n \n # Get the total count of emails in the IMAP inboxes\n ...
[ "0.60687375", "0.5973583", "0.58890414", "0.58464164", "0.57725275", "0.57662296", "0.57595015", "0.57320666", "0.56180024", "0.5595161", "0.5556608", "0.55356663", "0.5535499", "0.5496299", "0.5449656", "0.54237795", "0.5350977", "0.5295367", "0.52566683", "0.52468854", "0.5...
0.73914623
0
Attach the work to a collection
def attach_work_to_collection(work,collection) attached = true collection.reindex_extent = Hyrax::Adapters::NestingIndexAdapter::LIMITED_REINDEX begin work.member_of_collections << collection work.save! rescue StandardError => e attached = false end attached end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attach_to_work(work, file_set_params = {})\n acquire_lock_for(work.id) do\n # Ensure we have an up-to-date copy of the members association, so that we append to the end of the list.\n work.reload unless work.new_record?\n file_set.visibility = work.visibility unless assign_vis...
[ "0.6794248", "0.6728939", "0.6595821", "0.6533343", "0.6373338", "0.62597394", "0.6197687", "0.6012525", "0.5997932", "0.589586", "0.589586", "0.5816458", "0.57911694", "0.57782656", "0.5719103", "0.56780744", "0.5677392", "0.5676644", "0.56722075", "0.5623032", "0.56229496",...
0.8328691
0
Create a work using the xml parsed
def create_work(xml_metadata) parsed_data = Ingest::Services::MetadataParser.new(xml_metadata, @depositor, @collection, @config).parse work_attributes = parsed_data[:work_attributes] # Create new work record and save new_work = work_record(work_attributes) new_work.save! new_work end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tasks_from_xml( doc )\r\n\r\n # Extract details of every task into a flat array\r\n tasks = []\r\n\r\n logger.error \"DEBUG: BEGIN get_tasks_from_xml\"\r\n\r\n tracker_alias = Setting.plugin_redmine_loader['tracker_alias'].force_encoding \"UTF-8\"\r\n tracker_field_id = nil;\r\n #FIXME На...
[ "0.5928454", "0.5889597", "0.5782293", "0.57218707", "0.5679979", "0.5646381", "0.5618511", "0.5566267", "0.5561271", "0.55488926", "0.5523513", "0.5500408", "0.5479861", "0.54796576", "0.54609215", "0.5425286", "0.5416991", "0.5415916", "0.5390891", "0.53864044", "0.5359866"...
0.7075035
0
FileSets can include any metadata listed in BasicMetadata file
def file_record(work_attributes) file_set = FileSet.new file_attributes = Hash.new # Singularize non-enumerable attributes work_attributes.each do |k,v| if file_set.attributes.keys.member?(k.to_s) if !file_set.attributes[k.to_s].respond_to?(:each) && work_attributes[k].respond_to?(:each) file_attributes[k] = v.first else file_attributes[k] = v end end end file_attributes[:visibility] = work_attributes['visibility'] unless work_attributes['embargo_release_date'].blank? file_attributes[:embargo_release_date] = work_attributes['embargo_release_date'] file_attributes[:visibility_during_embargo] = work_attributes['visibility_during_embargo'] file_attributes[:visibility_after_embargo] = work_attributes['visibility_after_embargo'] end file_attributes end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def metadata_file; end", "def metadata_file; end", "def load_workset( filename )\n\n md_filename = ''\n asset_files = []\n File.open( filename, 'r').each do |line|\n if /^metadata : /.match( line )\n md_filename = /^metadata : (.*)$/.match( line ).captures[ 0 ]\n end\n\n i...
[ "0.71350425", "0.71350425", "0.67456824", "0.66652495", "0.6634314", "0.649845", "0.6472493", "0.62322074", "0.62176937", "0.6192708", "0.6182669", "0.6163496", "0.6144549", "0.6090247", "0.60851675", "0.6083046", "0.6083046", "0.6083046", "0.6083046", "0.6083046", "0.6083046...
0.0
-1
This is potentially bad a find and update for every oplog....
def update_optime(timestamp) # track what's been written with this - write optime to the fs, perhaps periodically. @log.debug("Optime: #{timestamp}") begin @_mongoClient.db("local").collection("oplog.tracker").update({}, {'timestamp' => timestamp}, {:upsert => true}) rescue @log.error("Unable to update optime: #{timestamp}") raise end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update ; end", "def update\n# read the first 2 lines - it should be enough\n# lsvob starts with \"Tag: \\BARABOOM\"\n# both lsreplica and lsepoch start with \"For VOB replica \"\\BARABOOM\":\"\n# the second line in lsreplica is \"replica \"name\"\"\n# the second line in lsepoch is \"Oplog IDs for row...\" or...
[ "0.55723226", "0.55404735", "0.5522223", "0.54790014", "0.5458692", "0.54485846", "0.54485846", "0.54485846", "0.54485846", "0.54485846", "0.54485846", "0.54485846", "0.54485846", "0.5441119", "0.5396982", "0.5390092", "0.5335071", "0.52499294", "0.5243563", "0.5231356", "0.5...
0.0
-1
To change the redisBinary system property for running the test, use argLine option from surefire plugin: $ mvn DargLine="DredisBinary=`which redisserver`" Punittest clean \ verify
def run_with_config_file(configPath=nil) if configPath.class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:runWithConfigFile, [Java::java.lang.String.java_class]).call(configPath),::VertxRedisson::RedisProcess) end raise ArgumentError, "Invalid arguments when calling run_with_config_file(configPath)" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def startup_test_redis\n `redis-server #{TEST_DIR_BASE}/redis-test.conf`\n Resque.redis = 'localhost:9736'\nend", "def initialize\n @redis = MockRedis.new( :url => ENV[\"REDISTOGO_URL\"] ) # later, that env variable will be filled.\n end", "def fake_redis!\n @@redis = Redis.new(host: ENV['REDIS_HOST...
[ "0.7124926", "0.62832147", "0.60922754", "0.6001948", "0.58239615", "0.5817418", "0.5758948", "0.56483585", "0.563411", "0.5596748", "0.5572657", "0.5553455", "0.5538716", "0.5485873", "0.5479294", "0.5463666", "0.5406739", "0.5375936", "0.5252816", "0.5234911", "0.5176746", ...
0.48635748
50
Renders the search results partial within +app/views/alchemy/search/_results.html+
def render_search_results(options={}) default_options = { :show_result_count => true, :show_heading => true } render 'alchemy/search/results', :options => default_options.merge(options) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def render_search_results(options = {})\n default_options = {\n show_result_count: true,\n show_heading: true,\n }\n render \"alchemy/search/results\", options: default_options.merge(options)\n end", "def results\n get_results(true)\n render :partial => (params[:...
[ "0.8085688", "0.7821141", "0.7396624", "0.73813134", "0.7336223", "0.71947485", "0.7128651", "0.70948905", "0.7067658", "0.7060747", "0.7031068", "0.6999058", "0.699142", "0.6985357", "0.696734", "0.6927623", "0.6917432", "0.6878287", "0.68713117", "0.6855304", "0.6790137", ...
0.8142435
0
These functions are private to the problem one class.
def isMultiple(intMultiplier,input) if (input % intMultiplier)==0 #puts(" multiple of #{intMultiplier}: #{input}") return true else return false end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def probers; end", "def suivre; end", "def internal; end", "def schubert; end", "def implementation; end", "def implementation; end", "def problem_8\nend", "def problem_14\nend", "def bug\n end", "def specie; end", "def specie; end", "def specie; end", "def specie; en...
[ "0.77340615", "0.66720784", "0.6499635", "0.6469419", "0.6428283", "0.64189804", "0.64189804", "0.6341851", "0.6320635", "0.6303247", "0.62737", "0.62737", "0.62737", "0.62737", "0.62624973", "0.6238918", "0.6151551", "0.614391", "0.614391", "0.6140727", "0.6113295", "0.602...
0.0
-1
GET /tasks GET /tasks.json
def index @tasks = @user.tasks.all.includes(:tags) if params[:query] @tasks = @tasks.search(params[:query]) set_complete_incomplete render 'tasks/search' else set_complete_incomplete end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tasks\n uri = URI(BASE_URL + TASKS_ENDPOINT)\n\n make_request(uri)\n end", "def tasks\n @todos = Todo.all\n render json: @todos\n end", "def index\n render json: {\n tasks: tasks.map(&:to_hash)\n }\n end", "def index\n @tasks = Task.all\n\n render json: @tasks\n end", "...
[ "0.7889543", "0.7751927", "0.7619872", "0.75984913", "0.75936216", "0.7505406", "0.7464987", "0.74337274", "0.7383206", "0.7344766", "0.7322099", "0.7322099", "0.7322099", "0.7303383", "0.7263056", "0.72467685", "0.72430325", "0.7233159", "0.7165631", "0.7160025", "0.713756",...
0.0
-1
POST /tasks POST /tasks.json
def create set_user @task = @user.tasks.new(task_params) if @task.save respond_to do |format| format.js {} end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n #@task = Task.new(task_params)\n task = @task_list.tasks.create!(task_params)\n render json: task\n end", "def create\n @task = Task.new(task_params)\n\n if @task.save\n render json: @task, status: :created\n else\n render json: @task.errors, status: :unprocessable_entit...
[ "0.7529737", "0.74976224", "0.7411092", "0.7389878", "0.7261207", "0.72587913", "0.7183996", "0.7147952", "0.71120256", "0.70759165", "0.70639485", "0.70576006", "0.70560944", "0.70294535", "0.7016957", "0.7012058", "0.70110804", "0.7009976", "0.6993863", "0.69896185", "0.698...
0.0
-1
PATCH/PUT /tasks/1 PATCH/PUT /tasks/1.json
def update set_task respond_to do |format| if @task.update!(task_params) format.html format.json { respond_with_bip(@task) } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\r\n @tasks = Task.find(params[:id])\r\n if @tasks.update(task_params)\r\n render json: @tasks\r\n else\r\n render json: @tasks.errors, status: :unprocessable_entity\r\n end\r\n end", "def update\n task = Task.find(params[:id])\n if task.update(t...
[ "0.74462444", "0.72925776", "0.7264818", "0.7264818", "0.7076864", "0.70250654", "0.69654405", "0.69621724", "0.6952344", "0.6910241", "0.6906667", "0.6906667", "0.6906667", "0.6896555", "0.6896555", "0.6896555", "0.6896555", "0.6896555", "0.6896555", "0.6896555", "0.6896555"...
0.7138948
4
DELETE /tasks/1 DELETE /tasks/1.json
def destroy @task.destroy respond_to do |format| format.js { render layout: false} end flash.now[:info] = 'Task was successfully deleted.' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_task id\n request :delete, \"tasks/#{id}\"\n nil\n end", "def delete_task\n @task = Task.find_by(id: params[:id])\n @task.destroy\n render :json => @task.as_json(:only => [:id])\n end", "def destroy\n @task = Task.find(params[:id])\n @task.destroy\n\n respond_to do |f...
[ "0.78326327", "0.75876695", "0.7564121", "0.75633883", "0.7529625", "0.7529625", "0.7529625", "0.7529625", "0.7529625", "0.7529625", "0.7529625", "0.7529625", "0.7529625", "0.7529625", "0.7529625", "0.7529625", "0.7529625", "0.7488168", "0.7488168", "0.7488168", "0.7488168", ...
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_complete_incomplete @tasks_incomplete = @tasks.where("completed = 'f'").order('tasks.created_at DESC') @tasks_complete = @tasks.where("completed = 't'").order('tasks.created_at DESC') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def task_params params.require(:task).permit(:task, :all_tags, :completed, :raw_date) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n...
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076",...
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_user @user = User.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.61642385", "0.60448", "0.5945487", "0.5915654", "0.58890367", "0.58330417", "0.5776098", "0.5703048", "0.5703048", "0.5654613", "0.5620029", "0.5423114", "0.540998", "0.540998", "0.540998", "0.5393666", "0.53783023", "0.53568405", "0.53391176", "0.5339061", "0.53310865", ...
0.0
-1
after_commit :create_hash_tags, on: :create def create_hashtags extract_hashtags.each do |name| hash_tags.create(name: name) end end
def extract_hashtags description.to_s.scan(/#\w+/).map{|name| name.gsub("#", "")} end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_hash_tags\n get_name_hash_tags.each do |name|\n hash_tags.create(name: name)\n end\n end", "def generate_tags\n\t\ttags = Twitter::Extractor.extract_hashtags(caption)\n\t\ttags.each do |tag|\n\t\t\thashtag = Hashtag.find_by_name(tag)\n\t\t\tif hashtag\n\t\t\t\thashtags << hashtag\n\t\t\tel...
[ "0.7510807", "0.71801835", "0.6715844", "0.66586167", "0.6565296", "0.6375183", "0.62083095", "0.60688454", "0.59807956", "0.5976545", "0.59640515", "0.59308684", "0.57908475", "0.5771271", "0.57668513", "0.5763289", "0.576197", "0.5731258", "0.5686651", "0.5680399", "0.56768...
0.5915009
12
GET /pages GET /pages.json
def index @pages = Page.includes(:user) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @pages = Page.page params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end", "def index\n @pages = current_site.pages\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render ...
[ "0.80336875", "0.78896105", "0.7849311", "0.7684534", "0.7683288", "0.7683288", "0.7683288", "0.7683288", "0.7683288", "0.7683288", "0.7683288", "0.75573516", "0.75080585", "0.7400755", "0.7392056", "0.73434967", "0.73199916", "0.72880936", "0.7158694", "0.7145756", "0.712009...
0.0
-1
GET /pages/1 GET /pages/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @pages = Page.page params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end", "def index\n @pages = current_site.pages\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render ...
[ "0.77813053", "0.7577138", "0.7564708", "0.74609", "0.74609", "0.74609", "0.74609", "0.74609", "0.74609", "0.74609", "0.7314717", "0.71998656", "0.7184496", "0.7140601", "0.7108643", "0.7108643", "0.7108643", "0.7108643", "0.7108643", "0.7108643", "0.7108643", "0.71046406",...
0.0
-1
POST /pages POST /pages.json
def create params = page_params possible_page = Page.where('user_id IS NOT NULL').where(uid: params[:uid]).order('updated_at DESC').first() # last page associated to some user that has the "uid" param if(!possible_page.nil?) params[:user_id] = possible_page.user_id end @page = Page.new(params) respond_to do |format| if @page.save format.html { redirect_to @page, notice: 'Page was successfully created.' } format.json { render :show, status: :created, location: @page } else format.html { render :new } format.json { render json: @page.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 respond_to do |format|\n begin\n @page = Page.create_page!\n ...
[ "0.7211315", "0.6897405", "0.6834769", "0.68295294", "0.68169403", "0.6816336", "0.6809005", "0.6803334", "0.6786953", "0.6776035", "0.67602175", "0.6754758", "0.6717724", "0.6717724", "0.6717724", "0.6717724", "0.6717724", "0.6717724", "0.66893786", "0.6675025", "0.66329163"...
0.0
-1
DELETE /pages/1 DELETE /pages/1.json
def destroy @page.destroy respond_to do |format| format.html { redirect_to pages_url, notice: 'Page was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_page(id)\n @client.raw('delete', \"/content/pages/#{id}\")\n end", "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :ok }\n end\n end", "def destroy\n @page = Page.find(...
[ "0.75885814", "0.7533844", "0.7533844", "0.7533844", "0.75185406", "0.75185406", "0.75185406", "0.75185406", "0.75185406", "0.75185406", "0.75185406", "0.75185406", "0.7513754", "0.7513754", "0.7513754", "0.7513754", "0.7400107", "0.73982805", "0.7391226", "0.7356314", "0.734...
0.723134
32
Use callbacks to share common setup or constraints between actions.
def set_page @page = Page.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def page_params params.require(:page).permit(:title, :url, :access_at, :user_id, :uid) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n...
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076",...
0.0
-1
Override Devise Sign Out Behavior Delete the pa_auth_token cookie Redirect to the PA logout page
def after_sign_out_path_for(resource_or_scope) cookies.delete :pa_auth_token "#{Civiccommons::PeopleAggregator.URL}/logout.php?redirect=http://#{request.host}#{request.port == "80" ? nil : ":#{request.port}"}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sign_out\n\n # mark them as signed out.\n # (this is a helper method of devise, the rails ruby gem we're using for\n # authentication in the sample app.)\n # \n # \n #session_sign_out <---- NEED TO CHANGE TO CUSTOM USER SIGN OUT\n\n # send them back to the homepage.\n redirect_to r...
[ "0.7290194", "0.7285405", "0.72332394", "0.71412194", "0.70934147", "0.7092693", "0.70764625", "0.70427114", "0.7027523", "0.70130646", "0.6987139", "0.6986207", "0.6982017", "0.69804245", "0.6953956", "0.691257", "0.69027793", "0.69003195", "0.68968827", "0.6892779", "0.6884...
0.76395696
0
return render setting keys
def rendersettingkeys() return @settings_render.keys end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def keys\n @config.keys\n end", "def keys\n configuration.keys\n end", "def get_keys()\n\t\t\treturn @config.keys\n\t\tend", "def get_names\r\n\t\tsettings = []\r\n\t\t@settings.each { |key, value|\r\n\t\t\tsettings.push(key)\r\n\t\t}\r\n\t\treturn settings\r\n\tend", "def settings_list\n ...
[ "0.66135925", "0.6577235", "0.65454", "0.6471078", "0.63356584", "0.6269167", "0.61767477", "0.60718304", "0.60665935", "0.60665935", "0.60665935", "0.6042199", "0.6013304", "0.5994426", "0.59562343", "0.59562343", "0.59562343", "0.59562343", "0.59562343", "0.59562343", "0.59...
0.9029768
0
END load_from_model def save_to_model note: all changes are saved to model instantly puts "LuxrenderSettings.rb calling attribute dictionary to save settings to SketchUp file"
def get_names settings = [] @settings.each { |key, value| settings.push(key) } return settings end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_settings\n dir = 'Wave_Trace'\n model = Sketchup.active_model\n model.start_operation('Wave_Trace: Save All Settings', true) # Start an undo-able operation\n model.attribute_dictionaries.delete(dir) # First delete any pre-existing Wave_Trace dictionary\n ...
[ "0.6754634", "0.6215465", "0.62102216", "0.6163619", "0.61432266", "0.6064836", "0.60359275", "0.60189044", "0.5959097", "0.59505486", "0.59270483", "0.59225625", "0.59225625", "0.59225625", "0.59225625", "0.59225625", "0.59225625", "0.59225625", "0.59225625", "0.58287615", "...
0.0
-1
def sign_up_page? current_page?(:controller => 'users', :action => 'new') end helper_method :sign_up_page? def login_page? current_page?(:controller => 'sessions', :action => 'new') end helper_method :login_page? def issues_page? current_page?(:controller => 'issues', :action => 'index') end helper_method :issues_page?
def reset_stats redirect_to issue_stats_reset_stats_path end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def identity_page?\n active_page? 'accounts' => ['show']\n end", "def profile_show_page?\n controller_name == \"profiles\"\n end", "def profile_show_page?\n controller_name == \"profiles\"\n end", "def home_page\n if current_user.guest?\n user_signup_url\n elsif current_user.administra...
[ "0.656914", "0.6489379", "0.64887154", "0.64642644", "0.64386004", "0.6285159", "0.6172293", "0.6101515", "0.6026966", "0.60103494", "0.60071486", "0.59975964", "0.59882087", "0.59798837", "0.5974045", "0.595959", "0.5858104", "0.5853803", "0.58495694", "0.58186704", "0.58004...
0.0
-1
Delete a google network
def delete_network(name) data = false conn = @ec2_main.environment.connection if conn != nil response = conn.delete_network(name) if response.status == 200 data = response.body else data = {} end else raise "Connection Error" end return data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_network(id)\n fog_service_interface.delete_network(id)\n end", "def delete_network(network)\n return delete_request(address(\"networks/\" + network), @token)\n end", "def delete_network(network_name)\n return if !configured? || !network_exists?(network_name)\n\n @service.de...
[ "0.7768572", "0.7497454", "0.72349966", "0.7036554", "0.6990914", "0.69321114", "0.692941", "0.69169647", "0.69169647", "0.69169647", "0.69126743", "0.6877859", "0.68085796", "0.6730797", "0.6591075", "0.65406287", "0.65344536", "0.653317", "0.6506465", "0.6481593", "0.646242...
0.68946576
11
Insert a google network
def insert_network(name, ip_range) data = false conn = @ec2_main.environment.connection if conn != nil response = conn.insert_network(name, ip_range) if response.status == 200 data = response.body else data = {} end else raise "Connection Error" end return data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save\n requires :display_text, :name, :network_offering_id, :zone_id\n\n options = {\n 'displaytext' => display_text,\n 'name' => name,\n 'zoneid' => zone_id,\n 'networkofferingid' => network_offering_id...
[ "0.61276823", "0.57330877", "0.5642036", "0.5594418", "0.5558452", "0.5539666", "0.55309004", "0.5499608", "0.5420942", "0.54077256", "0.5365044", "0.5345096", "0.5337898", "0.53363234", "0.5324854", "0.53011876", "0.5213359", "0.5208594", "0.5203045", "0.51862115", "0.517461...
0.6110077
1
GET /collections GET /collections.json
def index @gallery = Gallery.find(params["gallery_id"]) @collections = @gallery.collections.active end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collection(slug, options)\n _get(\"v1/collections/\" + slug, options)\n end", "def index\n @collections = current_user.collections.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @collections }\n end\n end", "def list\n @collection...
[ "0.7903878", "0.7902042", "0.7901478", "0.7798958", "0.76547277", "0.74742806", "0.7404062", "0.73411196", "0.73396087", "0.7331687", "0.7301158", "0.7301158", "0.7140841", "0.70761335", "0.7036882", "0.70322394", "0.70099014", "0.6999159", "0.6996238", "0.6944972", "0.694326...
0.6413606
63
GET /collections/1 GET /collections/1.json
def show @gallery = Gallery.find(@collection.gallery_id) # p "collections controller" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collection(slug, options)\n _get(\"v1/collections/\" + slug, options)\n end", "def index\n @collections = current_user.collections.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @collections }\n end\n end", "def show\n\n @collecti...
[ "0.7678446", "0.76061696", "0.75371283", "0.7443003", "0.72130686", "0.7119864", "0.7102526", "0.7100734", "0.7100734", "0.709121", "0.7061903", "0.704557", "0.70365316", "0.7006357", "0.6956208", "0.6920214", "0.6828716", "0.6815708", "0.68125314", "0.6763249", "0.6738598", ...
0.0
-1
POST /collections POST /collections.json
def create @gallery = Gallery.find(params["gallery_id"]) @collection = @gallery.collections.build(collection_params) @collection.thumbnail = 9999 respond_to do |format| if @collection.save format.html { redirect_to @collection, notice: 'Collection was successfully created.' } format.json { render :show, status: :created, location: @collection } else format.html { render :new } format.json { render json: @collection.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n collection = Collection.create(collection_params)\n\n render json: collection\n end", "def create\n @collection = Admin::Collection.new(collection_params)\n\n if @collection.save\n render json: @collection, status: :created#, location: @collection\n else\n render json: @col...
[ "0.7406109", "0.73826146", "0.7293025", "0.70655507", "0.70375437", "0.6995771", "0.6995771", "0.69555485", "0.6955021", "0.6950639", "0.6943942", "0.6942102", "0.69265264", "0.6894755", "0.6851965", "0.6742832", "0.67059416", "0.6694796", "0.6656791", "0.6656791", "0.6559917...
0.5710844
95
PATCH/PUT /collections/1 PATCH/PUT /collections/1.json
def update respond_to do |format| if @collection.update(collection_params) format.html { redirect_to @collection, notice: 'Collection was successfully updated.' } format.json { render :show, status: :ok, location: @collection } else format.html { render :edit } format.json { render json: @collection.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n render_json :status => :forbidden and return unless @collection.write?(@user, @client)\n if !params[:collection]\n render_json :status => :bad_request, :messages => \"Tried to update collection with no data.\" and return\n end\n @collection.update_attributes(params[:collection].slice(...
[ "0.72595423", "0.7024464", "0.6988568", "0.6988568", "0.6988568", "0.6967083", "0.69305056", "0.6921532", "0.6830486", "0.67997783", "0.6757201", "0.6719196", "0.6689609", "0.6638305", "0.6585662", "0.6583257", "0.65761065", "0.65675074", "0.651061", "0.64499813", "0.639242",...
0.6771792
11
DELETE /collections/1 DELETE /collections/1.json
def destroy gallery = @collection.gallery_id if @collection.destroy message = "Collection destroyed successfully" else message = "Collection could not be destroyed because it has images in it" end respond_to do |format| format.html { redirect_to gallery_collections_path(gallery), notice: message } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n response = connection.delete(\"/collections/#{id}\")\n (200..299).include?(response.status)\n end", "def destroy\n @collection = Collection.find(params[:id])\n @collection.destroy\n\n respond_to do |format|\n format.html { redirect_to collections_url }\n format.json ...
[ "0.7955601", "0.76791966", "0.7664679", "0.7664679", "0.7664679", "0.7664679", "0.75711703", "0.7557922", "0.7541033", "0.7540196", "0.7532294", "0.74901825", "0.74650514", "0.7449756", "0.7449204", "0.7449204", "0.7449204", "0.74310577", "0.7296184", "0.7282262", "0.7269583"...
0.66093147
59
GET /rants/1 GET /rants/1.xml
def show @rant = Rant.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @rant } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rest_get(uri)\n \n request = Net::HTTP::Get.new uri\n request.add_field(\"Accept\",\"application/xml\")\n auth_admin(request)\n \n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request request\n response.value\n\n doc = REXML::Document.new response.body\n \n return doc\n ...
[ "0.6563115", "0.6412381", "0.6379286", "0.63558936", "0.6348562", "0.631062", "0.6255079", "0.6253695", "0.6190788", "0.6178475", "0.6168402", "0.61354077", "0.61206174", "0.6091785", "0.6091137", "0.6074826", "0.6072125", "0.6066851", "0.60651684", "0.60115874", "0.6005408",...
0.6738103
0
GET /rants/new GET /rants/new.xml
def new @rant = Rant.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @rant } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @node = Node.scopied.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end", "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => new_vurl }\n end\n end", "def new\n ...
[ "0.7358266", "0.7260429", "0.725598", "0.7205338", "0.71587896", "0.71106416", "0.710072", "0.7089057", "0.7089057", "0.7077673", "0.7076395", "0.70757353", "0.7064889", "0.70575297", "0.70433474", "0.70415646", "0.70298064", "0.7022948", "0.7012879", "0.70019037", "0.7001903...
0.7633198
0
POST /rants POST /rants.xml
def create @rant = Rant.new(params[:rant]) respond_to do |format| if @rant.save format.html { redirect_to(@rant, :notice => 'Rant was successfully created.') } format.xml { render :xml => @rant, :status => :created, :location => @rant } else format.html { render :action => "new" } format.xml { render :xml => @rant.errors, :status => :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post(uri, xml)\r\n req = Net::HTTP::Post.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end", "def post(xmldoc)\n headers = {'Content-Type' => 'text/xml'}\n check_response( @httpcli.post(@endpoint, xmldoc, headers) )\n end", "d...
[ "0.61703706", "0.61036104", "0.594174", "0.5814326", "0.58089244", "0.56920713", "0.5669344", "0.5648547", "0.56257904", "0.5597021", "0.5570518", "0.5561257", "0.55009115", "0.5475654", "0.54615736", "0.54613745", "0.5455044", "0.54516435", "0.5438742", "0.54210216", "0.5419...
0.5999423
2
PUT /rants/1 PUT /rants/1.xml
def update @rant = Rant.find(params[:id]) respond_to do |format| if @rant.update_attributes(params[:rant]) format.html { redirect_to(@rant, :notice => 'Rant was successfully updated.') } format.xml { head :ok } else format.html { render :action => "edit" } format.xml { render :xml => @rant.errors, :status => :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end", "def rest_update(uri, method: Net::HTTP::Put)\n request = Net::HTTP::Get.new uri\n request.add_field(\"Accept\",\"application/xml\")\n auth_admin(request)\n \n Net::HTTP.start...
[ "0.66125566", "0.6565633", "0.6480401", "0.6308165", "0.6123096", "0.6023699", "0.5961873", "0.5935211", "0.57414746", "0.5708852", "0.570121", "0.56939745", "0.5654527", "0.56332725", "0.5601463", "0.56011236", "0.55987847", "0.5591594", "0.55872583", "0.5575569", "0.5558669...
0.61573076
4
DELETE /rants/1 DELETE /rants/1.xml
def destroy @rant = Rant.find(params[:id]) @rant.destroy respond_to do |format| format.html { redirect_to(rants_url) } format.xml { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def netdev_resxml_delete( xml )\n top = netdev_resxml_top( xml )\n par = top.instance_variable_get(:@parent)\n par['delete'] = 'delete'\n end", "def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end", "def delete!\n Recliner.delete(uri)\n end", "def del...
[ "0.6995677", "0.6889536", "0.6782724", "0.67415076", "0.6666296", "0.6520055", "0.6416102", "0.6396114", "0.63591385", "0.62944627", "0.62926376", "0.6288517", "0.62749314", "0.6267756", "0.62559575", "0.6255345", "0.6255345", "0.62546223", "0.6250471", "0.62441224", "0.62432...
0.6775186
3
Returns true if and only if: 1. There are two and only two arguments 2. That argument, when converted to an integer, is nonnegative Returns false otherwise If any errors occur (e.g. args is nil), just return false we are going to exit anyways, so no need for more detailed categorization of the error
def check_args(args) begin results = [Integer(args[0]), Integer(args[1])] rescue ArgumentError, TypeError puts 'Invalid input.' end args.count == 2 && results[1] >= 1 rescue StandardError false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_args(args)\n args.count == 2 && args[0].to_i > 0 && args[1].to_i > 0\n rescue StandardError\n false\n end", "def check_args(arguments)\r\n if arguments.length != 3\r\n puts 'There must be exactly three arguments: *seed*, *num_prospectors*, *num_turns*'\r\n return false\r\n elsif argumen...
[ "0.8418269", "0.7506146", "0.7396315", "0.73773485", "0.71942866", "0.7113682", "0.7085484", "0.69793206", "0.6940506", "0.69321555", "0.6847524", "0.68365204", "0.68036664", "0.6797044", "0.6788786", "0.67845666", "0.67836887", "0.6717154", "0.67052054", "0.6696459", "0.6690...
0.8140739
1
:nodoc: Load the makefile dependencies in +fn+.
def load(fn) # :nodoc: lines = File.read fn lines.gsub!(/\\ /, SPACE_MARK) lines.gsub!(/#[^\n]*\n/m, "") lines.gsub!(/\\\n/, " ") lines.each_line do |line| process_line(line) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_dependencies( file_list, force_require=true )\r\n loader = DependencyLoader.new( file_list, force_require )\r\n loader.load_dependencies\r\nend", "def add_elm_dependencies(filepath, context)\n # Turn e.g. ~/NoRedInk/app/assets/javascripts/Quiz/QuestionStoreAPI.js.elm\n # into just ~/NoRedInk...
[ "0.6360848", "0.5768108", "0.57253647", "0.5649865", "0.5521204", "0.5487045", "0.5483122", "0.5483122", "0.54162985", "0.5372437", "0.5253465", "0.525309", "0.5236198", "0.52052885", "0.5192162", "0.5184371", "0.5184371", "0.5139757", "0.5139065", "0.5128504", "0.50825745", ...
0.4859695
50
Process one logical line of makefile data.
def process_line(line) # :nodoc: file_tasks, args = line.split(":", 2) return if args.nil? dependents = args.split.map { |d| respace(d) } file_tasks.scan(/\S+/) do |file_task| file_task = respace(file_task) file file_task => dependents end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_line(line)\n file_tasks, args = line.split(':', 2)\n return if args.nil?\n dependents = args.split.map { |d| respace(d) }\n file_tasks.scan(/\\S+/) do |file_task|\n file_task = respace(file_task)\n file file_task => dependents\n end\n end", "def process_line line\n if lin...
[ "0.5764406", "0.56965643", "0.563328", "0.5499889", "0.5335075", "0.5329485", "0.53235936", "0.5292877", "0.521437", "0.52138317", "0.51894873", "0.51529676", "0.50604826", "0.50520396", "0.5046127", "0.5037432", "0.50259346", "0.5001728", "0.49882397", "0.49559128", "0.49457...
0.5739876
1
Sets the location of the configuration YAML file and old deletes configurations.
def default_file=(file_path) @configuration = nil @defaults = nil @default_file = File.expand_path(file_path) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete( )\n File.delete(@configFileDNE)\n self.clear\n self\n end", "def delete_configuration\n super\n end", "def delete_configuration\n super\n end", "def reset\n @config_file = nil\n set_defaults\n load_from_file if config_file\n end", "def update_config\...
[ "0.6546112", "0.64143276", "0.64143276", "0.63878983", "0.6162204", "0.6139792", "0.60812825", "0.605352", "0.6051329", "0.6051111", "0.60418296", "0.60291165", "0.60291165", "0.60206574", "0.6003221", "0.59757495", "0.59426975", "0.58803165", "0.5862864", "0.5852922", "0.584...
0.0
-1
Sets the value of a config entry.
def []=(key, val) (@configuration ||= setup)[key.to_s] = val end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def config=(value); end", "def cfg_set(key, value)\n hr_config.set_for_url(url.to_s, key, value)\n end", "def set_config(key, val)\n @config[key] = val\n end", "def set(key, *value)\n run { conf.set(key, value, config_params) }\n end", "def set_config(key, val)\n config[key...
[ "0.71924496", "0.7010172", "0.692519", "0.68895197", "0.688462", "0.68385464", "0.6832461", "0.6806092", "0.67972547", "0.6754969", "0.6753217", "0.6752761", "0.67244047", "0.66976887", "0.66976887", "0.65687174", "0.6543687", "0.6480943", "0.6462865", "0.642735", "0.64197123...
0.6562834
16
Remove the value of a config entry.
def delete(key) @configuration.delete(key) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_configuration(value)\n @children['configuration'][:value].delete(value)\n end", "def remove(key)\n\t\t\tvalue = @config.shift(key)\n\t\t\treturn value\n\t\tend", "def remove(value)\n connection.zrem(key_label, value)\n end", "def delete(key)\n @config.delete(key....
[ "0.73884994", "0.7178903", "0.71487164", "0.6921228", "0.68019474", "0.67671424", "0.6677443", "0.66625893", "0.66153365", "0.6447354", "0.6440813", "0.6440767", "0.6440767", "0.6380671", "0.6372172", "0.63495606", "0.6304644", "0.6278421", "0.6267512", "0.62208825", "0.61835...
0.6052736
28
Remove all configuration. This can be useful for testing purpose.
def delete_all @configuration = nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_all_configurations\n super\n end", "def delete_all_configurations\n super\n end", "def clear\n self.configuration = {}\n end", "def clear(config)\n Array(config).each do |setting|\n delete_setting setting\n end\n end", "def reset_configuration\n @...
[ "0.81042236", "0.81042236", "0.7791918", "0.7680122", "0.7584492", "0.74850965", "0.73792917", "0.73251456", "0.7309198", "0.7309198", "0.7294231", "0.71759224", "0.71539766", "0.711651", "0.7109858", "0.71056795", "0.70922244", "0.70922244", "0.70493436", "0.70065486", "0.69...
0.8488825
1
Converts the defaults hash to a Java HashMap used by the Neo4j API.
def to_java_map map = java.util.HashMap.new to_hash.each_pair do |k, v| case v when TrueClass map[k.to_s] = "true" when FalseClass map[k.to_s] = "false" when String, Fixnum, Float map[k.to_s] = v.to_s # skip list and hash values - not accepted by the Java Neo4j API end end map end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_hash\n default_options.to_hash\n end", "def to_hash\n default_options.to_hash\n end", "def to_hash\n dup = @hash.dup\n dup.delete(\"__default__\")\n dup\n end", "def to_hash\n Hash.new(default).merge(self)\n end", "def to_hash\n Hash.new(default).merge(sel...
[ "0.67691034", "0.67691034", "0.6739721", "0.6715363", "0.6688526", "0.6688526", "0.6648757", "0.649802", "0.64636695", "0.6374837", "0.6330976", "0.63282806", "0.6235643", "0.62268627", "0.6186034", "0.61377585", "0.6116371", "0.60332936", "0.60277724", "0.5993876", "0.599387...
0.56578475
66
Transforms `switch` to nested `if`expressions
def transform_switch_to_if(switch_expr) _tag, *cases = switch_expr if_expr = ['if', nil, nil, nil] current = if_expr (0..(cases.size - 2)).each do |i| current_cond, current_block = cases[i] current[1] = current_cond current[2] = current_block next_case = cases[i + 1] next_cond, next_block = next_case current[3] = next_cond == 'else' ? next_block : ['if'] current = current[3] end if_expr end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_case(exp)\n obj = exp.shift \n \n with_temporary_variable do |tmp|\n @local_variables_need_no_initialization.add(tmp)\n asgn = want_expression do\n \"#{tmp}=#{process(obj)}\"\n end\n\n new_exp = current_exp = []\n\n while not exp.empty?\n _when = exp.shi...
[ "0.70899206", "0.67532337", "0.67532337", "0.64739573", "0.6440181", "0.6146391", "0.6141592", "0.6138998", "0.6123627", "0.60947526", "0.58883935", "0.5840469", "0.57809496", "0.57747877", "0.5759751", "0.5699032", "0.5673397", "0.5672154", "0.56571805", "0.5650493", "0.5638...
0.8090183
0
Transforms `for` to `while`expression
def transform_for_to_while(for_expr) _tag, init, condition, modifier, body = for_expr ['begin', init, ['while', condition, ['begin', body, modifier]]] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def for_loop\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 21 )\n return_value = ForLoopReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n\n _last = _first_0 = n...
[ "0.65082234", "0.6499518", "0.6420092", "0.64042795", "0.635707", "0.6321666", "0.6283487", "0.625449", "0.6238574", "0.6174425", "0.607747", "0.60531", "0.60411763", "0.60126317", "0.60126317", "0.5955936", "0.59337515", "0.5925265", "0.59237796", "0.5912331", "0.59095484", ...
0.8376138
0
Transforms `(++ )` to `(set (+ 1))`
def transform_inc_to_set(inc_expr) _tag, expr = inc_expr ['set', expr, ['+', expr, 1]] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transform_inc_val_to_set(inc_expr)\n _tag, expr, val = inc_expr\n ['set', expr, ['+', expr, val]]\n end", "def plus(reg)\n return lambda do |pos|\n statelist = reg.call(pos)\n curpos = pos + statelist.size\n endstate = { '' => Set.new( [pos, curpos + 1] ) }\n statelist <...
[ "0.6812443", "0.6358723", "0.6274109", "0.60673857", "0.60572845", "0.6006127", "0.5761416", "0.57488865", "0.5741002", "0.5737076", "0.5698682", "0.5697059", "0.56441516", "0.56254303", "0.5602991", "0.55986685", "0.55882615", "0.55832213", "0.55612993", "0.5522802", "0.5507...
0.7238825
0
Transforms `( )` to `(set ( 1))`
def transform_dec_to_set(dec_expr) _tag, expr = dec_expr ['set', expr, ['-', expr, 1]] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set=(_arg0); end", "def k_set!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 63 )\n\n\n\n type = K_SET\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 5...
[ "0.6269487", "0.6157073", "0.6126773", "0.6060199", "0.5949183", "0.5681861", "0.56674725", "0.56674725", "0.5479863", "0.5452042", "0.5416909", "0.541476", "0.54129785", "0.5400769", "0.53996706", "0.53427625", "0.5330251", "0.5295366", "0.5289325", "0.5285828", "0.52601475"...
0.55855435
8
Transforms `(+= )` to `(set (+ ))`
def transform_inc_val_to_set(inc_expr) _tag, expr, val = inc_expr ['set', expr, ['+', expr, val]] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transform_inc_to_set(inc_expr)\n _tag, expr = inc_expr\n ['set', expr, ['+', expr, 1]]\n end", "def plus(reg)\n return lambda do |pos|\n statelist = reg.call(pos)\n curpos = pos + statelist.size\n endstate = { '' => Set.new( [pos, curpos + 1] ) }\n statelist << endstate\...
[ "0.6234682", "0.6066214", "0.6028541", "0.6002726", "0.59775984", "0.5937529", "0.5705494", "0.56881034", "0.5628338", "0.5606911", "0.5593371", "0.5541609", "0.5517003", "0.5509002", "0.5489131", "0.5468621", "0.5449312", "0.54473984", "0.54438317", "0.5384107", "0.5369717",...
0.63655674
0
Transforms `(= )` to `(set ( ))`
def transform_dec_val_to_set(dec_expr) _tag, expr, val = dec_expr ['set', expr, ['-', expr, val]] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set=(_arg0); end", "def set!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 37 )\n\n type = SET\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 158:7: 'set'\n match( \"set\" )\n\n \...
[ "0.66755444", "0.6134457", "0.6090639", "0.6019862", "0.5904584", "0.5904584", "0.588307", "0.5705421", "0.56710213", "0.55703163", "0.5561224", "0.55544937", "0.55494976", "0.55375004", "0.55122155", "0.54984313", "0.5463807", "0.5462546", "0.5444475", "0.5432947", "0.543054...
0.55494875
13
attach_function :make_cudaExtent, [:size_t, :size_t, :size_t], CudaExtent attach_function :make_cudaPitchedPtr, [:pointer, :size_t, :size_t, :size_t], CudaPitchedPtr attach_function :make_cudaPos, [:size_t, :size_t, :size_t], CudaPos
def make_cudaExtent(w, h, d) e = CudaExtent.new e[:width], e[:height], e[:depth] = w, h, d e end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def matrix_multiplication_gpu_transposed_a(a, b, size)\n # Matrix A is transposed\n\n return PArray.new(size * size) do |index|\n x = index % size\n y = index / size\n\n # TODO(4): Implement\n # Try with GPU_T_A 150\n # If correct, run with GPU_T_A 3000 and compare runtime ...
[ "0.5572456", "0.5295591", "0.52067196", "0.5107961", "0.48958468", "0.47258863", "0.46983442", "0.46916234", "0.46669888", "0.45319483", "0.4461606", "0.4417411", "0.4414394", "0.4403324", "0.4380201", "0.43618035", "0.43106952", "0.42903173", "0.42824343", "0.42774197", "0.4...
0.65973806
0
Pop whatever is on queue
def pop_from_queue(queue) prioritized?(queue) ? z_pop_from_queue(queue) : super end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pop()\n @queue.shift\n end", "def dequeue; @queue.pop end", "def pop()\n res = @pop_queue.shift()\n return res\n end", "def pop\n @lock.synchronize do\n @queue.pop\n end\n end", "def pop()\n @size -= 1 \n @queue.shift\n end", "def ...
[ "0.8933662", "0.89276385", "0.8645964", "0.8628593", "0.84859085", "0.838032", "0.83730185", "0.83674884", "0.83536345", "0.8337667", "0.8333567", "0.8318516", "0.8231321", "0.82159853", "0.81657517", "0.813559", "0.8089793", "0.8015996", "0.8014671", "0.8012965", "0.8000831"...
0.7772736
37
Get the number of items in the queue
def queue_size(queue) prioritized?(queue) ? z_queue_size(queue) : super end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def queue_count()\n @queue.length\n end", "def count\n\t\t@queue.length\n\tend", "def queue_count\n @queues.length\n end", "def size\n\n @queue.size\n end", "def length\n @queue.length\n end", "def length\n @queue.length\n end", "def size\n @queue.size\n end", "def...
[ "0.8580045", "0.85783106", "0.83036584", "0.82349086", "0.82245785", "0.81955695", "0.8187706", "0.8167576", "0.812935", "0.81070226", "0.8098918", "0.8021362", "0.8017036", "0.7968305", "0.79549927", "0.7953664", "0.78912073", "0.78033257", "0.77628225", "0.7707948", "0.7664...
0.0
-1
Remove data from the queue, if it's there, returning the number of removed elements
def remove_from_queue(queue, data) prioritized?(queue) ? z_remove_from_queue(queue, data) : super end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove\n if empty?\n raise \"Can't remove if queue is empty\"\n else\n @info.shift\n end\n end", "def remove\n if empty?\n raise \"Can't remove if queue is empty\"\n else\n @info.shift\n end\n end", "def remove\n if empty?\n raise \"Can't remove if queue is e...
[ "0.7422291", "0.7422291", "0.7422291", "0.7303138", "0.71217644", "0.70009404", "0.6995074", "0.69667345", "0.6885083", "0.6810454", "0.6790756", "0.6743725", "0.67210877", "0.6683692", "0.66377836", "0.6607834", "0.6577161", "0.65137124", "0.64157766", "0.63901013", "0.63619...
0.67974263
10
Get the number of items in the queue
def z_queue_size(queue) handle_pipeline(@redis.zcount(redis_key_for_queue(queue), 0, Float::INFINITY), &:to_i) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def queue_count()\n @queue.length\n end", "def count\n\t\t@queue.length\n\tend", "def queue_count\n @queues.length\n end", "def size\n\n @queue.size\n end", "def length\n @queue.length\n end", "def length\n @queue.length\n end", "def size\n @queue.size\n end", "def...
[ "0.8580045", "0.85783106", "0.83036584", "0.82349086", "0.82245785", "0.81955695", "0.8187706", "0.8167576", "0.812935", "0.81070226", "0.8098918", "0.8021362", "0.8017036", "0.7968305", "0.79549927", "0.7953664", "0.78912073", "0.78033257", "0.77628225", "0.7707948", "0.7664...
0.74530905
30
Remove data from the queue, if it's there, returning the number of removed elements Not so very fast method. But because of uuid in the zset items we could not to make it faster. Usaually this method uses manually, so speed not so critical. NOTE: placing uuids into special key not a good idea. We could to remove queue, for example, and we lose symchronize between two lists. So speed increase in this case will break a logic. NOTE: We need at least two requests to redis, so, we could not to make it inside pipeline block
def z_remove_from_queue(queue, data) raise PipelineNotSupported if @redis.client.is_a?(Redis::Pipeline) priority = extract_priority(data) z_item = @redis.zrevrange(redis_key_for_queue(queue), 0, -1).find do |item| (priority && item.include?(data)) || \ (item.include?(data[/"class":"[^ "]+/]) && item.include?(data[/"args":.+/])) end or return @redis.zrem(redis_key_for_queue(queue), z_item) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_from_queue(queue, data)\n prioritized?(queue) ? z_remove_from_queue(queue, data) : super\n end", "def remove\n if empty?\n raise \"Can't remove if queue is empty\"\n else\n @info.shift\n end\n end", "def remove\n if empty?\n raise \"Can't remove if que...
[ "0.6768191", "0.6622731", "0.6622731", "0.6622731", "0.6564068", "0.6533087", "0.6527856", "0.64525205", "0.6358689", "0.63296527", "0.6185299", "0.6137111", "0.6098556", "0.6054851", "0.5975801", "0.5957081", "0.59408224", "0.59402317", "0.593895", "0.59385234", "0.59278", ...
0.7145564
0
parent method returns object, when count eq 1, and array, whe count is more.
def z_list_range(key, start = 0, count = 1) handle_pipeline(@redis.zrevrange(key, start, start + count - 1)) { |object| list = Array(object).map(&method(:without_uuid)) next list.first if count == 1 list } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def length\n array.first.size\n end", "def _serializable_array\n if @options[:single_record]\n super.first\n else\n super\n end\n end", "def ensure_cardinality(result)\n Array.wrap(result)\n end", "def get_items\r\n @arr.to_a\r\n end", "def [](length)\n ...
[ "0.58764225", "0.5869556", "0.5867699", "0.57020897", "0.56857085", "0.55863225", "0.55777645", "0.5574888", "0.5563173", "0.55594844", "0.55537474", "0.5550768", "0.5545989", "0.5530395", "0.5529184", "0.55236626", "0.5506737", "0.5490876", "0.54904", "0.54904", "0.54904", ...
0.0
-1
Hack to allow gem work inside Redis Pipilened block. NOTE: See Resque::Plugins::Prioritize::RedisFutureExtensionadd_transformation
def handle_pipeline(object, &block) object.is_a?(Redis::Future) ? object.add_transformation(&block) : block.call(object) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def third_party_processors; end", "def mix\n #future code\n end", "def pre_install; end", "def install_pre_hook\n end", "def redis_pool; end", "def write_redis_recommendation(development_working, lines, index, gemfile)\n # provide a recommendation for using redis-session-store, including commented ...
[ "0.5497072", "0.54320955", "0.52802294", "0.5263244", "0.5177432", "0.5140445", "0.51394904", "0.5109744", "0.5075031", "0.5073833", "0.50692666", "0.50364727", "0.5034003", "0.50293165", "0.4995952", "0.49938673", "0.49792054", "0.49570453", "0.49433434", "0.49433434", "0.49...
0.5610397
0
zset store only uniq elements. But redis queue could have few same elements. So, we should add some uuid to every element
def with_uuid(encoded_item, uuid = SecureRandom.uuid) without_uuid(encoded_item) .then { |item| Serializer.serialize(item, uuid: uuid) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_unique_from_redis\n redis = Redis.new\n keys = redis.scan(0, :match => \"unique*\").last\n redis.del(keys) if !keys.empty?\n end", "def push_unique_payload(conn, payload, queue)\n uniqueue_payload = Sidekiq::Uniqueue.uniqueue_payload(payload)\n serialized_work = Sidekiq.dump_json(pa...
[ "0.61004", "0.5999087", "0.5997439", "0.5977999", "0.5958174", "0.57865757", "0.5760568", "0.5760568", "0.5720658", "0.5575801", "0.5559301", "0.5534899", "0.55315816", "0.55221695", "0.55065435", "0.55040324", "0.54772705", "0.54653394", "0.54578716", "0.5432307", "0.5387189...
0.54641885
18
Remove uuid from item. See `with_uuid` method
def without_uuid(item) Serializer.extract(item, :uuid).fetch(:rest) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def with_uuid(encoded_item, uuid = SecureRandom.uuid)\n without_uuid(encoded_item)\n .then { |item| Serializer.serialize(item, uuid: uuid) }\n end", "def remove_item(id:)\n order.items.destroy(id)\n end", "def remove_item(id)\n @items.delete_at(id)\n end", "def remove...
[ "0.6722437", "0.65494317", "0.65238476", "0.6312063", "0.6298739", "0.62261593", "0.6216924", "0.6081139", "0.6037604", "0.60075015", "0.5982403", "0.5962084", "0.591718", "0.5884895", "0.5884895", "0.5881425", "0.5859742", "0.5825744", "0.5825744", "0.5825055", "0.5819777", ...
0.75625235
0
Check by type. If type is zset queue is prioritized. In other cases work like it was before
def prioritized?(queue) queue = queue.to_s if @redis.client.is_a?(Redis::Pipeline) # To prevent unexpected values inside result block return queue.include?(Prioritize.prioritized_queue_postfix) end queue = queue.include?('queue:') ? queue : redis_key_for_queue(queue) queue_type = @redis.type(queue) # With type check we will handle the cases when queue postfix was renamed during # the work. So, it is the better practise. However, it doesn't work for empty queues. queue_type == 'zset' || \ # In case when queue is empty on type check, but not empty on the action (pop, in # the most cases), we could have an error. # So, in that cases we should check queue type by name. (queue_type == 'none' && queue.include?(Prioritize.prioritized_queue_postfix)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_a_priority_queue?\n @@queue_types ||= {}\n (@@queue_types[@redis_name] ||= queue_type) == 'zset'\n end", "def queue_size(queue)\n prioritized?(queue) ? z_queue_size(queue) : super\n end", "def in_queue?\n depq_or_subpriority().kind_of? Depq\n end", "def pop_fro...
[ "0.7281272", "0.60881543", "0.60406184", "0.5983466", "0.5537937", "0.55207115", "0.5492066", "0.54646033", "0.54320776", "0.5410443", "0.5278801", "0.5233972", "0.5216417", "0.51771605", "0.5163688", "0.51524955", "0.51396704", "0.50943226", "0.50801915", "0.50719863", "0.50...
0.6942802
1
This method handles: Vine video URLs (vine.co/v/...) Vine profile URLs (vine.co/u/...) Tweet URLs (twitter.com/foobar/status/...)
def vines_from_url(url) case url when %r{vine.co/v/.+} then [Pair.new(url, nil)] when %r{vine.co/u/.+} then vines_from_user_profile(url).map { |v| Pair.new(v, url) } when %r{twitter.com/.+} then vine_urls_from_tweet(url).map { |u| vines_from_url(u) }.flatten when %r{\s*} then [] else logger.warn(format("Don't know how to handle input <%s>; skipping", col)) [] end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_video_url(url)\n url_video = case url.downcase\n when /^http:\\/\\/(www\\.)?youtube\\.com/\n parse_youtube(url)\n # when /tudou/\n # parse_tudou(url)\n when /^http:\\/\\/(www\\.)?dailymotion\\.com/\n parse_...
[ "0.7082522", "0.6794188", "0.66055846", "0.6520774", "0.6426998", "0.6340824", "0.6217328", "0.61695296", "0.6168784", "0.615081", "0.6111477", "0.6023151", "0.60227937", "0.6020153", "0.598621", "0.59522283", "0.5908281", "0.5902367", "0.5877663", "0.5853634", "0.5841633", ...
0.65810585
3
Test about associating token info with node Might delete this method
def setLine (line) @line = line end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_token\n end", "def token\n end", "def token; end", "def token; end", "def token; end", "def token; end", "def token; end", "def token; end", "def push_token(tk); end", "def process_token(tk); end", "def token\n @token\n end", "def assign_token(user)\n\t\t0\n\tend", "def crea...
[ "0.6736973", "0.6532654", "0.6398172", "0.6398172", "0.6398172", "0.6398172", "0.6398172", "0.6398172", "0.62084687", "0.60977995", "0.593706", "0.59104717", "0.5894079", "0.58867645", "0.5874596", "0.5858708", "0.58429295", "0.58253163", "0.5807749", "0.57968974", "0.5796544...
0.0
-1
Return the sequence of letters on the reflector.
def letters @letters.join("") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def letters\n # the_letters = []\n letter_regex = /[a-z]/i\n # for i in 0..self.length - 1\n # character = self[i]\n # if (character.match(letter_regex))\n # the_letters << character\n # end\n # end\n\n # self.chars.each do |character|\n # if character.match(letter_regex)\...
[ "0.72158295", "0.69570714", "0.6926662", "0.68904597", "0.6764149", "0.6706202", "0.6706202", "0.6649412", "0.65311885", "0.6524821", "0.6502596", "0.6443188", "0.6435509", "0.64260197", "0.6414374", "0.64039165", "0.6389422", "0.63270694", "0.6261627", "0.6218776", "0.619361...
0.76369154
0
Get the current letter position of the rotor.
def current_letter @letters[self.position] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def position_for(char)\n return ''.freeze if char.position.y == @y\n\n @y = char.position.y\n char.position.to_s\n end", "def current_char\n @current_char\n end", "def getAlphabeticalPosition()\n \n @alphabeticalPosition = returnPermutationsBefore(@multiLetterDivisor) + 1\n ...
[ "0.68672055", "0.6770376", "0.6634781", "0.6595292", "0.6595292", "0.6354422", "0.63511574", "0.63159454", "0.62628335", "0.62415946", "0.6236456", "0.61646485", "0.61506283", "0.6139785", "0.61211425", "0.60932535", "0.60834205", "0.60301054", "0.6013547", "0.60059726", "0.5...
0.78007245
0
GET /customer_users GET /customer_users.json
def index @customer_users = CustomerUser.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @customers = @user.customers.all\n render json: @customers\n end", "def index\n @user = current_user\n @customers = @user.customers\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @customers }\n en...
[ "0.7715447", "0.76284164", "0.7294764", "0.72746605", "0.7166863", "0.7097876", "0.706521", "0.7025746", "0.6991902", "0.6927888", "0.6877634", "0.6840204", "0.68299955", "0.6819776", "0.6819776", "0.67977816", "0.67977816", "0.6795483", "0.6790534", "0.67780924", "0.67735255...
0.71540993
5