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 |
|---|---|---|---|---|---|---|
Gets the statistics for all the RTSP profile. | def all_statistics
super
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rtsp_statistics\n super\n end",
"def get_all_time_sampling_profile\n {\n method: \"Memory.getAllTimeSamplingProfile\"\n }\n end",
"def stats\n Client.current.get(\"#{resource_url}/stats\")\n end",
"def stats\n response[\"stats\"]\n end",
"def stat... | [
"0.6554155",
"0.6513015",
"0.6342399",
"0.6158902",
"0.6115791",
"0.60776454",
"0.604171",
"0.604171",
"0.60020363",
"0.59317636",
"0.59203297",
"0.5903324",
"0.5837413",
"0.5768416",
"0.5725708",
"0.5717446",
"0.5693302",
"0.567123",
"0.5662358",
"0.56558734",
"0.56542903",
... | 0.0 | -1 |
Gets the states to indicate how the RTSP filter handles the source attribute in the transport header. If true, the system will use the source attribute in the transport header to establish the target address of the RTP stream, and will update the value of the source attribute to be the virtual address (VIP) before the ... | def check_source_state
super
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_source_header?\n false\n end",
"def is_source?\n @before.nil?\n end",
"def src_addr_on_header\n request.headers['X-Forwarded-For'] || request.headers['REMOTE_ADDR']\n end",
"def source resolver = nil\n source =\n if ipv4? then\n @ipv4_header\n elsif ipv6? then... | [
"0.5825899",
"0.54495585",
"0.5398412",
"0.5389634",
"0.53434193",
"0.52816594",
"0.51022947",
"0.5061781",
"0.50461274",
"0.50425315",
"0.50425315",
"0.502995",
"0.501652",
"0.50071096",
"0.5001154",
"0.49904376",
"0.4981639",
"0.4979894",
"0.49646723",
"0.49595913",
"0.4949... | 0.4927001 | 22 |
Gets the names of the default profile from which this profile will derive default values for its attributes. | def default_profile
super
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def default_properties\n begin\n SETTINGS[self.class.to_s.downcase]['default_properties']\n rescue\n []\n end\n end",
"def info_defaults\n [:dn, :email, :firstName, :lastName, :fullName, :citizenshipStatus,\n :country, :grantBy, :organizations, :uid, :dutyorg, :visa... | [
"0.67806304",
"0.65118796",
"0.6452768",
"0.6360012",
"0.6337309",
"0.63272053",
"0.63010013",
"0.62956065",
"0.6218587",
"0.6198631",
"0.6079782",
"0.60738784",
"0.60356164",
"0.59820473",
"0.5954468",
"0.5920524",
"0.59104526",
"0.5904921",
"0.58940285",
"0.58894736",
"0.58... | 0.6433335 | 10 |
Gets the idle timeouts (seconds) for this RTSP profile. This is the number of seconds that the UDP data connections are allowed to idle before they are closed. | def idle_timeout
super
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def idle_timeout()\n if transport && (t = transport.remote_idle_timeout)\n Rational(t, 1000) # More precise than Float\n end\n end",
"def timeout_in_minutes\n data[:timeout_in_minutes]\n end",
"def idle_timeout\n @agent.idle_timeout\n end",
"def get_timeouts\n @... | [
"0.6927321",
"0.6569857",
"0.6545935",
"0.6523919",
"0.6523919",
"0.6523919",
"0.6491681",
"0.6457892",
"0.63612163",
"0.63612163",
"0.6279725",
"0.6242333",
"0.6088507",
"0.6086387",
"0.6012943",
"0.60016",
"0.59668314",
"0.59653276",
"0.5927533",
"0.5910499",
"0.5899203",
... | 0.5531837 | 50 |
Gets a list of all RTSP profile. | def list
super
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list()\n\t\t\tkparams = {}\n\t\t\tclient.queue_service_action_call('cdvradapterprofile', 'list', 'KalturaCDVRAdapterProfileListResponse', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend",
"def pull_profiles\n \tprofiles_from_api = self.clie... | [
"0.6706182",
"0.64612883",
"0.6447574",
"0.64305675",
"0.62854487",
"0.62825036",
"0.6219123",
"0.621281",
"0.6188615",
"0.6133864",
"0.6113665",
"0.6106877",
"0.6104507",
"0.6038918",
"0.6010221",
"0.590451",
"0.58226734",
"0.58226734",
"0.5790999",
"0.578323",
"0.5641879",
... | 0.0 | -1 |
Gets the maximum header sizes for this RTSP profile. This is the largest RTSP request or response header that the RTSP filter (control channel) will allow before aborting the connection. | def maximum_header_size
super
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_maximum_header_size(opts)\n opts = check_params(opts,[:sizes])\n super(opts)\n end",
"def set_maximum_header_size(opts)\n opts = check_params(opts,[:sizes])\n super(opts)\n end",
"def maximum_frame_size\n\t\t\t\t@remote_settings.maximum_frame_size\n\t\t\tend",
"def ws_messag... | [
"0.6079202",
"0.6079202",
"0.6052313",
"0.5930747",
"0.58998704",
"0.5845871",
"0.5797089",
"0.5797089",
"0.5640896",
"0.5576268",
"0.55477345",
"0.553345",
"0.5528212",
"0.54956126",
"0.5486908",
"0.54680324",
"0.5414697",
"0.54044265",
"0.5396626",
"0.5367845",
"0.53623086"... | 0.63051116 | 1 |
Gets the maximum queued data sizes for this RTSP profile. This is the maximum amount of data that the RTSP filter (control channel) will buffer before assuming the connection is dead and subsequently aborting the connection. | def maximum_queued_data_size
super
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_queue_size\n if @number_of_processes\n @queueSize = @number_of_processes\n else\n @queueSize = DATSauce::PlatformUtils.processor_count * 2\n # get max threads from platform utils\n end\n @queueSize\n end",
"def queue_size\n _get(\"/system/queue-size\") {... | [
"0.67224354",
"0.6694302",
"0.65585285",
"0.6489846",
"0.63588756",
"0.63555485",
"0.6351835",
"0.63136387",
"0.62978494",
"0.62978494",
"0.6293516",
"0.6232589",
"0.6229626",
"0.61986685",
"0.61986685",
"0.6157659",
"0.614688",
"0.61283267",
"0.61253387",
"0.61126715",
"0.61... | 0.69677407 | 0 |
Gets the states to indicate whether to allow redirection of multicasts for this RTSP profile. If enabled, the client is allowed to select the destination where data will be streamed. | def multicast_redirect_state
super
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_multicast_redirect_state(opts)\n opts = check_params(opts,[:states])\n super(opts)\n end",
"def unicast_redirect_state\n super\n end",
"def set_unicast_redirect_state(opts)\n opts = check_params(opts,[:states])\n super(opts)\n end",
"def passive\n\tm=[]\n\n\t# Via HT... | [
"0.540773",
"0.5122343",
"0.49316922",
"0.48184326",
"0.4740415",
"0.47184053",
"0.46903887",
"0.46833834",
"0.4681199",
"0.4670969",
"0.46469605",
"0.4626129",
"0.46181127",
"0.45946082",
"0.45806485",
"0.45617798",
"0.45455813",
"0.45146644",
"0.45073673",
"0.45028964",
"0.... | 0.5381076 | 1 |
Gets the names of the headers that are passed from the client side VIP to the server side VIP in an RTSP proxy configuration. The name of the header should begin with "X". | def proxy_header
super
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def headerlist; return ['X-MXL-NoteHash', 'X-MXL-Hash', 'X-MX-Bounce']; end",
"def get_request_headers\n request.env.find_all {|k, v|\n UnprefixedHeaders.include?(k) || k.start_with?('HTTP_')\n }.map {|k, v|\n range = UnprefixedHeaders.include?(k) ? 0..-1 : 1..-1\n [k.sp... | [
"0.7058545",
"0.6916013",
"0.68464345",
"0.67823",
"0.670102",
"0.65971065",
"0.65864265",
"0.6556355",
"0.65019673",
"0.65010184",
"0.64906883",
"0.6450321",
"0.6441831",
"0.6441831",
"0.6441245",
"0.6438584",
"0.6429978",
"0.6428739",
"0.6416587",
"0.64030313",
"0.6398361",... | 0.0 | -1 |
Gets the proxy types that this RTSP filters are associated with. | def proxy_type
super
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def proxy_types; end",
"def types\n types = ActiveRDF::Query.new(N::SourceClass).distinct(:t).where(self,N::RDF::type,:t).execute\n # Add the \"default\" types if necessary\n self.class.default_types.each do |def_type|\n types << def_type unless(types.include?(def_type))\n end\n \... | [
"0.6766988",
"0.5905452",
"0.5875535",
"0.57176834",
"0.5704013",
"0.56016743",
"0.5598252",
"0.5594051",
"0.554245",
"0.554245",
"0.5535147",
"0.5534184",
"0.5502223",
"0.54094636",
"0.54094636",
"0.5395521",
"0.5392654",
"0.5321577",
"0.5311107",
"0.5287993",
"0.5286698",
... | 0.5245303 | 22 |
Gets the RTCP port for this RTSP profile. | def rtcp_port
super
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rtp_port=(port)\n @rtp_port = port\n @rtcp_port = @rtp_port + 1\n end",
"def getPort()\n return @uri.port\n end",
"def remote_port\n return @remote_port\n end",
"def rport\n\t\t@target_port\n\tend",
"def preferred_port\n @preferred_port\n end... | [
"0.5978408",
"0.57220185",
"0.5704727",
"0.56370384",
"0.5624232",
"0.55813724",
"0.55576164",
"0.55534977",
"0.5550528",
"0.5524952",
"0.5379341",
"0.53653324",
"0.5363686",
"0.5338299",
"0.53194886",
"0.53132087",
"0.53132087",
"0.53060246",
"0.53001785",
"0.52685165",
"0.5... | 0.5510711 | 10 |
Gets the RTP port for this RTSP profile. | def rtp_port
super
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rtp_port=(port)\n @rtp_port = port\n @rtcp_port = @rtp_port + 1\n end",
"def src_port\n @src_port.length == 1 ? @src_port[0] : @src_port\n end",
"def rport\n datastore['RPORT']\n end",
"def getPort()\n return @uri.port\n end",
"def port\n return @... | [
"0.6875926",
"0.5508926",
"0.54768085",
"0.5365791",
"0.5345435",
"0.52868205",
"0.52699506",
"0.5262216",
"0.5261767",
"0.525538",
"0.5205666",
"0.5198926",
"0.51811576",
"0.5153292",
"0.5089951",
"0.5081718",
"0.50611174",
"0.49828845",
"0.4956562",
"0.4956562",
"0.4942143"... | 0.6120815 | 1 |
Gets the states to indicate whether the RTSP filter will automatically handle persisting Real Networks tunneled RTSP over HTTP, over the RTSP port. The default value is enabled. Disabling this value allows the user to override the default behavior with a rule. | def rtsp_over_http_persistence_state
super
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stp_enabled_state\n super\n end",
"def conditional_requests=(enabled); end",
"def available_states\n states = []\n states << :passive if passive?\n states << :pending if passive? || pending?\n states << :active\n states << :suspended unless deleted?\n states << :deleted\n stat... | [
"0.58184224",
"0.56345403",
"0.548743",
"0.53896827",
"0.5349162",
"0.5268158",
"0.52361023",
"0.5233692",
"0.5216355",
"0.51723856",
"0.51701343",
"0.51425904",
"0.5085684",
"0.5024749",
"0.5010521",
"0.50088483",
"0.5000625",
"0.49680057",
"0.49571693",
"0.49381587",
"0.488... | 0.5159079 | 11 |
The RTSP specification allows a control connection to be resumed after it has become disconnected. Gets the states to indicate whether the RTSP filter will persist the control connection that is being resumed to the correct server. | def session_reconnect_state
super
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def can_reattempt_connect_for_state?(state)\n case state\n when :disconnected\n time_spent_attempting_state(:disconnected, ignore_states: [:connecting]) < connection.connection_state_ttl\n when :suspended\n true # suspended state remains indefinitely\n else\n ... | [
"0.55554265",
"0.5147861",
"0.51063174",
"0.5089772",
"0.5087018",
"0.50859517",
"0.50839716",
"0.5001564",
"0.49973488",
"0.49613678",
"0.49188995",
"0.49117574",
"0.49055788",
"0.49055788",
"0.48627466",
"0.48626843",
"0.48422125",
"0.48320866",
"0.4807221",
"0.48056254",
"... | 0.4539748 | 58 |
Gets the statistics for this RTSP profile. | def statistics
super
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stats\n response[\"stats\"]\n end",
"def stats\n Client.current.get(\"#{resource_url}/stats\")\n end",
"def stats\n return self.endpoint.stats(self.id)\n end",
"def rtsp_statistics\n super\n end",
"def stats\n _get(\"/system/stats\") { |json| json }\n end... | [
"0.701418",
"0.69042295",
"0.681231",
"0.67136353",
"0.6504009",
"0.6345313",
"0.6333966",
"0.63263214",
"0.63057005",
"0.6291274",
"0.6291274",
"0.6259487",
"0.62331766",
"0.6215178",
"0.6199249",
"0.619835",
"0.6170827",
"0.61683005",
"0.6120271",
"0.6120271",
"0.6098003",
... | 0.54945654 | 73 |
Gets the states to indicate whether to allow redirection of unicasts for this RTSP profile. If enabled, the client is allowed to select the destination where data will be streamed. | def unicast_redirect_state
super
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_unicast_redirect_state(opts)\n opts = check_params(opts,[:states])\n super(opts)\n end",
"def is_enable_direct_url\n return @direct_url != nil && @direct_url == \"true\"\n end",
"def unicast_stream\n Set[self]\n end",
"def multicast_redirect_state\n super\n end",
... | [
"0.5610655",
"0.51891154",
"0.5046605",
"0.48825935",
"0.48452535",
"0.4831758",
"0.48189753",
"0.48025018",
"0.4796401",
"0.4756398",
"0.47563502",
"0.47347155",
"0.47142172",
"0.46848652",
"0.4665142",
"0.4647054",
"0.463851",
"0.45688358",
"0.45643374",
"0.4552552",
"0.454... | 0.5764842 | 0 |
Gets the version information for this interface. | def version
super
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def versions\n info[:versions]\n end",
"def get_version\n request('getVersion')\n end",
"def version\n self[:version]\n end",
"def getVersion\r\n\t\t\t\t\treturn @version\r\n\t\t\t\tend",
"def version\n @version\n end",
"def version\n return @version\n ... | [
"0.75569206",
"0.7525785",
"0.7351491",
"0.7316212",
"0.72740763",
"0.7263238",
"0.7263238",
"0.7263238",
"0.7263238",
"0.7263238",
"0.7263238",
"0.7263238",
"0.7263238",
"0.7263238",
"0.71812236",
"0.71682125",
"0.7123709",
"0.71198016",
"0.71106577",
"0.71022844",
"0.709299... | 0.0 | -1 |
Determines whether this profile are base/preconfigured profile, or userdefined profile. | def is_base_profile
super
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def profile?(profile=RC.current_profile)\n self.profile == (profile || 'default').to_s\n end",
"def profile?\n instance.options[:profile]\n end",
"def has_profile?\n return self.profile.present?\n end",
"def profile_type\n return @profile_type if @profile_type\n\n @profile_t... | [
"0.8220585",
"0.76744926",
"0.69489473",
"0.67570335",
"0.6684086",
"0.66471165",
"0.6614185",
"0.65904033",
"0.6448535",
"0.63045484",
"0.63045484",
"0.6260409",
"0.6254542",
"0.62480557",
"0.62206614",
"0.6202809",
"0.6199636",
"0.6199586",
"0.6153111",
"0.61435556",
"0.612... | 0.7560923 | 9 |
Resets the statistics for this RTSP profile. | def reset_statistics
super
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset_rtsp_statistics\n super\n end",
"def stats_reset\n @stats = nil\n end",
"def reset_stats\n @ping_stats = RightSupport::Stats::Activity.new\n @retry_stats = RightSupport::Stats::Activity.new\n @request_stats = RightSupport::Stats::Activity.new\n @result_stats = RightSup... | [
"0.77180773",
"0.7687024",
"0.736648",
"0.73167646",
"0.7218459",
"0.706815",
"0.706815",
"0.7062292",
"0.696313",
"0.6904173",
"0.6851351",
"0.6829327",
"0.6726912",
"0.6602668",
"0.65543073",
"0.65320104",
"0.6432764",
"0.6404493",
"0.63808966",
"0.6348796",
"0.62733525",
... | 0.6983735 | 18 |
Sets the states to indicate how the RTSP filter handles the source attribute in the transport header. If true, the system will use the source attribute in the transport header to establish the target address of the RTP stream, and will update the value of the source attribute to be the virtual address (VIP) before the ... | def set_check_source_state(opts)
opts = check_params(opts,[:states])
super(opts)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_nat_source_address(opts)\n opts = check_params(opts,[:nat_states])\n super(opts)\n end",
"def set_source_port_behavior(opts)\n opts = check_params(opts,[:source_port_behaviors])\n super(opts)\n end",
"def set_source_port_behavior(opts)\n opts = check_params(opts,[:source_... | [
"0.60283095",
"0.5624531",
"0.56226736",
"0.5409487",
"0.52982354",
"0.5289764",
"0.527831",
"0.5278022",
"0.52559173",
"0.52286464",
"0.51649445",
"0.51382786",
"0.51382786",
"0.51218325",
"0.50974524",
"0.50974524",
"0.5092757",
"0.5082836",
"0.50678915",
"0.50646996",
"0.5... | 0.5432322 | 3 |
Sets the names of the default profile from which this profile will derive default values for its attributes. | def set_default_profile(opts)
opts = check_params(opts,[:defaults])
super(opts)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def default_profile\n super\n end",
"def default_profile\n super\n end",
"def default_profile\n super\n end",
"def default_profile\n super\n end",
"def default_profile\n super\n end",
"def default_profile\n super\n end",
"def default_profile\n super\... | [
"0.7003473",
"0.7003473",
"0.7003473",
"0.7003473",
"0.7003473",
"0.7003473",
"0.7003473",
"0.7003473",
"0.62879956",
"0.60302275",
"0.6017118",
"0.59742385",
"0.59742385",
"0.5961683",
"0.5927742",
"0.5923132",
"0.58971393",
"0.58971393",
"0.58971393",
"0.58971393",
"0.58971... | 0.72344184 | 7 |
Sets the idle timeouts (seconds) for this RTSP profile. This is the number of seconds that the UDP data connections are allowed to idle before they are closed. | def set_idle_timeout(opts)
opts = check_params(opts,[:timeouts])
super(opts)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def idle_timeout=(idle_timeout); end",
"def idle_timeout=(timeout); end",
"def idle_timeout= idle_timeout\n @agent.idle_timeout = idle_timeout\n end",
"def idle_timeout( new_timeout=nil )\n\t\t\t@idle_timeout = new_timeout if new_timeout\n\t\t\treturn @idle_timeout\n\t\tend",
"def max_idle_time\n ... | [
"0.72378445",
"0.7214121",
"0.6987832",
"0.666907",
"0.66479415",
"0.6506345",
"0.6442328",
"0.63562506",
"0.63562506",
"0.63562506",
"0.61763686",
"0.6173471",
"0.6173471",
"0.61598086",
"0.6153257",
"0.61462456",
"0.6078717",
"0.6078717",
"0.60654867",
"0.6061122",
"0.60569... | 0.68169445 | 5 |
Sets the maximum header sizes for this RTSP profile. This is the largest RTSP request or response header that the RTSP filter (control channel) will allow before aborting the connection. | def set_maximum_header_size(opts)
opts = check_params(opts,[:sizes])
super(opts)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def maximum_header_size\n super\n end",
"def maximum_header_size\n super\n end",
"def headers_send_size=(newsize)\n raise \"The headers are already sent and you cannot modify the send-size any more.\" if self.headers_sent?\n _httpsession.size_send = newsize.to_i\n return nil\n end",
... | [
"0.6581005",
"0.6581005",
"0.60715353",
"0.5895608",
"0.58877164",
"0.5882871",
"0.57706887",
"0.57706887",
"0.57443666",
"0.5654247",
"0.5610332",
"0.54833865",
"0.54621375",
"0.5299637",
"0.5213336",
"0.5209",
"0.52051294",
"0.5179436",
"0.5166502",
"0.5125331",
"0.5116046"... | 0.7602142 | 1 |
Sets the maximum queued data sizes for this RTSP profile. This is the maximum amount of data that the RTSP filter (control channel) will buffer before assuming the connection is dead and subsequently aborting the connection. | def set_maximum_queued_data_size(opts)
opts = check_params(opts,[:sizes])
super(opts)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def maximum_queued_data_size\n super\n end",
"def set_connection_pool_maximum_size(opts)\n opts = check_params(opts,[:sizes])\n super(opts)\n end",
"def max_chunk_size=(size)\n case size.to_s.downcase\n when 'wan'\n @max_chunk_size = 1420\n when 'lan'\n @max_ch... | [
"0.721285",
"0.64077806",
"0.6332515",
"0.6325466",
"0.62379533",
"0.6163509",
"0.614314",
"0.6079906",
"0.603748",
"0.603748",
"0.60351044",
"0.6023334",
"0.59705234",
"0.59705234",
"0.59705234",
"0.59509987",
"0.5942707",
"0.5875105",
"0.58705986",
"0.58642864",
"0.5849686"... | 0.77480614 | 0 |
Sets the states to indicate whether to allow redirection of multicasts for this RTSP profile. If enabled, the client is allowed to select the destination where data will be streamed. | def set_multicast_redirect_state(opts)
opts = check_params(opts,[:states])
super(opts)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_unicast_redirect_state(opts)\n opts = check_params(opts,[:states])\n super(opts)\n end",
"def multicast_redirect_state\n super\n end",
"def set_bridge_multicast_state(opts)\n opts = check_params(opts,[:states])\n super(opts)\n end",
"def unicast_redirect_state\n ... | [
"0.6340366",
"0.60115",
"0.5922282",
"0.5636035",
"0.486339",
"0.48370782",
"0.47712708",
"0.4747175",
"0.47439674",
"0.47022012",
"0.46876812",
"0.4680357",
"0.46226454",
"0.45555225",
"0.45337278",
"0.4513157",
"0.4512272",
"0.44979608",
"0.44876513",
"0.44872406",
"0.44590... | 0.68984455 | 0 |
Sets the names of the headers that are passed from the client side VIP to the server side VIP in an RTSP proxy configuration. The name of the header should begin with "X". | def set_proxy_header(opts)
opts = check_params(opts,[:headers])
super(opts)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def headers=(v)\n cfg_set(:headers, v)\n end",
"def setup_proxy_header(req, res)\n # Choose header fields to transfer\n header = Hash.new\n choose_header(req, header)\n set_via(header)\n return header\n end",
"def headers=(v)\n cfg_set(:headers, v)\n end"... | [
"0.67050123",
"0.670144",
"0.65866196",
"0.6329697",
"0.63150954",
"0.60831875",
"0.6062732",
"0.60314196",
"0.6020273",
"0.601445",
"0.5968088",
"0.5958109",
"0.5908121",
"0.5882475",
"0.5871773",
"0.5852825",
"0.5849685",
"0.5845424",
"0.5842526",
"0.5820938",
"0.5812671",
... | 0.6285241 | 5 |
Sets the proxy types that this RTSP filters are associated with. | def set_proxy_type(opts)
opts = check_params(opts,[:types])
super(opts)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def proxy_types; end",
"def proxytype=(value)\n Ethon.logger.warn(\n \"ETHON: Easy#proxytype= is deprecated. \"+\n \"Please use Easy#proxy= with protocoll handlers.\"\n )\n Curl.set_option(:proxytype, value_for(value, :string), handle)\n end",
"def types=(types)\n ... | [
"0.6318985",
"0.59721196",
"0.5895904",
"0.55299914",
"0.54358673",
"0.5271017",
"0.5212688",
"0.5127691",
"0.5123151",
"0.5084496",
"0.5000521",
"0.4998321",
"0.49956065",
"0.49895155",
"0.49729115",
"0.49653354",
"0.4910141",
"0.48969302",
"0.48839206",
"0.48816022",
"0.486... | 0.70855 | 0 |
Sets the RTCP port for this RTSP profile. | def set_rtcp_port(opts)
opts = check_params(opts,[:ports])
super(opts)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rtp_port=(port)\n @rtp_port = port\n @rtcp_port = @rtp_port + 1\n end",
"def remote_port=(value)\n @remote_port = value\n end",
"def set_rtp_port(opts)\n opts = check_params(opts,[:ports])\n super(opts)\n end",
"def set_port port\n @port = port\n e... | [
"0.704602",
"0.64023215",
"0.63986313",
"0.63383526",
"0.61628115",
"0.614506",
"0.6008618",
"0.59694093",
"0.5957918",
"0.59459436",
"0.5880413",
"0.58689225",
"0.58553255",
"0.5844061",
"0.57948023",
"0.5760458",
"0.57377285",
"0.5698243",
"0.5698243",
"0.56891286",
"0.5652... | 0.6668208 | 1 |
Sets the RTP port for this RTSP profile. | def set_rtp_port(opts)
opts = check_params(opts,[:ports])
super(opts)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rtp_port=(port)\n @rtp_port = port\n @rtcp_port = @rtp_port + 1\n end",
"def set_rtcp_port(opts)\n opts = check_params(opts,[:ports])\n super(opts)\n end",
"def rtp_port\n super\n end",
"def port=(p)\n attributes['port'] = p.to_s\n end",
"def set_rtp\n ... | [
"0.8042171",
"0.66624504",
"0.6304571",
"0.61375034",
"0.61219984",
"0.5929876",
"0.5778769",
"0.57517636",
"0.57450914",
"0.57092166",
"0.5703773",
"0.56770027",
"0.5660205",
"0.5624654",
"0.5613771",
"0.5490867",
"0.5477463",
"0.5467492",
"0.5439793",
"0.5439793",
"0.540203... | 0.7323501 | 1 |
Sets the states to indicate whether the RTSP filter will automatically handle persisting Real Networks tunneled RTSP over HTTP, over the RTSP port. The default value is enabled. Disabling this value allows the user to override the default behavior with a rule. | def set_rtsp_over_http_persistence_state(opts)
opts = check_params(opts,[:states])
super(opts)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def conditional_requests=(enabled); end",
"def set_stp_enabled_state(opts)\n opts = check_params(opts,[:states])\n super(opts)\n end",
"def stp_enabled_state\n super\n end",
"def set_state(modes = nil)\r\n @modes = modes\r\n @online = true\r\n end",
"def update!(**args)\n ... | [
"0.586101",
"0.5752903",
"0.55405575",
"0.5431967",
"0.54253554",
"0.54253554",
"0.5423927",
"0.5397252",
"0.5374343",
"0.5360775",
"0.53601724",
"0.53601724",
"0.53601724",
"0.53601724",
"0.53601724",
"0.53313756",
"0.52962995",
"0.52579737",
"0.5245035",
"0.52291185",
"0.51... | 0.6348523 | 0 |
The RTSP specification allows a control connection to be resumed after it has become disconnected. This sets the states to indicate whether the RTSP filter will persist the control connection that is being resumed to the correct server. | def set_session_reconnect_state(opts)
opts = check_params(opts,[:states])
super(opts)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resume\n\t\t@state = STATE_ONLINE\n\tend",
"def set_rtsp_over_http_persistence_state(opts)\n opts = check_params(opts,[:states])\n super(opts)\n end",
"def set_state(state)\n stop if state == :error and [:initializing, :ready, :running_sm].include? resource_status\n record.set_state(stat... | [
"0.5573704",
"0.5434342",
"0.5341928",
"0.5330499",
"0.53140193",
"0.52934474",
"0.52740645",
"0.5231777",
"0.51595026",
"0.5152962",
"0.5120279",
"0.509075",
"0.5083628",
"0.5062445",
"0.50289035",
"0.49970245",
"0.49799883",
"0.49387857",
"0.4922136",
"0.48598713",
"0.48504... | 0.54413813 | 1 |
Sets the states to indicate whether to allow redirection of unicasts for this RTSP profile. If enabled, the client is allowed to select the destination where data will be streamed. | def set_unicast_redirect_state(opts)
opts = check_params(opts,[:states])
super(opts)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_multicast_redirect_state(opts)\n opts = check_params(opts,[:states])\n super(opts)\n end",
"def unicast_redirect_state\n super\n end",
"def multicast_redirect_state\n super\n end",
"def set_redirect_location\n @redirect_location = @shareable\n end",
"def set_stp... | [
"0.63102996",
"0.6217044",
"0.54729325",
"0.51543486",
"0.5069824",
"0.50362545",
"0.49045628",
"0.4889612",
"0.48451504",
"0.48371962",
"0.48289922",
"0.4817892",
"0.4786695",
"0.47695652",
"0.47472608",
"0.47418433",
"0.47197193",
"0.4719224",
"0.4714906",
"0.4714906",
"0.4... | 0.6982541 | 0 |
This should probably be moved to the data_entries helper Based on the display type, returns the arguments for the formhelper methods | def prepare_form_helpers
if display_type == "text_field"
return ["data_fields", id, {id: id}]
elsif display_type == "text_area"
return ["data_fields", id]
elsif display_type == "select"
options = values.split(',').each{|opt| opt.squish!}
return ["data_fields", id, options.map{|opt| [... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def form_entry_param\n Array.new.tap do |arr|\n form.fields.map do |field|\n if field.field_type_range?\n arr << { field.id.to_s => [:from, :to] }\n\n elsif field.field_type_datetime?\n arr << { field.id.to_s => [:date, :hours, :minutes] }\n\n elsif fiel... | [
"0.61814237",
"0.6072047",
"0.5916162",
"0.5772364",
"0.5742951",
"0.57161635",
"0.57161635",
"0.57161635",
"0.57112503",
"0.5670137",
"0.5522625",
"0.55135447",
"0.5492983",
"0.5467844",
"0.5446035",
"0.5430582",
"0.54143167",
"0.540981",
"0.53492117",
"0.53443605",
"0.53353... | 0.62346333 | 0 |
run each match rule to find the group for the resource, or return 'other' group if not found | def calc_group
GROUP_MAPPINGS.keys.each do |group_id|
# return the details, and include the id for reference
return group_details(group_id) if self.in_group?(group_id)
end
# default: return 'other'
return group_details('other')
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def retrieve_remote_group\n self.each_security_group do |sg|\n sg.rules.map do |rule|\n next if rule.group.nil? || rule.group == rule.parent_group_name\n rule.group = self.find_by(:name, sg.name)\n end\n end\n end",
"def get_group(string); end",
"def group(name)\n ... | [
"0.63951737",
"0.58562285",
"0.57455903",
"0.5638764",
"0.5611811",
"0.55788726",
"0.54993",
"0.54827064",
"0.54464674",
"0.5443971",
"0.5415251",
"0.5414902",
"0.5399078",
"0.5389319",
"0.5378255",
"0.5368092",
"0.5353419",
"0.5345528",
"0.53178716",
"0.53072685",
"0.5274265... | 0.6292832 | 1 |
returns true if the resource matches any of the rules for a given group | def in_group?(group_id)
group_details = GROUP_MAPPINGS[group_id]
raise "Group not found" if group_details.nil?
group_details[MATCH_RULES].each do |rule|
matched = self.type.match(rule)
return true if matched
end
return false
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check(action, resource, group = nil)\n return false unless valid_group? group\n\n # rules precedence is bigger than inner_check\n return true if check_rules action, resource\n\n inner_check(action, resource)\n end",
"def match?(id, email)\n return true unless authenticated? #always match ... | [
"0.7028722",
"0.64262843",
"0.6404983",
"0.63294613",
"0.6259457",
"0.62593555",
"0.6225221",
"0.61399555",
"0.6082136",
"0.6079451",
"0.60791826",
"0.6061007",
"0.60523605",
"0.60512334",
"0.6022492",
"0.6014628",
"0.60080665",
"0.6000578",
"0.59798205",
"0.5979551",
"0.5964... | 0.6897544 | 1 |
Never trust parameters from the scary internet, only allow the white list through. | def notification_content_params
params.require(:notification_content).permit(:title, :message_body, :attachment_cache, :attachment, {attachments: []})
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 |
def login render :login end def display_page | def edit
@student = Student.find(params[:id])
render :edit
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def loginpage\n end",
"def login_page\n end",
"def login\n render('login')\n end",
"def login\n # render :login\n end",
"def login\n render(:login, layout:false) and return \n end",
"def displayLoginPage()\n\t# User Name: \n\t# Password:\n\t# Forgot Password?\tNew User?\n\treturn\nen... | [
"0.84844166",
"0.83541256",
"0.82984287",
"0.8293039",
"0.80885893",
"0.79285014",
"0.7852244",
"0.78004044",
"0.768074",
"0.7646711",
"0.7618553",
"0.7427387",
"0.73695326",
"0.73647183",
"0.73445064",
"0.73254067",
"0.7298994",
"0.72904354",
"0.72904354",
"0.72904354",
"0.7... | 0.0 | -1 |
SINCE YOU CAN'T BYPASS THE CONTROLLER AND GO STRAIGHT TO THE VIEW WHEN DEFINING ROUTES IT'S A VIOLATION AGAINST MVC PATTERN, I TEND TO USE THIS CONTROLLER AS ROUTES FOR PAGES THAT FALL OUTSIDE A SPECIFIC RESOURCE | def index
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def route_index; end",
"def controller(controller); end",
"def controller; end",
"def controller; end",
"def controller; end",
"def controller; end",
"def controller; end",
"def controller; end",
"def controller; end",
"def controller; end",
"def controller; end",
"def controller; end",
"de... | [
"0.6691116",
"0.6519406",
"0.6475669",
"0.6475669",
"0.6475669",
"0.6475669",
"0.6475669",
"0.6475669",
"0.6475669",
"0.6475669",
"0.6475669",
"0.6475669",
"0.6381939",
"0.6381939",
"0.63737565",
"0.6369649",
"0.6363044",
"0.6318552",
"0.6318552",
"0.6318552",
"0.6318552",
... | 0.0 | -1 |
NOTE: HELPER METHODS AREN'T ACCESSIBLE INSIDE CONTROLLERS METHODS USED BY BOTH HELPERS AND CONTROLLERS TO BE CALLED FROM ANY VIEW AND ANY CONTROLLER | def current_petsitter
petsitterobjectview = Petsitter.find_by(id: session[:petsitter] )
return petsitterobjectview
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def helpers; end",
"def helpers; end",
"def helpers; end",
"def _view; end",
"def helper(_method)\n ActionController::Base.helpers.method(_method)\n end",
"def helper\n @helper ||= ApplicationController.helpers\n end",
"def helper\n @helper\n end",
"def helper\n @he... | [
"0.72115314",
"0.72115314",
"0.72115314",
"0.64231986",
"0.639213",
"0.6351571",
"0.6305262",
"0.6305262",
"0.6221597",
"0.6221597",
"0.6138595",
"0.6123772",
"0.61211",
"0.6094109",
"0.6094109",
"0.60407585",
"0.5997766",
"0.59767157",
"0.5960855",
"0.595261",
"0.59323746",
... | 0.0 | -1 |
Declare a controller method as a helper | def require_petsitter_signin
# how we can tell if a user who is a petsitter is signed in is by checking current_petsitter method which would either return nil or a petsitter object
# we want to redirect to sign in page unless there is a petsitter object(meaning a petsitter is signed in)
unless curre... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def helper(_method)\n ActionController::Base.helpers.method(_method)\n end",
"def helpers; end",
"def helpers; end",
"def helpers; end",
"def define_action_helpers; end",
"def helper\n @helper ||= ApplicationController.helpers\n end",
"def helper\n @helper\n end",
"def hel... | [
"0.78896844",
"0.735967",
"0.735967",
"0.735967",
"0.73279613",
"0.7300658",
"0.7223526",
"0.7223526",
"0.71280813",
"0.7019406",
"0.701649",
"0.701649",
"0.69828326",
"0.6924627",
"0.6894111",
"0.6894111",
"0.68505573",
"0.67921066",
"0.6755987",
"0.6619479",
"0.6618733",
... | 0.0 | -1 |
So, what we have at the moment is a spiral, and we know we are a certian number of steps along said spiral 1716151413 1854312 1961211 2078910 21222324etc and we need to navagate back to the center as quickly as possible soooooo we need to figure out how to turn a certian number of steps into a x,y coordinate, and then ... | def findRing(spiralLoc)
currentRing=1#Our current ring, we are gonna end up returning this ... unfortunatly the maths work out nicer if we start at 1 ...
currentSum=1 #and our current sum
while spiralLoc>currentSum
currentRing+=1 #incrementing our ring number up
currentSum+=currentRing*2*4#Incrementing the n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def spiral(n) # n is the max dimensions. ex n = 5, this is a 5x5 square.\n\ta = [0,0]\n\tx = 1 # X is how many steps to go\n\t#t = 1 # T is how many times X\n\n\t# Round 1 - Positive!\n\tx.times do\n\t\ta[1] += 1\n\t\tputs a # [0,1]\n\tend\n\n\tx.times do\n\t\ta[0] += 1\n\t\tputs a # [1,1]\n\tend\n\t\n\tx += 1\n\t... | [
"0.7554959",
"0.71582854",
"0.7108948",
"0.7002764",
"0.6956078",
"0.69180775",
"0.68265086",
"0.6817606",
"0.6813227",
"0.675757",
"0.6747196",
"0.6735056",
"0.6701224",
"0.6586943",
"0.6583884",
"0.6535537",
"0.6535441",
"0.65235573",
"0.650234",
"0.64246917",
"0.64203006",... | 0.64707774 | 19 |
ok, so next we really should figure out how many memory addresses are in the rings below us ... it will narrow down our search | def getArea(ringNumber)
((ringNumber-1)*2+1)**2
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def know_neighbors\n bomb_neighbors = 0\n neighbor_coords = []\n rel_neighbor_coords = [[0, 1], [1, 1], [-1, 0], [-1, 1], [1, 0], [1, -1], [0, -1], [-1, -1]]\n rel_neighbor_coords.each do | coord |\n neighbor_coords << [@coords[0] + coord[0], @coords[1] + coord[1]]\n end\n neighbor_coords.se... | [
"0.59677064",
"0.59152305",
"0.5900579",
"0.55361074",
"0.552847",
"0.5528255",
"0.54772735",
"0.5455484",
"0.54408634",
"0.5439188",
"0.5409107",
"0.53860426",
"0.5385654",
"0.5383343",
"0.5367885",
"0.536496",
"0.5352106",
"0.53456104",
"0.5334761",
"0.5330428",
"0.53167003... | 0.0 | -1 |
alright, so with that sorted ... we can figure out which part of the ring we are in | def findCoordinates(spiralLocation)
returner=[nil,nil]
ring=findRing(spiralLocation)#ring that this spiral location is on
puts ring
ringLocation=spiralLocation-getArea(ring-1)
ringSection=ceiling(ringLocation/2.0/ring)
#ok so, what we've got out of the ring section is ...
# 1. whether we are on the x (if it's od... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def findRing(spiralLoc)\n\tcurrentRing=1#Our current ring, we are gonna end up returning this ... unfortunatly the maths work out nicer if we start at 1 ...\n\tcurrentSum=1 #and our current sum\n\twhile spiralLoc>currentSum\n\t\tcurrentRing+=1\t\t #incrementing our ring number up\n\t\tcurrentSum+=currentRing*2*4... | [
"0.5947639",
"0.5791608",
"0.57721376",
"0.57523054",
"0.57274216",
"0.5714346",
"0.5684979",
"0.5642924",
"0.5642924",
"0.552068",
"0.5495047",
"0.5483661",
"0.544421",
"0.5413072",
"0.5413072",
"0.5397071",
"0.5393127",
"0.53837603",
"0.53831357",
"0.53623277",
"0.5348941",... | 0.0 | -1 |
Function: greet Description: Say hi! | def greet(m)
return unless m.message =~ /\b(hellos?|hi(ya)?|howdy|hey|greetings|yo|sup|hai|hola),? #{m.bot.nick}\b/i
greetings = ['Hello', 'Hi', 'Hola', 'Ni hao', 'Hey', 'Yo', 'Howdy']
greeting = greetings[rand(greetings.size)]
m.reply "#{greeting}, #{m.user.nick}!"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sayHi\n\t\tputs(greet)\n\tend",
"def greet\n 'Ahoy Mateys!'\n end",
"def greet\n puts '------------------------'\n puts \"Greetings to you #{@name}\"\n end",
"def greeter\nend",
"def greetings\n\tputs \"Greetings friend!\"\nend",
"def greet(name)\n puts \"hello \" + name\nend",
"def g... | [
"0.8389536",
"0.8155066",
"0.8151555",
"0.81071603",
"0.7983699",
"0.7943182",
"0.7941654",
"0.7941654",
"0.7941654",
"0.79087615",
"0.7891568",
"0.7880581",
"0.7867641",
"0.78609437",
"0.78525305",
"0.7837601",
"0.78338766",
"0.7832918",
"0.78254807",
"0.781844",
"0.781844",... | 0.0 | -1 |
Function: timeofday_greet Description: Gives a time of dayspecific response to a greeting. i.e. 'good morning'. | def timeofday_greet(m)
return unless m.message =~ /\b(good)? ?(morning|afternoon|evening|night),? #{m.bot.nick}\b/i
m.reply "Good #{Regexp.last_match(2).downcase}, #{m.user.nick}!"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def greeting(time)\n\t\"It's already #{day_of_the_week(time)}! Time to slay the day!\"\nend",
"def potential_greetings(time)\n if time >= 5 && time <= 12 \n puts \"Good Mornin'!\"\n elsif time >= 12 && time <= 18\n puts \"Good Afternoon ma dudes!\"\n elsif time >= 18 && time <= 20\n puts \"Good eveni... | [
"0.73249775",
"0.6755421",
"0.6668454",
"0.6465696",
"0.6460346",
"0.63507646",
"0.6331161",
"0.632958",
"0.6322136",
"0.6228706",
"0.61747766",
"0.60696936",
"0.59717387",
"0.59560746",
"0.59490436",
"0.5890466",
"0.5851322",
"0.58511907",
"0.584923",
"0.58061975",
"0.580156... | 0.7698322 | 0 |
Function: farewell Description: Says farewell. | def farewell(m)
return unless m.message =~ /\b((good)?bye|adios|farewell|later|see ?(ya|you|u)|cya),? #{m.bot.nick}\b/i
farewells = ['Bye', 'Adios', 'Farewell', 'Later', 'See ya', 'See you', 'Take care']
farewell = farewells[rand(farewells.size)]
m.reply "#{farewell}, #{m.user.nick}!"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fare\n return PENALTY_FARE if penalty?\n return MINIMUM_FARE\n end",
"def calculate_fare\n @balance = -Oystercard::PENALTY_FARE if !(@entry_station && @exit_station)\n @balance = Oystercard::PENALTY_FARE - Oystercard::MINIMUM_CHARGE if (@entry_station && @exit_station)\n end",
"def farewell\n... | [
"0.6311417",
"0.61396533",
"0.59033346",
"0.5753193",
"0.57008964",
"0.56996953",
"0.5647802",
"0.56385225",
"0.5541162",
"0.5528366",
"0.5505922",
"0.54841685",
"0.5414978",
"0.5399993",
"0.5356644",
"0.5356393",
"0.5338865",
"0.5273917",
"0.52404493",
"0.5237344",
"0.523084... | 0.5272828 | 18 |
Creates a new LineNumberingProcessor. | def initialize()
super
@unsupported.delete :newline
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def line_numbering(value)\n @document_builder.line_numbering = value\n end",
"def assign_line_numbers\n line_num = 1;\n\n @line_num = [ ]\n @tokens.each do |token|\n @line_num << line_num\n line_num += token.count \"\\n\"\n end\n end",
"def with_line_numbers(y_n=true)\n ... | [
"0.6397314",
"0.61090034",
"0.59959865",
"0.5975659",
"0.57501894",
"0.5702076",
"0.5681374",
"0.5595327",
"0.55816287",
"0.556858",
"0.5500973",
"0.54960304",
"0.54789007",
"0.54312444",
"0.5422565",
"0.54124457",
"0.5404029",
"0.5397429",
"0.5374947",
"0.5360359",
"0.532072... | 0.0 | -1 |
Rewrites a Sexp using :newline nodes to fill in line and file information. | def rewrite exp
unless exp.nil?
if exp.sexp_type == :newline
@line = exp[1]
@file = exp[2]
end
exp.file ||= @file
exp.line ||= @line
end
super exp
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rewrite_newline(exp)\n # New lines look like:\n # s(:newline, 21, \"test/sample.rb\", s(:call, nil, :private, s(:arglist)) )\n sexp = exp[3]\n rewrite(sexp)\n end",
"def newline!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 100 )\n\n ty... | [
"0.7744412",
"0.5639076",
"0.55614924",
"0.5350796",
"0.5311735",
"0.53104633",
"0.5299037",
"0.52685547",
"0.52639675",
"0.52369195",
"0.52094483",
"0.52094483",
"0.52094483",
"0.52081984",
"0.51165146",
"0.5105133",
"0.5087152",
"0.50737965",
"0.50638896",
"0.5054732",
"0.5... | 0.71668655 | 1 |
Removes newlines from the expression, they are read inside of rewrite, and used to give the other nodes a line number and file. | def rewrite_newline(exp)
# New lines look like:
# s(:newline, 21, "test/sample.rb", s(:call, nil, :private, s(:arglist)) )
sexp = exp[3]
rewrite(sexp)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_mid_expression_newlines\n scan_tokens do |prev, token, post, i|\n next 1 unless post && EXPRESSION_CLOSE.include?(post[0]) && token[0] == \"\\n\"\n @tokens.delete_at(i)\n next 0\n end\n end",
"def rewrite exp\n unless exp.nil?\n if exp.sexp_type == :newline\n ... | [
"0.64332885",
"0.626454",
"0.5912111",
"0.5856412",
"0.5714056",
"0.557913",
"0.55675864",
"0.5510834",
"0.5510834",
"0.5510834",
"0.5501318",
"0.54518175",
"0.54356503",
"0.53717405",
"0.5347911",
"0.53229576",
"0.530769",
"0.52796197",
"0.52237934",
"0.521817",
"0.5216458",... | 0.6404034 | 1 |
Get full request uri | def request_uri(path)
"#{@api_url}#{path}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def full_path\n uri.request_uri\n end",
"def request_uri\n return nil if absolute? && scheme !~ /^https?$/\n res = path.to_s.empty? ? \"/\" : path\n res += \"?#{self.query}\" if self.query\n return res\n end",
"def request_uri\n @request.uri\n end",
"def request_uri\n ... | [
"0.8786264",
"0.8563415",
"0.8303243",
"0.82844913",
"0.8159769",
"0.8098412",
"0.80939907",
"0.80496603",
"0.79003406",
"0.7849571",
"0.77632546",
"0.7747951",
"0.76390606",
"0.7612423",
"0.7566937",
"0.7466792",
"0.7426754",
"0.7405252",
"0.73942333",
"0.7372924",
"0.735937... | 0.71654046 | 28 |
Encode body based on content type | def encode_body(body, content_type)
if content_type == 'application/json'
dump_json(body)
else
body
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def encode_body(body, content_type)\n if content_type =~ JSON_REGEX # vnd.api+json should pass as json\n dump_json(body)\n elsif content_type == CONTENT_URLENCODED && body.kind_of?(Hash)\n URI.encode_www_form(body)\n else\n body\n end\n end",
"def reencode(body, conten... | [
"0.8354865",
"0.77103513",
"0.77103513",
"0.7065272",
"0.70233506",
"0.7010058",
"0.6947725",
"0.6729361",
"0.6718823",
"0.6665795",
"0.6630537",
"0.662766",
"0.66038436",
"0.6566983",
"0.6561522",
"0.65545213",
"0.65110964",
"0.64469874",
"0.6437376",
"0.6437376",
"0.6423414... | 0.82004017 | 1 |
Title: Beginner Series 3 Sum of Numbers v2 | def get_sum(a, b)
a < b ? (a..b).sum : (b..a).sum
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sum(n)\n end",
"def sum_multiples_3_and_5\n return 3 * 333 * 334 / 2 + 5 * 199 * 200 / 2 - 15 * 66 * 67 / 2\nend",
"def sum; end",
"def sum_3_5(number) \r\n\tsum3 = 0\r\n\tsum5 = 0\r\n\tsum15 = 0\r\n\t0.step(number-1,3) do |num|\r\n\t\tsum3 += num\r\n\tend\r\n\t0.step(number-1,5) do |num|\r\n\t\tsum5 +... | [
"0.7448523",
"0.73091716",
"0.723814",
"0.7110367",
"0.707675",
"0.6933545",
"0.6921378",
"0.6912585",
"0.6892389",
"0.6892217",
"0.6892217",
"0.6890896",
"0.6875345",
"0.6862716",
"0.68624586",
"0.68360776",
"0.68296754",
"0.680698",
"0.67839813",
"0.6780524",
"0.67666805",
... | 0.0 | -1 |
Create a new SpanKind. | def initialize name
@name = name
@@mapping[name] = self
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize trace_id, span_id, name, start_time, end_time,\n kind: SPAN_KIND_UNSPECIFIED,\n parent_span_id: \"\", attributes: {},\n dropped_attributes_count: 0, stack_trace: [],\n dropped_frames_count: 0, time_events: [],\n ... | [
"0.6521865",
"0.6228136",
"0.62247586",
"0.6143928",
"0.60974514",
"0.60613847",
"0.59393096",
"0.5904315",
"0.57164603",
"0.5601407",
"0.5574581",
"0.54874283",
"0.5478304",
"0.54395354",
"0.54387397",
"0.53764087",
"0.5285611",
"0.5275877",
"0.5252824",
"0.52512646",
"0.520... | 0.0 | -1 |
Returns the symbolic representation of this SpanKind | def to_sym
@name
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_str\n AnchorToSymbol.rassoc(kind).first\n end",
"def to_s\n return self.symbol\n end",
"def to_s \n self.symbol\n end",
"def kind_as_string\n @ole.KindAsString\n end",
"def to_s\n to_symbol.to_s\n end",
"def to_s\n \"Span(name:#{@name},sid:#{@id... | [
"0.6809541",
"0.63872653",
"0.610227",
"0.5950198",
"0.58931303",
"0.58505344",
"0.58429044",
"0.5807455",
"0.575931",
"0.57369363",
"0.57333666",
"0.57042086",
"0.5699125",
"0.564652",
"0.564652",
"0.564652",
"0.5632754",
"0.5632754",
"0.5598128",
"0.55497295",
"0.554783",
... | 0.5787103 | 8 |
Returns the string representation of this SpanKind | def to_s
to_sym.to_s
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_s\n \"Span(name:#{@name},sid:#{@id},tid:#{@trace_id},pid:#{@parent_id})\"\n end",
"def to_str\n AnchorToSymbol.rassoc(kind).first\n end",
"def to_s\n @trace.to_s\n end",
"def kind_as_string\n @ole.KindAsString\n end",
"def to_s\n label.to_s\n end",
"def ... | [
"0.7508853",
"0.68708485",
"0.6538413",
"0.6520552",
"0.649239",
"0.6449045",
"0.635523",
"0.6299112",
"0.62152076",
"0.6192924",
"0.61802953",
"0.61802953",
"0.6134385",
"0.61324996",
"0.6131685",
"0.6124594",
"0.6124594",
"0.6124594",
"0.6124594",
"0.6123304",
"0.61192554",... | 0.0 | -1 |
Create a method for name | def name
# Input string
# Return datatype: string
# String interpolation and Ruby method sleep
puts "name your monster"
@name = gets.chomp.upcase
puts "The Gods are considering your request please wait 3 seconds"
sleep 3
puts "Congratulations: The Gods have granted your wish, they have christened y... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_method( name, &block )\n self.class.send( :define_method, name, &block )\n end",
"def create_method(name, &block)\n\t\t\tself.class.send(:define_method, name, &block)\n\t\tend",
"def create_method( class_name , method_name , args = {})\n raise \"create_method #{class_name}.#{class_name.... | [
"0.7613378",
"0.75377953",
"0.74597144",
"0.718023",
"0.70005566",
"0.6983268",
"0.6974725",
"0.69639885",
"0.6951592",
"0.68771845",
"0.6871776",
"0.68491614",
"0.6837864",
"0.6807928",
"0.67782634",
"0.6700814",
"0.6635997",
"0.6547923",
"0.6518142",
"0.6518142",
"0.6482159... | 0.0 | -1 |
Method role allows user to input what the monster does | def role
puts "Now give #{@name} a role"
@role = gets.chomp.upcase
puts "The Gods are considering your request, please wait 3 seconds"
sleep 3
puts "The Gods have heard you and #{@name} shall be a: #{@role}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def role; end",
"def role; end",
"def choose_role\n puts \"Press 1 to be the Codebreaker or 2 to be the Codemaker\"\n input = gets.chomp\n if input == \"1\"\n @maker.random_code\n elsif input == \"2\"\n @maker.set_code\n @breaker.ai = true\n else\n choose_role\n end\n end... | [
"0.6912598",
"0.6912598",
"0.69110215",
"0.6876162",
"0.6755045",
"0.65376735",
"0.6521792",
"0.6515744",
"0.6453178",
"0.6291625",
"0.6264913",
"0.62439996",
"0.6203511",
"0.618348",
"0.59902006",
"0.59849554",
"0.5983828",
"0.59752274",
"0.5964463",
"0.59601367",
"0.5956212... | 0.7208747 | 0 |
Method age gives monsters an age which is randomly assigned Outputs an integer Output uses conditional to determine next string for output | def age
puts "Now the Gods are assigning a power to #{@name}. This is up to the Gods alone."
sleep 3
@age = rand(10..100)
puts "Attention!!!"
puts "The Gods have given #{@name} the age of #{@age}, and the Gods have willed that age shall determine strength. A power of 1 is no more powerful than a ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def age\n puts \"Teddy is #{rand(20...200)} years old!\"\nend",
"def guess_age()\n return rand(17..20)\n end",
"def age!\n #tree aging code goes here\n @age += 1\n @height += rand(100..400)\n rand(50..100).times {@pears << Pear.new(rand(10..40))} if @age > FRUIT_SEASON_TIME\n end",
"def age... | [
"0.7303589",
"0.7079749",
"0.6960017",
"0.69206464",
"0.6883057",
"0.6858585",
"0.68430936",
"0.68300325",
"0.6815439",
"0.6800489",
"0.6774892",
"0.6771532",
"0.6693276",
"0.6676104",
"0.66536",
"0.6631366",
"0.661759",
"0.6576099",
"0.65202695",
"0.6506279",
"0.6498705",
... | 0.7520591 | 0 |
Power method gives user a choice to give their monster more powers. Computer slects from 4 opposing possibilities in array if Y If N then puts else string This is where game could increment and give user a fixed number of terms Alternatively two monsters could be created who would then battle. | def power
puts "Do you want to request the Gods assign #{@name} some special power?"
puts "Warning!!! The Gods may spite you for asking for too much: Y or N?"
@power = gets.chomp
if @power == "Y"
@power = ["a seer", "as dumb as a cow", "as strong as an ox",
"as fragile as a bird"].samp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def choose_power(power)\n power.downcase!\n case power\n when \"digging\"\n clear_screen\n spacing\n puts \"Ah, the digging power! Have fun throwing up dirt in search for your food treasures.\"\n $power = \"dig\"\n when \"trash diving\"\n clear_screen\n spacing\n puts... | [
"0.6542454",
"0.61348915",
"0.6051837",
"0.5923863",
"0.58877534",
"0.58812994",
"0.5721982",
"0.559601",
"0.5575507",
"0.55614763",
"0.5545126",
"0.55340093",
"0.54947466",
"0.5483629",
"0.54782254",
"0.5472636",
"0.5435528",
"0.5435224",
"0.5428633",
"0.5420588",
"0.5420466... | 0.7302369 | 0 |
gives back the index number of value found | def search_array (array, number)
counter = 0
index = []
array.each do |value|
index << counter if value == number
counter += 1
end
index.empty? ? nil : index
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_element_index(array, value_to_find)\n array.length.times do |count|\n if array[count] == value_to_find \n return count\nend\nend\nnil\nend",
"def find_element_index(array, value_to_find)\n array.length.times do |count|\n if array[count] == value_to_find\n return count\n end\n end\n ni... | [
"0.7775963",
"0.7715733",
"0.76551133",
"0.75895673",
"0.74938405",
"0.7465199",
"0.74453",
"0.7432234",
"0.7356486",
"0.72906226",
"0.728227",
"0.7270286",
"0.7185477",
"0.7174511",
"0.71380866",
"0.71273136",
"0.708455",
"0.69988215",
"0.699243",
"0.6976948",
"0.69705147",
... | 0.6806523 | 35 |
Sorting method, takes an array and returns sorted array | def sort(array)
loop do
flag = false
array.each_index do |index|
break if array[index] == array.last
if array[index] > array[index + 1]
array[index], array[index + 1] = array[index + 1], array[index]
flag = true
end
end
break if flag == false
end
retur... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def using_sort(array)\n sorted_array=array.sort\nend",
"def using_sort(array)\narray.sort\nend",
"def using_sort(array)\narray.sort\nend",
"def sort_array_asc(array)\n\tarray.sort\nend",
"def my_array_sorting_method(array)\n\t@array=array\n\t@array.sort\n\treturn @array\nend",
"def sort1(array)\n\nend"... | [
"0.8173239",
"0.8104786",
"0.8104786",
"0.7976946",
"0.7967579",
"0.79629076",
"0.7915064",
"0.7856833",
"0.7856833",
"0.7856833",
"0.7856833",
"0.7856833",
"0.7856833",
"0.78447104",
"0.7836271",
"0.7836271",
"0.7836271",
"0.7784215",
"0.77727133",
"0.76826745",
"0.7628365",... | 0.7142554 | 76 |
Returns the status or pattern of percolator for this class. | def percolator
@_percolator
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pattern\n @pattern\n end",
"def percolator\n @_percolator || instance.class.tire.percolator || nil\n end",
"def status\n return @status\n end",
"def status\n return @status\n end",
"def status\n return @s... | [
"0.60104096",
"0.5695527",
"0.5578998",
"0.5578998",
"0.5578998",
"0.5578998",
"0.5578998",
"0.5578998",
"0.5578998",
"0.5578998",
"0.5578998",
"0.5578998",
"0.5578998",
"0.5578998",
"0.5578998",
"0.5578998",
"0.5578998",
"0.5578998",
"0.5578998",
"0.5578998",
"0.5578998",
... | 0.62085366 | 0 |
Mark this instance for percolation when adding it to the index. | def percolate=(pattern)
@_percolator = pattern
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mark\n @temp = @push\n @mark = @index\n end",
"def mark!\n\t\t\t\t@marked = true\n\t\t\tend",
"def freeze\n reindex unless @clean\n super\n end",
"def add_point(point)\n point.cluster.remove_point point if point.cluster\n self.points << point\n point.cluster... | [
"0.5383807",
"0.52310777",
"0.5223086",
"0.5148856",
"0.51434445",
"0.5049182",
"0.49304944",
"0.4900306",
"0.4898562",
"0.4896379",
"0.48854005",
"0.48763484",
"0.4837335",
"0.4835549",
"0.4815145",
"0.48103142",
"0.48074254",
"0.4804175",
"0.47849163",
"0.4782662",
"0.47780... | 0.0 | -1 |
Returns the status or pattern of percolator for this instance. | def percolator
@_percolator || instance.class.tire.percolator || nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def percolator\n @_percolator\n end",
"def pattern\n @pattern\n end",
"def status\n return @status\n end",
"def status\n return @status\n end",
"def status\n return @status\n end",
"def status\n ... | [
"0.62870634",
"0.58525974",
"0.5709131",
"0.5709131",
"0.5709131",
"0.5709131",
"0.5709131",
"0.5709131",
"0.5709131",
"0.5709131",
"0.5709131",
"0.5709131",
"0.5709131",
"0.5709131",
"0.5709131",
"0.5709131",
"0.5709131",
"0.5709131",
"0.5709131",
"0.5709131",
"0.5709131",
... | 0.5820959 | 2 |
tmm = CSV.open('data/TMM_Import_Template.csv', headers:true) IMPORTANT : because this relies on processing already done in the current row, THIS SHOULD BE THE LAST SUBROUTINE CALLED IN MAIN!!!!! | def assign_products(row, input, pubYear)
products = []
base = ''
if( pubYear < 2020 )
base = 'bar_pre2020_collection'
else
base = "bar_#{pubYear}_annual"
end
products.push base
case input['Series']
when 'BAR British Series'
products.push base+='_brit'
when 'BAR International Series'
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def import_csv_full\n \n end",
"def import_csv_smart\n \n end",
"def csv\n @csv_table ||= begin\n csv_raw = File.read(CSV_PATH)\n CSV.parse(csv_raw, headers: true)\n end\n\nend",
"def process_csv\n @file = @file.tempfile\n CSV.foreach(@file, he... | [
"0.69254655",
"0.67566913",
"0.6756662",
"0.6613132",
"0.65935457",
"0.650139",
"0.6342479",
"0.63329345",
"0.6308604",
"0.6286504",
"0.6242824",
"0.6219132",
"0.6173586",
"0.6102715",
"0.6049458",
"0.60441875",
"0.60280704",
"0.6027074",
"0.6024273",
"0.60154057",
"0.6010947... | 0.0 | -1 |
Adds ourselves to the ownership list. The last one in the list may access the input through interruptible_region(). | def __with_ownership(&block)
@mutex.synchronize do
# Three cases:
# 1) There are no owners, in this case we are good to go.
# 2) The current owner of the input is not reading the input (it might
# just be evaluating some ruby that the user typed).
# The current owner ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_owner(owner_ID)\n if @owners[0] == nil\n @owners = [owner_ID]\n else\n @owners << owner_ID\n end\n end",
"def add_owner(owner_ID)\n if @owners[0] == nil\n @owners = [owner_ID]\n else\n @owners << owner_ID\n end\n end",
"def claim!\n i... | [
"0.59389186",
"0.59389186",
"0.57822007",
"0.5754531",
"0.572765",
"0.56806916",
"0.565123",
"0.554262",
"0.554262",
"0.55110997",
"0.54434663",
"0.5440486",
"0.5384157",
"0.53796494",
"0.5337447",
"0.53357303",
"0.52801573",
"0.526531",
"0.5264497",
"0.519527",
"0.5187047",
... | 0.6552393 | 0 |
Obsolete tests def test_toggle_changes_correct_cell_with_coords world1 = World.new(3,4) world1.rules.toggle(1,2, world1.world) assert_equal( [ [ ".", ".", "."], [ ".", ".", "."], | def test_count_neighbors_returns_correct_amount
rules = Rules.new([[".",".","."],[".",".","."],[".",".","."]])
assert ( 3 == rules.count_neighbors(1,1,
[[".","@","@"],["@",".","."],[".",".","."]]) )
assert ( 6 == rules.count_neighbors(1,1,
[[".","@","@"],[".",".","@"],["@","@","@"]]) )
assert ( ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_dead_cell_with_three_neighbors_lives\n assert @life.will_live?(false, 3)\n end",
"def test_live_cell_with_two_neighbors_lives\n assert @life.will_live?(true, 2)\n end",
"def test_computer_ships_sunk\n setup_game_with_submarines_on_C3_and_D3\n assert_equal false, @game.computer_ships_sunk... | [
"0.67087275",
"0.66563714",
"0.6296687",
"0.6280104",
"0.6086775",
"0.6022944",
"0.600594",
"0.5984882",
"0.5980087",
"0.5951711",
"0.5914646",
"0.59083617",
"0.5896968",
"0.5872455",
"0.58424246",
"0.5815312",
"0.5763282",
"0.5757266",
"0.5748684",
"0.57472116",
"0.57246214"... | 0.0 | -1 |
POST Create or recreate a Spotify playlist given a title | def generate_playlist
playlist = Search.find_or_create_by!(keyword: params[:keyword])
redirect_to playlist.get_playlist!(current_user, "listwalk for #{params[:keyword]}")
# Sometimes, the access token cannot be verified
# thus throwing a 401 back. Redirect to index with proper notice
rescue
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_playlist\n r = HTTParty.post(\n Spotify_api + \"/v1/users/ferretpenguin/playlists\",\n headers: { \"Accept\" => \"application/json\", \"Authorization\" => @authorization},\n body: {\n name: \"Weekly Playlist\",\n }.to_json)\n\n\n body = JSON.parse r.body\n body[\"id\"]\... | [
"0.7466582",
"0.7076837",
"0.70648366",
"0.70176375",
"0.69605666",
"0.6896509",
"0.6871074",
"0.6868779",
"0.6827785",
"0.68106544",
"0.6736638",
"0.67277646",
"0.6726602",
"0.6696253",
"0.66599977",
"0.6658288",
"0.66287977",
"0.6626047",
"0.6601463",
"0.65895176",
"0.65609... | 0.0 | -1 |
GET /rodzaj_pracownikas GET /rodzaj_pracownikas.json | def index
@rodzaj_pracownikas = RodzajPracownika.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @prueba_jsons = PruebaJson.all\n end",
"def index\n @preparatoria_o_universidad_de_origens = PreparatoriaOUniversidadDeOrigen.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @preparatoria_o_universidad_de_origens }\n end\n end",
"de... | [
"0.7290897",
"0.70171094",
"0.69696",
"0.69319475",
"0.69062006",
"0.6892055",
"0.6854771",
"0.6834547",
"0.68299884",
"0.6808771",
"0.6807779",
"0.6790135",
"0.6775285",
"0.67682254",
"0.67641556",
"0.6751184",
"0.6747686",
"0.6728923",
"0.67248213",
"0.67204326",
"0.6702211... | 0.6893538 | 5 |
GET /rodzaj_pracownikas/1 GET /rodzaj_pracownikas/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @prueba_jsons = PruebaJson.all\n end",
"def getOrden \n \t@orden = Orden.where(:rest => params[:id_res])\n \trender json: @orden\n end",
"def show\n @respuesta = Respuesta.find(params[:id])\n\n render json: @respuesta\n end",
"def index\n @repas = Repa.all\n\n respond_to do |f... | [
"0.71391666",
"0.6993588",
"0.697617",
"0.69117165",
"0.6881253",
"0.6875984",
"0.6860235",
"0.6860036",
"0.684559",
"0.68153155",
"0.68153155",
"0.68056136",
"0.6796876",
"0.6783926",
"0.67810404",
"0.67751044",
"0.6774224",
"0.67602944",
"0.6758746",
"0.6745288",
"0.674261"... | 0.0 | -1 |
POST /rodzaj_pracownikas POST /rodzaj_pracownikas.json | def create
@rodzaj_pracownika = RodzajPracownika.new(rodzaj_pracownika_params)
respond_to do |format|
if @rodzaj_pracownika.save
format.html { redirect_to @rodzaj_pracownika, notice: 'Rodzaj pracownika was successfully created.' }
format.json { render :show, status: :created, location: @r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @prueba_json = PruebaJson.new(prueba_json_params)\n\n respond_to do |format|\n if @prueba_json.save\n format.html { redirect_to @prueba_json, notice: 'Prueba json was successfully created.' }\n format.json { render action: 'show', status: :created, location: @prueba_json }\n ... | [
"0.6678849",
"0.6659103",
"0.6618492",
"0.6562258",
"0.654229",
"0.65275776",
"0.64866114",
"0.6483085",
"0.64743936",
"0.64240587",
"0.6386122",
"0.63410866",
"0.63291246",
"0.6313765",
"0.63067335",
"0.62916297",
"0.6289334",
"0.6287908",
"0.6273681",
"0.6263106",
"0.625531... | 0.71637666 | 0 |
PATCH/PUT /rodzaj_pracownikas/1 PATCH/PUT /rodzaj_pracownikas/1.json | def update
respond_to do |format|
if @rodzaj_pracownika.update(rodzaj_pracownika_params)
format.html { redirect_to @rodzaj_pracownika, notice: 'Rodzaj pracownika was successfully updated.' }
format.json { render :show, status: :ok, location: @rodzaj_pracownika }
else
format.html ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @prueba_json.update(prueba_json_params)\n format.html { redirect_to @prueba_json, notice: 'Prueba json was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { ren... | [
"0.699071",
"0.6664461",
"0.6619514",
"0.6607504",
"0.65926605",
"0.65656424",
"0.65583384",
"0.6554695",
"0.65524733",
"0.65058917",
"0.6501299",
"0.6489016",
"0.64889765",
"0.6485643",
"0.64716494",
"0.6471584",
"0.64691806",
"0.6467676",
"0.64669645",
"0.6462159",
"0.64550... | 0.6424791 | 26 |
DELETE /rodzaj_pracownikas/1 DELETE /rodzaj_pracownikas/1.json | def destroy
@rodzaj_pracownika.destroy
respond_to do |format|
format.html { redirect_to rodzaj_pracownikas_url, notice: 'Rodzaj pracownika was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @asignatura.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @prueba_json.destroy\n respond_to do |format|\n format.html { redirect_to prueba_jsons_url }\n format.json { head :no_content }\n end\n end",
"def delete... | [
"0.74160796",
"0.74142",
"0.7348636",
"0.7164973",
"0.715292",
"0.7148131",
"0.7145855",
"0.71420366",
"0.7124769",
"0.71108204",
"0.71108204",
"0.7092769",
"0.7088193",
"0.7085743",
"0.70682526",
"0.7057442",
"0.70556283",
"0.70475",
"0.7038237",
"0.7031903",
"0.7031595",
... | 0.70481896 | 17 |
Use callbacks to share common setup or constraints between actions. | def set_rodzaj_pracownika
@rodzaj_pracownika = RodzajPracownika.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 rodzaj_pracownika_params
params.require(:rodzaj_pracownika).permit(:ID_rodzajprac, :rodazj_prac)
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.69802505",
"0.6781974",
"0.67470175",
"0.67430073",
"0.67350477",
"0.6593221",
"0.6504263",
"0.64988977",
"0.6481794",
"0.64800006",
"0.64568025",
"0.64411247",
"0.6379476",
"0.63765615",
"0.6368045",
"0.6320141",
"0.6300363",
"0.6300057",
"0.62952244",
"0.6294712",
"0.629... | 0.0 | -1 |
def playlist_ids params[:props][:playlist_ids] end | def search_term
if params[:props]
params[:props][:search_term]
else
return nil
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def playlist_id;\treturn @json_data['playlist_id'];\tend",
"def subscription_params\n {:playlist_id => @playlist.id}\n end",
"def get_playlist_vids(playlist)\n Log.log.debug \"Returning playlist vids\"\n vids = Array.new\n playlist.playlist_items.each {|item| vids << item.video_id}\n return vids\ne... | [
"0.71518385",
"0.70277363",
"0.69359547",
"0.6901813",
"0.68992746",
"0.68555677",
"0.6843144",
"0.68303186",
"0.68276346",
"0.67868984",
"0.6780766",
"0.67413616",
"0.67413616",
"0.67413616",
"0.67413616",
"0.67376935",
"0.6731274",
"0.6724984",
"0.67248386",
"0.66822165",
"... | 0.0 | -1 |
GET /sizes GET /sizes.json | def index
respond_to do |format|
format.html { @sizes = Size.all }
format.json { @sizes = Size.order(:name) }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_sizes\n @item = Item.find(params[:id])\n @sizes = @item.variants_for(:size, nil, params[:colour])\n respond_to do |format|\n format.json { render :json => @sizes }\n end\n end",
"def list\n @sizes = Admin::Size.all\n\n render json: { sizes: @sizes }\n end",
"def index\n @siz... | [
"0.8136878",
"0.79906666",
"0.73033905",
"0.7300564",
"0.7221485",
"0.70094013",
"0.68684834",
"0.6837686",
"0.67877424",
"0.67323846",
"0.66871",
"0.66808563",
"0.66507584",
"0.6626935",
"0.6582233",
"0.6554229",
"0.6523962",
"0.65130043",
"0.6511861",
"0.65058404",
"0.64766... | 0.7324994 | 2 |
GET /sizes/1 GET /sizes/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_sizes\n @item = Item.find(params[:id])\n @sizes = @item.variants_for(:size, nil, params[:colour])\n respond_to do |format|\n format.json { render :json => @sizes }\n end\n end",
"def list\n @sizes = Admin::Size.all\n\n render json: { sizes: @sizes }\n end",
"def index\n resp... | [
"0.8058863",
"0.7707797",
"0.7307143",
"0.7245306",
"0.71214724",
"0.71112037",
"0.6917717",
"0.6850906",
"0.6747701",
"0.6711364",
"0.6707561",
"0.6689937",
"0.66845036",
"0.66680044",
"0.6644164",
"0.66151035",
"0.6597985",
"0.6595268",
"0.65695965",
"0.65695834",
"0.656872... | 0.0 | -1 |
POST /sizes POST /sizes.json | def create
@size = Size.new size_params
respond_to do |format|
if @size.save
format.html { redirect_to [:admin, @size], notice: t('messages.created', model:Size.model_name.human) }
format.json { render action: 'show', status: :created, location: @size }
else
format.html { re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @size = Admin::Size.new(size_params)\n\n if @size.save\n render json: @size, status: :created#, location: @size\n else\n render json: @size.errors, status: :unprocessable_entity\n end\n end",
"def set_sizes\n @size = Size.find(params[:id])\n end",
"def size_params\n ... | [
"0.76007164",
"0.71498376",
"0.71255076",
"0.7005281",
"0.6923478",
"0.69144",
"0.6816628",
"0.6768846",
"0.6746254",
"0.66500944",
"0.66047853",
"0.6574506",
"0.6552128",
"0.6538872",
"0.6490958",
"0.6490958",
"0.64604205",
"0.6396359",
"0.638157",
"0.6343469",
"0.63195777",... | 0.6747474 | 8 |
PATCH/PUT /sizes/1 PATCH/PUT /sizes/1.json | def update
respond_to do |format|
if @size.update(size_params)
format.html { redirect_to [:admin, @size], notice: t('messages.updated', model:Size.model_name.human) }
format.json { head :no_content }
else
format.html { render action: 'edit' }
format.json { render json: @s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n if @size.update(size_params)\n render json: @size, status: :ok#, location: @size\n else\n render json: @size.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @size.update(size_params)\n format.html { redirect_to @size, n... | [
"0.7611473",
"0.73845625",
"0.70988876",
"0.70538676",
"0.6840355",
"0.68090487",
"0.6774686",
"0.6709351",
"0.65790975",
"0.6573734",
"0.6519762",
"0.6519122",
"0.65037036",
"0.64609313",
"0.6446068",
"0.6430001",
"0.64299846",
"0.64299846",
"0.62442994",
"0.62402356",
"0.62... | 0.73228616 | 2 |
DELETE /sizes/1 DELETE /sizes/1.json | def destroy
begin
@size.destroy
respond_to do |format|
format.html { redirect_to admin_sizes_url, notice: t('messages.deleted', model:Size.model_name.human) }
format.json { head :no_content }
end
rescue ActiveRecord::InvalidForeignKey => e
flash[:error] = t 'errors.messag... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @size.destroy\n respond_to do |format|\n format.html { redirect_to sizes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @size.destroy\n\n render json: @size, status: :ok#, location: @size\n end",
"def destroy\n @admin_size.destroy\n respond_... | [
"0.79964894",
"0.7853951",
"0.7436627",
"0.735875",
"0.7307277",
"0.724324",
"0.7184013",
"0.71698576",
"0.7131747",
"0.7122032",
"0.7096082",
"0.7026168",
"0.7017179",
"0.6996017",
"0.6925552",
"0.69036955",
"0.6869338",
"0.6832866",
"0.6801249",
"0.67801833",
"0.6707523",
... | 0.72230595 | 6 |
Use callbacks to share common setup or constraints between actions. | def set_sizes
@size = Size.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 size_params
params.require(:size).permit :name, :description, :splittable
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.69802505",
"0.6781974",
"0.67470175",
"0.67430073",
"0.67350477",
"0.6593221",
"0.6504263",
"0.64988977",
"0.6481794",
"0.64800006",
"0.64568025",
"0.64411247",
"0.6379476",
"0.63765615",
"0.6368045",
"0.6320141",
"0.6300363",
"0.6300057",
"0.62952244",
"0.6294712",
"0.629... | 0.0 | -1 |
GET /c_likes GET /c_likes.json | def index
@c_likes = CLike.all
if params[:comment_id].present?
like = CLike.find_by(user_id: current_user.id, comment_id: params[:comment_id])
render json: {status: 'success', like: like, counts: CLike.where(comment_id: params[:comment_id]).count, liked: like.present?}
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_likes\n user = User.find(params[:user_id])\n likes = user.likes\n render json: likes\n\nend",
"def index\n @likes = Like.all\n render json: @likes, status: 200\n end",
"def get_likes media_id\n url = API + \"media/#{media_id}/likes?access_token=\" + @access_token\n get(url)['... | [
"0.7578904",
"0.75106186",
"0.7483569",
"0.7410986",
"0.72927266",
"0.7284583",
"0.7238111",
"0.7167504",
"0.70773137",
"0.7076917",
"0.70005906",
"0.68855333",
"0.68188167",
"0.6818012",
"0.6818012",
"0.681268",
"0.6802099",
"0.67992973",
"0.6788047",
"0.67873496",
"0.675516... | 0.757135 | 1 |
GET /c_likes/1 GET /c_likes/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_likes\n user = User.find(params[:user_id])\n likes = user.likes\n render json: likes\n\nend",
"def index\n @likes = Like.all\n render json: @likes, status: 200\n end",
"def index\n @c_likes = CLike.all\n if params[:comment_id].present?\n like = CLike.find_by(user_id: cur... | [
"0.7654578",
"0.7588878",
"0.75102323",
"0.7418352",
"0.7391274",
"0.72953326",
"0.7022443",
"0.69915015",
"0.69678295",
"0.69665086",
"0.6922274",
"0.69057524",
"0.69033825",
"0.6889923",
"0.6889923",
"0.68841",
"0.68479407",
"0.68418974",
"0.68162256",
"0.68055326",
"0.6782... | 0.0 | -1 |
POST /c_likes POST /c_likes.json | def create
@c_like = CLike.new(user_id: current_user.id, comment_id: params[:comment_id])
respond_to do |format|
if @c_like.save
format.html { redirect_to :back, notice: 'Like was successfully created.' }
format.json { render json: {status: 'success', like: @c_like, counts: CLike.where(comment_id: ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def postlikes\n render json: @likes.length, status: 200\n end",
"def create_likes\n end",
"def create_likes\n end",
"def create_likes\n end",
"def like\n if @vote\n authorize! :like, @vote\n @vote.like\n else \n authorize! :create_vote, @votable.votes.new\n @votable.v... | [
"0.7602593",
"0.7390603",
"0.7390603",
"0.7390603",
"0.70534825",
"0.6961425",
"0.6906912",
"0.6871369",
"0.68571895",
"0.6813561",
"0.68064564",
"0.67910403",
"0.6772798",
"0.67127794",
"0.67127794",
"0.6704647",
"0.6684229",
"0.6673954",
"0.66664934",
"0.6639606",
"0.663849... | 0.71904427 | 4 |
PATCH/PUT /c_likes/1 PATCH/PUT /c_likes/1.json | def update
respond_to do |format|
if @c_like.update(c_like_params)
format.html { redirect_to @c_like, notice: 'C like was successfully updated.' }
format.json { render :show, status: :ok, location: @c_like }
else
format.html { render :edit }
format.json { render json: @c_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n render json: Like.update(params[\"id\"], params[\"like\"])\n end",
"def update_likes\n @wish.update(like_params)\n end",
"def update\n respond_to do |format|\n if @like.update(like_params)\n format.json { render json: @like, status: :ok }\n else\n format.json { r... | [
"0.7129053",
"0.696687",
"0.69165057",
"0.6646052",
"0.6587011",
"0.6582156",
"0.65808034",
"0.6505598",
"0.64959127",
"0.646471",
"0.6438363",
"0.6434221",
"0.64290154",
"0.63728213",
"0.63475794",
"0.63368136",
"0.6214339",
"0.6185156",
"0.6172508",
"0.6160431",
"0.6150454"... | 0.6668666 | 3 |
DELETE /c_likes/1 DELETE /c_likes/1.json | def destroy
@c_like = CLike.find_by(user_id: current_user.id, comment_id: params[:comment_id])
@c_like.destroy
respond_to do |format|
format.html { redirect_to :back, notice: 'Like was successfully destroyed.' }
format.json { render json: {status: 'success', like: @c_like, counts: CLike.where(co... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_likes\n end",
"def delete_likes\n end",
"def delete_likes\n end",
"def delete\n render json: Like.delete(params[\"id\"])\n end",
"def destroy\n @like = Like.find(params[:id])\n @like.destroy\n\n respond_to do |format|\n format.html { redirect_to likes_url }\n format.jso... | [
"0.7751501",
"0.7751501",
"0.7751501",
"0.76173174",
"0.7376399",
"0.72787166",
"0.7174488",
"0.71722054",
"0.7105569",
"0.7105569",
"0.7037612",
"0.7026736",
"0.69998276",
"0.6974718",
"0.6938857",
"0.693206",
"0.692144",
"0.6907067",
"0.69066024",
"0.6887163",
"0.68693215",... | 0.71290857 | 8 |
Use callbacks to share common setup or constraints between actions. | def set_c_like
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 c_like_params
params.require(:c_like).permit(:user_id, :comment_id)
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 |
def valid_begin_date? if effective_beg_date.present? if effective_beg_date < Date.civil(1900,1,1) errors.add(:effective_beg_date, "must be after 1900.") return false else return true end else return true end end | def valid_end_date?
if effective_end_date.present?
if effective_end_date < Date.civil(1900,1,1)
errors.add(:effective_end_date, "must be after 1900.")
return false
else
return true
end
else
return true
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def begin_date_cannot_be_greater_than_end_date\n if effective_end_date.present? && effective_end_date > Date.civil(1900, 1, 1) && effective_begin_date.present? && effective_begin_date > Date.civil(1900, 1, 1)\n if (effective_begin_date > effective_end_date)\n local_message = \"Begin date can... | [
"0.8493053",
"0.7791999",
"0.75851315",
"0.75048804",
"0.74525565",
"0.7414231",
"0.7298743",
"0.72711986",
"0.7269682",
"0.7207354",
"0.72005785",
"0.71957654",
"0.71895623",
"0.7146458",
"0.71451753",
"0.71346176",
"0.71067125",
"0.71067125",
"0.709517",
"0.7049074",
"0.701... | 0.8207228 | 1 |
How do I check for an item in an array with a certain name? | def examine(item)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def item_exists?(name)\n items.detect { |item| item.name == name }\n end",
"def is_item_in_array(array,item)\n return array.include?(item)\nend",
"def innit?(array, item_to_look_for)\n\tresult = false\n\tarray.each do |list_item|\n\t\tif list_item == item_to_look_for\n\t\t\tresult = true\t\n\t\tend\n\... | [
"0.70370024",
"0.7032793",
"0.7010523",
"0.67941093",
"0.67919284",
"0.67824644",
"0.67732555",
"0.66211975",
"0.66023946",
"0.65914965",
"0.65773684",
"0.65666556",
"0.6565602",
"0.65494066",
"0.6546507",
"0.65459704",
"0.6537394",
"0.6507575",
"0.6483125",
"0.6454708",
"0.6... | 0.0 | -1 |
Create new Node object. If +id+ is +nil+ a new unique negative ID will be allocated. | def initialize(attrs = {})
attrs = attrs.dup.stringify_keys!
@lon = attrs['lon'].to_f rescue nil
@lat = attrs['lat'].to_f rescue nil
super(attrs)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new_node\n id = @nodes.size\n node = Node.new(id: id)\n @nodes.push(node)\n id\n end",
"def add id\n return unless @nodes[id].nil?\n @nodes[id] = Array.new\n end",
"def new_node(element)\n Node.new(element)\n end",
"def bnode(id)\n id.gsub!(/[^A-Za-z0-9\\-_]/, '_')\... | [
"0.74382836",
"0.6507118",
"0.63477093",
"0.6303044",
"0.6253342",
"0.6132995",
"0.6116539",
"0.5999445",
"0.5969429",
"0.5960762",
"0.5949093",
"0.59288317",
"0.59283113",
"0.5906262",
"0.59026253",
"0.58977437",
"0.5897174",
"0.58832824",
"0.5855554",
"0.58368635",
"0.58198... | 0.0 | -1 |
List of attributes for a Node | def attribute_list
[:id, :version, :uid, :user, :timestamp, :lon, :lat, :changeset]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def attributes\n node[1]\n end",
"def attributes\n\t\treturn attributes_of @current_node\n\tend",
"def attributes\n attribute_nodes.each_with_object({}) do |node, hash|\n hash[node.node_name] = node\n end\n end",
"def attributes\n (node.attributes['attrs'] || ... | [
"0.84633666",
"0.8054519",
"0.7911453",
"0.75749",
"0.75221163",
"0.7411067",
"0.7245381",
"0.7225327",
"0.7203603",
"0.7159381",
"0.7052119",
"0.70433676",
"0.7017425",
"0.7005776",
"0.7005064",
"0.70038635",
"0.696381",
"0.6960521",
"0.6940008",
"0.6921732",
"0.68829423",
... | 0.6281949 | 92 |
rubocop:disable Metrics/AbcSize rubocop:disable Metrics/MethodLength rubocop:disable Metrics/CyclomaticComplexity rubocop:disable Metrics/PerceivedComplexity | def process_tb_screened
tb_screened_data = find_tb_screened_data
tb_screened_data.each do |patient|
age_group = patient['age_group']
next unless pepfar_age_groups.include?(age_group)
gender = patient['gender'].to_sym
metrics = @report[age_group][gende... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def private; end",
"def implementation; end",
"def implementation; end",
"def probers; end",
"def strategy; end",
"def schubert; end",
"def refutal()\n end",
"def offences_by; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def used?; end",
"def inten... | [
"0.7251694",
"0.6039049",
"0.6039049",
"0.5979582",
"0.58592343",
"0.58204705",
"0.5816026",
"0.5772713",
"0.5680276",
"0.5680276",
"0.5680276",
"0.5680276",
"0.5677024",
"0.5630721",
"0.559484",
"0.559484",
"0.5567181",
"0.5567181",
"0.5564538",
"0.5540128",
"0.5540128",
"... | 0.0 | -1 |
rubocop:enable Metrics/AbcSize rubocop:enable Metrics/MethodLength rubocop:enable Metrics/CyclomaticComplexity rubocop:enable Metrics/PerceivedComplexity | def execute_query(query)
ActiveRecord::Base.connection.select_all(query)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def private; end",
"def implementation; end",
"def implementation; end",
"def probers; end",
"def schubert; end",
"def strategy; end",
"def refutal()\n end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def offences_by; end",
"def used?; end",
"def inten... | [
"0.7320475",
"0.61145204",
"0.61145204",
"0.6092322",
"0.5940488",
"0.5874232",
"0.58720297",
"0.5774892",
"0.5774892",
"0.5774892",
"0.5774892",
"0.57653624",
"0.5727569",
"0.5721843",
"0.56936216",
"0.5674986",
"0.5674986",
"0.56202674",
"0.56202674",
"0.56122166",
"0.56122... | 0.0 | -1 |
altera o layout da pagina | def new
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_layout\n @layoutme = 1\n end",
"def layout; end",
"def set_layout\n if 1==1\n 'application'\n else\n 'dean'\n end\n end",
"def kopal_layout_after_page_sidebar\n\n end",
"def place_in_layout?; end",
"def place_in_layout?; end",
"def kopal_layout_after_page_header\n\n ... | [
"0.77737516",
"0.72701705",
"0.7239699",
"0.7218212",
"0.7139192",
"0.7139192",
"0.7129017",
"0.7082399",
"0.7082399",
"0.7025905",
"0.70205027",
"0.6975916",
"0.695403",
"0.69146216",
"0.6872627",
"0.6856197",
"0.68154365",
"0.67714596",
"0.67714596",
"0.67297435",
"0.672586... | 0.0 | -1 |
mark cell on board with some token. mutative. does bounds checking and "is this spot taken" checking | def mark!(row, col, player)
return false if invalid_indices(row, col) || !@m[row][col].nil?
@m[row][col] = player.to_s
true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_mark(pos, mark)\n\t row, col = to_row_col(pos)\n\t return if row.nil? || col.nil?\n\t @grid[row][col] = mark\n\tend",
"def marked(row, pos)\n @board[row][pos] != 0\n end",
"def place_marker(spot, mark)\n board[spot - 1] = mark\n end",
"def update_cell(number, mark)\n if cell_free?(numbe... | [
"0.6619088",
"0.65935653",
"0.6586341",
"0.6556981",
"0.6555034",
"0.6469302",
"0.6452955",
"0.6420033",
"0.6391298",
"0.6291013",
"0.6282189",
"0.62614715",
"0.61486644",
"0.6109998",
"0.6042633",
"0.6040825",
"0.6040296",
"0.60358214",
"0.6026539",
"0.60084766",
"0.59961283... | 0.6728289 | 0 |
nonmutative version of mark! will fail silently for invalid placements. used in minimax search. | def mark(row, col, player)
new_board = Board.new(@m.map(&:dup), @human_player, @computer_player)
new_board.mark!(row, col, player.to_s)
new_board
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def place_mark(*pos, mark)\n if !valid_move?(*pos)\n pos = off_board_error\n self[*pos] = mark\n elsif !empty?(*pos)\n pos = pos_error\n self[*pos] = mark\n else\n self[*pos] = mark\n end\n end",
"def place_mark(pos, mark)\n\n if valid?(pos) && empty?(pos)\n ... | [
"0.66947",
"0.6322199",
"0.61301494",
"0.60157216",
"0.59564966",
"0.59382135",
"0.5754261",
"0.57307523",
"0.5717444",
"0.56787634",
"0.5676574",
"0.5661836",
"0.56464213",
"0.56129414",
"0.5545835",
"0.5523926",
"0.54914063",
"0.547776",
"0.5449565",
"0.54189533",
"0.541857... | 0.0 | -1 |
enumerable stuff ends maximum index of board. used for convenience. | def max_ind
@m.size - 1
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def end_board\n @end_board = []\n @end_board.push(\"|-------\")\n @end_board.push(\"| |\")\n @end_board.push(\"| O\")\n @end_board.push(\"| /|\\\\\")\n @end_board.push(\"| / \\\\\")\n @end_board.push(\"|\")\nend",
"def endCol; @col + @width - 1; end",
"def board_at_last_move\n game.bo... | [
"0.6250335",
"0.5929417",
"0.5804449",
"0.57171434",
"0.5691996",
"0.5668897",
"0.5663707",
"0.5632025",
"0.5620904",
"0.55918276",
"0.5515443",
"0.55137646",
"0.55106956",
"0.5507435",
"0.54897964",
"0.5477766",
"0.5451781",
"0.54477155",
"0.54369557",
"0.542122",
"0.5410765... | 0.5637521 | 7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.