query stringlengths 7 6.41k | document stringlengths 12 28.8k | metadata dict | negatives listlengths 30 30 | negative_scores listlengths 30 30 | document_score stringlengths 5 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
Delete a 'Embed Pods Frameworks' Script Build Phase if present | def remove_embed_frameworks_script_phase_from_target(native_target)
remove_script_phase_from_target(native_target, EMBED_FRAMEWORK_PHASE_NAME)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_copy_xcframeworks_script_phase_from_target(native_target)\n remove_script_phase_from_target(native_target, COPY_XCFRAMEWORKS_PHASE_NAME)\n end",
"def create_embed_frameworks_phase(project, t)\n \n t.build_phases.delete_if { |phase| \n phase.to_s == 'Embed Frameworks'\n... | [
"0.7098056",
"0.67912596",
"0.6777354",
"0.65161484",
"0.63132244",
"0.62601656",
"0.6252111",
"0.6181388",
"0.6180695",
"0.59834546",
"0.5946267",
"0.58439374",
"0.5722547",
"0.56842804",
"0.5630349",
"0.55702645",
"0.55023277",
"0.54310054",
"0.54300886",
"0.5404655",
"0.53... | 0.6804209 | 1 |
Adds a shell script build phase responsible to copy the xcframework slice to the intermediate build directory. | def create_or_update_copy_xcframeworks_script_phase_to_target(native_target, script_path, input_paths_by_config = {}, output_paths_by_config = {})
phase = TargetIntegrator.create_or_update_shell_script_build_phase(native_target, BUILD_PHASE_PREFIX + COPY_XCFRAMEWORKS_PHASE_NAME)
phase.shell_scri... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_copy_xcframeworks_script_phase(native_target)\n script_path = \"${PODS_ROOT}/#{target.copy_xcframeworks_script_path.relative_path_from(target.sandbox.root)}\"\n\n input_paths_by_config = {}\n output_paths_by_config = {}\n\n xcframeworks = target.xcframeworks.valu... | [
"0.75888526",
"0.700123",
"0.6526602",
"0.64533275",
"0.64480674",
"0.63587296",
"0.6202722",
"0.61730415",
"0.6154149",
"0.5999833",
"0.59893095",
"0.5960087",
"0.5894985",
"0.57374066",
"0.5666484",
"0.56215286",
"0.56177515",
"0.5610106",
"0.55437547",
"0.55349827",
"0.551... | 0.7424395 | 1 |
Delete a 'Copy XCFrameworks' Script Build Phase if present | def remove_copy_xcframeworks_script_phase_from_target(native_target)
remove_script_phase_from_target(native_target, COPY_XCFRAMEWORKS_PHASE_NAME)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_embed_frameworks_phase(project, t)\n \n t.build_phases.delete_if { |phase| \n phase.to_s == 'Embed Frameworks'\n }\n\n embed_frameworks_build_phase = project.new(\n Xcodeproj::Project::Object::PBXCopyFilesBuildPhase\n )\n\n embed_frameworks_build_phase.name = 'Embed Frame... | [
"0.67660594",
"0.6628715",
"0.6527245",
"0.6347394",
"0.6079273",
"0.6024978",
"0.5963984",
"0.590165",
"0.58984447",
"0.58905786",
"0.58841264",
"0.58121765",
"0.58029467",
"0.5783603",
"0.57787454",
"0.5745195",
"0.57395023",
"0.5721305",
"0.5674515",
"0.5672167",
"0.565794... | 0.7573576 | 0 |
Removes a script phase from a native target by name | def remove_script_phase_from_target(native_target, phase_name)
build_phase = native_target.shell_script_build_phases.find { |bp| bp.name && bp.name.end_with?(phase_name) }
return unless build_phase.present?
native_target.build_phases.delete(build_phase)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_copy_xcframeworks_script_phase_from_target(native_target)\n remove_script_phase_from_target(native_target, COPY_XCFRAMEWORKS_PHASE_NAME)\n end",
"def remove_embed_frameworks_script_phase_from_target(native_target)\n remove_script_phase_from_target(native_target, EMBED_FR... | [
"0.75342923",
"0.72990423",
"0.6754826",
"0.66617566",
"0.6188673",
"0.6130282",
"0.6057574",
"0.60063744",
"0.5924827",
"0.5904603",
"0.5879518",
"0.5789481",
"0.5708207",
"0.5695094",
"0.5688474",
"0.56761956",
"0.5633179",
"0.5575318",
"0.552158",
"0.55161124",
"0.5427239"... | 0.84856915 | 0 |
Delete a 'Copy Pods Resources' script phase if present | def remove_copy_resources_script_phase_from_target(native_target)
build_phase = native_target.shell_script_build_phases.find { |bp| bp.name && bp.name.end_with?(COPY_PODS_RESOURCES_PHASE_NAME) }
return unless build_phase.present?
native_target.build_phases.delete(build_phase)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_copy_resources_script_phase\n phase_name = \"Copy Pods Resources\"\n native_targets.each do |native_target|\n phase = native_target.shell_script_build_phases.select { |bp| bp.name == phase_name }.first ||\n native_target.new_shell_script_build_phase(phase_nam... | [
"0.66800314",
"0.6514744",
"0.62775815",
"0.62116045",
"0.6128252",
"0.6071449",
"0.6038747",
"0.5961787",
"0.596162",
"0.5850976",
"0.56830734",
"0.56733406",
"0.5597245",
"0.5553472",
"0.5553455",
"0.5506269",
"0.5488788",
"0.5477906",
"0.5455514",
"0.54488474",
"0.54360884... | 0.7444011 | 0 |
Creates or update a shell script build phase for the given target. | def create_or_update_shell_script_build_phase(native_target, script_phase_name, show_env_vars_in_log = '0')
build_phases = native_target.build_phases.grep(Xcodeproj::Project::Object::PBXShellScriptBuildPhase)
build_phases.find { |phase| phase.name && phase.name.end_with?(script_phase_name) }.tap... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_or_update_copy_xcframeworks_script_phase_to_target(native_target, script_path, input_paths_by_config = {}, output_paths_by_config = {})\n phase = TargetIntegrator.create_or_update_shell_script_build_phase(native_target, BUILD_PHASE_PREFIX + COPY_XCFRAMEWORKS_PHASE_NAME)\n phase.she... | [
"0.71108156",
"0.70612246",
"0.68617845",
"0.6617549",
"0.6260934",
"0.61934084",
"0.61624455",
"0.61587083",
"0.60037637",
"0.5873172",
"0.5734559",
"0.56950223",
"0.5687578",
"0.564136",
"0.5554124",
"0.5553439",
"0.5534892",
"0.55276144",
"0.55210054",
"0.5406049",
"0.5378... | 0.7815728 | 0 |
Returns the resource output paths for all given input paths. | def resource_output_paths(resource_input_paths)
resource_input_paths.map do |resource_input_path|
base_path = '${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}'
extname = File.extname(resource_input_path)
basename = extname == '.xcassets' ? 'Assets' : File.b... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _output_paths(file)\n input_file_dir = File.dirname(file)\n file_name = _output_filename(file)\n file_name = \"#{file_name}.erb\" if _append_html_ext_to_output_path?(file_name)\n input_file_dir = input_file_dir.gsub(Regexp.new(\"#{options[:input]}(\\/){0,1}\"), '') if options[:input]\n\n ... | [
"0.66897076",
"0.65654",
"0.63224965",
"0.63178664",
"0.624684",
"0.61743546",
"0.61714906",
"0.6109313",
"0.60726273",
"0.60675794",
"0.60056865",
"0.5977739",
"0.5953805",
"0.5951337",
"0.59202105",
"0.59168273",
"0.59031516",
"0.58494526",
"0.5840587",
"0.58181113",
"0.574... | 0.76816154 | 0 |
Returns the framework input paths for the given framework paths | def embed_frameworks_input_paths(framework_paths, xcframeworks)
input_paths = framework_paths.map(&:source_path)
# Only include dynamic xcframeworks as the input since we will not be copying static xcframework slices
xcframeworks.select { |xcf| xcf.build_type.dynamic_framework? }.eac... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def embed_frameworks_output_paths(framework_paths, xcframeworks)\n paths = framework_paths.map do |framework_path|\n \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/#{File.basename(framework_path.source_path)}\"\n end.uniq\n # Static xcframeworks are not copied to the ... | [
"0.70226055",
"0.6260233",
"0.60946685",
"0.60912216",
"0.6058688",
"0.6053993",
"0.60456896",
"0.6024619",
"0.6005011",
"0.59711254",
"0.59552926",
"0.5936528",
"0.5935329",
"0.5934319",
"0.59150016",
"0.59048796",
"0.58765805",
"0.5876535",
"0.58716",
"0.58592844",
"0.58506... | 0.787345 | 0 |
Returns the framework output paths for the given framework paths | def embed_frameworks_output_paths(framework_paths, xcframeworks)
paths = framework_paths.map do |framework_path|
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/#{File.basename(framework_path.source_path)}"
end.uniq
# Static xcframeworks are not copied to the build dir
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def embed_frameworks_input_paths(framework_paths, xcframeworks)\n input_paths = framework_paths.map(&:source_path)\n # Only include dynamic xcframeworks as the input since we will not be copying static xcframework slices\n xcframeworks.select { |xcf| xcf.build_type.dynamic_framewor... | [
"0.70253336",
"0.6675473",
"0.653083",
"0.6499567",
"0.63632137",
"0.62908715",
"0.6255764",
"0.62101877",
"0.6208901",
"0.6195849",
"0.6144477",
"0.61337125",
"0.60706973",
"0.6053972",
"0.5964605",
"0.5962045",
"0.58769554",
"0.5866441",
"0.58415556",
"0.5834538",
"0.583432... | 0.7923304 | 0 |
Updates a projects native targets to include on demand resources specified by the supplied parameters. Note that currently, only app level targets are allowed to include on demand resources. | def update_on_demand_resources(sandbox, project, native_targets, file_accessors, parent_odr_group,
target_odr_group_name)
category_to_tags = {}
file_accessors = Array(file_accessors)
native_targets = Array(native_targets)
# Target... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_on_demand_resources(native_target, app_spec)\n dependent_targets = target.dependent_targets_for_app_spec(app_spec)\n parent_odr_group = native_target.project.group_for_spec(app_spec.name)\n\n # Add ODRs of the app spec dependencies first.\n dependent_targets.each... | [
"0.58724767",
"0.576779",
"0.56466395",
"0.5448475",
"0.53682774",
"0.5301318",
"0.5281299",
"0.524073",
"0.5163851",
"0.5163851",
"0.5134046",
"0.5074465",
"0.5057932",
"0.5053632",
"0.50389576",
"0.5038832",
"0.50362545",
"0.50297695",
"0.49729547",
"0.49286824",
"0.4923264... | 0.63340986 | 0 |
Find or create a 'Copy Pods Resources' build phase | def add_copy_resources_script_phase
unless target.includes_resources?
native_targets.each do |native_target|
TargetIntegrator.remove_copy_resources_script_phase_from_target(native_target)
end
return
end
script_path = target.copy_resources_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_copy_resources_script_phase\n phase_name = \"Copy Pods Resources\"\n native_targets.each do |native_target|\n phase = native_target.shell_script_build_phases.select { |bp| bp.name == phase_name }.first ||\n native_target.new_shell_script_build_phase(phase_nam... | [
"0.7506854",
"0.63259166",
"0.60588396",
"0.60438776",
"0.5913537",
"0.5913537",
"0.5906089",
"0.58915305",
"0.5888176",
"0.5858439",
"0.5802226",
"0.57770187",
"0.5769325",
"0.5739297",
"0.5723602",
"0.5702394",
"0.5684604",
"0.5683808",
"0.56771743",
"0.5666653",
"0.5651197... | 0.6852865 | 1 |
Removes the embed frameworks build phase from embedded targets | def remove_embed_frameworks_script_phase_from_embedded_targets
return unless target.requires_host_target?
native_targets.each do |native_target|
if AggregateTarget::EMBED_FRAMEWORKS_IN_HOST_TARGET_TYPES.include? native_target.symbol_type
TargetIntegrator.remove_embed_framew... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_embed_frameworks_script_phase_from_target(native_target)\n remove_script_phase_from_target(native_target, EMBED_FRAMEWORK_PHASE_NAME)\n end",
"def add_embed_frameworks_script_phase\n unless target.includes_frameworks? || (target.xcframeworks_by_config.values.flatten.any? {... | [
"0.74486816",
"0.74412745",
"0.7373841",
"0.676171",
"0.6487609",
"0.6229096",
"0.6203047",
"0.6107716",
"0.6092439",
"0.59680283",
"0.592779",
"0.58669883",
"0.5771275",
"0.57394516",
"0.57358813",
"0.57039696",
"0.5666438",
"0.55424386",
"0.5411368",
"0.5410671",
"0.5361785... | 0.81939775 | 0 |
Updates all target script phases for the current target, including creating or updating, deleting and reordering. | def add_user_script_phases
native_targets.each do |native_target|
TargetIntegrator.create_or_update_user_script_phases(target.target_definition.script_phases, native_target)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def script_phase(options)\n raise Informative, 'Script phases can only be added within target definitions.' if current_target_definition.root?\n raise Informative, 'Script phases cannot be added to abstract targets.' if current_target_definition.abstract?\n current_target_definition.store_scri... | [
"0.63579714",
"0.61931425",
"0.58182645",
"0.569193",
"0.5387635",
"0.5368888",
"0.5324073",
"0.5166562",
"0.5161826",
"0.5152414",
"0.5149767",
"0.51259726",
"0.509653",
"0.5056445",
"0.5055019",
"0.5053777",
"0.5039345",
"0.500798",
"0.5005767",
"0.4997562",
"0.49560797",
... | 0.62622136 | 1 |
Adds a shell script build phase responsible for checking if the Pods locked in the Pods/Manifest.lock file are in sync with the Pods defined in the Podfile.lock. | def add_check_manifest_lock_script_phase
phase_name = CHECK_MANIFEST_PHASE_NAME
native_targets.each do |native_target|
phase = TargetIntegrator.create_or_update_shell_script_build_phase(native_target, BUILD_PHASE_PREFIX + phase_name)
native_target.build_phases.unshift(phase).... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_check_manifest_lock_script_phase\n phase_name = 'Check Pods Manifest.lock'\n native_targets.each do |native_target|\n next if native_target.shell_script_build_phases.any? { |phase| phase.name == phase_name }\n phase = native_target.project.new(Xcodeproj::Project::Obj... | [
"0.8060131",
"0.61538553",
"0.5682199",
"0.5630723",
"0.5587884",
"0.5550743",
"0.5519414",
"0.55132455",
"0.54747367",
"0.53839135",
"0.5336132",
"0.5320417",
"0.5279995",
"0.52783394",
"0.52426434",
"0.5242064",
"0.5242064",
"0.52115595",
"0.51987386",
"0.51917833",
"0.5174... | 0.78093374 | 1 |
Public: Elevator, Sorts elevators based on the number of stops they have | def elevator
elevators.sort_by { |e| e.stop_count }.first
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_elevators\n @elevator_number.times do |i|\n floor_gap = @building.floors / @elevator_number * i\n elevator_list.append(Elevator.new(i, 1 + floor_gap, 1 + floor_gap))\n end\n end",
"def choose_elevator\n elevator_scores = []\n\n for elevator in @column.elevator_list do\n ... | [
"0.6298116",
"0.6162324",
"0.5863129",
"0.5796128",
"0.57165194",
"0.56179225",
"0.54705626",
"0.5448131",
"0.5425242",
"0.5390634",
"0.5317472",
"0.5293465",
"0.52821577",
"0.52778375",
"0.52574193",
"0.5252519",
"0.5249105",
"0.51937574",
"0.51047045",
"0.50997806",
"0.5088... | 0.7403369 | 0 |
Method to check the domain registration status. | def check_status(domain=nil)
begin
domain = self.fqdn if domain == nil
rescue NoMethodError
raise ArgumentError, "wrong number of arguments (0 for 1)"
end
@whois = parse_query(domain)
@whois['status']
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_registration_status(domain)\n xml = send_recv(:GetRegistrationStatus, split_domain(domain))\n { :hold => xml.RegistrarHold?, :registration => xml.RegistrationStatus, :purchase => xml.PurchaseStatus }\n end",
"def valid?\n !domain.nil?\n end",
"def registered?\n begin\n se... | [
"0.6696315",
"0.66007185",
"0.65794474",
"0.651366",
"0.64911664",
"0.6426261",
"0.6426261",
"0.624149",
"0.6241229",
"0.6222592",
"0.618795",
"0.618795",
"0.61872554",
"0.6181001",
"0.6152879",
"0.6134844",
"0.6115462",
"0.6109446",
"0.6078349",
"0.60673165",
"0.60570025",
... | 0.6601201 | 1 |
Method to run the whois program with the domain and parse the output into a hash | def parse_query(domain=nil)
domain_file = "tmp/#{domain}_whois"
#puts("DEBUG >>> whois/parse_query called on domain #{domain}. Cache file will be stored in #{domain_file}")
begin
domain = self.fqdn if domain == nil
rescue NoMethodError
raise ArgumentError, "wrong number of arguments (0 for 1... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def whois(domain)\n raise InvalidDomainError unless domain.to_s =~ /\\.nz\\z/i\n\n fetch_content domain\n self\n end",
"def whoisgem(domain)\n client = Whois::Client.new\n return client.lookup(domain) # returns the Whois::Record relevant to the domain\n end",
"def get_whois_n... | [
"0.7176516",
"0.70282465",
"0.6706688",
"0.6699175",
"0.6475335",
"0.63044935",
"0.62118024",
"0.6078173",
"0.59896564",
"0.5939859",
"0.58387315",
"0.5833264",
"0.5777313",
"0.5736887",
"0.57274336",
"0.5693436",
"0.5648879",
"0.5646573",
"0.5550882",
"0.5514687",
"0.5511142... | 0.76582336 | 0 |
For each root ul/ol we are going to process all children, and then replace the root ul/ol. | def process_lists
@doc.css('ul', 'ol').each do |list|
# If we get a list (ol/ul) which is not a root, we stop processing.
if list.ancestors('ul').count > 0 || list.ancestors('ol').count > 0
return
end
textile_list = []
list.css('li').each do |li|
proc... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def process_child_nodes(node)\n node.xpath(\"./li/#{@list_tag}\").each do |list|\n # transfer attributes from parent now because the list tag will\n # no longer be a child and won't inheirit them as usual\n transfer_node_attributes(list.children, list.parent.attributes)\n ... | [
"0.62530977",
"0.6205985",
"0.62044185",
"0.61164755",
"0.60626346",
"0.60519624",
"0.6049954",
"0.60266316",
"0.5990934",
"0.59436643",
"0.5922585",
"0.58766913",
"0.5871193",
"0.5822433",
"0.58136374",
"0.57919",
"0.57919",
"0.5785689",
"0.5749788",
"0.5749248",
"0.5749038"... | 0.72732353 | 0 |
This should be in another class, we are not transforming to Textile, we are just removing the title tag. | def remove_title_if_present
@doc.css('title').each { |node| node.remove }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cleansed_title\n self.title.gsub(/[\\t\\r\\n\\f:@]/, '')\n end",
"def cut_title\n self.title.sub(RUBY_FORMAT, '')\n# self.title.sub!(RHTML_FORMAT, '')\n# self.title.sub!(RJS_FORMAT, '')\n end",
"def titleless_content\n parse if fresh?\n @content.sub(/h\\d\\..+/, '')\n end",
"def titl... | [
"0.6486843",
"0.6468631",
"0.64637405",
"0.64043486",
"0.6299299",
"0.62575483",
"0.6213798",
"0.61520493",
"0.61520493",
"0.6104568",
"0.60666037",
"0.6061295",
"0.6042974",
"0.60358334",
"0.6032165",
"0.6028055",
"0.601616",
"0.601616",
"0.601616",
"0.6011499",
"0.6007132",... | 0.70244247 | 0 |
Queue a verify API call in the Hydra. | def valid?
@hydra.queue(request('verify'))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify()\n # TODO\n end",
"def verify\n create_order\n start_challenge\n wait_verify_status\n check_verify_status\n rescue Acme::Client::Error => e\n retry_on_verify_error(e)\n end",
"def verify_response\n\n self.exec\n end",
"def verify_callback; end",
"def v... | [
"0.66038525",
"0.6555798",
"0.6433716",
"0.6430709",
"0.6430709",
"0.6425885",
"0.633897",
"0.62767875",
"0.62711334",
"0.61311936",
"0.6080868",
"0.6052273",
"0.6052273",
"0.60451573",
"0.5975101",
"0.5975101",
"0.5961242",
"0.5959812",
"0.5912138",
"0.5899672",
"0.58973867"... | 0.6897904 | 0 |
Calculates automatically the total amount. There is a gotcha: If not all the payments are from the same money, this method won't calculate the total amount because this gem doesn't force the user to use a exchange service. | def total_amount
common_currency = calculate_common_currency
if common_currency.nil?
self[:total_amount]
else
self[:total_amount] ||= PaymentAmount[calculate_total, common_currency]
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def total_payments\n total = 0\n payments.each{|payment| total += payment.amount}\n total\n end",
"def paid_total\n paid_total = 0\n unless self.payments.blank?\n for payment in self.payments\n paid_total += payment.amount.blank? ? 0 : payment.amount\n end\n end\n return pa... | [
"0.7728512",
"0.7668864",
"0.7522648",
"0.75194734",
"0.7499672",
"0.7485404",
"0.7406738",
"0.73492044",
"0.7337877",
"0.7318705",
"0.7199955",
"0.71560115",
"0.7152253",
"0.71406984",
"0.7124839",
"0.7035886",
"0.70224744",
"0.70153385",
"0.7010843",
"0.7010449",
"0.6980845... | 0.7700049 | 1 |
mount_command :: string > string | def mount_command(path)
"udisksctl mount --block-device #{path}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_mountstring\n mount = nil\n name = \"yaytest\"\n path = tmpdir\n assert_nothing_raised {\n mount = Puppet::Network::Handler.fileserver::Mount.new(name, path)\n }\n\n assert_equal(\"mount[#{name}]\", mount.to_s)\n end",
"def mount_path=(_arg0); end",
"def cmd(string)\n @com... | [
"0.61680084",
"0.6104018",
"0.6093119",
"0.6012799",
"0.5979571",
"0.59167814",
"0.5913823",
"0.58655703",
"0.5821163",
"0.5820151",
"0.5807807",
"0.579581",
"0.57951766",
"0.57951766",
"0.57951766",
"0.57951766",
"0.57951766",
"0.57951766",
"0.57941616",
"0.57668674",
"0.576... | 0.7148927 | 0 |
unmount_command :: string > string | def unmount_command(path)
"udisksctl unmount --block-device #{path}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unmount(name)\n mount_loc = File.join(KVM_MOUNT_POINT, name)\n if(system(\"umount #{mount_loc}\"))\n true\n else\n raise \"Failed to unmount kvm drive\"\n end\nend",
"def rm(path)\n cmd 'rm', path\nend",
"def unmount(opts)\n ct = lxc_ct(opts[:id])\n\n pid = ct.attach do\n next u... | [
"0.6148337",
"0.61282843",
"0.6105494",
"0.59178114",
"0.5895012",
"0.5881112",
"0.5808577",
"0.5798837",
"0.57206845",
"0.5710889",
"0.5691322",
"0.5689457",
"0.56493556",
"0.5548245",
"0.5541479",
"0.5524508",
"0.5514308",
"0.55064505",
"0.54871696",
"0.547982",
"0.54666984... | 0.7586523 | 0 |
GET /testers GET /testers.json | def index
@testers = Tester.all
respond_to do |format|
format.html # index.html.erb
format.json { render json: @testers }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @tester = Tester.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tester }\n end\n end",
"def teachers\n url = drop_url_version + \"/count/teacherAssociations/#{params['edorg_id']}/teachers\"\n begin\n entities = Re... | [
"0.69367653",
"0.66942996",
"0.635389",
"0.6339862",
"0.6263857",
"0.6202649",
"0.61038965",
"0.6098523",
"0.60888034",
"0.60538757",
"0.59716266",
"0.59070766",
"0.59070766",
"0.59070766",
"0.5889392",
"0.5889392",
"0.5861978",
"0.5832927",
"0.5828665",
"0.5826435",
"0.58264... | 0.759817 | 0 |
GET /testers/new GET /testers/new.json | def new
@tester = Tester.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @tester }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @trainer = Trainer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trainer }\n end\n end",
"def new\n @taker = Taker.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @taker }\n end\n... | [
"0.6962197",
"0.6915781",
"0.67971915",
"0.6740493",
"0.67219055",
"0.66921794",
"0.66775817",
"0.6666965",
"0.66543376",
"0.66265124",
"0.66245407",
"0.6603341",
"0.6600335",
"0.65905786",
"0.6590227",
"0.6590227",
"0.6575504",
"0.65586287",
"0.6549298",
"0.6535533",
"0.6528... | 0.7707012 | 1 |
PUT /testers/1 PUT /testers/1.json | def update
@tester = Tester.find(params[:id])
respond_to do |format|
if @tester.update_attributes(params[:tester])
format.html { redirect_to @tester, notice: 'Tester was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: "edit" }
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_put_success\n put \"/blah\", @test_obj do |response|\n assert response.ok?, \"Update test object failed\"\n end\n end",
"def test_update_successful\n data = {\n firstname: \"Anh\",\n lastname: \"Hoang\",\n avatar: \"avatar.png\",\n address: \"111D Ly Chinh Tha... | [
"0.61199856",
"0.60428333",
"0.6009719",
"0.599153",
"0.5939015",
"0.5874653",
"0.5859881",
"0.5837808",
"0.5810235",
"0.57881397",
"0.57473135",
"0.5744735",
"0.57092404",
"0.5698415",
"0.56830764",
"0.56617266",
"0.5657657",
"0.5647752",
"0.5647752",
"0.5647752",
"0.5647752... | 0.6563973 | 1 |
DELETE /testers/1 DELETE /testers/1.json | def destroy
@tester = Tester.find(params[:id])
@tester.destroy
respond_to do |format|
format.html { redirect_to testers_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @test = Test.find(params[:id])\n @test.destroy\n\n respond_to do |format|\n format.html { redirect_to tests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test.destroy\n respond_to do |format|\n format.html { redirect_to tests_url }\n f... | [
"0.71065456",
"0.7083975",
"0.7083975",
"0.70367557",
"0.6883506",
"0.6862371",
"0.6860467",
"0.6860467",
"0.6860467",
"0.6860467",
"0.6860467",
"0.6860467",
"0.6860467",
"0.68592167",
"0.68464684",
"0.6819669",
"0.6817015",
"0.67892253",
"0.6787282",
"0.67779654",
"0.6773422... | 0.77072614 | 1 |
Called by Mongrel2::Handler when it starts accepting requests. Overridden to start up the heartbeat thread. | def start_accepting_requests
self.start_heartbeat
super
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start_heartbeat\n\t\tself.log.info \"Starting heartbeat timer.\"\n\t\t@heartbeat_timer = self.reactor.add_periodic_timer( self.class.heartbeat_rate ) do\n\t\t\tself.cull_idle_sockets\n\t\t\tself.ping_all_sockets\n\t\tend\n\tend",
"def start_heartbeat\n @hb_received_at = Time.now\n send_heartbea... | [
"0.7564895",
"0.72110647",
"0.6966699",
"0.688922",
"0.68513125",
"0.68230104",
"0.64901096",
"0.64671785",
"0.6271216",
"0.62344164",
"0.6221152",
"0.6127869",
"0.61002326",
"0.6076735",
"0.5988071",
"0.5980867",
"0.5975331",
"0.59176195",
"0.59176195",
"0.58216685",
"0.5803... | 0.8145583 | 0 |
Called by Mongrel2::Handler when the server is restarted. Overridden to restart the heartbeat thread. | def restart
self.stop_heartbeat
super
self.start_heartbeat
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def on_restart(&block); end",
"def restart\n client.restart\n end",
"def restart_server\n stop_server\n sleep 1\n start_server\n end",
"def start_heartbeat\n\t\tself.log.info \"Starting heartbeat timer.\"\n\t\t@heartbeat_timer = self.reactor.add_periodic_ti... | [
"0.6904999",
"0.68003976",
"0.6763715",
"0.669449",
"0.6671425",
"0.66584456",
"0.6590591",
"0.6571508",
"0.6565373",
"0.65432674",
"0.6542003",
"0.6502352",
"0.64218545",
"0.63798964",
"0.6370832",
"0.636443",
"0.63335013",
"0.62856543",
"0.6281572",
"0.6279329",
"0.6245739"... | 0.8183777 | 0 |
Called by Mongrel2::Handler when the server is shut down. Overridden to stop the heartbeat thread. | def shutdown
self.stop_heartbeat
super
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stop_heartbeat\n\t\tself.reactor.remove_timer( @heartbeat_timer )\n\tend",
"def signal_server_down\n interrupt_server_polling_sleep\n nil\n end",
"def shutdown\n @server_active = false\n end",
"def shut_down\n trigger(:shut_down_started)\n @server.stop(true) if @server\n ... | [
"0.79765886",
"0.7400563",
"0.7303974",
"0.7200122",
"0.6892235",
"0.6854887",
"0.6834558",
"0.6832956",
"0.6822465",
"0.6822465",
"0.6822465",
"0.6813245",
"0.6813245",
"0.6813245",
"0.6813245",
"0.6813245",
"0.6813245",
"0.6813245",
"0.6795474",
"0.67950827",
"0.6772762",
... | 0.7993101 | 0 |
Disconnect any sockets that haven't sent any frames for at least SOCKET_IDLE_TIMEOUT seconds. | def cull_idle_sockets
self.log.debug "Culling idle sockets."
earliest = Time.now - self.class.idle_timeout
self.connection_times.each do |sender_id, times|
times.each do |conn_id, lastframe|
next unless earliest > lastframe
self.log.warn "Timing out connection %s:%d: last seen %0.3fs ago." %
[ ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def close_idle_sockets\n return if closed?\n return unless max_idle_time\n\n @lock.synchronize do\n i = 0\n while i < @available_connections.length\n connection = @available_connections[i]\n if last_checkin = connection.last_checkin\n if (Ti... | [
"0.6893426",
"0.6375546",
"0.6176038",
"0.61718494",
"0.61718494",
"0.61693037",
"0.60364634",
"0.60205466",
"0.60091364",
"0.59411675",
"0.59056914",
"0.58360547",
"0.5812672",
"0.579687",
"0.57572174",
"0.5739143",
"0.5730113",
"0.5686966",
"0.5680631",
"0.5609806",
"0.5573... | 0.70669025 | 0 |
Send a PING frame to all connected sockets. | def ping_all_sockets
return if self.connections.empty?
self.log.debug "Pinging %d connected sockets." % [ self.connections.length ]
self.connections.each do |sender_id, conn_ids|
frame = Mongrel2::WebSocket::Frame.new( sender_id, conn_id, '', {}, 'heartbeat' )
frame.opcode = :ping
frame.fin = true
s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def send_ping\n @connections.each do |socket|\n begin\n socket << \":\\n\"\n rescue Reel::SocketError\n @connections.delete(socket)\n end\n end\n end",
"def pong_everyone\n #log \"trying to pong\"\n if @sockets.length > 0 && !self.stopped?\n #log \"ponging\"\n ... | [
"0.71765536",
"0.64182895",
"0.64092845",
"0.62453675",
"0.62212956",
"0.61426455",
"0.6081005",
"0.5954288",
"0.59502035",
"0.59472543",
"0.59466946",
"0.5917659",
"0.5876896",
"0.577325",
"0.5772197",
"0.5748139",
"0.5626021",
"0.5625602",
"0.56120896",
"0.56100816",
"0.557... | 0.7254184 | 0 |
Validates different types based on regexp and such | def validate(type,input)
if input.nil? then return false end
if !(input.is_a? String) then return false end
case type
when 'Integer'
return !(input.match(INTEGER_FORMAT).nil?)
when 'String'
return (input.length <= 1024)
when 'Mail'
return !(input.match(MAIL_FORMAT).nil?)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate_type(type, context:); end",
"def valid_input?(owner, value)\n if value.nil?\n raise StandardError.new(\"Cannot validate null value\")\n end\n \n # Convert to string first\n value = value.to_s\n \n # Match depending on type\n case type\... | [
"0.68802184",
"0.6839543",
"0.6527269",
"0.64993024",
"0.64837825",
"0.6456251",
"0.641913",
"0.63899815",
"0.6378739",
"0.63780916",
"0.63386846",
"0.6270964",
"0.6194017",
"0.6101317",
"0.60903764",
"0.6088762",
"0.60780627",
"0.607773",
"0.6049135",
"0.60403526",
"0.601582... | 0.7350269 | 0 |
Validate payment_nonce_uuid if present Author: Aman Date: 30/05/2019 Reviewed By: | def validate_payment_nonce_uuid
return success if @payment_nonce_uuid.blank?
return error_with_identifier('invalid_api_params',
'ra_c_c_vpnu_1',
['invalid_payment_nonce_uuid']
) unless Util::CommonValidateAndSanitize.is_s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def valid_nonce?(nonce, timestamp, consumer_key)\n \n end",
"def validate_nonce(request, value, seconds_to_timeout=5*60)\n t = ActiveSupport::Base64.decode64(value).split(\":\").first.to_i\n nonce(t) == value && (t - Time.now.to_i).abs <= seconds_to_timeout\n end",
"def validate(response)\n ... | [
"0.6798067",
"0.6088441",
"0.6086424",
"0.608403",
"0.59804237",
"0.5917215",
"0.5785835",
"0.57154334",
"0.5712858",
"0.5705686",
"0.56677246",
"0.5593132",
"0.55722463",
"0.5552786",
"0.55427426",
"0.5502488",
"0.5471665",
"0.54157007",
"0.536569",
"0.5360557",
"0.5360557",... | 0.7954449 | 0 |
Retrieves cards that are in both deck and collection where deck qty != collection qty | def quantity_diff_query(coll_id, tracked_deck_id)
Card.joins(:external_deck_instances).joins(:collection_card_instances)
.where("collection_id = ? and external_deck_id = ? and
external_deck_instances.quantity !=
collection_card_instances.quantity and
collection_card_instances.quantity = 1"... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def deck_not_collection_query(coll_id, tracked_deck_id)\n\t\tcards_in_collection = Card.joins(:collection_card_instances)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.where(\"collection_id = ?\", coll_id)\n\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t.select(\"cards.id\").to_sql\n\t\tCard.joins(:external_deck_instances)\n\t\t\t\t.where(\"ex... | [
"0.68230206",
"0.5959882",
"0.58532596",
"0.5819215",
"0.55439067",
"0.5456701",
"0.54545224",
"0.53686583",
"0.5356306",
"0.53508294",
"0.534702",
"0.53214866",
"0.529456",
"0.5200646",
"0.52005833",
"0.5157011",
"0.51557565",
"0.51116216",
"0.5102882",
"0.5072869",
"0.50661... | 0.69170415 | 0 |
Retrieves cards that are in the deck but not collection | def deck_not_collection_query(coll_id, tracked_deck_id)
cards_in_collection = Card.joins(:collection_card_instances)
.where("collection_id = ?", coll_id)
.select("cards.id").to_sql
Card.joins(:external_deck_instances)
.where("external_deck_id = ? and
cards.id NOT IN (#{car... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def non_trump_cards\n @cards.select {|c| c.suit != @trump_suit}\n end",
"def filter_cards(cards)\n cards = Array(cards) unless cards.respond_to?(:count) \n return cards.select { |card| Card.get(card.id).nil? } #TODO: move this to method\n end",
"def all_not_wild\n result = []\n for card in... | [
"0.7606907",
"0.71900344",
"0.70573133",
"0.69579625",
"0.6838108",
"0.65207887",
"0.64346135",
"0.6410397",
"0.63013524",
"0.6232891",
"0.62307066",
"0.61847264",
"0.61731243",
"0.6142808",
"0.61351234",
"0.611484",
"0.6111583",
"0.6087007",
"0.6083565",
"0.6060248",
"0.6021... | 0.72905326 | 1 |
Totals number of cards missing for tracked deck | def num_cards_owned(tracked_deck)
quantity_same_cards = quantity_same_query(coll_id, tracked_deck_id(tracked_deck))
quantity_diff_cards = quantity_diff_query(coll_id, tracked_deck_id(tracked_deck))
same_card_count = quantity_same_cards.inject(0) do |quantity, card|
quantity + card_quantity(card)
end
same_c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def total_cards\n cards.count\n end",
"def numCards\n\t\t@cards.reduce(0) {|memo, card| memo += card.copies}\n\tend",
"def count\n @deck.count\n end",
"def count\n @deck.size\n end",
"def cards_in_deck\n Card.where(game_id: @game.id, owner: 0).size\n end",
"def no_of_cards\r\n @card_li... | [
"0.74861246",
"0.73736274",
"0.73668736",
"0.7309849",
"0.72209054",
"0.69569254",
"0.69569254",
"0.695109",
"0.6945925",
"0.6934842",
"0.6934842",
"0.6934842",
"0.6919808",
"0.6892707",
"0.6892707",
"0.6891934",
"0.688746",
"0.683361",
"0.68086827",
"0.6789684",
"0.6787599",... | 0.7677884 | 0 |
Returns user's collection ID | def coll_id
current_user.collection.id
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_collection_id()\r\n return @coll_id\r\n end",
"def id\n @collection.id\n end",
"def set_collection\n @collection = User.find(current_user.id).collections.find(params[:id])\n end",
"def set_collection\n @collection = current_user.collections.find(params[:id])\n end"... | [
"0.787871",
"0.75485414",
"0.7346955",
"0.7140479",
"0.71065795",
"0.70943207",
"0.706617",
"0.6924091",
"0.6712702",
"0.65566456",
"0.6532065",
"0.6513397",
"0.65081376",
"0.6499959",
"0.6488324",
"0.64867777",
"0.64555883",
"0.6444607",
"0.6385404",
"0.6370033",
"0.6331714"... | 0.86051685 | 0 |
Returns tracked deck ID | def tracked_deck_id(tracked_deck)
tracked_deck.id
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def last_guessed_card\n current_round.guesses.last.card_id\nend",
"def card_id\n card.id\n end",
"def deck\n \"TK DECK\"\n end",
"def current_card\n @deck.cards[0]\n end",
"def current_card\n @deck.cards[@turns.count]\n end",
"def game_id\n @id\n end",
"def game_id\n service... | [
"0.6738969",
"0.6412447",
"0.62486315",
"0.61921483",
"0.6138566",
"0.61309654",
"0.61103064",
"0.6102644",
"0.6070289",
"0.6045724",
"0.6045724",
"0.6045724",
"0.6045724",
"0.5985913",
"0.594382",
"0.5891126",
"0.5863037",
"0.586269",
"0.5846808",
"0.58039325",
"0.57911664",... | 0.8802808 | 0 |
Returns dust total for cards | def dust_total(cards)
cards.inject(0) do |dust_total, card|
dust_total + dust_value(card.rarity)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def total\n tot = 0\n for card in @cards\n tot += card.value\n end\n if has_ace and tot < 12\n tot2 = tot + 10\n if tot2 > 17\n return tot2\n elsif tot2 == 17\n unless @hit_soft_17\n return tot2\n end\n end\n end\n return tot\n end",
"def ... | [
"0.7352754",
"0.7171395",
"0.7079808",
"0.68658787",
"0.67936575",
"0.67681825",
"0.6722632",
"0.6616248",
"0.65452385",
"0.65284073",
"0.6528178",
"0.652529",
"0.6524382",
"0.65076166",
"0.6506992",
"0.6503395",
"0.64710736",
"0.64354193",
"0.64199483",
"0.63819104",
"0.6379... | 0.8612727 | 0 |
Returns the dust value associated with card's rarity | def dust_value(card_rarity)
case card_rarity
when "Free"
return 0
when "Common"
return 40
when "Rare"
return 100
when "Epic"
return 400
when "Legendary"
return 1600
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dust_total(cards)\n\t\tcards.inject(0) do |dust_total, card|\n\t\t\tdust_total + dust_value(card.rarity)\n\t\tend\n\tend",
"def randomRarity\n\t\tr = Random.rand\n\t\tfor rarity in RARITIES\n\t\t\tif r < DISTRIBUTION[rarity]\n\t\t\t\treturn rarity\n\t\t\tend\n\t\tend \n\tend",
"def rarity\r\n 6\r\n end... | [
"0.6842959",
"0.6626873",
"0.644227",
"0.627616",
"0.6265986",
"0.6092428",
"0.6080056",
"0.60292",
"0.5972159",
"0.5930678",
"0.5930015",
"0.58792806",
"0.5839148",
"0.58099556",
"0.5759916",
"0.5751199",
"0.5737049",
"0.5681297",
"0.5677197",
"0.5670033",
"0.5638383",
"0.... | 0.8876473 | 0 |
Returns the current month | def current_month
Date.today.strftime("%B")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def current_month\n Time.now.strftime(\"%^b\")\n end",
"def time_month; Time.now.month; end",
"def current_month\n colspan = @options[:previous_month] || @options[:next_month] ? 3 : 7 # span across all 7 days if previous and next month aren't shown\n\n show_month(@days.first, @options[:current_mo... | [
"0.85755014",
"0.82750607",
"0.82561046",
"0.8227698",
"0.7905204",
"0.7657554",
"0.7653123",
"0.7520926",
"0.751522",
"0.7468684",
"0.7428697",
"0.7398828",
"0.73548764",
"0.7280612",
"0.7273064",
"0.7248864",
"0.7248864",
"0.7236135",
"0.72231627",
"0.71911114",
"0.71835196... | 0.8837745 | 0 |
Resets the deck to its initial state | def reset!
@cards = load_cards
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset\n @cards = Card.suits.keys.map do |suit|\n Card.values.map {|i| Card.new(suit, i)}\n end.flatten\n @dealt = []\n self\n end",
"def reset!\n self.cards = CARDS.dup\n end",
"def reset!\n @hands.each(&:discard!)\n @cards += @used\n @used = []\n end... | [
"0.7677289",
"0.7619788",
"0.7354242",
"0.72920626",
"0.7029121",
"0.70242834",
"0.69429487",
"0.6933892",
"0.6880998",
"0.68518317",
"0.6824319",
"0.6736215",
"0.67171663",
"0.6687541",
"0.66756934",
"0.66600865",
"0.66305983",
"0.66120774",
"0.66120774",
"0.66015124",
"0.66... | 0.7718841 | 0 |
GET /displays/1 GET /displays/1.json | def show
@display = Display.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render :json => @display }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @displays = Display.all\n end",
"def show\n @hardware = Hardware.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @hardware }\n end\n end",
"def show\n @experiment_control = ExperimentControl.find(params[:id])\n\n ... | [
"0.7406387",
"0.67018",
"0.65529764",
"0.6539569",
"0.6536577",
"0.6519089",
"0.6515544",
"0.64929235",
"0.6418445",
"0.64058226",
"0.64058226",
"0.6384856",
"0.63755006",
"0.637004",
"0.6350795",
"0.63322103",
"0.6331071",
"0.6294739",
"0.6294739",
"0.62918437",
"0.6291266",... | 0.7049758 | 1 |
GET /displays/new GET /displays/new.json | def new
@display = Display.new
respond_to do |format|
format.html # new.html.erb
format.json { render :json => @display }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @url = Url.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @url }\n end\n end",
"def new\n @cloud = Cloud.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @cloud }\n end\n end",
... | [
"0.6886341",
"0.685189",
"0.684743",
"0.6839169",
"0.6816413",
"0.6801673",
"0.67967474",
"0.67844576",
"0.6777947",
"0.6776038",
"0.6770538",
"0.67643064",
"0.67564976",
"0.6720139",
"0.6720139",
"0.6720139",
"0.6720139",
"0.67104584",
"0.6678559",
"0.6678559",
"0.6673926",
... | 0.77718985 | 0 |
PUT /displays/1 PUT /displays/1.json | def update
@display = Display.find(params[:id])
respond_to do |format|
if @display.update_attributes(params[:display])
format.html { redirect_to @display, :notice => 'Display was successfully updated.' }
format.json { head :no_content }
else
format.html { render :action => "... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @display.update(display_params)\n format.html { redirect_to @display, notice: 'Display was successfully updated.' }\n format.json { render :show, status: :ok, location: @display }\n else\n format.html { render :edit }\n format.json {... | [
"0.6391333",
"0.6046896",
"0.6025971",
"0.599391",
"0.59579",
"0.5889966",
"0.5852696",
"0.5840017",
"0.5769007",
"0.5767611",
"0.5656527",
"0.5615269",
"0.5615269",
"0.5611087",
"0.55896235",
"0.55652785",
"0.5553896",
"0.55279565",
"0.5514554",
"0.5513218",
"0.5500137",
"... | 0.64890707 | 0 |
DELETE /displays/1 DELETE /displays/1.json | def destroy
@display = Display.find(params[:id])
@display.destroy
respond_to do |format|
format.html { redirect_to displays_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @display = Display.find(params[:id])\n @display.destroy\n\n respond_to do |format|\n format.html { redirect_to(displays_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @display.destroy\n respond_to do |format|\n format.html { redirect_to displays_url... | [
"0.7295277",
"0.7247227",
"0.6883154",
"0.68739027",
"0.68485904",
"0.6832466",
"0.68277794",
"0.68199867",
"0.67659575",
"0.67593324",
"0.66454387",
"0.66435814",
"0.66037893",
"0.66037893",
"0.6603657",
"0.66025704",
"0.66011417",
"0.6591571",
"0.65859663",
"0.654852",
"0.6... | 0.748138 | 0 |
List the house contract based on the houseid/userid/roleId combination | def contracts
#if isAuth(@userhouselink.house) # only house owner or admin can delete
id = params[:id]
print "contracts id=" + id.to_s
#houseId_userId_roleNumber
houseId,userId,role = id.to_s.split("_")
print "houseId=" + houseId.to_s + ", userId=" + userId.to_s + ", role=" + role.to_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n \n if User.find(session[:id]).role_type == \"admin\"\n @house_interest_lists = HouseInterestList.all\n elsif User.find(session[:id]).role_type == \"buyer\"\n @house_interest_lists = HouseInterestList.where(\"user_id = ?\", session[:id])\n else\n # TODO Filter all houses which... | [
"0.7065561",
"0.6148539",
"0.5889526",
"0.5803619",
"0.58031493",
"0.5802085",
"0.57494056",
"0.5730157",
"0.5725203",
"0.56907874",
"0.5658419",
"0.56570804",
"0.5607655",
"0.5600839",
"0.559615",
"0.55758566",
"0.5557621",
"0.55381143",
"0.5494804",
"0.5486327",
"0.54849654... | 0.7446135 | 0 |
Gets the applicableArchitectures property value. Contains properties for Windows architecture. | def applicable_architectures
return @applicable_architectures
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def applicable_architectures=(value)\n @applicable_architectures = value\n end",
"def detect_architecture()\r\n\t\tprint_status(\"Attempting to automatically detect the architecture\")\r\n\t\tres = send_serialized_request(\"osarch.bin\")\r\n\t\tif (res.body =~ /(i386|x86)/i)\r\n\t\t\tar... | [
"0.754819",
"0.67374974",
"0.6482059",
"0.6465427",
"0.63852566",
"0.6374508",
"0.6170374",
"0.61428696",
"0.61124086",
"0.6077849",
"0.60704404",
"0.59934604",
"0.59934604",
"0.5914384",
"0.5903381",
"0.5903381",
"0.5887445",
"0.58827317",
"0.5850506",
"0.5844784",
"0.581159... | 0.8083377 | 0 |
Sets the applicableArchitectures property value. Contains properties for Windows architecture. | def applicable_architectures=(value)
@applicable_architectures = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def applicable_architectures\n return @applicable_architectures\n end",
"def supported_archs\n @supported_archs ||= Dir.glob(File.join(__dir__, 'consts', 'sys_nr', '*.rb'))\n .map { |f| File.basename(f, '.rb').to_sym }\n .so... | [
"0.6752265",
"0.5448921",
"0.5242476",
"0.5205646",
"0.5181193",
"0.5133941",
"0.50813645",
"0.5079059",
"0.50757474",
"0.50558347",
"0.49650002",
"0.49574012",
"0.4948594",
"0.4945317",
"0.48942187",
"0.48512644",
"0.4807871",
"0.47687423",
"0.4767766",
"0.4755526",
"0.47236... | 0.8062361 | 0 |
Gets the applicableDeviceTypes property value. Contains properties for Windows device type. | def applicable_device_types
return @applicable_device_types
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def applicable_device_types=(value)\n @applicable_device_types = value\n end",
"def allowed_types\n\t\t[Device]\n\tend",
"def platform_types\n get(\"platform-types\")[\"types\"]\n end",
"def allowed_types\n\t\t[Device, Domain]\n\tend",
"def allowed_types\n\t\t[Domain,Devic... | [
"0.76458436",
"0.6872334",
"0.630855",
"0.6050196",
"0.59861934",
"0.5977894",
"0.592861",
"0.5922494",
"0.5885626",
"0.58193094",
"0.5695545",
"0.5625735",
"0.5588949",
"0.5587785",
"0.5554366",
"0.55500036",
"0.5540546",
"0.5490816",
"0.5484551",
"0.54590076",
"0.5453824",
... | 0.84048593 | 0 |
Sets the applicableDeviceTypes property value. Contains properties for Windows device type. | def applicable_device_types=(value)
@applicable_device_types = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def applicable_device_types\n return @applicable_device_types\n end",
"def allowed_types\n\t\t[Device]\n\tend",
"def set_UsageTypes(value)\n set_input(\"UsageTypes\", value)\n end",
"def device_type=(value)\n @device_type = value\n end",
"... | [
"0.6758772",
"0.5762656",
"0.570532",
"0.56365144",
"0.5500077",
"0.5481403",
"0.5264788",
"0.526408",
"0.512341",
"0.5111277",
"0.5111277",
"0.5079081",
"0.50491333",
"0.50402194",
"0.50382125",
"0.50145364",
"0.50114244",
"0.49923953",
"0.49885377",
"0.49813613",
"0.4972244... | 0.82789534 | 0 |
Gets the committedContainedApps property value. The collection of contained apps in the committed mobileAppContent of a windowsUniversalAppX app. | def committed_contained_apps
return @committed_contained_apps
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def committed_contained_apps=(value)\n @committed_contained_apps = value\n end",
"def managed_apps\n return @managed_apps\n end",
"def apps\n return @apps\n end",
"def compliant_apps_list\n return @compliant_apps_lis... | [
"0.7249253",
"0.65224946",
"0.6446249",
"0.63637567",
"0.63637567",
"0.6301004",
"0.6301004",
"0.62364256",
"0.6193645",
"0.6193645",
"0.61709696",
"0.59477043",
"0.59101737",
"0.5873077",
"0.5834695",
"0.58264476",
"0.5772239",
"0.57623154",
"0.5684509",
"0.55921525",
"0.557... | 0.7778579 | 0 |
Sets the committedContainedApps property value. The collection of contained apps in the committed mobileAppContent of a windowsUniversalAppX app. | def committed_contained_apps=(value)
@committed_contained_apps = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def committed_contained_apps\n return @committed_contained_apps\n end",
"def managed_apps=(value)\n @managed_apps = value\n end",
"def apps=(value)\n @apps = value\n end",
"def installed_apps=(value)\n @installed_app... | [
"0.647464",
"0.62848115",
"0.6057803",
"0.5866532",
"0.5866532",
"0.58548427",
"0.58548427",
"0.5799521",
"0.5799521",
"0.57533014",
"0.56424147",
"0.55927914",
"0.5431217",
"0.53694624",
"0.53576523",
"0.5320876",
"0.5204975",
"0.5072575",
"0.5072575",
"0.50648826",
"0.50232... | 0.78734946 | 0 |
Instantiates a new windowsUniversalAppX and sets the default values. | def initialize()
super
@odata_type = "#microsoft.graph.windowsUniversalAppX"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(window_or_handle)\n @main_window = case window_or_handle\n when Window\n window_or_handle\n when Integer\n Window.new window_or_handle\n else\n raise WinGui:... | [
"0.6252148",
"0.58806974",
"0.5633095",
"0.5610413",
"0.539812",
"0.5367561",
"0.53484225",
"0.528339",
"0.5231668",
"0.5147744",
"0.51375055",
"0.51279587",
"0.5097683",
"0.5095246",
"0.50710464",
"0.5061951",
"0.50201494",
"0.4995328",
"0.4979578",
"0.49622387",
"0.49612227... | 0.6203908 | 1 |
Gets the identityName property value. The Identity Name. | def identity_name
return @identity_name
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def identity_name=(value)\n @identity_name = value\n end",
"def name\n \"identity\"\n end",
"def name\n \"identity\"\n end",
"def name\n @name ||= metadata.attributes['Name'].value\n end",
"def iname\n attributes['name']\n end",
... | [
"0.77704644",
"0.68171906",
"0.670793",
"0.63422227",
"0.63371587",
"0.63371587",
"0.63371587",
"0.6310999",
"0.6257595",
"0.62386453",
"0.61399966",
"0.61399966",
"0.61110246",
"0.61110246",
"0.61110246",
"0.61110246",
"0.60955626",
"0.60774475",
"0.60698193",
"0.60634214",
... | 0.8184187 | 0 |
Sets the identityName property value. The Identity Name. | def identity_name=(value)
@identity_name = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_name(vmname)\n execute(:set_name, VMID: vm_id, VMName: vmname)\n end",
"def set_name(name)\n @name = name\n end",
"def set_name(name)\n unless name.nil?\n @name = name\n end\n @name\n end",
"def set_name(a_name)\n @name = a_name\n end",
"def set_Name(value)\n ... | [
"0.64760625",
"0.63080764",
"0.62054354",
"0.6166203",
"0.6107941",
"0.6107941",
"0.6107941",
"0.6107941",
"0.6107941",
"0.6107941",
"0.6107941",
"0.6107941",
"0.6071007",
"0.6032065",
"0.6002141",
"0.5986748",
"0.59534484",
"0.59531736",
"0.5943592",
"0.5943592",
"0.5943592"... | 0.80607766 | 0 |
Gets the identityPublisherHash property value. The Identity Publisher Hash. | def identity_publisher_hash
return @identity_publisher_hash
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def identity_publisher_hash=(value)\n @identity_publisher_hash = value\n end",
"def subscriber_hash(email)\n # Simple hash of the email address.\n Digest::MD5.hexdigest(email)\n end",
"def publisher_id\n @@publisher_id\n end... | [
"0.7262022",
"0.62221134",
"0.61998796",
"0.6110589",
"0.59888893",
"0.59888893",
"0.59888893",
"0.59888893",
"0.594417",
"0.57995397",
"0.5771863",
"0.5764781",
"0.5687812",
"0.56190515",
"0.5553423",
"0.5553423",
"0.5543121",
"0.554274",
"0.553105",
"0.55155444",
"0.5499481... | 0.7749287 | 0 |
Sets the identityPublisherHash property value. The Identity Publisher Hash. | def identity_publisher_hash=(value)
@identity_publisher_hash = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def identity_publisher_hash\n return @identity_publisher_hash\n end",
"def publisher_id=(pub_id)\n @@publisher_id = pub_id\n end",
"def publisher=(value)\n @publisher = value\n end",
"def publisher=(value)\n @publisher = value\n ... | [
"0.641728",
"0.61349046",
"0.5713129",
"0.5713129",
"0.5713129",
"0.5713129",
"0.53256893",
"0.5321547",
"0.5266213",
"0.5255182",
"0.5234663",
"0.5234663",
"0.5196565",
"0.51780987",
"0.5134948",
"0.51230896",
"0.5120138",
"0.5120138",
"0.5106773",
"0.5087401",
"0.5058881",
... | 0.8067959 | 0 |
Gets the identityResourceIdentifier property value. The Identity Resource Identifier. | def identity_resource_identifier
return @identity_resource_identifier
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def identity_resource_identifier=(value)\n @identity_resource_identifier = value\n end",
"def resource_id\n return @resource_id\n end",
"def resource_id\n return @resource_id\n end",
"def resource_id\n return @resour... | [
"0.79088676",
"0.67911166",
"0.67911166",
"0.67911166",
"0.6789129",
"0.6429631",
"0.6417267",
"0.6417267",
"0.6417267",
"0.6131746",
"0.6023177",
"0.5972557",
"0.58868754",
"0.58250946",
"0.579673",
"0.57639194",
"0.5756805",
"0.57225823",
"0.5676673",
"0.56735003",
"0.56734... | 0.85948515 | 0 |
Sets the identityResourceIdentifier property value. The Identity Resource Identifier. | def identity_resource_identifier=(value)
@identity_resource_identifier = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resource_id=(value)\n @resource_id = value\n end",
"def resource_id=(value)\n @resource_id = value\n end",
"def resource_id=(value)\n @resource_id = value\n end",
"def resource_id(resource_id)\n Apipie.set_resource_id(@c... | [
"0.70811224",
"0.70811224",
"0.70811224",
"0.6454386",
"0.63288367",
"0.6233248",
"0.58926857",
"0.57745105",
"0.57745105",
"0.574675",
"0.5626062",
"0.5456853",
"0.53346324",
"0.53346324",
"0.53346324",
"0.5314172",
"0.5314172",
"0.5314172",
"0.5314172",
"0.5314172",
"0.5314... | 0.84304595 | 0 |
Gets the identityVersion property value. The identity version. | def identity_version
return @identity_version
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def identity_version=(value)\n @identity_version = value\n end",
"def version_id\n return @version_id\n end",
"def version_number\n return @version_number\n end",
"def version_number\n @version\n end",
"def version\n ... | [
"0.8012434",
"0.7202184",
"0.71312004",
"0.70702577",
"0.67199373",
"0.6626703",
"0.6626703",
"0.66263837",
"0.66263837",
"0.66263837",
"0.66263837",
"0.66263837",
"0.65953803",
"0.65953803",
"0.65953803",
"0.65953803",
"0.65953803",
"0.65953803",
"0.65953803",
"0.65953803",
... | 0.86396176 | 0 |
Sets the identityVersion property value. The identity version. | def identity_version=(value)
@identity_version = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def version_id=(value)\n @version_id = value\n end",
"def version=(value)\n @version = value\n end",
"def version=(value)\n @version = value\n end",
"def version=(value)\n @version = value\n end",
"def v... | [
"0.69507086",
"0.6835644",
"0.6835644",
"0.6835644",
"0.6835644",
"0.6835644",
"0.6835644",
"0.6835644",
"0.6835644",
"0.6835644",
"0.6761322",
"0.6648685",
"0.6618371",
"0.6590801",
"0.65704435",
"0.6199865",
"0.615906",
"0.6068511",
"0.6020224",
"0.6013223",
"0.6013223",
... | 0.842419 | 0 |
Gets the isBundle property value. Whether or not the app is a bundle. | def is_bundle
return @is_bundle
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bundled?\n $BUNDLE || ENV.key?(\"BUNDLE\")\n end",
"def is_bundle=(value)\n @is_bundle = value\n end",
"def bundle?\n @descriptive_detail.bundle?\n end",
"def bundle_exists?\n File.exists? self.bundle_dir\n end",
"def bundle?\n @product_composition.hum... | [
"0.7860241",
"0.7747696",
"0.71905863",
"0.6793058",
"0.66005206",
"0.65717113",
"0.64848053",
"0.6107878",
"0.6011536",
"0.59816766",
"0.59372455",
"0.5902744",
"0.587771",
"0.5790042",
"0.5768125",
"0.57109594",
"0.57063776",
"0.5587821",
"0.555296",
"0.55318785",
"0.552023... | 0.86101365 | 0 |
Sets the isBundle property value. Whether or not the app is a bundle. | def is_bundle=(value)
@is_bundle = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_bundle\n return @is_bundle\n end",
"def bundled?\n $BUNDLE || ENV.key?(\"BUNDLE\")\n end",
"def set_bundle\n @bundle = Bundle.find(params[:id])\n end",
"def bundle()\n merge(notbundle: 'true')\n end",
"def bundle?\n @descriptive_detail.bundl... | [
"0.7101724",
"0.6549954",
"0.6123661",
"0.5884388",
"0.5600334",
"0.55814475",
"0.5572675",
"0.548277",
"0.5374566",
"0.537286",
"0.5306937",
"0.5306665",
"0.50813246",
"0.5070391",
"0.50437355",
"0.5022118",
"0.4991801",
"0.4991801",
"0.49761167",
"0.4884269",
"0.48604423",
... | 0.8297566 | 0 |
Gets the minimumSupportedOperatingSystem property value. The minimum operating system required for a Windows mobile app. | def minimum_supported_operating_system
return @minimum_supported_operating_system
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def minimum_supported_operating_system=(value)\n @minimum_supported_operating_system = value\n end",
"def os_minimum_version\n return @os_minimum_version\n end",
"def os_minimum_version\n return @os_minimum_version\n end",
"def ope... | [
"0.7969517",
"0.71976584",
"0.71976584",
"0.6334428",
"0.6334428",
"0.63101476",
"0.6273507",
"0.6273507",
"0.6257329",
"0.6246654",
"0.62266916",
"0.6124294",
"0.61151314",
"0.61151314",
"0.6106756",
"0.59954673",
"0.59906447",
"0.59522414",
"0.5950611",
"0.59461236",
"0.592... | 0.8513557 | 0 |
Sets the minimumSupportedOperatingSystem property value. The minimum operating system required for a Windows mobile app. | def minimum_supported_operating_system=(value)
@minimum_supported_operating_system = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def minimum_supported_operating_system\n return @minimum_supported_operating_system\n end",
"def os_minimum_version=(value)\n @os_minimum_version = value\n end",
"def os_minimum_version=(value)\n @os_minimum_version = value\n end",
... | [
"0.71812075",
"0.68334085",
"0.68334085",
"0.587645",
"0.587645",
"0.5864988",
"0.5864988",
"0.55708003",
"0.55708003",
"0.55708003",
"0.5568457",
"0.52787787",
"0.5254271",
"0.5254271",
"0.5193076",
"0.5176393",
"0.5176393",
"0.50513387",
"0.5029917",
"0.49848616",
"0.496970... | 0.8417662 | 0 |
the old profile page had review filter on the main profile page. These are the params used to come across in the query string. Here I'm redirecting to the new profile reviews page, WITHOUT those parameters...I am not attempting to translate the old param values in the the new ones. | def redirect_old_review_filters
old_params = [:min_rating, :N, :Ne, :Nf, :Nrc, :Ns, :page, :sort]
if old_params.inject(false) { |memo, key| memo |= params.has_key?(key) }
permanent_redirect_to :profile_mode => @profile_mode,
:screen_name => params[:screen_name],
:controller => 'profil... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_review_status # :norobots:\n pass_query_params\n id = params[:id].to_s\n desc = NameDescription.find(id)\n if is_reviewer?\n desc.update_review_status(params[:value])\n end\n redirect_to(:action => 'show_name', :id => desc.name_id,\n :params => query_params)\n end",
... | [
"0.61475843",
"0.6129108",
"0.6120188",
"0.60081196",
"0.60081196",
"0.59394747",
"0.5898609",
"0.5879598",
"0.58793443",
"0.5776228",
"0.577145",
"0.5763739",
"0.57447124",
"0.5743676",
"0.5727358",
"0.5713074",
"0.5713074",
"0.5712933",
"0.56751096",
"0.5644288",
"0.5622947... | 0.8074964 | 0 |
params.require(:venue).permit(:name, :street, :city, :state, :country, :latitude, :longitude, :popularity_rating) | def venue_params
params.require(:venue).permit(:name, :street, :city, :state, :country, :latitude, :longitude, :popularity_rating)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def venue_params\n params.require(:venue).permit(:name, :address, :longitude, :latitude, :neighborhood_id, :owner, :menu_address, :phone_number, :genre, :urbanist, :open_table_id,:spr_rank)\n end",
"def venue_params\n params.require(:venue).permit(:name, :street, :zip, :city)\n end",
"def venue_par... | [
"0.8762258",
"0.8758704",
"0.8664499",
"0.85965633",
"0.8529291",
"0.8449578",
"0.82946223",
"0.8227379",
"0.81355715",
"0.8134661",
"0.7883928",
"0.7754324",
"0.77355796",
"0.7674995",
"0.7602287",
"0.7564811",
"0.75022167",
"0.7477081",
"0.74583536",
"0.7436551",
"0.7428146... | 0.9377816 | 0 |
Initialiser. Cells are the cells in the object Children are other objects | def initialize(cells)
@cells = cells
@children = []
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize\n\t\t@cells = []\n\n\t\t9.times { @cells << Cell.new }\t\n\tend",
"def initialize(cell)\n super(cell)\n end",
"def initialize(cell, tentCell)\n super(cell, tentCell)\n end",
"def initialize\n @cells = reset!\n end",
"def initialize\n\t\t@width = 5\n\t\t@height = 5\n\t\t@cells = [... | [
"0.7319839",
"0.7152518",
"0.6953881",
"0.6845339",
"0.6780871",
"0.67352074",
"0.6710445",
"0.6701461",
"0.66248107",
"0.65675783",
"0.6563345",
"0.6559393",
"0.65571487",
"0.6544548",
"0.65354687",
"0.6524417",
"0.65029985",
"0.6488611",
"0.63776654",
"0.63671166",
"0.63579... | 0.7936095 | 0 |
For every `redirect_from` entry, generate a redirect page | def generate_redirect_from(doc)
doc.redirect_from.each do |path|
doc.site.pages << RedirectPage.redirect_from(doc, path)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def redirects; end",
"def generate(site)\n site.pages.select{|x| x.data.key? 'redirects' }.each do |p|\n p.data['redirects'].each do |r|\n redirect = RedirectPage.new(site, site.source, r, p.url)\n redirect.render(site.layouts, site.site_payload)\n redirect.write(site.dest)... | [
"0.6977429",
"0.6628007",
"0.6411655",
"0.6241093",
"0.61140233",
"0.61140233",
"0.61088634",
"0.60609436",
"0.60413414",
"0.60293114",
"0.59945375",
"0.5988351",
"0.5974561",
"0.5970313",
"0.5949967",
"0.59362626",
"0.5935935",
"0.5901778",
"0.5893381",
"0.58883876",
"0.5860... | 0.7692713 | 0 |
Responds to request with show_ok status and resource | def show_ok(resource:)
render json: resource, status: :ok, include: show_includes
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show_ok\n controller.show_ok(resource: resource)\n end",
"def show\n respond_with client, resource\n end",
"def show\n render status: :ok\n end",
"def status_ok(resource)\n respond_to do |format|\n format.json { render json: resource.to_json, status: :ok, content_type: 'applic... | [
"0.75861204",
"0.7107819",
"0.70973635",
"0.69898677",
"0.69344246",
"0.6845681",
"0.67787755",
"0.6707929",
"0.6670621",
"0.6666087",
"0.6666087",
"0.66628885",
"0.66368407",
"0.6619437",
"0.65775377",
"0.6562515",
"0.653197",
"0.6495018",
"0.6492195",
"0.64832294",
"0.64468... | 0.7460887 | 1 |
compare parent to both left, right kids, recursively checking down the tree | def child_compare(parent)
unless parent.nil?
if parent.left.nil? && parent.right.nil?
nil
elsif parent.right.nil?
if parent.rating > parent.left.rating
swap(parent.left, parent)
end
else
if parent.rating > parent.left.rating || parent.rating > parent.right.rating
if parent.left.ra... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def child_compare(parent)\n\t\tunless parent.nil?\n\t\t\tif parent.left.nil? && parent.right.nil?\n\t\t\t\tnil\n\t\t\telsif parent.right.nil?\n\t\t\t\tif parent.value > parent.left.value\n\t\t\t\t\tswap(parent.left, parent)\n\t\t\t\tend\n\t\t\telse\t\t\n\t\t\t\tif parent.value > parent.left.value || parent.value >... | [
"0.66738623",
"0.6379302",
"0.6372852",
"0.62830114",
"0.6165596",
"0.61002564",
"0.6074607",
"0.6064618",
"0.60307646",
"0.600181",
"0.59663904",
"0.5957884",
"0.5940037",
"0.5921143",
"0.5893615",
"0.589213",
"0.5883418",
"0.5883418",
"0.588056",
"0.58666825",
"0.581503",
... | 0.6884053 | 0 |
Returns the AWS SQS Client | def sqs
@sqs ||= Aws::SQS::Client.new
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def aws_sns_client\n return @aws_sns_client if @aws_sns_client\n\n @aws_sns_client = Aws::SNS::Client.new(region: self.class.sms_aws_region)\n end",
"def sqs\n @sqs ||= Chore::Queues::SQS.sqs_client\n end",
"def new_sqs_client type\n ::AWS::SQS.new aws_identity(type)\n ... | [
"0.76662487",
"0.73675054",
"0.72776425",
"0.69445866",
"0.6934433",
"0.6890007",
"0.6863533",
"0.6842974",
"0.67306465",
"0.6724365",
"0.6619779",
"0.6612059",
"0.6589289",
"0.6540269",
"0.6493663",
"0.62928706",
"0.62598026",
"0.6164521",
"0.6153829",
"0.60942745",
"0.60536... | 0.82289195 | 0 |
Returns the AWS SNS Client | def sns
@sns ||= Aws::SNS::Client.new(
http_idle_timeout: @sns_keep_alive_timeout,
http_continue_timeout: @sns_continue_timeout
)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def aws_sns_client\n return @aws_sns_client if @aws_sns_client\n\n @aws_sns_client = Aws::SNS::Client.new(region: self.class.sms_aws_region)\n end",
"def loadSNSClient\n @snsClient = Aws::SNS::Client.new(access_key_id: ENV['h_aws_access_key_id'],\n secret_acce... | [
"0.8669044",
"0.73946285",
"0.7279516",
"0.6532922",
"0.649756",
"0.6448559",
"0.64463377",
"0.6383555",
"0.6354256",
"0.6325573",
"0.63059914",
"0.62951267",
"0.6238947",
"0.62069494",
"0.62035877",
"0.6196929",
"0.6169629",
"0.6125074",
"0.6058878",
"0.60009885",
"0.5926739... | 0.8201545 | 1 |
METHOD to validate user operator | def valid_operator(user_operator)
possible_operators = [ "add", "+", "subtract", "-", "multiply", "x", "*", "divide", "/" ]
possible_operators.include?(user_operator)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate_operator\n if device_limit.to_i < 0\n errors.add(:device_limit, 'Device limit count is invalid')\n return\n end\n if event_limit.to_i < 0\n errors.add(:event_limit, 'Event limit count is invalid')\n return\n end\n if discount.to_i < 0 or discount.to_i > 100\n er... | [
"0.71468246",
"0.68399924",
"0.6823085",
"0.6731083",
"0.65548277",
"0.65451396",
"0.65140384",
"0.6379725",
"0.6262707",
"0.6242223",
"0.6209113",
"0.6187763",
"0.61659664",
"0.61523",
"0.6121679",
"0.60405684",
"0.5977044",
"0.5974359",
"0.5951384",
"0.5947278",
"0.5944696"... | 0.7872635 | 0 |
one represents the percentage of characters in the string that are lowercase letters, one the percentage of characters that are uppercase letters, and one the percentage of characters that are neither. You may assume that the string will always contain at least one character. | def letter_percentages(str)
percentages = {}
str_length = str.length.to_f
percentages[:lowercase] = ((str.count('a-z') / str_length) * 100).round(1)
percentages[:uppercase] = ((str.count('A-Z') / str_length) * 100).round(1)
percentages[:neither] = 100 - percentages[:lowercase] - percentages[:uppercase]
pe... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def letter_percentages(str)\n hsh = { lowercase: 0, uppercase: 0, neither: 0 }\n\n str.chars.each do |elem|\n if elem =~ /[a-z]/\n hsh[:lowercase] += 1\n elsif elem =~ /[A-Z]/\n hsh[:uppercase] += 1\n else\n hsh[:neither] += 1\n end\n end\n hsh.transform_values! { |v| format('%.1f', ... | [
"0.72065175",
"0.71859896",
"0.71580446",
"0.7116647",
"0.7090129",
"0.70728993",
"0.7062781",
"0.7021826",
"0.69425255",
"0.69388753",
"0.679409",
"0.6360381",
"0.6263177",
"0.6212856",
"0.62003666",
"0.6186049",
"0.6178867",
"0.60719454",
"0.6059661",
"0.6053832",
"0.601185... | 0.7353618 | 0 |
We skip check when: association isn't a `HasOne` or `HasMany` association has `through` option associated class doesn't exist | def preconditions
%i[
has_one
has_many
].include?(association.macro) && association.through_reflection.nil? && association.klass
rescue StandardError
false
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unused_preload_associations_for?(klass, association)\n Bullet.collected_unused_eager_association_notifications.select do |notification|\n notification.base_class == klass.to_s && notification.associations.include?(association)\n end.present?\n end",
"def preconditions\n ... | [
"0.70514137",
"0.68552464",
"0.684273",
"0.6782048",
"0.6423",
"0.6415613",
"0.628376",
"0.62309015",
"0.6226636",
"0.6216277",
"0.61456573",
"0.61237365",
"0.61225384",
"0.6017212",
"0.6014498",
"0.60036373",
"0.60026085",
"0.60016125",
"0.5968144",
"0.5964782",
"0.59437877"... | 0.69059914 | 1 |
Boot Firefox, go to loginpage, wait for user to login, and return cookies | def cookies_from_selenium
driver = Selenium::WebDriver.for :firefox
driver.navigate.to "https://min.e-boks.dk/logon.aspx?logontype=oces"
loop do
break if driver.title =~ %r(^e-Boks )
sleep 1
end
cookies = driver.manage.all_cookies
driver.quit
cookies
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def login \n headless = Headless.new\n headless.start\n \n @browser = Watir::Browser.start LOGIN_URL\n\n # Delete all expired cookies\n delete_cookies_if_expire\n # Use unexpired cookies that match the given email and password\n the_cookies = use_cookies\n\n # Fresh log... | [
"0.73265994",
"0.71788573",
"0.7105065",
"0.67447335",
"0.67420727",
"0.67062974",
"0.6684113",
"0.6642855",
"0.6633111",
"0.65554416",
"0.65110373",
"0.64730686",
"0.64524496",
"0.6445762",
"0.6437271",
"0.643003",
"0.63793963",
"0.63672096",
"0.63672096",
"0.6344731",
"0.63... | 0.7189555 | 1 |
Download all messages on a folder page. | def process_page(folderpage, folderpath, folderpath_hidden, agent)
folderpage.search('//div[@id="messages"]/ul/li/dl').each do |msg|
elm = msg.xpath('.//dt/label/input').first
if elm["name"] != "did"
$stderr.puts "Error. HTML may have changed, and script needs updating."
$stderr.puts reason
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fetch_messages(folder, archive_folder, batch_limit, href_regex, reporter=nil, &proc)\n messages = []\n \n if folder == archive_folder # don't descend into archive folder\n log.info \"skipping folder '#{folder}' because it's the archive folder\"\n return messages\n ... | [
"0.6543573",
"0.6444406",
"0.6011316",
"0.5998763",
"0.5922031",
"0.59205854",
"0.59190524",
"0.591469",
"0.588878",
"0.58723277",
"0.5839488",
"0.5838414",
"0.5829674",
"0.5797315",
"0.5721657",
"0.57160383",
"0.5700563",
"0.5658236",
"0.56576896",
"0.56278104",
"0.56202483"... | 0.64967245 | 1 |
DELETE /userfiles/1 DELETE /userfiles/1.json | def destroy
@userfile.destroy
respond_to do |format|
format.html { redirect_to userfiles_url, notice: 'Userfile was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @userfile = Userfile.find(params[:id])\n @userfile.destroy\n\n respond_to do |format|\n format.html { redirect_to uploads_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_file.destroy\n respond_to do |format|\n format.html { redirect_to u... | [
"0.75363964",
"0.7422391",
"0.7362244",
"0.7313111",
"0.72862923",
"0.71802795",
"0.71015304",
"0.70886976",
"0.7021113",
"0.69476765",
"0.6907134",
"0.68676865",
"0.68504906",
"0.6832666",
"0.6823374",
"0.681007",
"0.6796322",
"0.67942774",
"0.6772355",
"0.67696077",
"0.6765... | 0.7451433 | 1 |
Fills the object with data coming from the API Params: +data+:: +Hash+ of data coming from the API | def fill_with_data(data)
if data.include? "id"
@id = data["id"]
end
if data.include? "project"
@project = data["project"]
end
if data.include? "customer"
@customer = data["customer"]
end
if data.include? "token"
@token = data["token"]
end
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fill_with_data(data)\n if data.include? \"id\"\n @id = data[\"id\"]\n end\n if data.include? \"project\"\n @project = data[\"project\"]\n end\n if data.include? \"url\"\n @url = data[\"url\"]\n end\n if data.include? \"name\"\n @name = data[\"name\... | [
"0.8257124",
"0.80399275",
"0.79668176",
"0.7144249",
"0.696927",
"0.6897578",
"0.6859003",
"0.675878",
"0.6719612",
"0.67161655",
"0.6714151",
"0.6680818",
"0.6680818",
"0.6680818",
"0.6680818",
"0.6680818",
"0.6680818",
"0.6680818",
"0.6680818",
"0.6648529",
"0.6644291",
... | 0.82482195 | 1 |
Get the customer linked to the authorization request. Params: +options+:: +Hash+ of options | def customer(options = nil)
request = Request.new(@client)
path = "/authorization-requests/" + CGI.escape(@id) + "/customers"
data = {
}
response = Response.new(request.get(path, data, options))
return_values = Array.new
body = response.body
body = body["cu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def customerGet(options={})\n assert_valid_keys(options, :customerId)\n assert_keys_exists(options, :customerId)\n execute(:customerGet, options)\n end",
"def customerGet(options={})\n assert_valid_keys(options, :customerId)\n assert_keys_exists(options, :customerId)\n ... | [
"0.7612801",
"0.7612801",
"0.7438744",
"0.71672285",
"0.66973925",
"0.66973925",
"0.66216516",
"0.6543561",
"0.634384",
"0.62946665",
"0.6291615",
"0.6291615",
"0.62848425",
"0.62813157",
"0.6277352",
"0.61704564",
"0.6137568",
"0.6137568",
"0.6133101",
"0.60970366",
"0.60749... | 0.78930485 | 0 |
Create a new authorization request for the given customer ID. Params: +customer_id+:: ID of the customer +options+:: +Hash+ of options | def create(customer_id, options = nil)
request = Request.new(@client)
path = "/authorization-requests"
data = {
"name"=> @name,
"currency"=> @currency,
"return_url"=> @return_url,
"cancel_url"=> @cancel_url,
"custom"=> @custom,
'customer_id'=>... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def customerCreate(options = {})\n assert_valid_keys(options, :accessKey, :testMode, :customerId, :freeParams)\n assert_keys_exists(options, :customerId)\n execute(:customerCreate, options)\n end",
"def customerCreate(options={})\n assert_valid_keys(options, :customerId, :freePar... | [
"0.7060646",
"0.6959064",
"0.6959064",
"0.66844",
"0.65551436",
"0.65031236",
"0.64348817",
"0.6369084",
"0.6367614",
"0.6260787",
"0.62348676",
"0.622578",
"0.6216633",
"0.61589926",
"0.61455727",
"0.61365706",
"0.6065897",
"0.60240555",
"0.600908",
"0.59845006",
"0.59527653... | 0.8213277 | 0 |
Find an authorization request by its ID. Params: +authorization_request_id+:: ID of the authorization request +options+:: +Hash+ of options | def find(authorization_request_id, options = nil)
request = Request.new(@client)
path = "/authorization-requests/" + CGI.escape(authorization_request_id) + ""
data = {
}
response = Response.new(request.get(path, data, options))
return_values = Array.new
body = re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def search_request_by_id(id)\n @search_requests[id]\n end",
"def find_hash(id, options = {})\n options.assert_valid_keys(:request_level)\n level = find_level(options[:request_level])\n record = self.find(id, :select => level.select_field.join(', '), :include => level.include_field)\n ... | [
"0.5601527",
"0.54645497",
"0.5462754",
"0.5349435",
"0.5208992",
"0.51834184",
"0.5129201",
"0.507622",
"0.5052594",
"0.50379044",
"0.50206035",
"0.49878615",
"0.4969185",
"0.4958501",
"0.49483415",
"0.49384612",
"0.49118584",
"0.48981726",
"0.48665774",
"0.48523477",
"0.481... | 0.81766945 | 0 |
Move the given register to temporary storage and rewrite reads from it to point to the new location. | def spill(reg)
spill_move = Move.new(reg, SPILL_REG, true)
@moves.each do |move|
move.src = SPILL_REG if move.src == reg
end
@moves << spill_move
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def shiftRight(register)\n\tregister.unshift(0).pop\nend",
"def pop_reg reg\n @fisk.pop reg.to_register\n end",
"def with_register name = \"temp\"\n reg = register(name)\n yield reg\n release_register reg\n end",
"def register name = \"temp\"\n Registers::Temp.new name, \"r64\"\n end",
... | [
"0.55005604",
"0.5304445",
"0.52626455",
"0.5249074",
"0.5239891",
"0.5112067",
"0.51108605",
"0.5095372",
"0.4973654",
"0.49369252",
"0.49340752",
"0.48452878",
"0.4843692",
"0.48028213",
"0.47891957",
"0.47784686",
"0.4710739",
"0.46858305",
"0.46796703",
"0.46791205",
"0.4... | 0.54092324 | 1 |
Allocate storage for local variables on the stack. | def locals(&blk)
@stack_usage ||= 0
num_locals = blk.arity
# Allocate stack space
locals = (0...num_locals).map do |i|
offset = -(@stack_usage+i+1)
PlusRegister.new j, (offset & 0xFFFF)
end
@stack_usage += num_locals
SUB sp, num_locals
yield *locals
# Deallocate stack ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def local_variables() end",
"def push_local\n <<-CODE\n next_int;\n stack_push(fast_fetch(c->locals, _int));\n CODE\n\n # \"next_int; stack_push(fast_fetch(cpu_current_locals(state, c), _int));\"\n end",
"def new_local(name)\n name = name.name if name.is_a? Identifier\n @variables[nam... | [
"0.6657945",
"0.6476294",
"0.63291484",
"0.6280848",
"0.6264493",
"0.62583894",
"0.62052745",
"0.61316067",
"0.6096079",
"0.60400754",
"0.60282224",
"0.5930591",
"0.5871734",
"0.58600366",
"0.58068335",
"0.57896346",
"0.5743584",
"0.57284284",
"0.5661522",
"0.5649867",
"0.564... | 0.6802815 | 0 |
Given file, look up matching application | def select_app file_name
ftype = file_type( file_name ).downcase
@app_map[ ftype ]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def select_app file_name \n ftype = file_type( file_name ).downcase\n @app_map[ ftype ]\n end",
"def select_app( file_name )\n ftype = file_type( file_name )\n @app_map[ ftype ]\n end",
"def select_app file_name \n\t\tftype = file_type( file_name ).downcase\n\t\t@app_map[ ftype ]\n\tend",
"def ... | [
"0.7087219",
"0.7029745",
"0.6963543",
"0.693891",
"0.69037956",
"0.66919976",
"0.6542444",
"0.6382299",
"0.6157495",
"0.60503167",
"0.601646",
"0.5859156",
"0.5818461",
"0.57572633",
"0.57046884",
"0.5678892",
"0.56743115",
"0.5649614",
"0.5636007",
"0.5610509",
"0.56057966"... | 0.7122727 | 0 |
Initialize class, and set default strategy to :user | def initialize
super
@strategy = :user
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(strategy)\n @strategy = strategy\n end",
"def configure_user_search_strategy(strategy)\n @user_search_strategy =\n case strategy.to_s\n when \"default\"\n GitHub::Ldap::UserSearch::Default.new(self)\n when \"global_catalog\"\n GitHub::Ldap::UserSearc... | [
"0.67172897",
"0.6685895",
"0.668033",
"0.6675152",
"0.66650766",
"0.654373",
"0.65173364",
"0.6514021",
"0.6514021",
"0.6514021",
"0.6506571",
"0.6500203",
"0.6500203",
"0.6496486",
"0.6461032",
"0.6426161",
"0.6419987",
"0.63515323",
"0.63169116",
"0.63151526",
"0.625627",
... | 0.82145846 | 0 |
Set the Twitter lookup strategy to :search or :user | def strategy=(strategy)
case strategy
when :user, :search
@strategy = strategy
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def configure_user_search_strategy(strategy)\n @user_search_strategy =\n case strategy.to_s\n when \"default\"\n GitHub::Ldap::UserSearch::Default.new(self)\n when \"global_catalog\"\n GitHub::Ldap::UserSearch::ActiveDirectory.new(self)\n else\n GitHub::L... | [
"0.6899154",
"0.60859466",
"0.60526884",
"0.58958787",
"0.5813516",
"0.56575435",
"0.5576044",
"0.5574021",
"0.55738586",
"0.5396325",
"0.53547204",
"0.5337322",
"0.5326187",
"0.530415",
"0.5301709",
"0.52801555",
"0.52781755",
"0.52741367",
"0.5263843",
"0.523065",
"0.519487... | 0.6275252 | 1 |
Return a specified user from Twitter | def twitter_user
@twitter_user ||= TwitterClient.new.user(@user)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_user_from_twitter_as_hash(screen_name_or_twitter_id)\n Rails.cache.fetch(\"/users/show/#{screen_name_or_twitter_id}\", :expires_in => 2.hours) { twitter.get(\"/users/show/#{screen_name_or_twitter_id}\") }\n end",
"def get_user_detail_by_twitter_id(twitter_id)\n @user = User.find(:select=>\"*\",:co... | [
"0.7574586",
"0.757112",
"0.7473761",
"0.74678403",
"0.7417528",
"0.73607737",
"0.7356598",
"0.7271338",
"0.71384966",
"0.7107479",
"0.7039584",
"0.70374835",
"0.7031068",
"0.7017989",
"0.68920445",
"0.68843776",
"0.6844438",
"0.6824777",
"0.67040557",
"0.65976465",
"0.658888... | 0.7708476 | 0 |
Parse out a percentage (as a float) | def parse(text)
text.gsub(/[\s%]/, '').strip.to_f
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse(string)\n string = string.tr(\",\", \".\").delete(\"~\")\n if (match = string.match(/^(\\d*\\.?\\d*)$/))\n match[1].to_f\n elsif (match = string.match(/^(\\d*\\.?\\d*)%$/))\n match[1].to_f / 100\n elsif (match = string.match(/^(\\d*\\.?\\d*)[:\\/](\\d*\\.?\\d*)$/))\n match[1].t... | [
"0.73787385",
"0.72825503",
"0.69483334",
"0.68342865",
"0.6810938",
"0.67334825",
"0.67295235",
"0.6727258",
"0.6716521",
"0.6677001",
"0.66509783",
"0.6631067",
"0.6560657",
"0.65534985",
"0.6470235",
"0.64059305",
"0.63977706",
"0.6391433",
"0.6383352",
"0.63677",
"0.63518... | 0.74519306 | 0 |
Private method to load API service | def load_api_service
@api_service = ApiService.new
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def api\n @api ||= PrismicService.init_api\n end",
"def data_service\n DataServicesApi::Service.new(url: api_service_url)\n end",
"def method_missing(method_sym, *arguments, &block)\n if self.class.service_class(method_sym)\n # load service from cache if available\n service = i... | [
"0.68924063",
"0.6859681",
"0.6827161",
"0.68155384",
"0.67120504",
"0.6692524",
"0.65503263",
"0.6486344",
"0.6486344",
"0.6456455",
"0.6454877",
"0.64273906",
"0.6424875",
"0.6351732",
"0.6325336",
"0.6222585",
"0.615099",
"0.6147298",
"0.6120337",
"0.6119487",
"0.61189526"... | 0.873317 | 0 |
For when Mailchimp is testing that our webhook works | def confirm_webhook
render :json => "ok", :status => 200
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def webhook\n puts \"webhook params: #{params.inspect}\"\n if GoCardless.webhook_valid?(params[:payload])\n render :text => \"true\", :status => 200\n else\n render :text => \"false\", :status => 403\n end\n end",
"def webhook\n @config = ZipMoney::Configuration \n @_webhook =... | [
"0.67869085",
"0.6571325",
"0.6552353",
"0.6531604",
"0.63817245",
"0.6359207",
"0.63590926",
"0.6242446",
"0.6233506",
"0.62312764",
"0.6208684",
"0.61513346",
"0.61503863",
"0.6099582",
"0.607256",
"0.6063292",
"0.6039634",
"0.601697",
"0.59806085",
"0.59806085",
"0.5965347... | 0.6655412 | 1 |
"type": "subscribe", "fired_at": "20090326 21:35:57", "data[id]": "8a25ff1d98", "data[list_id]": "a6b5da1054", | def customer_mailchimp_subscribed
{
:list_id => data['list_id'],
:fired_at => params['fired_at'],
:mailchimp_id => data['id'],
:email => data['email'],
:email_type => data['email_type'],
:merges => data['merges'],
:ip_opt ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_subscribers\n subscriber_data = RunrWatcherServer.runr_session_get(\"subscribers\")\n return [] unless subscriber_data.present?\n list = subscriber_data[:subscribers][\"list\"]\n return [] unless list.present?\n JSON.parse list\n end",
"def http_raw_notify_data\n {\n \"id\"=>\"b98... | [
"0.5999414",
"0.5978768",
"0.57443494",
"0.5717597",
"0.5698974",
"0.56845605",
"0.5588418",
"0.55851257",
"0.5563251",
"0.55236775",
"0.5500315",
"0.5499309",
"0.547075",
"0.54653543",
"0.54242164",
"0.5415669",
"0.5391406",
"0.53794944",
"0.5363186",
"0.53216493",
"0.530618... | 0.64715093 | 0 |
"type": "unsubscribe", "fired_at": "20090326 21:40:57", "data[action]": "unsub", "data[reason]": "manual", "data[id]": "8a25ff1d98", "data[list_id]": "a6b5da1054", | def customer_mailchimp_unsubscribed
{
:list_id => data['list_id'],
:fired_at => params['fired_at'],
:mailchimp_id => data['id'],
:email => data['email'],
:email_type => data['email_type'],
:merges => data['merges'],
:ip_opt ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def successful_unsubscribe\n end",
"def unsubscribed\n @attributes[:unsubscribed]\n end",
"def unsubscribe_from_list(user, list)\n delete(\"/#{user}/#{list}/subscribers.json\")\n end",
"def unsubscribe; end",
"def subid\n unsubscribe[:subid]\n end",
"def unsubscribe\n end",
... | [
"0.7093893",
"0.67585737",
"0.6753457",
"0.654267",
"0.6537029",
"0.64951944",
"0.64703214",
"0.64703214",
"0.6458982",
"0.64323497",
"0.64226466",
"0.63964117",
"0.63964117",
"0.63933295",
"0.6350215",
"0.6344921",
"0.6344216",
"0.6323642",
"0.62809145",
"0.6274924",
"0.6273... | 0.7201231 | 0 |
"type": "profile", "fired_at": "20090326 21:31:21", "data[id]": "8a25ff1d98", "data[list_id]": "a6b5da1054", | def customer_mailchimp_profile_updated
{
:list_id => data['list_id'],
:fired_at => params['fired_at'],
:mailchimp_id => data['id'],
:email => data['email'],
:email_type => data['email_type'],
:merges => data['merges'],
:ip_opt... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def trackgen_info;\treturn @json_data['trackgen_info'];\tend",
"def profile_data(uid, field)\n begin\n JSON.parse(RestClient.get construct_url(\"user/#{uid}/#{field}\"))\n rescue RestClient::BadRequest => e\n @last_error = e.http_body\n @last_error_code = e.http_code\n false\n end ... | [
"0.5621395",
"0.549105",
"0.5414451",
"0.5411209",
"0.53774613",
"0.53614426",
"0.532061",
"0.52865446",
"0.5200691",
"0.5182363",
"0.5174451",
"0.50722224",
"0.50630736",
"0.5050609",
"0.50498444",
"0.503773",
"0.5036641",
"0.50324535",
"0.501359",
"0.501359",
"0.50117403",
... | 0.56294674 | 0 |
"type": "upemail", "fired_at": "20090326\ 22:15:09", "data[list_id]": "a6b5da1054", "data[new_id]": "51da8c3259", | def customer_mailchimp_email_updated
{
:list_id => data['list_id'],
:fired_at => params['fired_at'],
:new_mailchimp_id => data['id'],
:new_email => data['new_email'],
:old_email => data['old_email'],
:human => "#{data['email']} updated th... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def email_cleaned\n {\n :list_id => data['list_id'],\n :fired_at => params['fired_at'],\n :campaign_id => data['campaign_id'],\n :email => data['email'],\n :reason => data['reason'],\n :human => \"#{data['email']} was cleaned fr... | [
"0.6213054",
"0.57850266",
"0.5681093",
"0.5540804",
"0.55029696",
"0.53624773",
"0.53202635",
"0.5304917",
"0.53043294",
"0.52784836",
"0.52484655",
"0.5196279",
"0.51936203",
"0.519108",
"0.5152175",
"0.5138144",
"0.51369935",
"0.5114219",
"0.5059403",
"0.5059069",
"0.50580... | 0.61849403 | 1 |
"type": "cleaned", "fired_at": "20090326 22:01:00", "data[list_id]": "a6b5da1054", "data[campaign_id]": "4fjk2ma9xd", "data[reason]": "hard", | def email_cleaned
{
:list_id => data['list_id'],
:fired_at => params['fired_at'],
:campaign_id => data['campaign_id'],
:email => data['email'],
:reason => data['reason'],
:human => "#{data['email']} was cleaned from Mailchimp ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hash\n [campaign, number, customer, scheduled_start, child, description, category_type, overview, priority, date_event, product_event, phone, event_name, event_number, time_difference, type_event, primary_phone_call_id, parent_phone_call_id, product_name, product_name_g, scheduled_start_parent, descriptio... | [
"0.5644173",
"0.5541001",
"0.54635406",
"0.5271407",
"0.5236314",
"0.5213901",
"0.51805097",
"0.51797944",
"0.5157291",
"0.5120727",
"0.5099303",
"0.5061041",
"0.5058922",
"0.50314",
"0.5026635",
"0.5021494",
"0.50193137",
"0.5004807",
"0.4940935",
"0.49341482",
"0.4931532",
... | 0.6565988 | 0 |
"type": "campaign", "fired_at": "20090326 21:31:21", "data[id]": "5aa2102003", "data[subject]": "Test Campaign Subject", "data[status]": "sent", "data[reason]": "", "data[list_id]": "a6b5da1054" | def campaign_status
{
:list_id => data['list_id'],
:campaign_id => data['id'],
:subject => data['subject'],
:status => data['status'],
:reason => data['reason'],
:human => "Campaign Status (ID: #{data['id']}) - Subject: '#{dat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def email_cleaned\n {\n :list_id => data['list_id'],\n :fired_at => params['fired_at'],\n :campaign_id => data['campaign_id'],\n :email => data['email'],\n :reason => data['reason'],\n :human => \"#{data['email']} was cleaned fr... | [
"0.5975898",
"0.5762865",
"0.5715143",
"0.569575",
"0.56628025",
"0.5376054",
"0.5373471",
"0.53494716",
"0.53301656",
"0.5320408",
"0.5264978",
"0.5246386",
"0.52330554",
"0.52212316",
"0.52072406",
"0.52053136",
"0.50999343",
"0.5090078",
"0.5073651",
"0.50715154",
"0.50434... | 0.6306562 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.