query stringlengths 7 9.55k | document stringlengths 10 363k | metadata dict | negatives listlengths 0 101 | negative_scores listlengths 0 101 | document_score stringlengths 3 10 | document_rank stringclasses 102
values |
|---|---|---|---|---|---|---|
======================================================================================= New Birthsigns If you want to modify the date ranges for each Birthsign: The first number on each line corresponds to the month that Birthsign begins. The second number on each line corresponds to the day of the given month that the... | def zodiac(month,day)
time=[
1,1,1,31, # The Apprentice
2,1,2,28, # The Companion
3,1,3,31, # The Beacon
4,1,4,30, # The Savage
5,1,5,31, # The Prodigy
6,1,6,30, # The Martyr
7,1,7,31, # The Maiden
8,1,8,31, # The Gladiator
9,1,9,30, # The Voyager
10,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ranges(date)\n ranges =[]\n bra_doc = bra_per_day(date)\n bra_doc.each do |element|\n ranges << element[\"massif\"]\n end\n p ranges\n end",
"def dashboard_births\n\t\t\n\t\tstart = params[:start_date].to_date\n\t\tendd = params[:end_date].to_date\n\t\tpeople = []\n\t\t(start .. endd).ea... | [
"0.5662637",
"0.5608834",
"0.5578971",
"0.5546566",
"0.55231494",
"0.53477204",
"0.52872694",
"0.5240179",
"0.5230652",
"0.520127",
"0.5199861",
"0.5184175",
"0.5144199",
"0.5104201",
"0.50703907",
"0.5052316",
"0.50502205",
"0.5047679",
"0.5040423",
"0.5026291",
"0.50072384"... | 0.0 | -1 |
======================================= Returns the opposite of the given zodiac sign. 0 is Aries, 11 is Pisces. | def zodiacOpposite(sign)
return (sign+6)%12
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def negative\n abs.flip_sign\n end",
"def zodiacValue(sign)\n return (sign)%12\nend",
"def reverse_sign(an_integer)\n return 0 - an_integer\nend",
"def reverse_sign(an_integer)\n return 0 - an_integer\nend",
"def opposite(number)\r\n return number * (-1)\r\nend",
"def opposite(num)\n if n... | [
"0.6672994",
"0.663077",
"0.6604508",
"0.6604508",
"0.65533894",
"0.64584255",
"0.64565927",
"0.6436645",
"0.64350575",
"0.6416863",
"0.63644296",
"0.6302906",
"0.6258611",
"0.6154677",
"0.6154677",
"0.600727",
"0.5945845",
"0.59093004",
"0.59093004",
"0.59093004",
"0.5909300... | 0.79610693 | 1 |
0 is Aries, 11 is Pisces. | def zodiacPartners(sign)
return [(sign+4)%12,(sign+8)%12]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cardinal; end",
"def kcallipidos\n\t\t\t@lipidos * 9\n\t\tend",
"def rentas\n profesion ? 1 : 0\n end",
"def pontosStrike index\n\t\tif @rolls[index + 2]\n\t\t\tif @rolls[index + 2] == 10\n\t\t\t\tif @rolls[index + 4]\n\t\t\t\t\t10 + 10 + @rolls[index + 4]\n\t\t\t\telse\n\t\t\t\t\t10 + 10\n\t\t\t\ten... | [
"0.6167821",
"0.5818059",
"0.5750823",
"0.5696515",
"0.5676475",
"0.5659556",
"0.56398845",
"0.5546157",
"0.5534421",
"0.55264515",
"0.5483487",
"0.5451898",
"0.54355955",
"0.54244095",
"0.5417245",
"0.54043525",
"0.53851855",
"0.53675556",
"0.535896",
"0.53390604",
"0.531774... | 0.0 | -1 |
0 is Aries, 11 is Pisces. | def zodiacComplements(sign)
return [(sign+1)%12,(sign+11)%12]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cardinal; end",
"def kcallipidos\n\t\t\t@lipidos * 9\n\t\tend",
"def rentas\n profesion ? 1 : 0\n end",
"def pontosStrike index\n\t\tif @rolls[index + 2]\n\t\t\tif @rolls[index + 2] == 10\n\t\t\t\tif @rolls[index + 4]\n\t\t\t\t\t10 + 10 + @rolls[index + 4]\n\t\t\t\telse\n\t\t\t\t\t10 + 10\n\t\t\t\ten... | [
"0.616733",
"0.5819274",
"0.57516754",
"0.5697697",
"0.5678372",
"0.5660931",
"0.56409883",
"0.554751",
"0.553565",
"0.55259246",
"0.5484236",
"0.54527223",
"0.54359895",
"0.5424836",
"0.54174215",
"0.5404143",
"0.53846663",
"0.5368005",
"0.53596485",
"0.5339799",
"0.5318399"... | 0.0 | -1 |
=============================================================================== Birthsigns Names & Descriptions If you choose to change the names of 'The Beacon', 'The Martyr', or 'The Voyager', you will also need to change the text in PScreen_Party & PScreen_Summary to match your new names. If you choose to change the... | def zodiacValue(sign)
return (sign)%12
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def drawBirthsignPage(pokemon)\n overlay=@sprites[\"overlay\"].bitmap\n overlay.clear\n @sprites[\"background\"].setBitmap(\"Graphics/Pictures/Birthsigns/summaryzodiac\")\n imagepos=[]\n zodiacimage=sprintf(\"Graphics/Pictures/Birthsigns/birthsign%02d\",zodiacValue(@pokemon.timeEggHatched.... | [
"0.5731608",
"0.5594626",
"0.5402176",
"0.5353482",
"0.53009146",
"0.5223681",
"0.5103112",
"0.5035548",
"0.4970095",
"0.49527085",
"0.4915802",
"0.4908737",
"0.4886652",
"0.48697636",
"0.48616186",
"0.48370934",
"0.48366216",
"0.48338023",
"0.48280442",
"0.48120713",
"0.4808... | 0.0 | -1 |
Gets the accessPackages property value. The access packages in this catalog. Readonly. Nullable. | def access_packages
return @access_packages
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def access_packages=(value)\n @access_packages = value\n end",
"def access_packages=(value)\n @access_packages = value\n end",
"def access_package\n return @access_package\n end",
"def access_package\n return @access... | [
"0.7164017",
"0.7164017",
"0.6164938",
"0.6164938",
"0.57729125",
"0.57729125",
"0.57148457",
"0.57126004",
"0.57126004",
"0.54519695",
"0.52545226",
"0.5215385",
"0.5014351",
"0.49851522",
"0.49223623",
"0.4910575",
"0.48178908",
"0.47005984",
"0.46983558",
"0.46467277",
"0.... | 0.7581815 | 1 |
Sets the accessPackages property value. The access packages in this catalog. Readonly. Nullable. | def access_packages=(value)
@access_packages = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def access_package=(value)\n @access_package = value\n end",
"def access_package=(value)\n @access_package = value\n end",
"def access_packages\n return @access_packages\n end",
"def access_packages\n return @access_... | [
"0.6546769",
"0.6546769",
"0.60224766",
"0.60224766",
"0.5847116",
"0.5443041",
"0.48399892",
"0.48399892",
"0.4716157",
"0.47159827",
"0.46786526",
"0.4661393",
"0.45467672",
"0.45431063",
"0.45431063",
"0.4536682",
"0.45285273",
"0.4467333",
"0.44614908",
"0.44371033",
"0.4... | 0.79809713 | 1 |
Gets the catalogType property value. Whether the catalog is created by a user or entitlement management. The possible values are: userManaged, serviceDefault, serviceManaged, unknownFutureValue. | def catalog_type
return @catalog_type
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def catalog_type=(value)\n @catalog_type = value\n end",
"def type\n return attributes['type'] if attributes['type']\n \n # Lookups are in order of preference so if, for example, you set the uri but display_name and id are also\n # set, we'd rather go... | [
"0.7399088",
"0.57515687",
"0.56392944",
"0.55835515",
"0.5505702",
"0.544588",
"0.5426479",
"0.5392685",
"0.5346012",
"0.5296567",
"0.52827084",
"0.5246587",
"0.51930106",
"0.51920575",
"0.51817214",
"0.51682276",
"0.515745",
"0.5125132",
"0.5123187",
"0.5116322",
"0.5112844... | 0.7568965 | 0 |
Sets the catalogType property value. Whether the catalog is created by a user or entitlement management. The possible values are: userManaged, serviceDefault, serviceManaged, unknownFutureValue. | def catalog_type=(value)
@catalog_type = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def catalog_type\n return @catalog_type\n end",
"def license_type=(value)\n @license_type = value\n end",
"def catalog=(value)\n @catalog = value\n end",
"def type=(type)\n validator = EnumAttributeValidator.new('String', [\"P... | [
"0.6362633",
"0.5905003",
"0.5870778",
"0.5846498",
"0.583583",
"0.57896173",
"0.57877254",
"0.57702464",
"0.5737238",
"0.5737238",
"0.5737238",
"0.5737238",
"0.5737238",
"0.5737238",
"0.5737238",
"0.5727562",
"0.56818837",
"0.566823",
"0.5656182",
"0.5627686",
"0.56132203",
... | 0.8189485 | 0 |
Instantiates a new accessPackageCatalog and sets the default values. | def initialize()
super
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(catalog, conf = nil)\n @catalog = catalog\n super conf\n end",
"def initialize(catalog, conf = nil)\n @catalog = catalog\n super conf\n end",
"def initialize(catalog, item_id = nil, conf = nil)\n @catalog = catalog\n @item_id = item_id\n super conf\n e... | [
"0.62884295",
"0.62884295",
"0.54038996",
"0.53740734",
"0.5300602",
"0.5300602",
"0.5251917",
"0.5251917",
"0.5234328",
"0.5154537",
"0.511681",
"0.50620973",
"0.50562924",
"0.50483733",
"0.5031273",
"0.5031273",
"0.5014646",
"0.49746564",
"0.4950188",
"0.49395618",
"0.49340... | 0.0 | -1 |
Gets the createdDateTime property value. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 20140101T00:00:00Z. Readonly. | def created_date_time
return @created_date_time
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def created_date_time\n return @created_date_time\n end",
"def created_date_time_utc\n return @created_date_time_utc\n end",
"def created_at\n object.created_at.iso8601\n end",
"def created_at\n attributes.send(:ts_created) rescue nil\n end",
"de... | [
"0.7722997",
"0.767215",
"0.74922127",
"0.7475374",
"0.74644446",
"0.74294436",
"0.7383081",
"0.73517555",
"0.73517555",
"0.73127663",
"0.7222228",
"0.7209232",
"0.7205299",
"0.71927994",
"0.71927994",
"0.71901155",
"0.71901155",
"0.7188098",
"0.71731377",
"0.717206",
"0.7168... | 0.77452713 | 23 |
Sets the createdDateTime property value. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 20140101T00:00:00Z. Readonly. | def created_date_time=(value)
@created_date_time = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def created_date_time=(createdDateTime)\n @created_date_time = createdDateTime\n end",
"def created_date_time_utc=(value)\n @created_date_time_utc = value\n end",
"def created_at=(value)\n @created_at = DateTime.parse(value)\n end",
"def create_timestamp\n... | [
"0.7881273",
"0.75287163",
"0.72160256",
"0.7087516",
"0.7087252",
"0.70207304",
"0.70004123",
"0.6825352",
"0.6825352",
"0.680555",
"0.66064066",
"0.6578572",
"0.6564616",
"0.6501608",
"0.64583474",
"0.64582604",
"0.64582604",
"0.64582604",
"0.64582604",
"0.64582604",
"0.645... | 0.7728247 | 24 |
Gets the customWorkflowExtensions property value. The customWorkflowExtensions property | def custom_workflow_extensions
return @custom_workflow_extensions
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def custom_workflow_extensions=(value)\n @custom_workflow_extensions = value\n end",
"def extensions\n return @extensions\n end",
"def extensions\n return @extensions\n end",
"def extensions\n return @extensions\n ... | [
"0.7669773",
"0.65424985",
"0.65424985",
"0.65424985",
"0.6439023",
"0.6346632",
"0.6346632",
"0.63085586",
"0.61968994",
"0.6000552",
"0.6000552",
"0.5997462",
"0.598793",
"0.598793",
"0.5899312",
"0.588772",
"0.5883786",
"0.58638334",
"0.5789303",
"0.57508636",
"0.57508636"... | 0.8118068 | 0 |
Sets the customWorkflowExtensions property value. The customWorkflowExtensions property | def custom_workflow_extensions=(value)
@custom_workflow_extensions = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extensions=(value)\n @extensions = value\n end",
"def extensions=(value)\n @extensions = value\n end",
"def extensions=(value)\n @extensions = value\n end",
"def extensions=(extensions)\n @extensions = Array extensions\n en... | [
"0.67108345",
"0.67108345",
"0.67108345",
"0.65337384",
"0.65057504",
"0.63305795",
"0.6271303",
"0.6086259",
"0.60776234",
"0.5851142",
"0.58286154",
"0.565621",
"0.56361943",
"0.55937946",
"0.5564678",
"0.55248314",
"0.54936075",
"0.54434556",
"0.54434556",
"0.5421142",
"0.... | 0.8651566 | 0 |
Gets the description property value. The description of the access package catalog. | def description
return @description
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def description\n res = (@package.short_description ? @package.short_description : \"Description not available\") + \"\\n\"\n return res unless @package.long_description\n @package.long_description.each_line do |line|\n if line.strip.empty?\n res << \" .\\n\"\n else\n ... | [
"0.69609463",
"0.6897119",
"0.6897119",
"0.6872738",
"0.6835116",
"0.6835116",
"0.6782187",
"0.6741151",
"0.6740732",
"0.6715621",
"0.6686423",
"0.6669005",
"0.666597",
"0.66648066",
"0.66057634",
"0.66057634",
"0.65907276",
"0.6584934",
"0.65722835",
"0.65582746",
"0.6554484... | 0.6713827 | 36 |
Sets the description property value. The description of the access package catalog. | def description=(value)
@description = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_description(description)\n @description = description\n end",
"def description=(description)\r\n\t\t\t`#{BITS::BITSADMIN} /setdescription {#{@id}} \\\"#{description}\\\"`\r\n\t\tend",
"def description=(v)\n @description = v\n end",
"def setDescription(description)\r\n\t\t\t\t\t@description = ... | [
"0.751411",
"0.7404056",
"0.7276967",
"0.7184654",
"0.7184654",
"0.7108584",
"0.7108584",
"0.70491564",
"0.7005734",
"0.69918567",
"0.6988434",
"0.69834185",
"0.69332194",
"0.68807054",
"0.6846096",
"0.680223",
"0.67855346",
"0.67780554",
"0.6766192",
"0.67648816",
"0.6764461... | 0.7558174 | 24 |
Gets the displayName property value. The display name of the access package catalog. | def display_name
return @display_name
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name\n @gapi[\"displayName\"]\n end",
"def display_name\n @hash['display_name']\n end",
"def display_name\n @display_name\n end",
"def display_name\n return @display_name\n end",
"def display_name\n @json['profile']['displ... | [
"0.7001966",
"0.6840132",
"0.6839034",
"0.68327117",
"0.68254447",
"0.675548",
"0.67156845",
"0.66648847",
"0.6630779",
"0.6614664",
"0.66143274",
"0.6545965",
"0.65105045",
"0.64822674",
"0.6385687",
"0.63812083",
"0.63682556",
"0.63682556",
"0.6316952",
"0.61938983",
"0.619... | 0.6918861 | 37 |
Sets the displayName property value. The display name of the access package catalog. | def display_name=(value)
@display_name = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_displayname(path,display_name)\n result = $evm.instance_set_display_name(path, display_name)\n return result\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = valu... | [
"0.6573683",
"0.65395415",
"0.6489236",
"0.64874923",
"0.6396542",
"0.63796824",
"0.62503535",
"0.61727214",
"0.61727214",
"0.61727214",
"0.60290074",
"0.5964407",
"0.5964407",
"0.5955119",
"0.5955119",
"0.5955119",
"0.5948357",
"0.57557476",
"0.57557476",
"0.5682463",
"0.567... | 0.65971905 | 37 |
The deserialization information for the current model | def get_field_deserializers()
return super.merge({
"accessPackages" => lambda {|n| @access_packages = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AccessPackage.create_from_discriminator_value(pn) }) },
"catalogType" => lambda {|n| @catal... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def deserialized\n @deserialized ||= @serializer.deserialize @serialized_object\n end",
"def serialized_attributes\n read_inheritable_attribute(\"attr_serialized\") || { }\n end",
"def get_field_deserializers()\n return super.merge({\n \"detectionStatus... | [
"0.65136534",
"0.63240266",
"0.6323858",
"0.63105166",
"0.62958705",
"0.62394285",
"0.6233034",
"0.6215588",
"0.6200782",
"0.62006205",
"0.6174826",
"0.6174555",
"0.6170587",
"0.616322",
"0.6162713",
"0.61585164",
"0.61560273",
"0.61437404",
"0.6140271",
"0.6138333",
"0.61204... | 0.0 | -1 |
Gets the isExternallyVisible property value. Whether the access packages in this catalog can be requested by users outside of the tenant. | def is_externally_visible
return @is_externally_visible
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_externally_visible=(value)\n @is_externally_visible = value\n end",
"def check_visibility\n if not @organisation.active?\n hidden = false\n if not current_user == @organisation\n hidden = true\n end\n\n current_user.is_a?(User) and curren... | [
"0.7127441",
"0.67031485",
"0.65775144",
"0.64736414",
"0.64317197",
"0.62772137",
"0.62013435",
"0.6110106",
"0.6047035",
"0.60445136",
"0.6010588",
"0.60101765",
"0.60023916",
"0.59949857",
"0.59665793",
"0.5941254",
"0.5895389",
"0.58895797",
"0.58887655",
"0.5883785",
"0.... | 0.77821183 | 0 |
Sets the isExternallyVisible property value. Whether the access packages in this catalog can be requested by users outside of the tenant. | def is_externally_visible=(value)
@is_externally_visible = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_externally_visible\n return @is_externally_visible\n end",
"def check_visibility\n if not @organisation.active?\n hidden = false\n if not current_user == @organisation\n hidden = true\n end\n\n current_user.is_a?(User) and current_user.ha... | [
"0.664973",
"0.6026473",
"0.5610782",
"0.5521253",
"0.5515217",
"0.5462556",
"0.54269063",
"0.5321732",
"0.5320191",
"0.5241687",
"0.52411085",
"0.52335685",
"0.52306855",
"0.5224688",
"0.51914394",
"0.5189172",
"0.5189172",
"0.5158065",
"0.5130254",
"0.5102938",
"0.5046724",... | 0.74379015 | 0 |
Gets the modifiedDateTime property value. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 20140101T00:00:00Z. Readonly. | def modified_date_time
return @modified_date_time
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def last_modified_date_time\n return @last_modified_date_time\n end",
"def last_modified_date_time\n return @last_modified_date_time\n end",
"def last_modified_date_time\n return @last_modified_date_time\n end",
"def last_modified_... | [
"0.724114",
"0.724114",
"0.724114",
"0.724114",
"0.724114",
"0.724114",
"0.724114",
"0.724114",
"0.724114",
"0.724114",
"0.724114",
"0.724114",
"0.724114",
"0.724114",
"0.7234074",
"0.71964914",
"0.7169872",
"0.69824445",
"0.69824445",
"0.69824445",
"0.69824445",
"0.6982444... | 0.7807483 | 2 |
Sets the modifiedDateTime property value. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 20140101T00:00:00Z. Readonly. | def modified_date_time=(value)
@modified_date_time = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def last_modified_date_time=(value)\n @last_modified_date_time = value\n end",
"def last_modified_date_time=(value)\n @last_modified_date_time = value\n end",
"def last_modified_date_time=(value)\n @last_modified_date_time = value\n ... | [
"0.7116853",
"0.7116853",
"0.7116853",
"0.7116853",
"0.7116853",
"0.7116853",
"0.7116853",
"0.7116853",
"0.7116853",
"0.7116853",
"0.7116853",
"0.7116853",
"0.7116853",
"0.7116853",
"0.70543236",
"0.66605514",
"0.66605514",
"0.6623176",
"0.6623176",
"0.6623176",
"0.65012455",... | 0.7836919 | 2 |
Gets the resourceRoles property value. The resourceRoles property | def resource_roles
return @resource_roles
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def roles\n @resource_roles\n end",
"def resource_roles=(value)\n @resource_roles = value\n end",
"def roles\n response[\"roles\"]\n end",
"def resource_role_scopes\n return @resource_role_scopes\n end",
"def roles\r\n @roles ||... | [
"0.8244089",
"0.80357206",
"0.68398136",
"0.68235034",
"0.67936695",
"0.66633666",
"0.6625901",
"0.6592014",
"0.65607786",
"0.64401186",
"0.64401186",
"0.6366345",
"0.635795",
"0.6326675",
"0.63102114",
"0.6243677",
"0.6241839",
"0.6188892",
"0.61791474",
"0.6174551",
"0.6140... | 0.82855386 | 0 |
Sets the resourceRoles property value. The resourceRoles property | def resource_roles=(value)
@resource_roles = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def roles(roles) #:nodoc:\n @roles = roles\n end",
"def roles\n @resource_roles\n end",
"def resource_role_scopes=(value)\n @resource_role_scopes = value\n end",
"def roles= *new_roles\n roles.set_roles new_roles\n end",
"def roles(klass)\n i... | [
"0.668208",
"0.66797745",
"0.6666629",
"0.6651612",
"0.6625105",
"0.6307997",
"0.62749714",
"0.62749714",
"0.62636536",
"0.6196383",
"0.6196383",
"0.6190066",
"0.6190066",
"0.6181105",
"0.6154921",
"0.6137115",
"0.61323655",
"0.6103167",
"0.6047066",
"0.6025439",
"0.60040224"... | 0.86069757 | 0 |
Gets the resourceScopes property value. The resourceScopes property | def resource_scopes
return @resource_scopes
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resource_scopes=(value)\n @resource_scopes = value\n end",
"def resource_scopes=(value)\n @resource_scopes = value\n end",
"def resource_role_scopes\n return @resource_role_scopes\n end",
"def resource_role_scopes=(value)\n ... | [
"0.77595764",
"0.77595764",
"0.7651429",
"0.7331777",
"0.6560884",
"0.6387792",
"0.63863796",
"0.6357074",
"0.63452214",
"0.6309005",
"0.6240311",
"0.6240038",
"0.6183952",
"0.61728805",
"0.61343503",
"0.6123813",
"0.61058617",
"0.6061496",
"0.599738",
"0.59488076",
"0.594880... | 0.82831246 | 1 |
Sets the resourceScopes property value. The resourceScopes property | def resource_scopes=(value)
@resource_scopes = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resource_role_scopes=(value)\n @resource_role_scopes = value\n end",
"def resource_scope=(resource_scope)\n @resource_scope = \"/#{resource_scope}\"\n end",
"def resource_scopes\n return @resource_scopes\n end",
"def resource_scopes\n ... | [
"0.81571317",
"0.7353741",
"0.6405257",
"0.6405257",
"0.6314455",
"0.6238285",
"0.6163406",
"0.61316746",
"0.60727245",
"0.5828662",
"0.5734913",
"0.5734913",
"0.5734913",
"0.5734913",
"0.5734913",
"0.5734913",
"0.55826235",
"0.55738384",
"0.5545482",
"0.5545482",
"0.5527147"... | 0.8820636 | 1 |
Gets the resources property value. Access package resources in this catalog. | def resources
return @resources
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resources\n instance_variable_get(\"@#{resources_name}\")\n end",
"def resources\n @resources.values\n end",
"def resources=(value)\n @resources = value\n end",
"def resources=(value)\n @resources = value\n end",
"def resources=(va... | [
"0.7305479",
"0.7047557",
"0.669468",
"0.669468",
"0.669468",
"0.66705287",
"0.66378736",
"0.6571846",
"0.6563361",
"0.65469265",
"0.6506333",
"0.639469",
"0.63352",
"0.6237431",
"0.62321794",
"0.6218281",
"0.61886656",
"0.6183649",
"0.6162993",
"0.61582345",
"0.6114098",
"... | 0.6846811 | 3 |
Sets the resources property value. Access package resources in this catalog. | def resources=(value)
@resources = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_Resources(value)\n set_input(\"Resources\", value)\n end",
"def resources=(collection)\n instance_variable_set(\"@#{resources_name}\", collection)\n end",
"def resource=(value)\n @resource = value\n end",
"def resource=(value)\n @re... | [
"0.70970035",
"0.66910946",
"0.6524971",
"0.6524971",
"0.6524971",
"0.6524971",
"0.6524971",
"0.6524971",
"0.63862026",
"0.6233686",
"0.6185343",
"0.61287624",
"0.6110455",
"0.5983229",
"0.59180576",
"0.5809473",
"0.57457787",
"0.5739924",
"0.5687186",
"0.5666226",
"0.5614553... | 0.81207937 | 1 |
Serializes information the current object | def serialize(writer)
raise StandardError, 'writer cannot be null' if writer.nil?
super
writer.write_collection_of_object_values("accessPackages", @access_packages)
writer.write_enum_value("catalogType", @catalog_type)
writer.write_date_tim... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def serialize\n end",
"def serialize(object) end",
"def serialize; end",
"def serialize; end",
"def serialize\n \n end",
"def serialize\n raise NotImplementedError\n end",
"def serialize\n raise NotImplementedError\n end",
"def dump\r\n super + to_s\r\n end",
... | [
"0.7951372",
"0.7645999",
"0.7579812",
"0.7579812",
"0.7440032",
"0.720861",
"0.720861",
"0.7207583",
"0.7016516",
"0.70007193",
"0.6992252",
"0.69838214",
"0.69723576",
"0.69666415",
"0.69666415",
"0.6942002",
"0.69417155",
"0.6933786",
"0.6913977",
"0.6891677",
"0.68810964"... | 0.6498714 | 76 |
Gets the state property value. Has the value published if the access packages are available for management. The possible values are: unpublished, published, unknownFutureValue. | def state
return @state
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def publishing_state\n return @publishing_state\n end",
"def publishing_state\n\n PublishingState.get(publishing_state_id)\n\n end",
"def publishing_state=(value)\n @publishing_state = value\n end",
"def state\n @state\n end",
"def state\n ... | [
"0.675052",
"0.66557187",
"0.6604693",
"0.63454205",
"0.6342846",
"0.63084435",
"0.63064414",
"0.6298327",
"0.6282515",
"0.62800395",
"0.6260496",
"0.6255623",
"0.6174148",
"0.61640465",
"0.6132624",
"0.61207753",
"0.6114818",
"0.61052066",
"0.6082763",
"0.608121",
"0.6071713... | 0.6338844 | 14 |
Sets the state property value. Has the value published if the access packages are available for management. The possible values are: unpublished, published, unknownFutureValue. | def state=(value)
@state = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def state=(value)\n @state = value\n end",
"def publishing_state=(value)\n @publishing_state = value\n end",
"def state=(s)\n @state = s\n end",
"def state=(value)\n client.put(path(\"/state\"), {:transitiontime => self.transitiontime}.merge(value))\n self.... | [
"0.75953525",
"0.74052745",
"0.70606875",
"0.69398254",
"0.68839693",
"0.68527055",
"0.679191",
"0.679191",
"0.679191",
"0.679191",
"0.679191",
"0.679191",
"0.679191",
"0.6774302",
"0.67354286",
"0.666373",
"0.666373",
"0.666373",
"0.666373",
"0.666373",
"0.666373",
"0.6663... | 0.7541445 | 7 |
FIXME: Add support for start, stop, count | def _get_columns(column_family, key, columns, sub_columns, consistency)
result = if is_super(column_family)
if sub_columns
columns_to_hash(column_family, client.get_slice(key,
CassandraThrift::ColumnParent.new(:column_family => column_family, :super_column => columns),
Ca... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start; end",
"def start; end",
"def start; end",
"def start; end",
"def start; end",
"def start; end",
"def start; end",
"def start; end",
"def start; end",
"def start; end",
"def start; end",
"def start; end",
"def start; end",
"def start; end",
"def start; end",
"def start=(_arg... | [
"0.67786735",
"0.67786735",
"0.67786735",
"0.67786735",
"0.67786735",
"0.67786735",
"0.67786735",
"0.67786735",
"0.67786735",
"0.67786735",
"0.67786735",
"0.67786735",
"0.67786735",
"0.67786735",
"0.67786735",
"0.63159776",
"0.6238663",
"0.6181715",
"0.6145329",
"0.6130119",
... | 0.0 | -1 |
Ant Design Table: Each record in table should have a unique `key` prop or set `rowKey` to an unique primary key | def key
id
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def batch_key(_record)\n raise \"Implement in child\"\n end",
"def original_key(row)\n end",
"def kv_table(table)\n transform_table!(table).rows_hash\nend",
"def row_for_record\n raise IdMissing.new(\"You must set an ID before save.\") if record.id.blank?\n\n MassiveRe... | [
"0.6372049",
"0.62427956",
"0.6156002",
"0.60425216",
"0.5932186",
"0.5932186",
"0.59312415",
"0.59246725",
"0.59241885",
"0.58648264",
"0.58237666",
"0.57881784",
"0.5767194",
"0.57656133",
"0.5764895",
"0.5758939",
"0.575432",
"0.57511264",
"0.57470894",
"0.57470894",
"0.57... | 0.5879658 | 9 |
GET /admin/questions GET /admin/questions.json | def index
authorize! :index, Question
@admin_questions = Admin::Question.accessible_by(current_ability, :read)
@admin_questions = @admin_questions.search(params[:search]) unless params[:search].blank?
@admin_questions = @admin_questions.order("#{sort_column} #{sort_direction}") unless sort_column.blank?... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def questions\n self.class.get(\"/2.2/questions\", @options)\n end",
"def index\n unless current_user.admin?\n respond_to do |format|\n format.html { redirect_to '/', alert: \"You don't have access to view that page\" }\n format.json { render :show, status: :ok, location: @user }\n ... | [
"0.7924908",
"0.736686",
"0.72706515",
"0.7226631",
"0.7193296",
"0.71818566",
"0.7144408",
"0.7031052",
"0.69481397",
"0.69481397",
"0.69481397",
"0.69481397",
"0.69481397",
"0.69481397",
"0.69481397",
"0.69481397",
"0.69481397",
"0.69481397",
"0.69481397",
"0.69481397",
"0.... | 0.65917856 | 53 |
GET /admin/questions/1 GET /admin/questions/1.json | def show
authorize! :read, @admin_question
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def questions\n self.class.get(\"/2.2/questions\", @options)\n end",
"def index\n render_json(current_user.created_questions)\n end",
"def index\n unless current_user.admin?\n respond_to do |format|\n format.html { redirect_to '/', alert: \"You don't have access to view that page\" }\n ... | [
"0.7445898",
"0.7167108",
"0.7117964",
"0.7023171",
"0.7010109",
"0.69792205",
"0.6978015",
"0.696465",
"0.69271904",
"0.68749005",
"0.683803",
"0.6828398",
"0.6788525",
"0.6747926",
"0.67308205",
"0.67255867",
"0.67241484",
"0.6699607",
"0.6692597",
"0.66919506",
"0.6691511"... | 0.64600515 | 59 |
POST /admin/questions POST /admin/questions.json | def create
@admin_question = Admin::Question.new(admin_question_params)
authorize! :create, @admin_question
respond_to do |format|
if @admin_question.save
format.html { redirect_to @admin_question, notice: 'Question was successfully created.' }
format.json { render action: 'show', sta... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def manage_question(body)\n upload_questions(JSON.parse(body)['questions'])\n get_questions\nend",
"def create\n question = @current_user.question.create!(question_params)\n render json: { question: question }\n end",
"def add_question\n\t\t\tif(current_instructor.quizzes.exists?(:id => params[:quiz_i... | [
"0.7106436",
"0.68439925",
"0.68302476",
"0.6824437",
"0.6807824",
"0.6761339",
"0.6743204",
"0.6740628",
"0.67149115",
"0.67028874",
"0.6682173",
"0.6618884",
"0.6604918",
"0.6604236",
"0.66003704",
"0.65806276",
"0.6571795",
"0.65672636",
"0.65644854",
"0.65563476",
"0.6535... | 0.7067244 | 1 |
PATCH/PUT /admin/questions/1 PATCH/PUT /admin/questions/1.json | def update
authorize! :update, @admin_question
respond_to do |format|
if @admin_question.update(admin_question_params)
format.html { redirect_to @admin_question, notice: 'Question was successfully updated.' }
format.json { head :no_content }
else
format.html { render action:... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to api_v1_question_path(@question), notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n ... | [
"0.6878379",
"0.66882557",
"0.66870445",
"0.6677232",
"0.6667987",
"0.66627175",
"0.6630765",
"0.66197294",
"0.66103035",
"0.66103035",
"0.66103035",
"0.66103035",
"0.66103035",
"0.6607339",
"0.6601542",
"0.65945536",
"0.6589202",
"0.6588152",
"0.6561332",
"0.6556589",
"0.654... | 0.7187009 | 0 |
DELETE /admin/questions/1 DELETE /admin/questions/1.json | def destroy
authorize! :destroy, @admin_question
@admin_question.destroy
respond_to do |format|
format.html { redirect_to admin_questions_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @question.destroy\n respond_to do |format|\n format.html { redirect_to admin_questions_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n if @v1_question.destroy\n render json: {'message': 'Deleted question successfully'}, status: :ok\n else\n ... | [
"0.784056",
"0.7719649",
"0.76042485",
"0.7565696",
"0.750822",
"0.74618286",
"0.74568343",
"0.74390036",
"0.7431825",
"0.7431825",
"0.7431825",
"0.7431825",
"0.7431825",
"0.7431825",
"0.7430915",
"0.7425789",
"0.7425789",
"0.7412051",
"0.7411497",
"0.7411497",
"0.7411497",
... | 0.7798983 | 1 |
Use callbacks to share common setup or constraints between actions. | def set_admin_question
@admin_question = Admin::Question.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6165152",
"0.60463154",
"0.59467196",
"0.5917112",
"0.5890387",
"0.58345735",
"0.57773316",
"0.56991524",
"0.56991524",
"0.565454",
"0.5622282",
"0.54232633",
"0.54119074",
"0.54119074",
"0.54119074",
"0.53937256",
"0.53801376",
"0.5358599",
"0.53412294",
"0.5340814",
"0.5... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def admin_question_params
params.require(:admin_question).permit(:name, :language_code_id, :question, {:answers => []}, :correct_answer)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",... | 0.0 | -1 |
Use callbacks to share common setup or constraints between actions. | def set_local
@local = Local.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576"... | 0.0 | -1 |
Only allow a trusted parameter "white list" through. | def local_params
params.require(:local).permit(:usuario_a_id, :nombre, :foto, :calificacion, :descripcion, :horario, :direccion, :latitud, :longitud, :foto_file_name, :foto_content_type, :foto_file_size, :foto_updated_at, :visible, :imagenUrl)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def allowed_params\n ALLOWED_PARAMS\n end",
"def expected_permitted_parameter_names; end",
"def param_whitelist\n [:role, :title]\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def permitted_params\n []\n end",
... | [
"0.7122997",
"0.70535856",
"0.6947653",
"0.6902139",
"0.6736141",
"0.67172843",
"0.66890657",
"0.66776687",
"0.66612494",
"0.65556705",
"0.6527668",
"0.6458227",
"0.64516383",
"0.6451055",
"0.6447473",
"0.6435168",
"0.641298",
"0.641298",
"0.6390906",
"0.63801134",
"0.6380113... | 0.0 | -1 |
arr Your array with desierd continent. char character with value you want to exclude. Examples exclude(["bosse", "olof", "kalle", "olof"], "olof") => ["bosse", "kalle"] Returns array with the other values. | def exclude(arr, char)
output = []
i = 0
charlength = char.length
while i < arr.length
if arr[i] != char
output << arr[i]
i += 1
else
i += 1
end
end
return output
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def exclude_array(arr)\n\t\tfilter_two_arrays(self, arr, false)\n\tend",
"def exclude(arr, num)\n i = 0\n a = []\n while i < arr.length\n if arr[i] != num\n a << arr[i]\n end\n i += 1\n end\n return a\nend",
"def remove_vowels(str_arr)\n result = []\n str_arr.ea... | [
"0.71823055",
"0.6593402",
"0.62146086",
"0.61398935",
"0.6083859",
"0.5981787",
"0.59516406",
"0.59370565",
"0.5928872",
"0.592382",
"0.5918632",
"0.58932835",
"0.58832455",
"0.5879958",
"0.58506036",
"0.58466834",
"0.5845169",
"0.5821142",
"0.57998335",
"0.57818234",
"0.576... | 0.69762725 | 1 |
initializing passed in variables so they can be corrected and used in the model | def initialize(location, city, start_date, end_date)
@location = location.gsub(' ', '_')
@cityfixed = city.gsub(' ', '_')
@city = city
@date = "planner_" + start_date.gsub('/', '') + end_date.gsub('/', '')
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def prep_variables\n end",
"def set_initial_values\n now = Time.now\n @first_seen ||= now\n @last_activity ||= now\n @total_connections ||= 0\n @total_time ||= 0\n @money ||= 0\n @donations ||= 0\n @rank ||= 0\n @colour ||= :ansi\n @muffled ||= false\n @history ||= History.new... | [
"0.73959047",
"0.63519645",
"0.6294727",
"0.6279159",
"0.6279159",
"0.6279159",
"0.6279159",
"0.62767017",
"0.62206405",
"0.6202622",
"0.62018967",
"0.6185826",
"0.61201173",
"0.60834354",
"0.607233",
"0.607233",
"0.6059757",
"0.6049417",
"0.6040384",
"0.60153246",
"0.6014319... | 0.0 | -1 |
retrieving api get request | def fetch_weather
response = HTTParty.get("http://api.wunderground.com/api/cdb75d07a23ad227/#{date}/q/#{location}/#{cityfixed}.xml")
parse_response(response)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_get_request\n 'get_%ss' % api_name\n end",
"def get endpoint\n do_request :get, endpoint\n end",
"def do_get\n Net::HTTP.get(URI.parse(api_url))\n end",
"def _get\n http_method(:get)\n end",
"def get_request( id )\n url = \"#{self.url}/#{id}?auth=#{self.auth... | [
"0.78162956",
"0.73392326",
"0.72750145",
"0.7252552",
"0.7250406",
"0.72315204",
"0.7132301",
"0.7126885",
"0.7115335",
"0.7048804",
"0.70399356",
"0.70399356",
"0.70382994",
"0.7025883",
"0.69976336",
"0.69936174",
"0.6992226",
"0.6992226",
"0.6966722",
"0.69643563",
"0.695... | 0.0 | -1 |
parsing the data that will be called on the show page | def parse_response(response)
date_title = response.parsed_response['response']['trip']
self.title = date_title['title']
date_start = response.parsed_response['response']['trip']['period_of_record']['date_start']['date']
self.startdate = date_start['pretty']
date_end = response.parsed_response... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def showData\n $page = $page +\n \"<dl>\\n\" +\n \" <dt>name\\n\" +\n \" <dd>\" + $name + \"\\n\" +\n \" <dt>organization\\n\" +\n \" <dd>\" + $organization + \"\\n\" +\n \" <dt>email\\n\" +\n \" <dd>\" + $email + \"\\n\" +\n \" <dt>source\\n\" +\n \" <dd>\" + $source + \"\\n\" ... | [
"0.63044804",
"0.62598413",
"0.6242917",
"0.613056",
"0.60782766",
"0.607227",
"0.5995927",
"0.5980924",
"0.5971029",
"0.59588146",
"0.59588075",
"0.5956349",
"0.594206",
"0.5939866",
"0.589733",
"0.589733",
"0.5894136",
"0.5827516",
"0.5824988",
"0.58132976",
"0.5809685",
... | 0.5527719 | 92 |
note kludge to force namespace vs method listing when input ends in ':' | def _namespace_class(ns)
return unless ns
Ing::Util.decode_class(ns.gsub(/:$/,": "))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse_name(name)\n parts = name.split(/(::|#|\\.)/)\n if parts.length == 1 then\n # Daniel Choi fixed this line from the official rdoc \n if parts.first =~ /^[a-z=<|^&*-+\\/\\[]/ then\n type = '.'\n meth = parts.pop\n else\n type = nil\n meth = nil\n end\n ... | [
"0.63336074",
"0.6231538",
"0.6230599",
"0.6212331",
"0.61621505",
"0.5899847",
"0.5898043",
"0.5877487",
"0.5877049",
"0.5843588",
"0.5835226",
"0.58351105",
"0.5805453",
"0.5794539",
"0.5794539",
"0.5793812",
"0.57629323",
"0.57598865",
"0.57598865",
"0.57506907",
"0.574777... | 0.0 | -1 |
test simple and rm | def test_generator_route1
s1 = File.read("routes.rb")
`./bin/nephos-generator --test -r get test ctr#mth`
s2 = File.read("routes.rb")
`./bin/nephos-generator --test -r get test ctr#mth --rm`
s3 = File.read("routes.rb")
assert_equal s1, s3
assert_not_equal s1, s2
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_remove_a_file\n a.rm(\"one\").commit(\"a removed one\")\n \n assert_equal nil, a['one']\n assert_equal \"one content\", b['one']\n \n b.pull\n \n assert_equal nil, a['one']\n assert_equal nil, b['one']\n \n assert_log_equal [\n \"a added one\",\n \"a removed one\... | [
"0.66864395",
"0.66011703",
"0.6558572",
"0.6501634",
"0.64856493",
"0.64760417",
"0.6383288",
"0.63712585",
"0.6317686",
"0.62930727",
"0.6284793",
"0.62803483",
"0.6259433",
"0.6245177",
"0.62090176",
"0.62090176",
"0.62078595",
"0.62078595",
"0.61898863",
"0.6181814",
"0.6... | 0.0 | -1 |
test if ctrmth == ctr mth | def test_generator_route2
s1 = File.read("routes.rb")
`./bin/nephos-generator --test -r get test ctr#mth`
s2 = File.read("routes.rb")
`./bin/nephos-generator --test -r get test ctr mth`
s3 = File.read("routes.rb")
`./bin/nephos-generator --test -r get test ctr mth --rm`
s4 = File.read("route... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cuadrada\n @n==@m\n end",
"def ==(value)\r\n return (@access >> 26) == value\r\n end",
"def verify(otp, counter)\n otp == self.at(counter)\n end",
"def ceq(pointer, pmodes)\n args = get_parameters(pointer, pmodes)\n @ram[args[2]] = args[0] == args[1] ? 1 : 0\n pointer + 4\n end"... | [
"0.59098613",
"0.577483",
"0.56793493",
"0.56146383",
"0.5506539",
"0.5494438",
"0.54425484",
"0.5440856",
"0.5440856",
"0.5425012",
"0.5368704",
"0.5339676",
"0.53153676",
"0.5297776",
"0.52615374",
"0.5257654",
"0.5251454",
"0.52463263",
"0.5202708",
"0.5200909",
"0.5159231... | 0.0 | -1 |
GET /questionnaire_settings/1 GET /questionnaire_settings/1.xml | def show
@questionnaire_setting = QuestionnaireSetting.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @questionnaire_setting }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n\t@questionnaire_setting = QuestionnaireSetting.new\n\n\trespond_to do |format|\n\t format.html # new.html.erb\n\t format.xml { render :xml => @questionnaire_setting }\n\tend\n end",
"def create\n\t@questionnaire_setting = QuestionnaireSetting.new(params[:questionnaire_setting])\n\n\trespond_to do |f... | [
"0.67203575",
"0.6493337",
"0.64643645",
"0.64643645",
"0.63620204",
"0.63620204",
"0.62090415",
"0.6112864",
"0.6014209",
"0.5999193",
"0.5994814",
"0.5908654",
"0.5902615",
"0.58854043",
"0.58839333",
"0.58445966",
"0.58445966",
"0.58445966",
"0.58445966",
"0.58445966",
"0.... | 0.74902225 | 0 |
GET /questionnaire_settings/new GET /questionnaire_settings/new.xml | def new
@questionnaire_setting = QuestionnaireSetting.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @questionnaire_setting }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @questionnaire = Questionnaire.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @questionnaire }\n end\n end",
"def create\n\t@questionnaire_setting = QuestionnaireSetting.new(params[:questionnaire_setting])\n\n\trespond_to do |format|\n\t ... | [
"0.7398748",
"0.7305513",
"0.70606226",
"0.70606226",
"0.6945047",
"0.68721664",
"0.67607415",
"0.6754397",
"0.6753932",
"0.67270195",
"0.6676992",
"0.66722184",
"0.66649044",
"0.66649044",
"0.66649044",
"0.66649044",
"0.66649044",
"0.66582894",
"0.66542876",
"0.66542876",
"0... | 0.77543503 | 0 |
POST /questionnaire_settings POST /questionnaire_settings.xml | def create
@questionnaire_setting = QuestionnaireSetting.new(params[:questionnaire_setting])
respond_to do |format|
if @questionnaire_setting.save
format.html { redirect_to(@questionnaire_setting, :notice => 'Questionnaire setting was successfully created.') }
format.xml { render :xml => @questionnaire_settin... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def settings\n request(Resources::RESOURCE_SETTINGS, HTTP_METHOD_POST)\n end",
"def questionnaire_params\n params.require(:questionnaire).permit(:title)\n end",
"def create\n @questionnaire = Questionnaire.new(questionnaire_params)\n @questionnaire.build_questionnaire_with_options(\n ... | [
"0.63910466",
"0.6174291",
"0.61143965",
"0.60971594",
"0.60474074",
"0.5960049",
"0.59596115",
"0.59533757",
"0.59215415",
"0.59008145",
"0.5894256",
"0.58273345",
"0.5787931",
"0.5787931",
"0.5787931",
"0.5787931",
"0.5787931",
"0.5787931",
"0.5787931",
"0.5787931",
"0.5787... | 0.7236441 | 0 |
PUT /questionnaire_settings/1 PUT /questionnaire_settings/1.xml | def update
@questionnaire_setting = QuestionnaireSetting.find(params[:id])
respond_to do |format|
if @questionnaire_setting.update_attributes(params[:questionnaire_setting])
format.html { redirect_to(@questionnaire_setting, :notice => 'Questionnaire setting was successfully updated.') }
format.xml { head :ok ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @questionnaire = Questionnaire.find(params[:id])\n\n respond_to do |format|\n if @questionnaire.update_attributes(params[:questionnaire])\n format.html { redirect_to(@questionnaire, :notice => 'Questionnaire was successfully updated.') }\n format.xml { head :ok }\n else\... | [
"0.6629307",
"0.6477327",
"0.62919754",
"0.6212928",
"0.61690485",
"0.6138525",
"0.6138525",
"0.6138525",
"0.6138525",
"0.6138525",
"0.6138525",
"0.6138525",
"0.6138525",
"0.6138525",
"0.61117446",
"0.6076522",
"0.60595477",
"0.5987258",
"0.59697497",
"0.59647334",
"0.5960907... | 0.7304637 | 0 |
DELETE /questionnaire_settings/1 DELETE /questionnaire_settings/1.xml | def destroy
@questionnaire_setting = QuestionnaireSetting.find(params[:id])
@questionnaire_setting.destroy
respond_to do |format|
format.html { redirect_to(questionnaire_settings_url) }
format.xml { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @questionnaire = Questionnaire.find(params[:id])\n @questionnaire.destroy\n\n respond_to do |format|\n format.html { redirect_to questionnaires_url }\n format.xml { head :ok }\n end\n end",
"def delete\n @questionnaire = Questionnaire.find(params[:id])\n if @questionna... | [
"0.6731679",
"0.6445223",
"0.6440796",
"0.63891006",
"0.63498104",
"0.6308637",
"0.6304806",
"0.6279613",
"0.6273471",
"0.6241044",
"0.6241044",
"0.62296855",
"0.62178284",
"0.6215277",
"0.6213418",
"0.6193339",
"0.6188219",
"0.6184334",
"0.61814725",
"0.6173637",
"0.6148745"... | 0.75749624 | 0 |
validates_uniqueness_of :teen_id, scope: :service_listing_id self.primary_key = :id,:language_id self.primary_key = :teen_id, :service_listing_id | def set_approved
if not self.approved # don't want to run with seed file
self.approved = false
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def only_one_primary_key\n if primary && self.class.where(primary: true).count >= 1\n errors.add(:primary, \"must be false if another primary already exists\")\n end\n end",
"def allows_unique?\n true\n end",
"def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = ... | [
"0.5859803",
"0.5682826",
"0.5496685",
"0.54599965",
"0.5444984",
"0.53789467",
"0.5311696",
"0.5281463",
"0.5280393",
"0.526791",
"0.5263439",
"0.52586573",
"0.5254994",
"0.52547604",
"0.5252191",
"0.5239852",
"0.523564",
"0.5217258",
"0.5217009",
"0.5197262",
"0.5188382",
... | 0.0 | -1 |
Return an initialized agent identifier. | def initialize(params={})
@name = params[:name]
@addresses = params[:addresses] || []
@resolvers = params[:resolvers] || []
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def agent_id\n self.dig_for_string(\"agentSummary\", \"id\")\n end",
"def agent\n @agent ||= initialize_agent\n end",
"def initialize(agentid)\n @agentid = agentid\n @counter = 0\n end",
"def identifier\n id || name || default_identifier\n end",
"def generate_identifier_token\n se... | [
"0.63371",
"0.61025804",
"0.61002934",
"0.60207397",
"0.5941004",
"0.59011114",
"0.5886964",
"0.5798053",
"0.5783118",
"0.577056",
"0.5753434",
"0.57399386",
"0.57042414",
"0.56884366",
"0.5686737",
"0.56805706",
"0.5644951",
"0.5642089",
"0.558741",
"0.5581407",
"0.5554534",... | 0.0 | -1 |
Return an ordered list of addresses where the agent can be contacted. | def addresses
@addresses
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def addresses\n collect { |a| a.address }\n end",
"def agent_transport_addresses\n [ @address ]\n end",
"def addresses\n Array(@addresses)\n end",
"def addresses\n @addresses ||= init_addresses\n end",
"def from_addresses\n return @from_addresses\n ... | [
"0.75185376",
"0.7243379",
"0.7206856",
"0.68885547",
"0.68816894",
"0.68719196",
"0.67684007",
"0.6749631",
"0.6737112",
"0.6606216",
"0.65668285",
"0.6525703",
"0.6521209",
"0.6495953",
"0.6488858",
"0.6483421",
"0.64824265",
"0.64477575",
"0.64356107",
"0.6393663",
"0.6360... | 0.71116775 | 3 |
Iterate over the addresses. | def each_address(&blk) # :yields: url
addresses.each(&blk)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def each_address(name)\n getaddresses(name).each { |address| yield(address)}\n end",
"def each_address\n (@addr..broadcast).each do |addr|\n yield _to_string(addr)\n end\n end",
"def each\n (@first..@last).each {|addr| yield addr}\n end",
"def addresses\n collect { |a| a.address }\... | [
"0.7809025",
"0.7397756",
"0.7260096",
"0.725386",
"0.72151256",
"0.6934764",
"0.6925367",
"0.6910473",
"0.6836179",
"0.6824585",
"0.682127",
"0.6730804",
"0.6704881",
"0.66964304",
"0.66885895",
"0.66597825",
"0.6629551",
"0.66267514",
"0.6559996",
"0.65033203",
"0.64851403"... | 0.81112355 | 0 |
Return the first address (if any), or +nil+ if no addresses specified. | def address
unless addresses.empty?
addresses.first
else
nil
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getaddress(name)\n addresses = getaddresses(name)\n if addresses.empty?\n raise ResolvError.new(\"no address for #{name}\")\n else\n addresses.first\n end\n end",
"def main_address\n addresses.first\n end",
"def get_street_address(results)\n results = results.last\n result ... | [
"0.6832089",
"0.6805103",
"0.66727483",
"0.64408815",
"0.6380976",
"0.62671065",
"0.6150695",
"0.60894144",
"0.60644746",
"0.60624754",
"0.60448825",
"0.5938635",
"0.5903079",
"0.58969474",
"0.5860533",
"0.58332765",
"0.5828194",
"0.58224165",
"0.5803908",
"0.5790506",
"0.579... | 0.828965 | 0 |
Return an ordered list of addresses where the agent can be contacted. | def resolvers
@resolvers
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def addresses\n collect { |a| a.address }\n end",
"def agent_transport_addresses\n [ @address ]\n end",
"def addresses\n Array(@addresses)\n end",
"def addresses\n @addresses\n end",
"def addresses\n @addresses ||= init_addresses\n end",
"def from_addresses... | [
"0.75185376",
"0.7243379",
"0.7206856",
"0.71116775",
"0.68885547",
"0.68816894",
"0.68719196",
"0.67684007",
"0.6749631",
"0.6737112",
"0.6606216",
"0.65668285",
"0.6525703",
"0.6521209",
"0.6495953",
"0.6488858",
"0.6483421",
"0.64824265",
"0.64477575",
"0.64356107",
"0.639... | 0.0 | -1 |
Iterate over the resolvers. | def each_resolver(&blk) # :yields: anAID
resolvers.each(&blk)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def each(&block)\n config.resolver.each(_container, &block)\n end",
"def resolvers\n @resolvers\n end",
"def resolvers\n @resolvers ||= from.merge(default: self).map { |origin, hint| { origin: origin, hint: hint, resolver: ((has_group? && group.resolvers[origin]) || Resolver.for(origin... | [
"0.7420374",
"0.7287524",
"0.6598927",
"0.60285777",
"0.60268366",
"0.5930143",
"0.58257735",
"0.58058614",
"0.5699752",
"0.5681123",
"0.5676933",
"0.5634946",
"0.5609371",
"0.56057554",
"0.56048954",
"0.56023073",
"0.55867857",
"0.55750746",
"0.55581987",
"0.55090666",
"0.54... | 0.7872115 | 0 |
Return the first resolver (if any), or +nil+ if no resolvers specified. | def resolver
unless resolvers.empty?
resolvers.first
else
nil
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resolver\n @resolver = Dnsruby::Resolver.new if @resolver==nil\n @resolver\n end",
"def resolution(name)\n return nil if name.nil?\n\n @resolves.find { |resolve| resolve.name == name }\n end",
"def resolution(name)\n return nil if name.nil?\n\n @resolves.find { |resolve| resolve... | [
"0.6381027",
"0.6160704",
"0.5952673",
"0.5947407",
"0.5878512",
"0.5675232",
"0.56315464",
"0.557306",
"0.5571894",
"0.5530545",
"0.5513594",
"0.55063593",
"0.54944825",
"0.5486534",
"0.53532815",
"0.5309924",
"0.5267328",
"0.52632755",
"0.5246789",
"0.5154382",
"0.5121541",... | 0.88695776 | 0 |
Return +true+ if this agent identifier matches the pattern. | def matches?(pattern)
return false if (pattern.name && self.name != pattern.name)
pattern.addresses.each do |address_pattern|
return false unless self.addresses.include? address_pattern
end
pattern.resolvers.each do |resolver_pattern|
this_pattern_matched = false
self.res... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def match?(pattern)\n pattern.split.each_with_index do |arg, index|\n return false unless arg == self[index]\n end\n return true\n end",
"def matches?(pattern); end",
"def name_matches?(pattern)\n name.match(pattern)\n end",
"def pattern_match?\n @pattern_match\n end"... | [
"0.7094951",
"0.6824299",
"0.680797",
"0.66410744",
"0.6576947",
"0.6469819",
"0.6436376",
"0.6352169",
"0.63104403",
"0.63004595",
"0.6156072",
"0.6139732",
"0.61250615",
"0.61178",
"0.6031935",
"0.6031154",
"0.60190254",
"0.60112196",
"0.6005391",
"0.59940124",
"0.5987994",... | 0.5958653 | 24 |
Return true if these two agent identifiers are equal | def ==(other)
return name == other.name
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ==(other)\n other.is_a?(Agent) && type == other.type && id == other.id\n end",
"def eql?(other)\n other.is_a?(Agent) && actor.eql?(other.actor)\n end",
"def == o\n identifier == o.identifier\n end",
"def equal?(other)\n object_id == other.object_id\n end",
"def package_a... | [
"0.706431",
"0.6691378",
"0.6089774",
"0.6026357",
"0.60153973",
"0.59648657",
"0.58072895",
"0.57920736",
"0.5790311",
"0.57757103",
"0.57597524",
"0.57495034",
"0.57458526",
"0.57441115",
"0.5722393",
"0.5703131",
"0.5701289",
"0.5700229",
"0.5649209",
"0.5647785",
"0.56191... | 0.0 | -1 |
Return true if these two agent identifiers are equal | def eql?(other)
self == other
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ==(other)\n other.is_a?(Agent) && type == other.type && id == other.id\n end",
"def eql?(other)\n other.is_a?(Agent) && actor.eql?(other.actor)\n end",
"def == o\n identifier == o.identifier\n end",
"def equal?(other)\n object_id == other.object_id\n end",
"def package_a... | [
"0.706431",
"0.6691378",
"0.6089774",
"0.6026357",
"0.60153973",
"0.59648657",
"0.58072895",
"0.57920736",
"0.5790311",
"0.57757103",
"0.57597524",
"0.57495034",
"0.57458526",
"0.57441115",
"0.5722393",
"0.5703131",
"0.5701289",
"0.5700229",
"0.5649209",
"0.5647785",
"0.56191... | 0.0 | -1 |
Return hash value for this agent identifier | def hash
name.hash
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hash\n guid.hash\n end",
"def hash_id\n @hid\n end",
"def hash\n value_id.hash\n end",
"def hash\r\n id.hash\r\n end",
"def hash\n @id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"de... | [
"0.7427548",
"0.72749025",
"0.7167621",
"0.71023935",
"0.70995754",
"0.7066214",
"0.7065374",
"0.7065374",
"0.7065374",
"0.7065374",
"0.7065374",
"0.7065374",
"0.7065374",
"0.7065374",
"0.7065374",
"0.70484704",
"0.70199865",
"0.6987799",
"0.69874066",
"0.69799906",
"0.697999... | 0.0 | -1 |
It accomplishes this feat through massive randomization. The number of possible UUID values is approximately 3.4 X 10E38. Each UUID consists of 32 hexadecimal characters, and is typically broken into 5 sections like this 844412 and represented as a string. It looks like this: "f65c57f6a6aa17a8faa1a67f2dc9fa91" Write a ... | def generate_UUID_1
uuid = ''
hex_index = (0..15)
hex_values = ('0'..'9').to_a + ('a'..'f').to_a
(0..8).each do |num|
uuid << hex_values[rand(hex_index)]
end
uuid << '-'
(0..4).each do |num|
uuid << hex_values[rand(hex_index)]
end
uuid << '-'
(0..4).each do |num|
uuid << hex_values[rand... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def return_uuid\n possible = []\n possible << ('a'..'f').to_a\n possible << ('0'..'9').to_a\n possible.flatten!\n uuid = ''\n\n sample = [8, 4, 4, 4, 12]\n\n sample.each_with_index do | value, index |\n value.times { uuid += possible.sample }\n uuid += '-' unless sample.size <= index + 1\n end\n\n u... | [
"0.81837505",
"0.8066601",
"0.8066601",
"0.8066601",
"0.8014923",
"0.79992604",
"0.7998337",
"0.7982643",
"0.79720306",
"0.79720306",
"0.79370487",
"0.7920133",
"0.7919785",
"0.7899849",
"0.7895349",
"0.7886014",
"0.7886014",
"0.7886014",
"0.7886014",
"0.7873961",
"0.78738326... | 0.83773166 | 0 |
creates users based on the data submitted via the users attribute | def create_users(mission)
# assume no errors to start with
@validation_error = false
# run UserBatch validations
if invalid?
@validation_error = true
return succeeded?
end
# parse the input file as a spreadsheet
data = Roo::Spreadsheet.open(file)
# assume the first row is ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @user = current_user.users.new(user_params)\n if @user.save\n @users = current_user.users\n end\n end",
"def create_users()\n del_rec = []\n @good_user_records.each do |rec|\n existing_user = @users[rec.fields[\"email\"]]\n # check if the user doesn't exist already\n ... | [
"0.75313455",
"0.742828",
"0.7397783",
"0.7285028",
"0.7268442",
"0.7124559",
"0.706242",
"0.7010662",
"0.69650924",
"0.69200104",
"0.68891346",
"0.6850046",
"0.68481475",
"0.6842409",
"0.68421155",
"0.68384606",
"0.6748966",
"0.6748611",
"0.6743342",
"0.67388135",
"0.6731373... | 0.65782696 | 37 |
=begin Function: logged_in? Parameters: none PreCondition: the application needs to check to see that the user is logged in PostCondition: will return a true or false value to say if the current user is set or not. =end | def logged_in?
!current_user.nil?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def logged_in?\n if current_user\n true\n else \n false\n end\n end",
"def logged_in?\n end",
"def logged_in?\n if current_user\n true\n else\n false\n end\n end",
"def logged_in?\n current_user ? true : false;\n end",
"def logged_in? \n # !!current_user eith... | [
"0.8663316",
"0.8630494",
"0.86233765",
"0.86066675",
"0.8545476",
"0.85337955",
"0.85294014",
"0.851968",
"0.85132027",
"0.8512205",
"0.8497825",
"0.8492867",
"0.8479348",
"0.8477953",
"0.84553874",
"0.84553874",
"0.84399",
"0.84351516",
"0.8434017",
"0.84298384",
"0.8429349... | 0.0 | -1 |
=begin Function: current_user Parameters: none PreCondition: none PostCondition: sets the current user only if it can find the user in the table =end | def current_user
@current_user ||= User.find_by(id: session[:user_id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_user\n @user = User.find(params[:id])\n\n return if unauthorized_local_access(@user.uo_id)\n end",
"def current_user\n @current_user ||= User.find(session[:user_id]) if session[:user_id]\n #if current_user exist or equil to this user then keep going\n end",
"def correct_user(user)\n ... | [
"0.69830203",
"0.6936337",
"0.68965864",
"0.682263",
"0.6819888",
"0.68121517",
"0.67993057",
"0.6797229",
"0.6789617",
"0.67878366",
"0.6785564",
"0.6783475",
"0.67622113",
"0.67613035",
"0.6757928",
"0.67465925",
"0.6734992",
"0.67229885",
"0.6722707",
"0.6721336",
"0.67179... | 0.0 | -1 |
=begin Function: current_user Parameters: none PreCondition: someone needs to get the current users email Postcondition: returns the id(email) from the session hash =end | def user_email
session[:user_id]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def email\n @current_user ||= User.find(session[:user_id]) if session[:user_id]\n end",
"def current_user\n User.where(email: session[:email]).first\n end",
"def current_user\n @current_user ||= User.find_by(email: session[:email]) if session[:email]\n end",
"def email\n (@session[:current_u... | [
"0.8186987",
"0.78892416",
"0.7635007",
"0.7549948",
"0.7540046",
"0.7444324",
"0.7405903",
"0.739889",
"0.7396239",
"0.7354801",
"0.73307264",
"0.7292827",
"0.7279583",
"0.72721016",
"0.7227918",
"0.72273964",
"0.7213761",
"0.7208869",
"0.71997166",
"0.71805775",
"0.7177663"... | 0.81007844 | 1 |
=begin Function: log_out Parameters: none PreCondition: the user is logged int and selects the logout button PostCondition: the session will be cleared and the user will be effectively logged out =end | def log_out
session.delete(:user_id)
session.delete(:user_type)
session.delete(:user_email)
@current_user = nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def log_out \n session.clear\n @current_user = nil\n end",
"def log_out\n\t \tsession.delete(:user_id)\n\t \t@current_user =nil\n\t end",
"def log_out\n \tsession.delete(:user_id)\n \t@current_user = nil\n end",
"def log_out\n\t\tsession.delete(:user_id)\n\t\t@current_user= nil\n\tend",
"de... | [
"0.8160788",
"0.81422216",
"0.8118977",
"0.81121016",
"0.8096977",
"0.80757225",
"0.8055795",
"0.8035092",
"0.8035092",
"0.8035092",
"0.8035092",
"0.80340666",
"0.80324703",
"0.80236614",
"0.79972833",
"0.7986234",
"0.7974895",
"0.7964948",
"0.7964948",
"0.7964948",
"0.795117... | 0.79987854 | 14 |
Checks if page is not beeing overriden by static one that starts with / Using request.path allows us to override dynamic pages including the home page, product and taxon pages. | def render_page_if_exists
# If we don't know if page exists we assume it's and we query DB.
# But we realy don't want to query DB on each page we're sure doesn't exist!
return if Rails.cache.fetch('page_not_exist/'+request.path)
if @page = Page.visible.find_by_slug(request.path)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def if_front_page\n view_context.request.path == '/'\n end",
"def page_requested\n\t\trequest.env['REQUEST_PATH'].split(\"/\")[-1]\n\tend",
"def if_questions_page\n view_context.request.path == '/questions'\n end",
"def render_page_path\n if Settings.website.base_url.present?\n render :partia... | [
"0.6834021",
"0.6637885",
"0.65089744",
"0.6314106",
"0.6198181",
"0.6183508",
"0.6059955",
"0.60556215",
"0.60435694",
"0.60122776",
"0.6006407",
"0.5994188",
"0.5965175",
"0.5950325",
"0.5942101",
"0.59169996",
"0.59145266",
"0.59136695",
"0.59021175",
"0.5883759",
"0.58629... | 0.5961213 | 13 |
Returns page.title for use in the element. | def title_with_page_title_check
return @page.title if @page && !@page.title.blank?
title_without_page_title_check
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def page_title\n page.title\n end",
"def title\n @title_pages.each { |tp| tp.title and return tp.title }\n nil\n end",
"def page_title\n @page_title ||= format_string(page[\"title\"]) || site_title\n end",
"def title\n return @title if @title\n if matches = clas... | [
"0.8646904",
"0.8313039",
"0.8254485",
"0.8236874",
"0.81611586",
"0.8140192",
"0.8140192",
"0.8140192",
"0.8140192",
"0.8076884",
"0.8047417",
"0.8017744",
"0.8014568",
"0.80110914",
"0.80057305",
"0.79806817",
"0.7976096",
"0.7976096",
"0.7971407",
"0.79641765",
"0.79509604... | 0.7534469 | 92 |
template method for subclasses | def next_occurrence(after = Time.now.utc)
return nil unless recurrence
occurrence = after.change(next_values)
# TODO: add support for year multiples (eg., every other year, every 10th year)
if @attribute == :year and @value < after.year
nil # years are anchored, they don't rec... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def inherited(subclass); end",
"def inherited(klass); end",
"def inherited(klass); end",
"def superclass() end",
"def type; super; end",
"def subclasses; end",
"def subclasses; end",
"def subtype; end",
"def inherited(base); end",
"def super_class; end",
"def super_class; end",
"def generic?;... | [
"0.7052017",
"0.6840827",
"0.6840827",
"0.67999464",
"0.6788757",
"0.6677899",
"0.6677899",
"0.6668216",
"0.6597822",
"0.6544462",
"0.6544462",
"0.6404766",
"0.6289241",
"0.6175129",
"0.6175129",
"0.6051473",
"0.6033063",
"0.6000737",
"0.6000477",
"0.59863764",
"0.5980433",
... | 0.0 | -1 |
must return a hash to be used as the arg to advance | def recurrence
nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hash=(_arg0); end",
"def hash()\n #This is a stub, used for indexing\n end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash()\n #This is a stub, used for indexing\nend",
"def hash; end",
"d... | [
"0.7516103",
"0.7329027",
"0.73283046",
"0.73283046",
"0.73283046",
"0.73283046",
"0.73283046",
"0.73283046",
"0.73283046",
"0.72873294",
"0.7280298",
"0.7280298",
"0.7280298",
"0.7280298",
"0.7280298",
"0.7280298",
"0.7280298",
"0.7280298",
"0.7280298",
"0.7280298",
"0.71847... | 0.0 | -1 |
GET /apps GET /apps.json | def index
#@apps = App.all
name = params[:name]
platform = params[:platform]
category = params[:category]
@apps = App.search(name, platform, category)
#@apps = App.search(params[:search])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @apps = @client.apps\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @apps }\n end\n end",
"def get_applist\n return get_response(\"applist\", :json)\n end",
"def applications_list\n get \"applications\"\n end",
"def index... | [
"0.7845385",
"0.7721336",
"0.770811",
"0.7544601",
"0.75186545",
"0.74467766",
"0.73854077",
"0.7346078",
"0.72866267",
"0.72813207",
"0.7275169",
"0.7146294",
"0.7101932",
"0.7101932",
"0.7101932",
"0.704213",
"0.70374143",
"0.70271826",
"0.6987599",
"0.6970022",
"0.69527817... | 0.0 | -1 |
GET /apps/1 GET /apps/1.json | def show
@app = App.find(params[:id])
@microposts = @app.microposts.paginate(page: params[:page])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @apps = @client.apps\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @apps }\n end\n end",
"def index\n @app = App.new\n @apps = App.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json:... | [
"0.7733586",
"0.74897856",
"0.7486628",
"0.74334395",
"0.74294025",
"0.74294025",
"0.74294025",
"0.7256082",
"0.7217825",
"0.717642",
"0.71089625",
"0.70911855",
"0.7086066",
"0.7039825",
"0.69849455",
"0.696184",
"0.6889052",
"0.6878475",
"0.67915773",
"0.67768115",
"0.67768... | 0.0 | -1 |
GET /random GET /random | def random
@app = App.order("RANDOM()").first
if @app.nil?
redirect_to home_url, notice: 'there is not app'
else
respond_to do |format|
format.html { redirect_to @app}
format.json { render :show, status: :show, location: @app }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def random\n Client.get(\"/patterns/random\")\n end",
"def get_random\n @question = Question.get_random\n\n unless @question\n render json: { error: \"random question can't be found\" }.to_json, status: 404\n end\n end",
"def get_random\n uri = [@@base_uri, 'all', 'getRandom'].joi... | [
"0.78656083",
"0.75258976",
"0.730783",
"0.7225449",
"0.71335244",
"0.7075332",
"0.70259297",
"0.6981438",
"0.6812086",
"0.6774752",
"0.6742765",
"0.6728164",
"0.6722806",
"0.66185474",
"0.6585667",
"0.6521571",
"0.6521571",
"0.6462894",
"0.6443955",
"0.63825464",
"0.62954116... | 0.6789497 | 9 |
POST /apps POST /apps.json | def create
@app = App.new(app_params)
#added code for realizers list
#@developers = Developer.where(:id => params[:realizers])
#logger.debug "DEVELOPER: #{@developers.inspect} \n"
#@app.developers << @developers
#logger.debug "DEVELOPERS: #{@app.developers.inspect} \n"
#end code
respond_to do |... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @app = App.new(app_params)\n\n if @app.save\n render json: @app, status: :created, location: @app\n else\n render json: @app.errors, status: :unprocessable_entity\n end\n end",
"def create\n @app = App.new(params[:app])\n\n respond_to do |format|\n if @app.save\n ... | [
"0.7577494",
"0.71249884",
"0.70900786",
"0.70900786",
"0.69244426",
"0.68925846",
"0.68837065",
"0.68554217",
"0.67974",
"0.67317426",
"0.6691223",
"0.6645074",
"0.6639822",
"0.6637362",
"0.6561623",
"0.65447116",
"0.65336186",
"0.65101993",
"0.65046984",
"0.6493017",
"0.649... | 0.6170765 | 33 |
PATCH/PUT /apps/1 PATCH/PUT /apps/1.json | def update
respond_to do |format|
if @app.update(app_params)
format.html { redirect_to @app, notice: 'App was successfully updated.' }
format.json { render :show, status: :ok, location: @app }
else
format.html { render :edit }
format.json { render json: @app.errors, statu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_app data={}\n put '/app', data\n end",
"def update\n @app = @client.app(params[:id])\n\n respond_to do |format|\n if @app.update_attributes(params[:app]) # FIXME\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { head :no_co... | [
"0.713274",
"0.71141285",
"0.69859433",
"0.6942652",
"0.6881043",
"0.6881043",
"0.687329",
"0.687329",
"0.68714815",
"0.68714815",
"0.68714815",
"0.66534746",
"0.6621158",
"0.661592",
"0.6514138",
"0.6466499",
"0.6466499",
"0.64536047",
"0.644862",
"0.64477634",
"0.6423935",
... | 0.66418654 | 15 |
DELETE /apps/1 DELETE /apps/1.json | def destroy
@dev = @app.developers.first.id
@app.destroy
respond_to do |format|
format.html { redirect_to developer_path(@dev), notice: 'App was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @client.app_destroy(params[:id])\n\n respond_to do |format|\n format.html { redirect_to apps_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @app = App.find(params[:id])\n @app.destroy\n\n respond_to do |format|\n format.html { redirect_to app... | [
"0.77303904",
"0.74758613",
"0.74758613",
"0.74653774",
"0.74653774",
"0.74653774",
"0.74615246",
"0.74615246",
"0.73429686",
"0.7299616",
"0.71906805",
"0.71906805",
"0.71906805",
"0.71906805",
"0.7170742",
"0.7133387",
"0.7131733",
"0.7131733",
"0.7131733",
"0.70582277",
"0... | 0.6921263 | 27 |
Use callbacks to share common setup or constraints between actions. | def set_app
@app = App.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6165152",
"0.60463154",
"0.59467196",
"0.5917112",
"0.5890387",
"0.58345735",
"0.57773316",
"0.56991524",
"0.56991524",
"0.565454",
"0.5622282",
"0.54232633",
"0.54119074",
"0.54119074",
"0.54119074",
"0.53937256",
"0.53801376",
"0.5358599",
"0.53412294",
"0.5340814",
"0.5... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def app_params
params.require(:app).permit(:name, :platform, :category, :version, :picture)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",... | 0.0 | -1 |
=Uploads yamlformatted data ==Usage: | def upload(options = {})
hash = { :email => @email,
:password => @password,
:yamldata => options[:yamldata] }
data = []
hash.each do |key, value|
data << "#{key.to_s}=#{CGI.escape(value)}" if value
end
data = data.join("&")
debug "[YAMLDATA]... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rawDataUpload()\n # prepare raw data for upload\n show do\n title \"Prepare to upload resulting analyzer data\"\n check \"Under <b>Analysis</b>. <b>Gel Image</b> tab, click <b>Select All</b>.\"\n check \"Under the <b>View</b> tab, check <b>Show Analysis Paramete... | [
"0.64182556",
"0.6219584",
"0.61505276",
"0.58982193",
"0.57091427",
"0.5619064",
"0.55461144",
"0.55461144",
"0.55461144",
"0.55461144",
"0.5544548",
"0.55194396",
"0.54941547",
"0.549309",
"0.548297",
"0.5480232",
"0.5480232",
"0.5467985",
"0.5467298",
"0.5453693",
"0.54202... | 0.0 | -1 |
=Handshake with login credentials ==Returns: true if handshake successful, false otherwise | def handshake
data = "email=#{@email}&password=#{@password}"
headers = { 'User-agent' => USER_AGENT }
begin
resp = @http.post(API_HANDSHAKE_PATH, data, headers)
rescue SocketError
return false
end
debug "[HANDSHAKE]" do puts resp.body end
return (resp.code... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def handshake\n end",
"def tls_successful_handshake\n logdebug \"Succesful handshake!\"\n end",
"def connect_login(global = true)\n pop2sock = connect(global)\n\n\n if !(user and pass)\n print_status(\"No username and password were supplied, unable to login\")\n return false\n ... | [
"0.6996724",
"0.67169625",
"0.65638053",
"0.6442517",
"0.6441348",
"0.6404147",
"0.6395865",
"0.6365239",
"0.6346802",
"0.63456154",
"0.62986994",
"0.62867045",
"0.6206187",
"0.61973906",
"0.6150894",
"0.6144634",
"0.6137736",
"0.6134021",
"0.61173123",
"0.61173123",
"0.61173... | 0.8084278 | 0 |
fetch preferences in their raw form | def _prefs_raw
start = Time.now
resp = run_and_capture(flag_get_pref)
@prefs_response_time = Time.now - start
return nil unless resp[:success]
resp[:out]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pref\n raw_config = File.open(\"#{Rails.root}/config/prefs.yml\")\n config = YAML.load(raw_config)\n #$prefs=config.symbolize_keys[:pref]\n config\n end",
"def load_all\n parse_json(get(PREFERENCE_URL))['prefs'].each do |p|\n @@greader_preferences[p['id']] = p['value... | [
"0.67864597",
"0.6752539",
"0.6730963",
"0.65789765",
"0.6485018",
"0.6360505",
"0.62521166",
"0.6089039",
"0.6078305",
"0.58325964",
"0.58315355",
"0.5821454",
"0.57908934",
"0.57774615",
"0.57342976",
"0.5717357",
"0.56625384",
"0.565627",
"0.5643073",
"0.5613923",
"0.55362... | 0.6137104 | 7 |
implementation for Arduino library dir location | def _lib_dir
File.join(get_pref("sketchbook.path"), "libraries")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def lib_path; end",
"def lib_path; end",
"def lib_path; end",
"def lib\n File.join root, 'lib'\n end",
"def lib\n File.join(@root, 'lib')\n end",
"def libraryPath(sourcePath)\n\t'../evothings-libraries/' + sourcePath\nend",
"def lib_dir\n File.join(root, 'lib')\n end",
"def lib_dir\n ... | [
"0.7344106",
"0.7344106",
"0.7344106",
"0.7091353",
"0.6992758",
"0.6908622",
"0.6906055",
"0.69060165",
"0.6881658",
"0.68434584",
"0.68434584",
"0.6664192",
"0.6642913",
"0.6642913",
"0.6642913",
"0.6620615",
"0.6616568",
"0.6558086",
"0.6502291",
"0.6461647",
"0.6460452",
... | 0.75889015 | 0 |
run the arduino command | def _run_and_output(*args, **kwargs)
@display_mgr.run_and_output(*args, **kwargs)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def execute_command( text , log, onscreen)\n\n begin\n\n # write the command to the arduino\n puts \"WR: #{text}\" if onscreen\n @bot_dbaccess.write_to_log(1, \"WR: #{text}\") if log\n @serial_port.read_timeout = 2\n @serial_port.write( \"#{text} \\n\" ) \n\n done = 0\n ... | [
"0.66382104",
"0.6366704",
"0.6266914",
"0.61878914",
"0.59809023",
"0.59671724",
"0.59671724",
"0.5923113",
"0.5907419",
"0.59062976",
"0.5899159",
"0.5875391",
"0.5875391",
"0.5871992",
"0.5814804",
"0.5810153",
"0.5790045",
"0.5760773",
"0.57582587",
"0.57539093",
"0.57423... | 0.0 | -1 |
run the arduino command | def _run_and_capture(*args, **kwargs)
@display_mgr.run_and_capture(*args, **kwargs)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def execute_command( text , log, onscreen)\n\n begin\n\n # write the command to the arduino\n puts \"WR: #{text}\" if onscreen\n @bot_dbaccess.write_to_log(1, \"WR: #{text}\") if log\n @serial_port.read_timeout = 2\n @serial_port.write( \"#{text} \\n\" ) \n\n done = 0\n ... | [
"0.66382104",
"0.6366704",
"0.6266914",
"0.61878914",
"0.59809023",
"0.59671724",
"0.59671724",
"0.5923113",
"0.5907419",
"0.59062976",
"0.5899159",
"0.5875391",
"0.5875391",
"0.5871992",
"0.5814804",
"0.5810153",
"0.5790045",
"0.5760773",
"0.57582587",
"0.57539093",
"0.57423... | 0.0 | -1 |
check whether a board is installed we do this by just selecting a board. the arduino binary will error if unrecognized and do a successful noop if it's installed | def board_installed?(boardname)
run_with_gui_guess(" about board not installed", flag_use_board, boardname)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def board_installed?(boardname)\n run_and_capture(flag_use_board, boardname)[:success]\n end",
"def use_board!(boardname)\n return true if use_board(boardname)\n\n boardfamily = boardname.split(\":\")[0..1].join(\":\")\n puts \"Board '#{boardname}' not found; attempting to install '#{board... | [
"0.79482394",
"0.730583",
"0.68480855",
"0.66729695",
"0.58173835",
"0.5691776",
"0.56730324",
"0.5611347",
"0.5604151",
"0.55884826",
"0.5587194",
"0.5553863",
"0.5549466",
"0.55206877",
"0.5506717",
"0.5504967",
"0.548683",
"0.5482956",
"0.5476315",
"0.5476123",
"0.54685473... | 0.80769455 | 0 |
use a particular board for compilation | def use_board(boardname)
run_with_gui_guess(" about board not installed", flag_use_board, boardname, flag_save_prefs)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def use_board!(boardname)\n return true if use_board(boardname)\n\n boardfamily = boardname.split(\":\")[0..1].join(\":\")\n puts \"Board '#{boardname}' not found; attempting to install '#{boardfamily}'\"\n return false unless install_boards(boardfamily) # guess board family from first 2 :-sepa... | [
"0.66833556",
"0.65568066",
"0.6381452",
"0.6266211",
"0.6230501",
"0.62252414",
"0.616023",
"0.616023",
"0.6138262",
"0.61318845",
"0.6116584",
"0.60897034",
"0.6076729",
"0.606804",
"0.605266",
"0.60276943",
"0.6005701",
"0.59087944",
"0.59000456",
"0.5888588",
"0.587915",
... | 0.68089944 | 0 |
Override the directory where uploaded files will be stored. This is a sensible default for uploaders that are meant to be mounted: | def store_dir
'uploads/images'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def store_dir\n 'file_uploads'\n end",
"def store_dir\n 'uploads'\n end",
"def store_dir\n \"uploads\"\n end",
"def store_dir\n if Rails.env == \"production\"\n ENV['CONFIG_FILE_UPLOAD_PATH']\n else\n \"uploads\"\n end\n end",
"def store_dir\n '%suploads/peopl... | [
"0.7866478",
"0.762767",
"0.76221263",
"0.7618018",
"0.75756973",
"0.7488916",
"0.74855983",
"0.74539375",
"0.74539375",
"0.74539375",
"0.7399524",
"0.7399524",
"0.7399524",
"0.7399524",
"0.7399524",
"0.73839206",
"0.736413",
"0.7357356",
"0.73573387",
"0.7348109",
"0.7340677... | 0.0 | -1 |
Use callbacks to share common setup or constraints between actions. | def set_type
@type = Type.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6165422",
"0.60457647",
"0.5946384",
"0.5916027",
"0.58905005",
"0.583495",
"0.5777223",
"0.56995213",
"0.56995213",
"0.56532377",
"0.5621348",
"0.5422839",
"0.54118705",
"0.54118705",
"0.54118705",
"0.53935355",
"0.5379617",
"0.53577393",
"0.53407264",
"0.53398263",
"0.53... | 0.0 | -1 |
Only allow a list of trusted parameters through. | def type_params
params.from_jsonapi.require(:type).permit(:name)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def allowed_params\n ALLOWED_PARAMS\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end",
"def param_whitelist\n [:role, :title]\... | [
"0.6950644",
"0.68134046",
"0.68034387",
"0.6796522",
"0.674668",
"0.6742105",
"0.6527854",
"0.65214247",
"0.6491907",
"0.64294493",
"0.64294493",
"0.64294493",
"0.64004904",
"0.6356768",
"0.63556653",
"0.6348119",
"0.6344521",
"0.63386923",
"0.632588",
"0.632588",
"0.632588"... | 0.0 | -1 |
For the lifetime of this instance, don't enforce rate limits. | def disable_rate_limits!
@rate_limits_disabled = true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ensure_rate_limits\n sleep 1 / REQUST_LIMIT_PER_MINUTE.to_f\n end",
"def rate_limit\n connection.rate_limit\n end",
"def rate_limit\n options[:rate_limit]\n end",
"def check_for_rate_limits\n rate_limit_remaining < 10\n end",
"def on_rate_limit(*)\n disconnect(:rate... | [
"0.7363239",
"0.7279231",
"0.69866717",
"0.6871604",
"0.6718486",
"0.66748476",
"0.6637804",
"0.6522834",
"0.6481041",
"0.648101",
"0.64804995",
"0.64560384",
"0.64272803",
"0.6410149",
"0.63971794",
"0.63944596",
"0.63599145",
"0.63403004",
"0.63403004",
"0.6325855",
"0.6315... | 0.68733007 | 3 |
GET /skills_users GET /skills_users.json | def index
@skills_users = SkillsUser.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_skills\n @user = User.find(params[:id])\n @user_skill = UserSkill.where(\"user_id = @user.id\")\n end",
"def set_user\n @user = User.find(params[:id])\n @skills = Skill.all\n @my_skills = @user.skills.all.map { |k| k[:name] }\n end",
"def index\n if params[:id]\n @skills... | [
"0.74701715",
"0.7066125",
"0.70630467",
"0.7032696",
"0.69550294",
"0.6939532",
"0.6904199",
"0.6810229",
"0.68013275",
"0.67973834",
"0.6789159",
"0.66354716",
"0.6566597",
"0.6523917",
"0.65160567",
"0.6491265",
"0.63998365",
"0.63816386",
"0.63300866",
"0.62994075",
"0.62... | 0.7222169 | 1 |
GET /skills_users/1 GET /skills_users/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_skills\n @user = User.find(params[:id])\n @user_skill = UserSkill.where(\"user_id = @user.id\")\n end",
"def index\n if params[:id]\n @skills = Skill.where(id:params[:id])\n elsif params[:user_id]\n @skills = Skill.where(user_id:params[:user_id])\n elsif params[:name]\n ... | [
"0.7594815",
"0.723618",
"0.72245973",
"0.7184732",
"0.714385",
"0.71432453",
"0.70960134",
"0.6970901",
"0.6957184",
"0.68739974",
"0.68346995",
"0.68181765",
"0.67963755",
"0.672233",
"0.66661084",
"0.6601401",
"0.6591272",
"0.6591272",
"0.6578587",
"0.65163136",
"0.6503426... | 0.0 | -1 |
POST /skills_users POST /skills_users.json | def create
respond_to do |format|
begin
if params["skills_user"]["user_id"]
skill_id = params["skills_user"]["skill_id"]
user_ids = params["skills_user"]["user_id"].reject{ |c| c.empty? }
user_ids.each do |user_id|
SkillsUser.create(skill_id: skill_id, user_id... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @user = User.new(user_params)\n\n respond_to do |format|\n if @user.save\n session[:user_skill_ids] = params[:skill_ids] unless session[:user_is_admin?]\n LocationsSkillsUsers.create(@user.id, @user.location_id, params[:skill_ids]) if params[:skill_ids]\n\n format.html ... | [
"0.7291792",
"0.7204678",
"0.7051565",
"0.6990777",
"0.691022",
"0.69097555",
"0.6830858",
"0.65570396",
"0.6421586",
"0.6374072",
"0.6318549",
"0.62968105",
"0.6253345",
"0.6209315",
"0.6183206",
"0.6115748",
"0.6097309",
"0.60922086",
"0.6090633",
"0.60549885",
"0.6048487",... | 0.80974776 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.