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 |
|---|---|---|---|---|---|---|
Returns the array of connections | def print_axons
return @axons
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_connections\n @connected_to.keys\n end",
"def connections\n @connections ||= []\n end",
"def connections\n return @connectors.keys\n end",
"def connections\n @mutex.synchronize do\n @connections.values.inject(0, &:+)\n end\n end",
"def connections\n... | [
"0.84199756",
"0.83361953",
"0.8253495",
"0.82119125",
"0.7830508",
"0.75360906",
"0.7534244",
"0.75239486",
"0.7496154",
"0.7428814",
"0.74046654",
"0.7377733",
"0.736391",
"0.736391",
"0.730409",
"0.7268998",
"0.72335035",
"0.7205237",
"0.7112734",
"0.70932084",
"0.70176387... | 0.0 | -1 |
Filling the weight array | def weight(connections)
weight_array=Array.new
for x in 0...connections.size
weight_array[x]=(rand() * (rand(3)-1))
end
@weights = weight_array
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rebuild_weight_array\n end",
"def init_weight\n # (J, 1)\n @b = Matrix.columns([Array.new(@size) { 0.0 }])\n\n # (J, I)\n @W = Array.new(@J) do\n Array.new(@I) { Sabina::Utils.box_muller }\n end.tap { |ary| break Matrix[*ary] }\n end",
"def weight(connections)\n\t\tweigh... | [
"0.7962386",
"0.7227585",
"0.6733168",
"0.66444814",
"0.6634451",
"0.6605456",
"0.65026075",
"0.6456368",
"0.63265693",
"0.6311121",
"0.6144314",
"0.61377937",
"0.61140144",
"0.60413444",
"0.60258794",
"0.60112876",
"0.60069036",
"0.59738547",
"0.5955651",
"0.59296227",
"0.59... | 0.6556735 | 6 |
Returns the values of the weights | def print_weight
return @weights
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def weights()\r\n @weights = @layers.map {|layer| layer.to_a}.flatten\r\n @num_weights = @weights.size\r\n return @weights\r\n end",
"def print_weight\n\t\treturn @weights\n\tend",
"def computed_values\n unless defined?(@computed_values) && @computed_values\n # Do nothing if... | [
"0.7723324",
"0.7507879",
"0.7200415",
"0.71802294",
"0.70859337",
"0.70395815",
"0.68619424",
"0.68462676",
"0.6824385",
"0.67995954",
"0.67970896",
"0.67870086",
"0.6636547",
"0.6616797",
"0.6582488",
"0.65306073",
"0.6470736",
"0.64522773",
"0.6417504",
"0.6402505",
"0.640... | 0.75028306 | 2 |
Setting the value of the neuron | def value(dendrites_array,num)
x=activation(dendrites_array,num)
@value=sigmoidal(x)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def value=(n)\n Gate.activate\n self.set(n)\n Gate.deactivate\n end",
"def set(n)\r\n self.value=n\r\n end",
"def value=(value); self.data.value = value; end",
"def w=(value); self[W] = Float(value); end",
"def value=(val); end",
"def feedforward(val)\n @output = val * weight ... | [
"0.7044373",
"0.6831833",
"0.65988195",
"0.63869697",
"0.63651115",
"0.6354962",
"0.6266707",
"0.6063819",
"0.6063819",
"0.60584897",
"0.60473937",
"0.6030555",
"0.5996067",
"0.5995567",
"0.59838426",
"0.5971663",
"0.5971302",
"0.59672827",
"0.59271127",
"0.5924724",
"0.58776... | 0.64737225 | 4 |
Returns the value of value | def print_value
return @value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_value\n value\n end",
"def get_value\n value\n end",
"def get_value\n @value\n end",
"def value\n @value\n end",
"def value\n @value\n end",
"def get(value)\n value\n end",
"def value\r\n @value\r\n end",
"def value\n return @... | [
"0.8921114",
"0.8921114",
"0.88181216",
"0.87535715",
"0.87535715",
"0.87196094",
"0.8655284",
"0.8643101",
"0.8643101",
"0.8643101",
"0.8582639",
"0.8581952",
"0.8560176",
"0.85336345",
"0.8520023",
"0.8520023",
"0.8520023",
"0.8520023",
"0.8520023",
"0.8520023",
"0.8520023"... | 0.7933802 | 60 |
Query Nexus3 API for list of repos, returns struct (parsed JSON) | def list_repositories
JSON.parse(request(:get, ''))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def repos\n api.repos.map(&:to_hash)\n end",
"def repositories\n response = self.class.get('/repositories').body\n JSON.parse(response)\n end",
"def get_app_repositories\n json_response = @client.list_installation_repos\n\n repository_list = []\n if json_response.count > 0\n json_response[\"re... | [
"0.7502272",
"0.7434903",
"0.7330957",
"0.73296297",
"0.72383",
"0.72094107",
"0.7143619",
"0.71376675",
"0.7124133",
"0.71132165",
"0.70196736",
"0.7009121",
"0.6992674",
"0.6979476",
"0.69176257",
"0.69145125",
"0.6907225",
"0.68972903",
"0.6862123",
"0.67973834",
"0.678841... | 0.7757501 | 0 |
the _list view can be included as a partial for parent items. | def available_views
%w(index new edit show _list _form)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list options = {} \n render_partial :list, template_locals(:list_item, options)\n end",
"def list(parent)\n list_in_path parent.model, parent.path\n end",
"def build_list(model, fields, items, resource = @resource.to_resource, link_options = {}, association = nil)\n te... | [
"0.694103",
"0.6888732",
"0.6511969",
"0.64882255",
"0.64511955",
"0.6425611",
"0.6421904",
"0.62679124",
"0.62366444",
"0.6214397",
"0.62106013",
"0.6156375",
"0.60782504",
"0.60782504",
"0.60782504",
"0.60782504",
"0.60782504",
"0.60782504",
"0.60782504",
"0.60782504",
"0.6... | 0.0 | -1 |
Gets the value of a feature flag or setting identified by the given `key`. :param key [String] the identifier of the feature flag or setting. :param default_value in case of any failure, this value will be returned. :param user [User] the user object to identify the caller. :return the value. | def get_value(key, default_value, user = nil)
settings, fetch_time = _get_settings()
if settings.nil?
message = "Config JSON is not present when evaluating setting '#{key}'. Returning the `default_value` parameter that you specified in your application: '#{default_value}'."
@log.error(1000, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_value_details(key, default_value, user = nil)\n settings, fetch_time = _get_settings()\n if settings.nil?\n message = \"Config JSON is not present when evaluating setting '#{key}'. Returning the `default_value` parameter that you specified in your application: '#{default_value}'.\"\n ... | [
"0.7046783",
"0.6465243",
"0.64109856",
"0.63932496",
"0.6219271",
"0.61431664",
"0.6131287",
"0.6111518",
"0.61069506",
"0.6077401",
"0.60297614",
"0.60100794",
"0.6005039",
"0.5985871",
"0.59745014",
"0.5954105",
"0.5947656",
"0.593162",
"0.5882612",
"0.58605117",
"0.586020... | 0.79400116 | 0 |
Gets the value and evaluation details of a feature flag or setting identified by the given `key`. :param key [String] the identifier of the feature flag or setting. :param default_value in case of any failure, this value will be returned. :param user [User] the user object to identify the caller. :return [EvaluationDet... | def get_value_details(key, default_value, user = nil)
settings, fetch_time = _get_settings()
if settings.nil?
message = "Config JSON is not present when evaluating setting '#{key}'. Returning the `default_value` parameter that you specified in your application: '#{default_value}'."
@log.erro... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_value(key, default_value, user = nil)\n settings, fetch_time = _get_settings()\n if settings.nil?\n message = \"Config JSON is not present when evaluating setting '#{key}'. Returning the `default_value` parameter that you specified in your application: '#{default_value}'.\"\n @log.e... | [
"0.7282808",
"0.52427334",
"0.51444644",
"0.5073486",
"0.49652964",
"0.48366758",
"0.48222488",
"0.4775133",
"0.47632915",
"0.473727",
"0.47361216",
"0.47224802",
"0.47218606",
"0.47162005",
"0.46967337",
"0.46904445",
"0.4681422",
"0.4681422",
"0.46697536",
"0.46697536",
"0.... | 0.7919912 | 0 |
Gets all setting keys. :return list of keys. | def get_all_keys
settings, _ = _get_settings()
if settings === nil
@log.error(1000, "Config JSON is not present. Returning empty list.")
return []
end
return settings.keys
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_keys()\n\t\t\treturn @config.keys\n\t\tend",
"def list_keys\n @keys.keys\n end",
"def all\n @keys\n end",
"def keys\n @config.keys\n end",
"def keys\n configuration.keys\n end",
"def get_names\r\n\t\tsettings = []\r\n\t\t@settings.each { |key, value|\r\n\t\t\tsetti... | [
"0.81173944",
"0.78345543",
"0.7692512",
"0.76197195",
"0.7618338",
"0.7525979",
"0.74996686",
"0.74118984",
"0.73614854",
"0.73590255",
"0.7306518",
"0.7240814",
"0.72191256",
"0.7209411",
"0.7206167",
"0.7094048",
"0.7081158",
"0.7069997",
"0.70634276",
"0.697977",
"0.69797... | 0.8266902 | 0 |
Gets the key of a setting, and it's value identified by the given Variation ID (analytics) :param variation_id [String] variation ID :return key and value | def get_key_and_value(variation_id)
settings, _ = _get_settings()
if settings === nil
@log.error(1000, "Config JSON is not present. Returning nil.")
return nil
end
for key, value in settings
if variation_id == value.fetch(VARIATION_ID, nil)
return KeyValue.new(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_key(id)\n @keys[id]\n end",
"def get_value(attribute_id)\n get_custom_value_hash\n return @custom_value_hash[attribute_id]\n end",
"def get(key)\n settings.find_by_key(key).try(:value)\n end",
"def get_value(secret_id)\n fail 'Not allowed env' unless config.is_allowed_env.... | [
"0.5664556",
"0.5640693",
"0.54966486",
"0.53809905",
"0.5340113",
"0.53368765",
"0.52629733",
"0.52510625",
"0.52250326",
"0.5221486",
"0.52193856",
"0.5182711",
"0.51394284",
"0.5138028",
"0.50934786",
"0.50909543",
"0.5058911",
"0.5041799",
"0.502945",
"0.50145036",
"0.501... | 0.80131763 | 0 |
Evaluates and returns the values of all feature flags and settings. :param user [User] the user object to identify the caller. :return dictionary of values | def get_all_values(user = nil)
settings, _ = _get_settings()
if settings === nil
@log.error(1000, "Config JSON is not present. Returning empty dictionary.")
return {}
end
all_values = {}
for key in settings.keys
value = get_value(key, nil, user)
if !value.e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_all_value_details(user = nil)\n settings, fetch_time = _get_settings()\n if settings.nil?\n @log.error(1000, \"Config JSON is not present. Returning empty list.\")\n return []\n end\n\n details_result = []\n for key in settings.keys\n details = _evaluate(key, u... | [
"0.60839343",
"0.57072407",
"0.5642115",
"0.56206363",
"0.5567443",
"0.5533149",
"0.5527195",
"0.5527195",
"0.5444756",
"0.54234004",
"0.5422794",
"0.53239256",
"0.5320237",
"0.52594763",
"0.52312803",
"0.51392657",
"0.5073653",
"0.50356215",
"0.50322986",
"0.50288284",
"0.49... | 0.5909934 | 1 |
Gets the values along with evaluation details of all feature flags and settings. :param user [User] the user object to identify the caller. :return list of all evaluation details | def get_all_value_details(user = nil)
settings, fetch_time = _get_settings()
if settings.nil?
@log.error(1000, "Config JSON is not present. Returning empty list.")
return []
end
details_result = []
for key in settings.keys
details = _evaluate(key, user, nil, nil, s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getEvaluations\n\t\tharness.evaluations\n\tend",
"def get_value_details(key, default_value, user = nil)\n settings, fetch_time = _get_settings()\n if settings.nil?\n message = \"Config JSON is not present when evaluating setting '#{key}'. Returning the `default_value` parameter that you spec... | [
"0.57614493",
"0.5660535",
"0.56371254",
"0.55519",
"0.5499858",
"0.54269636",
"0.52886474",
"0.52498174",
"0.5243943",
"0.52008444",
"0.5164947",
"0.51645654",
"0.5161445",
"0.5104576",
"0.5070791",
"0.5032864",
"0.4992631",
"0.49911875",
"0.49795246",
"0.49645886",
"0.49452... | 0.7131129 | 0 |
Initiates a force refresh on the cached configuration. :return [RefreshResult] | def force_refresh
return @_config_service.refresh if @_config_service
return RefreshResult(false,
"The SDK uses the LocalOnly flag override behavior which prevents making HTTP requests.")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def refresh_cache\n @cache = build_cache\n end",
"def reload\n clear_memoizations!\n perform_reload\n self\n end",
"def reload(force = false)\n if force || ! @reload_disabled\n _flush_cache\n end\n nil\n end",
"def refresh\n do_refresh\n end",
"def r... | [
"0.70481074",
"0.6626921",
"0.6626548",
"0.64792407",
"0.64792407",
"0.64105755",
"0.64105755",
"0.631216",
"0.63098866",
"0.6302452",
"0.62959397",
"0.6281873",
"0.6274866",
"0.6255527",
"0.6209672",
"0.6198283",
"0.61784256",
"0.61752576",
"0.61732584",
"0.61722034",
"0.616... | 0.7519283 | 0 |
Sets the default user. :param user [User] the user object to identify the caller. | def set_default_user(user)
@_default_user = user
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_default!\n @@default_user = self\n end",
"def set_user\n @user = current_user\n end",
"def set_user\n @user = current_user\n end",
"def set_user\n @user = current_user\n end",
"def set_user\n @user = current_user\n end",
"def set_user\n @user = current... | [
"0.7840584",
"0.7252007",
"0.7252007",
"0.7252007",
"0.7252007",
"0.7252007",
"0.7252007",
"0.7252007",
"0.7252007",
"0.7252007",
"0.7252007",
"0.7252007",
"0.7252007",
"0.7252007",
"0.7252007",
"0.7252007",
"0.7252007",
"0.7252007",
"0.7252007",
"0.7252007",
"0.7252007",
"... | 0.8944486 | 0 |
Sets the default user to nil. | def clear_default_user
@_default_user = nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_default!\n @@default_user = self\n end",
"def set_default_user(user)\n @_default_user = user\n end",
"def clear_current_user\n User.current_user = nil\n end",
"def clear_user\n warden.set_user(nil) if warden.user.present?\n end",
"def clear_user_without_logout\n sub... | [
"0.76407135",
"0.7438709",
"0.71555007",
"0.709768",
"0.6972834",
"0.6825718",
"0.6821262",
"0.6682511",
"0.6636883",
"0.65797335",
"0.65624726",
"0.650495",
"0.6470779",
"0.6450861",
"0.6450861",
"0.6450861",
"0.6447193",
"0.6446676",
"0.6402499",
"0.6402499",
"0.6402499",
... | 0.86048573 | 0 |
Configures the SDK to allow HTTP requests. | def set_online
if @_config_service
@_config_service.set_online
else
@log.warn(3202, "Client is configured to use the `LOCAL_ONLY` override behavior, thus `set_online()` has no effect.")
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def http_options; end",
"def configure\n yield self\n\n pool_size = 5\n host = @host.nil? ? 'minfraud.maxmind.com' : @host\n @connection_pool = ConnectionPool.new(size: pool_size) do\n make_http_client.persistent(\"https://#{host}\")\n end\n end",
"def api\... | [
"0.6521908",
"0.64304006",
"0.6385318",
"0.6184899",
"0.61212707",
"0.61132455",
"0.60528195",
"0.602811",
"0.602811",
"0.602811",
"0.602811",
"0.602811",
"0.602811",
"0.602811",
"0.59831494",
"0.59585994",
"0.5946174",
"0.5932136",
"0.5926398",
"0.5919483",
"0.5914711",
"0... | 0.0 | -1 |
Configures the SDK to not initiate HTTP requests and work only from its cache. | def set_offline
@_config_service.set_offline if @_config_service
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def disable_caching; end",
"def configure_cache; end",
"def disable_caching=(_arg0); end",
"def disable_cache; end",
"def set_no_caching\n self.vdo_caching = 1\n self.auto_caching = 1\n end",
"def set_defaults\r\n @options = {\r\n :caching => true\r\n ... | [
"0.74760205",
"0.7078137",
"0.70329946",
"0.69457996",
"0.6852097",
"0.6820525",
"0.6469502",
"0.64105505",
"0.61933124",
"0.61735666",
"0.61735666",
"0.61526865",
"0.6119028",
"0.6056222",
"0.6054114",
"0.6033432",
"0.60312426",
"0.6026728",
"0.6026728",
"0.6014664",
"0.5985... | 0.0 | -1 |
Returns true when the SDK is configured not to initiate HTTP requests, otherwise false. | def offline?
return @_config_service ? @_config_service.offline? : true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def api_request?\n false\n end",
"def make_request\n false\n end",
"def server_is_available?\n return true\n !@http_client.send_request(:get, \"#{@configuration.protocol}://#{@configuration.host}:#{@configuration.port}\", nil, {:timeout => 5}).nil?\n end",
"def local_request?\n fals... | [
"0.76027995",
"0.74488366",
"0.6862624",
"0.6834747",
"0.6834747",
"0.6834747",
"0.66991806",
"0.66841376",
"0.66830194",
"0.66587204",
"0.6623785",
"0.6608503",
"0.65440345",
"0.65386343",
"0.65386343",
"0.65256613",
"0.6484528",
"0.6458656",
"0.6454664",
"0.64343303",
"0.64... | 0.0 | -1 |
Closes the underlying resources. | def close
@@lock.synchronize do
_close_resources
@@instances.delete(@_sdk_key)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def close\n\t io.each { |file| file.close }\n\tend",
"def close\n @io.close\n @tar.close\n end",
"def close\n\n # nothing to do here.\n end",
"def close\n @io.close\n @tarreader.close\n end",
"def close!\n safe_close\n end",
"def close\n clo... | [
"0.72915775",
"0.7244819",
"0.7055762",
"0.6996104",
"0.6980384",
"0.69618624",
"0.6923154",
"0.689507",
"0.6873348",
"0.6873348",
"0.6873348",
"0.6873348",
"0.6873348",
"0.6873348",
"0.6873348",
"0.6873348",
"0.6873348",
"0.6866487",
"0.6836605",
"0.6836605",
"0.6836605",
... | 0.0 | -1 |
metodo retorna promedio de notas | def promedios
promedio = (@nota1.to_f + @nota2.to_f + @nota3.to_f) / 3
promedio
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def notations; end",
"def comisiones_asignadas\n asunto.comisiones if asunto\n end",
"def notificaciones\n end",
"def pontosanunciante\n\n\t\tUsuario.find(self.id_usuario).meuspontos\n\n\tend",
"def suivre; end",
"def enlaces_notas resumen\n mensaje = \"\"\n notas = resumen.notas.order \"updat... | [
"0.72180897",
"0.65498716",
"0.65089273",
"0.5855024",
"0.58543235",
"0.5813405",
"0.5780664",
"0.5721529",
"0.57022625",
"0.5664582",
"0.5579381",
"0.5577132",
"0.5574523",
"0.5571479",
"0.5567273",
"0.5557227",
"0.5550908",
"0.5542861",
"0.55348897",
"0.5516006",
"0.5493049... | 0.5632324 | 10 |
for the h method | def initialize(output)
@output = output
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sub_h\n end",
"def H(*args)\n end",
"def inc_h\n end",
"def cp_h\n end",
"def hd\n \n end",
"def add_a_h\n end",
"def hiss; end",
"def hamlet; end",
"def private; end",
"def hvals(key); end",
"def hvals(key); end",
"def sub_hl\n end",
"def header; end",
... | [
"0.7422639",
"0.73702604",
"0.7024651",
"0.68995863",
"0.67918754",
"0.6784133",
"0.6761726",
"0.6591199",
"0.6564148",
"0.6468458",
"0.6468458",
"0.6312357",
"0.63058585",
"0.63058585",
"0.63058585",
"0.6282117",
"0.6240452",
"0.61907476",
"0.61813563",
"0.6150867",
"0.60524... | 0.0 | -1 |
GET /applications GET /applications.json | def index
status = params[:status].downcase.to_sym if params[:status].present?
if [:all, :closed].include? status
@status = status
else
@status = Application::STATUS_IDS.key?(status) ? status : :open
end
respond_to do |format|
format.html do
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def applications_list\n get \"applications\"\n end",
"def get_applications\n http_get_request(Scalarium.applications_url)\n end",
"def index\n @applications = Application.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @applications }\n... | [
"0.86095876",
"0.79466546",
"0.7874737",
"0.7813404",
"0.7733895",
"0.769903",
"0.76737994",
"0.75551015",
"0.75261205",
"0.7498135",
"0.7498135",
"0.7469886",
"0.741001",
"0.7288906",
"0.7259488",
"0.72537243",
"0.72518766",
"0.72518766",
"0.72518766",
"0.72518766",
"0.71776... | 0.0 | -1 |
GET /applications/1 GET /applications/1.json | def show
if @application.verified_character
@character = Character.where(name: @application.character_name).first
end
if can? :read, Comment, @application
@commentable = @application
@comments = @commentable.comments.recent.page(params[:page]).per(15)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def applications_list\n get \"applications\"\n end",
"def show\n @applications_application = ApplicationsApplication.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @applications_application }\n end\n end",
"def index\n @app... | [
"0.81132996",
"0.7810077",
"0.7690873",
"0.7680093",
"0.7680093",
"0.7551706",
"0.7480087",
"0.7416221",
"0.7406069",
"0.73654455",
"0.730353",
"0.7294292",
"0.72875154",
"0.72744834",
"0.7261164",
"0.72428125",
"0.72428125",
"0.72428125",
"0.7239538",
"0.7212176",
"0.7209907... | 0.0 | -1 |
POST /applications POST /applications.json | def create
if not view_context.can_apply?
flash[:error] = 'You are not allowed to create new applications. If you have already applied to the guild, you can find a link to your application on your profile page.'
redirect_to root_path
return
end
respond_to do ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @application = Application.new(application_params)\n\n if @application.save\n render json: @application, status: :created, location: api_application_path(@application)\n else\n render json: @application.errors.full_messages.join(', '), status: :unprocessable_entity\n end\n end",... | [
"0.75115496",
"0.7120853",
"0.7010377",
"0.69720936",
"0.6955418",
"0.6880274",
"0.68689686",
"0.68499",
"0.68345064",
"0.68260735",
"0.68003273",
"0.67571235",
"0.67512643",
"0.6713185",
"0.6713185",
"0.666663",
"0.6665081",
"0.66627544",
"0.66618484",
"0.6633409",
"0.661857... | 0.598093 | 85 |
PATCH/PUT /applications/1 PATCH/PUT /applications/1.json | def update
if @application.user.confirmed_character?
c = @application.user.character
@application.character_name = c.name
@application.character_realm = c.realm
@application.character_guild_name = c.guild_name
@application.character_guild_realm = c.gui... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_app data={}\n put '/app', data\n end",
"def update\n if @application.update(application_params)\n render json: @application, status: :ok, location: api_application_path(@application)\n else\n render json: @application.errors.full_messages.join(', '), status: :unprocessable_... | [
"0.7152944",
"0.7136675",
"0.7115411",
"0.70114315",
"0.7003497",
"0.6962699",
"0.69392174",
"0.6899615",
"0.6899615",
"0.6898765",
"0.68742436",
"0.6868403",
"0.68482035",
"0.68115634",
"0.68115634",
"0.68107307",
"0.68107307",
"0.68107307",
"0.680725",
"0.6806085",
"0.68037... | 0.0 | -1 |
DELETE /applications/1 DELETE /applications/1.json | def destroy
@application.destroy
respond_to do |format|
format.html { redirect_to applications_url, notice: 'Application 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 delete_application(client, options)\n if !options[:application].nil?\n application = client.applications.get options[:appl... | [
"0.7910524",
"0.75619483",
"0.7552625",
"0.7552625",
"0.7552625",
"0.754801",
"0.754801",
"0.7524834",
"0.7524834",
"0.74202436",
"0.74202436",
"0.74049276",
"0.7368609",
"0.7368609",
"0.7368609",
"0.73630184",
"0.73555756",
"0.7338645",
"0.7307002",
"0.7307002",
"0.7307002",... | 0.6827767 | 75 |
PATCH /applications/1/open PATCH /applications/1/open.json | def open
authorize! :open, @application
@application.open
respond_to do |format|
if @application.save
format.html { redirect_to @application, notice: 'Application was successfully opened.' }
format.json { head :no_content }
else
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def patch_with_app(url, payload = '')\n github_api_conn.patch do |request|\n request.url url\n\n request.headers['Authorization'] = \"Token #{access_token}\"\n request.headers['Accept'] = accept_header\n request.body = payload\n end\n end",
"def update!(**args)\n ... | [
"0.61767256",
"0.61143476",
"0.6041094",
"0.60347015",
"0.59627104",
"0.59579664",
"0.58909297",
"0.5820855",
"0.5796795",
"0.5795272",
"0.57676977",
"0.57565176",
"0.57431686",
"0.57199043",
"0.57143617",
"0.57143617",
"0.5713419",
"0.5713419",
"0.5713419",
"0.57099366",
"0.... | 0.5805911 | 8 |
PATCH /applications/1/accept PATCH /applications/1/accept.json | def accept
authorize! :accept, @application
@application.accept
respond_to do |format|
if @application.save
format.html { redirect_to @application, notice: 'Application was successfully accepted.' }
format.json { head :no_content }
else
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n appointment_request = current_user.pending_requests.find(\n params[:request_id]\n )\n\n case params[:answer]\n when 'accept'\n if appointment_request.accept!\n redirect_to root_path\n else\n render status: 500\n end\n when 'reject'\n if appointment... | [
"0.601753",
"0.5932951",
"0.5873294",
"0.5843684",
"0.57807916",
"0.5741474",
"0.5737653",
"0.5706407",
"0.5662934",
"0.5644893",
"0.56226367",
"0.56168765",
"0.5612359",
"0.5592096",
"0.5590958",
"0.55558604",
"0.55558383",
"0.55458385",
"0.55152047",
"0.55036616",
"0.550238... | 0.57472056 | 5 |
PATCH /applications/1/decline PATCH /applications/1/decline.json | def decline
authorize! :decline, @application
@application.decline
respond_to do |format|
if @application.save
format.html { redirect_to @application, notice: 'Application was successfully declined.' }
format.json { head :no_content }
else
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update!(**args)\n @decline_reason = args[:decline_reason] if args.key?(:decline_reason)\n end",
"def decline\n order = current_user.restaurant.orders.find(params[:id])\n order.update(status: 2)\n render json: {is_success: true}, status: :ok\n end",
"def update\n\n if is_adm? &&... | [
"0.6742333",
"0.5999411",
"0.5900787",
"0.5870425",
"0.57429904",
"0.5627022",
"0.5605668",
"0.55955637",
"0.55613774",
"0.5531399",
"0.5521513",
"0.54637754",
"0.5428848",
"0.54241806",
"0.54079795",
"0.5403321",
"0.5388517",
"0.5359757",
"0.53548694",
"0.53547394",
"0.53534... | 0.7096309 | 0 |
Only allow a trusted parameter "white list" through. | def application_params
params.require(:application).permit(:content, :character_name, :character_realm, :character_guild_name, :character_guild_realm)
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.71207976",
"0.705222",
"0.69488335",
"0.69021654",
"0.67362636",
"0.6717561",
"0.6689192",
"0.6678948",
"0.66622657",
"0.6555007",
"0.6527569",
"0.64588845",
"0.64522904",
"0.6450812",
"0.6448551",
"0.6434285",
"0.6412147",
"0.6412147",
"0.6393719",
"0.6381976",
"0.6381976... | 0.0 | -1 |
This overrides the base class implementation. Instead of just failing save if the record is invalid, save the record bypassing validation. | def create_record!(record)
@created += 1
begin
ar_record = target_class.new(record_attributes(record))
ar_record.save!
return ar_record
rescue ActiveRecord::RecordInvalid => e
ar_record.save!(:validate => false)
@invalid_records += 1
raise e
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save_with_validation!()\n if valid?\n save_without_validation!()\n else\n raise RecordInvalid.new(self)\n end\n end",
"def save!(options={})\n perform_validations(options) ? super : raise(RecordInvalid.new(self))\n end",
"def save!(options = {})\n perform_valida... | [
"0.86060905",
"0.82381684",
"0.7787732",
"0.7376997",
"0.73441786",
"0.73418045",
"0.7294822",
"0.7290398",
"0.72672147",
"0.71872026",
"0.7186802",
"0.71481967",
"0.7080706",
"0.7047136",
"0.702279",
"0.69881356",
"0.6974771",
"0.69506574",
"0.6942918",
"0.69096905",
"0.6893... | 0.0 | -1 |
Adds base exceptions for each DP LPI record for which there is no corresponding LGA record. | def add_exceptions_for_missing_dp_lpi_records
missing_dp_lpi_records.each do |lpi_record|
add_exception_to_base(
NotInLgaError.new(
"'%s' is present in LPI database but not in this LGA" % [lpi_record]
)
)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_exceptions_for_missing_sp_lpi_records\n missing_sp_lpi_records.each do |lpi_record|\n add_exception_to_base(\n NotInLgaError.new(\n \"'%s' is present in LPI database but not in this LGA\" % [lpi_record]\n )\n )\n end\n end",
"def exceptions\n diva_algorithm = Di... | [
"0.80851424",
"0.5675848",
"0.55990386",
"0.55275583",
"0.5457935",
"0.5356299",
"0.53372014",
"0.5187624",
"0.51476014",
"0.51103836",
"0.5106149",
"0.5079132",
"0.5078075",
"0.5062838",
"0.5045317",
"0.5037593",
"0.5035784",
"0.50200105",
"0.501728",
"0.5012193",
"0.5007570... | 0.82988787 | 0 |
Adds base exceptions for each SP LPI record for which there is no corresponding LGA record. | def add_exceptions_for_missing_sp_lpi_records
missing_sp_lpi_records.each do |lpi_record|
add_exception_to_base(
NotInLgaError.new(
"'%s' is present in LPI database but not in this LGA" % [lpi_record]
)
)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_exceptions_for_missing_dp_lpi_records\n missing_dp_lpi_records.each do |lpi_record|\n add_exception_to_base(\n NotInLgaError.new(\n \"'%s' is present in LPI database but not in this LGA\" % [lpi_record]\n )\n )\n end\n end",
"def failure_exceptions\n @failure_... | [
"0.7833874",
"0.5562347",
"0.5533861",
"0.5515806",
"0.550916",
"0.54762566",
"0.5254793",
"0.5229209",
"0.5225668",
"0.5176929",
"0.5122118",
"0.5117783",
"0.51105756",
"0.5108509",
"0.5108509",
"0.50978476",
"0.5096248",
"0.50727624",
"0.5070771",
"0.5065631",
"0.5037363",
... | 0.8360677 | 0 |
Select which lookup to use based on the type of record | def lpi_by_lga_lookup_for_record(record)
if record.sp?
return send(:sp_lpi_by_lga_lookup)
elsif record.dp?
return send(:dp_lpi_by_lga_lookup)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def lookup(type, name)\n from_table(type, name)\n end",
"def find_by_type(types); end",
"def find_by_type(types); end",
"def find_by_generic(name, type = nil)\n if name.nil?\n return nil\n elsif not name.is_a? String\n name = name.to_s\n end\n\n name = name.downcase\n @ghash.... | [
"0.71984345",
"0.65497786",
"0.65497786",
"0.6290156",
"0.60856134",
"0.6059077",
"0.6047428",
"0.6037132",
"0.6036167",
"0.60347384",
"0.5996663",
"0.59880656",
"0.59224564",
"0.5919728",
"0.591306",
"0.5895944",
"0.58922344",
"0.5828381",
"0.5822125",
"0.58034766",
"0.58005... | 0.5779151 | 22 |
MAYBE CAUSE IT WAS POSTED and feed_items wasnt, this is why render is meh also fix home formatting | def destroy
@micropost.destroy
flash[:success] = "Micropost deleted"
redirect_to request.referrer || root_url
#same as redirect_back(fallback_location: root_url)
#request.referrer is the previous page
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def feed_items\n feed_item\n end",
"def feed\n @feed_items = @repository.recent_feed_items\n respond_to do |format|\n format.html # feed.html.erb\n format.json { render json: @feed_items }\n end\n end",
"def feed_items(feed_title) \n # update last_viewed_at \n @client.query \... | [
"0.71626484",
"0.6582605",
"0.63240415",
"0.63064426",
"0.6162634",
"0.6156963",
"0.61422896",
"0.6138658",
"0.613816",
"0.61306196",
"0.61062443",
"0.6066831",
"0.60605603",
"0.5997944",
"0.59585756",
"0.5941965",
"0.5941185",
"0.59198624",
"0.59198624",
"0.59198624",
"0.591... | 0.0 | -1 |
Returns the entry array for a language specified by its English name. | def find_by_english_name(name)
ISO_639_2.detect do |entry|
entry if entry.english_name == name
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read(locale, name)\r\n self[locale][name.to_s]\r\n end",
"def load_entry(locale, key)\n locale, key = locale.to_s, key.to_s\n data = self.find_all_by_locale_and_key(locale, key)\n result = {}\n data.each do |row|\n #only return the simple trans... | [
"0.62773037",
"0.607899",
"0.58459824",
"0.5831709",
"0.58133674",
"0.57012147",
"0.5683942",
"0.5679115",
"0.56611437",
"0.5579186",
"0.551512",
"0.55149615",
"0.55149615",
"0.55149615",
"0.55149615",
"0.55149615",
"0.55149615",
"0.55149615",
"0.55149615",
"0.54690564",
"0.5... | 0.6015222 | 3 |
Returns the entry array for a language specified by its French name. | def find_by_french_name(name)
ISO_639_2.detect do |entry|
entry if entry.french_name == name
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read(locale, name)\r\n self[locale][name.to_s]\r\n end",
"def load_entry(locale, key)\n locale, key = locale.to_s, key.to_s\n data = self.find_all_by_locale_and_key(locale, key)\n result = {}\n data.each do |row|\n #only return the simple trans... | [
"0.6139747",
"0.5902869",
"0.57911986",
"0.5521805",
"0.54947627",
"0.5489176",
"0.5429423",
"0.54091996",
"0.5404666",
"0.5404666",
"0.5361869",
"0.53398466",
"0.53398466",
"0.53128433",
"0.52709556",
"0.52476394",
"0.5242694",
"0.52401286",
"0.52242494",
"0.52143425",
"0.52... | 0.6105019 | 2 |
Returns an array of matches for the search term. The term can be a code of any kind, or it can be one of the words contained in the English or French name field. | def search(term)
term ||= ''
normalized_term = term.downcase.strip
indexes = INVERTED_INDEX[normalized_term]
indexes ? ISO_639_2.values_at(*indexes).uniq : []
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def search(term, lang=@default_lang)\n ret = []\n (1..114).each do |chapter|\n verses = get_chapter(chapter, lang)\n\n verses.each do |v|\n if v[lang].include? term\n ret << v\n end\n end\n end\n\n return ret\n end",
"def search(term)\n # pattern = Regexp.new... | [
"0.6782709",
"0.6776313",
"0.66781986",
"0.6531814",
"0.6522714",
"0.6448704",
"0.6373838",
"0.6338795",
"0.6323547",
"0.62653613",
"0.62595016",
"0.6256904",
"0.6129527",
"0.610696",
"0.60804296",
"0.6073197",
"0.60372573",
"0.60140413",
"0.60131633",
"0.600824",
"0.60050756... | 0.73585093 | 1 |
The entry's alpha3 bibliotigraphic code. | def alpha3_bibliographic
self[0]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def three_char_code(lang:)\n two_char_code = lang.to_s.split('-').first\n LANGUAGE_MAP[two_char_code.to_sym]\n end",
"def spanish_foreign_citizen_number; end",
"def export_as_mla_citation_txt\n (self[:citation_mla].presence || super).html_safe\n end",
"def generate_bib_entry(entr... | [
"0.5716967",
"0.57105887",
"0.5627657",
"0.557594",
"0.554335",
"0.54912364",
"0.5477718",
"0.5468056",
"0.5451846",
"0.5446857",
"0.54433674",
"0.54202247",
"0.54202247",
"0.54202247",
"0.54202247",
"0.5367892",
"0.53562725",
"0.5336459",
"0.53184915",
"0.53184915",
"0.53078... | 0.7367477 | 1 |
The entry's alpha3 terminologic (when given) | def alpha3_terminologic
self[1]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def alpha\n @attrs[:alpha]\n end",
"def alpha3_bibliographic\n self[0]\n end",
"def alpha3_bibliographic\n self[0]\n end",
"def alpha2\n alpha2 = domain_parts.tld.split('.').last\n if ALPHA2_MAP[alpha2.to_sym]\n ALPHA2_MAP[alpha2.to_sym]\n else\n alpha2\n end\n end",
... | [
"0.55337524",
"0.5505826",
"0.5505826",
"0.5255583",
"0.52074516",
"0.51963925",
"0.51705205",
"0.51540124",
"0.51166284",
"0.5101244",
"0.5100322",
"0.5092007",
"0.5077894",
"0.50704116",
"0.5067331",
"0.5064583",
"0.50602067",
"0.50193095",
"0.49941212",
"0.4993",
"0.499069... | 0.78334767 | 1 |
The entry's alpha2 code (when given) | def alpha2
self[2]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def code_to_key\n @code[0..2]\n end",
"def alpha2\n alpha2 = domain_parts.tld.split('.').last\n if ALPHA2_MAP[alpha2.to_sym]\n ALPHA2_MAP[alpha2.to_sym]\n else\n alpha2\n end\n end",
"def iso_code; end",
"def iso_code; end",
"def code\n '202'\n end",
"def country_code_alpha... | [
"0.62065256",
"0.6099368",
"0.59815824",
"0.59815824",
"0.5926851",
"0.5862605",
"0.5850716",
"0.5814725",
"0.5724367",
"0.5696116",
"0.56918275",
"0.56811047",
"0.56781435",
"0.566732",
"0.566528",
"0.5644336",
"0.5639588",
"0.5559755",
"0.55490977",
"0.55414164",
"0.5541416... | 0.63958085 | 1 |
The entry's english name. | def english_name
self[3]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name_display\n self.name[I18n.locale]\n end",
"def name(locale = :pl)\n @name[locale.to_s]\n end",
"def spanish_name\n self[5]\n end",
"def display_name\n\t\tself.name.titleize\n\tend",
"def i18n_name(locale = I18n.locale.to_s)\n ([self[Type.i18n_name_field(locale)], self... | [
"0.7852054",
"0.72741747",
"0.7228941",
"0.7198937",
"0.7152773",
"0.7091433",
"0.7018931",
"0.7016629",
"0.7016629",
"0.6993968",
"0.69147754",
"0.69147754",
"0.69013286",
"0.6898707",
"0.6862317",
"0.6862317",
"0.6832437",
"0.68246436",
"0.6805387",
"0.67996264",
"0.679708"... | 0.7565703 | 2 |
The entry's first part of english name. | def first_english_name
self[3].split(';').first
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def full_name(entry)\n \"#{entry.first_name} #{entry.last_name}\"\n end",
"def english_name\n self[3]\n end",
"def english_name\n self[3]\n end",
"def first_name\n if I18n.locale == :ka\n self.read_attribute(:first_name)\n else\n# require 'utf8_converter'\n# Utf8Converter.con... | [
"0.74635977",
"0.74301654",
"0.74301654",
"0.7337935",
"0.7242344",
"0.71608907",
"0.7099413",
"0.70874596",
"0.7071099",
"0.7013993",
"0.69878227",
"0.6972943",
"0.6964802",
"0.6964802",
"0.6939824",
"0.6929798",
"0.69202745",
"0.69079477",
"0.6893339",
"0.68852174",
"0.6880... | 0.7837334 | 0 |
The entry's french name. | def french_name
self[4]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name_display\n self.name[I18n.locale]\n end",
"def name\n case\n when current_language == :fr && french_name?\n read_attribute(:name_fr)\n\n when current_language == :fr && english_name?\n read_attribute(:name)\n\n when current_language != :fr && ... | [
"0.7233888",
"0.6870705",
"0.6809554",
"0.6678296",
"0.6678296",
"0.6667177",
"0.647045",
"0.6464419",
"0.6444128",
"0.6425853",
"0.64162415",
"0.6354202",
"0.6325395",
"0.6321524",
"0.63155806",
"0.63012207",
"0.62980175",
"0.62656003",
"0.6260469",
"0.62478346",
"0.62134874... | 0.7705488 | 1 |
This method should retrieve accounts which needs to be refreshed for specified collector | def get_accounts(collector, limit)
service = Service.where(name: collector).first
accounts = service.
user_proxies.
limit(limit).
order([:refresh_date, 'ASC'])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_all_accounts(authorizer)\n debug \"central find_all_accounts\"\n raise 'Method not implemented because the Central Manager just need to pass the same requisition to the other' \\\n ' brokers and create the concatenated results'\n end",
"def collect(collectors)\n logger.inf... | [
"0.62041324",
"0.6170802",
"0.54737586",
"0.54705715",
"0.5467309",
"0.532046",
"0.52621835",
"0.52146417",
"0.516655",
"0.5160364",
"0.51568085",
"0.5152991",
"0.51515365",
"0.5102092",
"0.51012206",
"0.5079855",
"0.5012411",
"0.49986842",
"0.49972177",
"0.49748927",
"0.4968... | 0.7228521 | 0 |
Fetches resources for specified collectors | def collect(collectors)
logger.info("[ " + Time.now.to_s + " ]" + " Collect task invoked")
collectors.each do |collector_name|
begin
collector = @collectors[collector_name]
accounts = get_accounts collector_name, collector.settings[:request_limit]
success_accounts = collector.colle... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def query_resources\n powershell_exec(\"get-dscresource\").result\n end",
"def index\n @collectors = ::Collector.includes(:collector_versions)\n end",
"def get_all_datasets_and_resources(base_url)\n return handle_request(URI.encode(base_url + '/current_package_list_with_ressources'))\n ... | [
"0.58355135",
"0.55957615",
"0.55784035",
"0.55000985",
"0.5478068",
"0.54734254",
"0.5459351",
"0.5446088",
"0.5366653",
"0.5358138",
"0.5355012",
"0.532647",
"0.5291824",
"0.5274581",
"0.52695733",
"0.5251019",
"0.52407885",
"0.5237211",
"0.5217205",
"0.5213068",
"0.520249"... | 0.670764 | 0 |
Lighthouse will split PDF's larger than 50mb before sending to VBA who has a limit of 50mb. so, PDF's can be larger than other files | def validate_file_size(file)
if file.content_type != 'application/pdf' && file.size > max_file_size_non_pdf
raise CarrierWave::IntegrityError, I18n.t(:'errors.messages.max_size_error',
max_size: '50MB')
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def split_pdf(filename, density=300, format=:jpg)\n\n #If this isn't a PDF, return the unmodified filename.\n return filename unless File.extname(filename) == '.pdf'\n\n #Get the length of the PDF...\n length = Docsplit.extract_length(filename)\n\n #If we don't have a multi-page document, abort.\n return fil... | [
"0.6480314",
"0.639862",
"0.63979167",
"0.63979167",
"0.6183275",
"0.6066621",
"0.60112274",
"0.59685886",
"0.59604645",
"0.5950587",
"0.59501976",
"0.5927286",
"0.59081376",
"0.5840355",
"0.5835848",
"0.58235574",
"0.58220667",
"0.58186954",
"0.58050895",
"0.57827014",
"0.57... | 0.5548475 | 32 |
/ operator L'instance annulateur | def cancellor
@cancellor ||= Cancellor.new(self)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def instance_method(p0) end",
"def instance_eval\n end",
"def express(instance)\n instance.define_singleton_method(@name) {|input|\n input\n }\n end",
"def operator; end",
"def express(instance)\n instance.define_singleton_method(@name) { 1.00 }\n end",
"def cla... | [
"0.62438667",
"0.6075527",
"0.59767234",
"0.59590477",
"0.5855188",
"0.5748425",
"0.57456607",
"0.57456607",
"0.57456607",
"0.5740778",
"0.5724634",
"0.5724634",
"0.57204986",
"0.56997377",
"0.5656735",
"0.56367373",
"0.56177485",
"0.5559638",
"0.55348176",
"0.55004287",
"0.5... | 0.0 | -1 |
/ distance_minimale_commune Question methods | def projet_scrivener?
extension == '.scriv'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def distance_measurement; end",
"def calculate_distance(translated_text, answer)\n DamerauLevenshtein.distance(prepare(translated_text), prepare(answer))\n end",
"def similar_questions\n\n end",
"def queensAttack(n, _k, r_q, c_q, obstacles)\n distances = compare_distances(n, r_q, c_q, obstacles)\n p d... | [
"0.6242709",
"0.59534836",
"0.56991976",
"0.5697374",
"0.5649285",
"0.5645817",
"0.5611398",
"0.55875844",
"0.54643756",
"0.5462678",
"0.54579544",
"0.5435183",
"0.542873",
"0.5413945",
"0.53925884",
"0.5376478",
"0.5373809",
"0.53406835",
"0.53260446",
"0.5323364",
"0.530012... | 0.0 | -1 |
Create a new media URL record in the database | def create_media_url(assignment_id, url, user_id, submitted_at)
# Generate a thumbnail for the URL
thumbnail_url = nil
site_and_slug = nil
if url
site_and_slug = url.extract_site_and_slug
thumbnail_url = Video::Metadata.thumbnail_url(site_and_slug[:site_tag], site_and_slug[:site_id])
end... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def newMediaObject(_, _, _, data)\n path = Media.save(@db.src_path, data['name'], data['bits'])\n\n run_user_cmd\n {\n 'url' => path\n }\n end",
"def add_media(db, mediatype, title, rentLease, mediaconsumed)\r\n\tdb.execute('INSERT INTO media (mediatype, title, rentLease, mediaconsumed) VALUES... | [
"0.7468943",
"0.6892798",
"0.6869916",
"0.6576265",
"0.64666826",
"0.641388",
"0.6370899",
"0.6299663",
"0.62820256",
"0.6266504",
"0.62519675",
"0.6203695",
"0.6176792",
"0.616319",
"0.6136255",
"0.61315846",
"0.6130284",
"0.6107623",
"0.60849416",
"0.6078489",
"0.6056169",
... | 0.70866036 | 1 |
Create an LTL BOL and schedule a pickup with R+L Carriers | def create_bill_of_lading(shipment, options:, debug: false)
request = FriendlyShipping::Request.new(
url: API_BASE + API_PATHS[:bill_of_lading],
http_method: "POST",
body: SerializeCreateBOLRequest.call(shipment: shipment, options: options).to_json,
headers: request_heade... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_new_plant_loop\n loop = OpenStudio::Model::PlantLoop.new(@model)\n loop.sizingPlant.setLoopType(\"Cooling\")\n loop.setName(\"Chiller for Serving Chilled Beams - Plant Loop\")\n \n pump = OpenStudio::Model::PumpConstantSpeed.new(@model)\n feetH2OtoPa = 12.0/0.00401463\n pump.setName... | [
"0.568086",
"0.562349",
"0.5577012",
"0.5452359",
"0.54473287",
"0.5393717",
"0.53690183",
"0.5236209",
"0.5192887",
"0.51883495",
"0.51754886",
"0.5127956",
"0.5124783",
"0.5120844",
"0.51161045",
"0.51074713",
"0.5098547",
"0.5084144",
"0.50772",
"0.5075547",
"0.50505006",
... | 0.48231015 | 58 |
Retrieve an existing binary BOL document for printing | def print_bill_of_lading(shipment_info, debug: false)
request = FriendlyShipping::Request.new(
url: API_BASE + API_PATHS[:print_bol] + "?ProNumber=#{shipment_info.pro_number}",
http_method: "GET",
headers: request_headers,
debug: debug
)
client.get(request... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def print_document(repo, path, modified_date = nil)\n g = Grit::Repo.new(path)\n\n # !!! do this for each head, ignoring common blobs, starting with master\n Grit::Git.git_timeout = 40\n g.git.method_missing('ls_tree', {'full-name' => true, 'r' => true}, 'master').split(\"\\n\").each do |line|\... | [
"0.63319415",
"0.6113358",
"0.5968836",
"0.59296316",
"0.59296316",
"0.59296316",
"0.59296316",
"0.59296316",
"0.59296316",
"0.59296316",
"0.59296316",
"0.59296316",
"0.59296316",
"0.59296316",
"0.59296316",
"0.59296316",
"0.59296316",
"0.59296316",
"0.59296316",
"0.59296316",
... | 0.0 | -1 |
Retrieve binary shipping labels for printing | def print_shipping_labels(shipment_info, style: 1, start_position: 1, num_labels: 4, debug: false)
request = FriendlyShipping::Request.new(
url: API_BASE + API_PATHS[:print_shipping_labels] + "?" \
"ProNumber=#{shipment_info.pro_number}&" \
"Style=#{style}&" \
"Star... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def print_labels\n list = @data.display_list\n # select addresses that need labels\n label_data = list.select {|address_entry| address_entry.make_label }\n\n values = { \n 'labels' => label_data.map {|address| address.add_to_hash({}) }\n }\n report_path = print_report(values, Reports::SHIPPI... | [
"0.7683573",
"0.6447096",
"0.6408181",
"0.6261096",
"0.61558294",
"0.6012797",
"0.5966331",
"0.59175044",
"0.588681",
"0.58776295",
"0.5862614",
"0.5838724",
"0.5801912",
"0.57747394",
"0.5774542",
"0.5762586",
"0.57462186",
"0.56550246",
"0.5587215",
"0.55807745",
"0.5576125... | 0.6824558 | 1 |
Request an LTL rate quote from R+L Carriers | def rate_quote(shipment, options:, debug: false)
request = FriendlyShipping::Request.new(
url: API_BASE + API_PATHS[:rate_quote],
http_method: "POST",
body: SerializeRateQuoteRequest.call(shipment: shipment, options: options).to_json,
headers: request_headers,
d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ltc()\n @response = HTTParty.get(\"https://www.btc-e.com/api/2/ltc_usd/ticker\")\n @JSON = JSON.parse(@response)\n @LTC_price = @JSON['ticker']['sell']\n if(@LTC_price.size() > 12)\n else\n CryptoPrices.create! :LTC => @LTC_price\n end\n end",
"def fetch_quote\n uri... | [
"0.6108141",
"0.5631293",
"0.55988085",
"0.5591397",
"0.5538508",
"0.5538508",
"0.5537079",
"0.5527909",
"0.5515455",
"0.54772455",
"0.5471903",
"0.54560274",
"0.5447354",
"0.5414872",
"0.53860146",
"0.5383412",
"0.5347288",
"0.5341198",
"0.5324761",
"0.5322235",
"0.5316196",... | 0.0 | -1 |
Request an LTL transit timing from R+L Carriers | def transit_times(shipment, options:, debug: false)
request = FriendlyShipping::Request.new(
url: API_BASE + API_PATHS[:transit_times],
http_method: "POST",
body: SerializeTransitTimesRequest.call(shipment: shipment, options: options).to_json,
headers: request_headers,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def state_at(t)\n\n if @time_span.include?(t)\n \n leg_percent = (t - @launch_time) / @flight_time\n dist = leg_percent * @distance\n dist_rad = leg_percent * @distance_rad\n\n alt_track = @alt1 + @v_init * (t - @launch_time) * Math.sin(@theta_init) - 0.5 * @g * (t - @launch... | [
"0.5613462",
"0.5573509",
"0.5525631",
"0.55065256",
"0.5428279",
"0.5415506",
"0.53710055",
"0.53404826",
"0.5323885",
"0.5317447",
"0.53130245",
"0.5299476",
"0.52751774",
"0.5270069",
"0.5263557",
"0.5232335",
"0.52293813",
"0.5225122",
"0.5171106",
"0.5163435",
"0.5154946... | 0.0 | -1 |
will return array of filepath of extracted files | def download_and_extract(filename, extractables)
downloader = self.download(filename.to_s)
downloaded_file = downloader.download_to
self.extract(downloaded_file, extractables)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def files\n result = []\n @my_files.each do |f|\n result << f.fname if FileTest.file?(f.fname)\n end\n result\n end",
"def files\n ext_files = mapper.extracted_files || []\n ext_files + [mapper.zip.name.to_s]\n end",
"def files\n entries.map(&:filepath)\n end",
"d... | [
"0.7609386",
"0.75945026",
"0.75217557",
"0.74381024",
"0.7401696",
"0.7319583",
"0.73183876",
"0.7304063",
"0.726917",
"0.7244092",
"0.7244092",
"0.7244092",
"0.7219359",
"0.7209426",
"0.72032493",
"0.71615136",
"0.7150772",
"0.7118836",
"0.7021925",
"0.7003884",
"0.6981145"... | 0.0 | -1 |
=== Delete Order Item Group. Delete an order item group. FIXME: This method doesn't work. Throw no action error. | def delete_order_item_group(id)
@client.raw('delete', "/ecommerce/order-items-groups/#{id}", nil, nil, @contact_v1_url)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_order_item_group(id)\n @client.raw('delete', \"/ecommerce/order-items-groups/#{id}\")\n end",
"def delete_group(group)\n\t\t\tend",
"def delete_group(group)\n\t\t\tend",
"def destroy\n @item_group = ItemGroup.find(params[:id])\n redirect_to root_path unless @item_group.user == request.us... | [
"0.8671275",
"0.70345503",
"0.70345503",
"0.68598306",
"0.6742221",
"0.6689881",
"0.66802007",
"0.65564173",
"0.652081",
"0.6490694",
"0.64900815",
"0.64501035",
"0.64482385",
"0.6435102",
"0.6427905",
"0.6392533",
"0.63757193",
"0.6370374",
"0.6369157",
"0.6359808",
"0.63572... | 0.87531275 | 0 |
Determines if a value is truthy. | def true?(val)
TRUE_VALUES.include? val
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def truthy?(value)\n value && value.to_s =~ /^(true|t|yes|y|1)$/i\n end",
"def truthy?(value)\n !(['0', 'false', ''].include?(value.to_s.strip))\n end",
"def is_true_value?(value)\n /true|yes|on|y|n|s|si|cierto/ === value \n end",
"def true_or_false?(value)\n case val... | [
"0.8448941",
"0.8043508",
"0.75658935",
"0.7484384",
"0.735335",
"0.7327643",
"0.720871",
"0.7112098",
"0.6972439",
"0.6956942",
"0.6884525",
"0.67644864",
"0.67155075",
"0.67155075",
"0.668406",
"0.6669424",
"0.6615555",
"0.66145945",
"0.6599308",
"0.6571452",
"0.65680563",
... | 0.7239106 | 6 |
Determines if a value is falsy. | def false?(val)
FALSE_VALUES.include? val
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def falsey?(value)\n value && value.to_s =~ /^(false|f|no|n|0)$/i\n end",
"def false?\n value.nil? || value == false\n end",
"def false_value?(val)\n EnvHelpers::Utils.false_value?(val)\n end",
"def true_or_false?(value)\n case value\n when NilClass then false\n when Tr... | [
"0.7768162",
"0.76568943",
"0.7146268",
"0.6995222",
"0.6983876",
"0.68614995",
"0.684932",
"0.6776485",
"0.6776485",
"0.66299844",
"0.6559258",
"0.6504373",
"0.64770555",
"0.64215165",
"0.64127374",
"0.63820153",
"0.6319222",
"0.6298046",
"0.6298046",
"0.62857276",
"0.628572... | 0.6955974 | 5 |
Given a path and separator, splits the path string using the separator and pops off the last element of the split array. | def split_and_pop(path:, separator: '/')
path.split(separator)[0..-2]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def split_path(path)\n path.split(\"/\", -1)\n end",
"def split(path)\n array = path.kind_of?(String) ? path.split(\"/\") : path.dup\n array.shift if nil_or_empty_string?(array[0])\n array.pop if nil_or_empty_string?(array[-1])\n array\n end",
"def chop_basename(path)... | [
"0.69869673",
"0.69601643",
"0.6922585",
"0.69045407",
"0.6903728",
"0.6648415",
"0.65537065",
"0.6546553",
"0.6511419",
"0.64079434",
"0.62964165",
"0.6282889",
"0.61719215",
"0.61665434",
"0.6057949",
"0.6027386",
"0.5997255",
"0.5980537",
"0.5939",
"0.5929303",
"0.58955055... | 0.8686415 | 0 |
Determines if object exists and if existing object is of a given type. | def obj_exists_and_is_not_type?(obj:, type:)
obj.nil? ? false : obj != type
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def exists?(object); end",
"def exists?(object); end",
"def saved_object_exists?(type, id)\n begin\n get_saved_object_by_id(type, id).present?\n rescue ApiExceptions::NotFoundError\n false\n end\n end",
"def check_if_exists(obj, field, attributes = [], ... | [
"0.7497198",
"0.7497198",
"0.7495398",
"0.7022196",
"0.6954409",
"0.68501294",
"0.6793336",
"0.6717645",
"0.666818",
"0.6662232",
"0.66383517",
"0.66366035",
"0.6554868",
"0.6542371",
"0.6526366",
"0.6499084",
"0.649723",
"0.649723",
"0.64872354",
"0.64499235",
"0.6446037",
... | 0.77521646 | 0 |
Given an array of hashes, returns an array of hash values. | def map_array_of_hashes(arr_hashes)
return if arr_hashes.nil?
[].tap do |output_array|
arr_hashes.each do |hash|
output_array.push hash.values
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def array_of_hashes_2_hash(arr)\n Hash[*arr.collect{|h| h.to_a}.flatten]\nend",
"def value_array(hash)\n array = []\n hash.each do |h|\n h.each do |key,value|\n if key == \"value\"\n array << value\n end\n end\n end\n return array\n end",
"def hashes_convert(array... | [
"0.68713576",
"0.66765463",
"0.6670099",
"0.6670099",
"0.6566359",
"0.65561575",
"0.6341956",
"0.63414294",
"0.6338098",
"0.6312698",
"0.6269425",
"0.61167556",
"0.60971504",
"0.6085058",
"0.60727483",
"0.6059233",
"0.6031562",
"0.6013219",
"0.5995338",
"0.59347314",
"0.58733... | 0.7622501 | 0 |
Extracts a lock token from an If headers. | def extract_lock_token(if_header)
token = if_header.scan(Calligraphy::LOCK_TOKEN_REGEX)
token.flatten.first if token.is_a? Array
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extract_header_token(env)\n BEARER_TOKEN_REGEX.match(env['HTTP_AUTHORIZATION'])&.[](1)\n end",
"def header_token\n request.headers['Authorization'].split(' ').last\n end",
"def http_auth_header\n if header['Authorization'].present?\n return header['Authorizatio... | [
"0.6123751",
"0.59460545",
"0.57926184",
"0.5758431",
"0.57505673",
"0.5668387",
"0.56507933",
"0.56329215",
"0.5596054",
"0.55316013",
"0.55258566",
"0.5483981",
"0.5470972",
"0.5462912",
"0.54605407",
"0.54604125",
"0.5398322",
"0.538482",
"0.5352223",
"0.5337845",
"0.53280... | 0.84449124 | 0 |
Hash used in describing a supportedlock. | def lockentry_hash(scope, type)
{ lockentry: { lockscope: scope, locktype: type } }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def lock_id\n Integer('0x' + Digest::MD5.hexdigest(name)) % (1 << 63)\n end",
"def hash\n name.hash ^ version.hash\n end",
"def hash # :nodoc:\n identifier.hash ^ requirement.hash\n end",
"def block_hash\n\t\tdigest = Digest::SHA2.new\n\n\t\tdigest << '%d' % [ self.index ]\n\t\tdigest << ... | [
"0.6943979",
"0.6880506",
"0.6866431",
"0.6799943",
"0.64198",
"0.639927",
"0.63737524",
"0.6344253",
"0.6335113",
"0.63337404",
"0.630757",
"0.630757",
"0.630757",
"0.62940925",
"0.628873",
"0.62872815",
"0.62847894",
"0.62673455",
"0.6214783",
"0.62105054",
"0.6187406",
"... | 0.60869247 | 28 |
GET /tutorials GET /tutorials.json | def index
@tutorials = current_user.tutorials
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @tutorials = Tutorial.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tutorials }\n end\n end",
"def index\n @tutorials = Tutorial.all\n\n respond_to do |format|\n format.html\n format.json do\n render json: @tutor... | [
"0.76766384",
"0.7651599",
"0.73566383",
"0.72547084",
"0.67954177",
"0.67954177",
"0.67930365",
"0.67930365",
"0.67266923",
"0.6671137",
"0.6664682",
"0.6612035",
"0.65844387",
"0.6584147",
"0.65572023",
"0.6529032",
"0.65067923",
"0.64678335",
"0.6459095",
"0.64441407",
"0.... | 0.6605375 | 12 |
GET /tutorials/1 GET /tutorials/1.json | def show
@steps = @tutorial.steps
@step = @tutorial.steps.build
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @tutorials = Tutorial.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tutorials }\n end\n end",
"def index\n @tutorials = Tutorial.all\n\n respond_to do |format|\n format.html\n format.json do\n render json: @tutor... | [
"0.7620547",
"0.7583031",
"0.75094706",
"0.7332875",
"0.69653296",
"0.69653296",
"0.67897344",
"0.67011213",
"0.66973394",
"0.66871244",
"0.6679583",
"0.6662252",
"0.66501784",
"0.6629295",
"0.66212803",
"0.66196203",
"0.66196203",
"0.6610705",
"0.65730286",
"0.65170896",
"0.... | 0.0 | -1 |
POST /tutorials POST /tutorials.json | def create
@tutorial = current_user.tutorials.create(tutorial_params)
respond_to do |format|
if @tutorial.save
format.html { redirect_to @tutorial, notice: 'Tutorial was successfully created.' }
format.json { render :show, status: :created, location: @tutorial }
else
format.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @tutorials = Tutorial.all\n @tutorial = Tutorial.new(tutorial_params)\n\n if @tutorial.save\n render json: @tutorial\n else\n render json: @tutorial.errors.full_messages, status:400\n end\n end",
"def create\n @tutorial = Tutorial.new(params[:tutorial])\n\n ... | [
"0.76708263",
"0.6955442",
"0.6955442",
"0.68647796",
"0.68629074",
"0.686008",
"0.67938536",
"0.6764541",
"0.66946125",
"0.66946125",
"0.6639854",
"0.6636353",
"0.6618273",
"0.65635926",
"0.6538954",
"0.6455335",
"0.64420134",
"0.6339229",
"0.63276666",
"0.62351245",
"0.6227... | 0.730819 | 1 |
PATCH/PUT /tutorials/1 PATCH/PUT /tutorials/1.json | def update
respond_to do |format|
if @tutorial.update(tutorial_params)
format.html { redirect_to @tutorial, notice: 'Tutorial was successfully updated.' }
format.json { render :show, status: :ok, location: @tutorial }
else
format.html { render :edit }
format.json { render... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @tutorial.update(tutorial_params)\n format.html { redirect_to @tutorial, notice: 'Tutorial was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @t... | [
"0.6698633",
"0.6668897",
"0.6668897",
"0.6622766",
"0.6616653",
"0.6431132",
"0.64124423",
"0.62858397",
"0.62479305",
"0.6179458",
"0.6115812",
"0.6110024",
"0.6091793",
"0.6082478",
"0.6036505",
"0.6024749",
"0.60161746",
"0.5967685",
"0.5939566",
"0.5926305",
"0.5920993",... | 0.6601614 | 5 |
DELETE /tutorials/1 DELETE /tutorials/1.json | def destroy
@tutorial.destroy
respond_to do |format|
format.html { redirect_to tutorials_url, notice: 'Tutorial was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @tutorial.destroy\n respond_to do |format|\n format.html { redirect_to tutorials_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tutorial = Tutorial.find(params[:id])\n @tutorial.destroy\n render json: @tutorial\n end",
"def destroy\n @tutor... | [
"0.78816277",
"0.77756006",
"0.77635777",
"0.76979846",
"0.7655823",
"0.7637724",
"0.7406003",
"0.7403622",
"0.7369901",
"0.7306867",
"0.7271038",
"0.72081655",
"0.72025627",
"0.71776426",
"0.7145344",
"0.71135455",
"0.7080351",
"0.70493287",
"0.7030867",
"0.70085275",
"0.699... | 0.7615782 | 6 |
Use callbacks to share common setup or constraints between actions. | def set_tutorial
@tutorial = Tutorial.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.6163754",
"0.6045816",
"0.5944853",
"0.59169096",
"0.58892167",
"0.58342934",
"0.5776148",
"0.57057375",
"0.57057375",
"0.56534296",
"0.56209534",
"0.54244673",
"0.54101455",
"0.54101455",
"0.54101455",
"0.53951085",
"0.5378493",
"0.53563684",
"0.53399915",
"0.5338049",
"0... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def tutorial_params
params.require(:tutorial).permit(:title, :author, :description, :user_id, :steps_attributes => [:id, :title, :problem, :solution, :_destroy])
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_property
@property = Property.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 |
require spechelper require color | def powers_of_3(input)
i=0
loop do
num = 3 ** i
i=i+1
if num >= input
return i-2
break
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def blue\n end",
"def colors; end",
"def test_invalid_color\n assert_raises(ArgumentError) do\n ResistorColorTrio.new(%w[yellow purple black]).label\n end\n end",
"def blue; end",
"def blue; end",
"def test_get_color\n assert_equal \"X\", @disc.color\n end",
"def use_color?\n use_... | [
"0.5880428",
"0.58692724",
"0.58336776",
"0.58267486",
"0.58267486",
"0.5759839",
"0.57582736",
"0.5740131",
"0.5717557",
"0.5717557",
"0.5717557",
"0.5704035",
"0.57006514",
"0.5686386",
"0.5674616",
"0.5662002",
"0.56307167",
"0.56307167",
"0.55782986",
"0.5572292",
"0.5552... | 0.0 | -1 |
Public: Returns a list of invoices for an Account. Endpoint: GET /api/v1/invoices.json start_date Date to filter from. (Default: 1 year ago) end_date Date to filter to. (Default: now) Returns an Array | def index
@invoices = @account_invoices.where(invoices: { created_at: @start_date...@end_date })
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def invoices\n result = Invoice.where(created_at: params[:start_date]..(params[:end_date]))\n .order(created_at: :desc)\n .map{ |x| filter_invoice(x)}\n render json: result\n end",
"def all_invoices\n @gateway.get_invoices.invoices\n end",
"def get_invoices(opts = {})\n data, _status_... | [
"0.76406866",
"0.7189581",
"0.7180423",
"0.7016731",
"0.68043035",
"0.67931294",
"0.67843276",
"0.6754035",
"0.6737712",
"0.6675335",
"0.6667127",
"0.6544232",
"0.6521185",
"0.64932865",
"0.6442689",
"0.64068633",
"0.6366915",
"0.6314056",
"0.629837",
"0.6267707",
"0.62574035... | 0.77027977 | 0 |
Public: Returns a list of Invoices due Endpoint: GET /api/v1/invoices/due.json start_date Date to filter from. (Default: 1 year ago) end_date Date to filter to. (Default: 30 days from now) Returns an Array | def due
@invoices = @account_invoices.where(invoices: { due_on_date: @start_date...@end_date })
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def invoices\n result = Invoice.where(created_at: params[:start_date]..(params[:end_date]))\n .order(created_at: :desc)\n .map{ |x| filter_invoice(x)}\n render json: result\n end",
"def index\n @due_dates = DueDate.all\n end",
"def issues_due_in_days\n due_date = options.days.day.from_n... | [
"0.6310526",
"0.6297584",
"0.62060803",
"0.61908454",
"0.58597034",
"0.5785664",
"0.57734746",
"0.5691133",
"0.5683437",
"0.566443",
"0.55305094",
"0.55100936",
"0.5467082",
"0.5457827",
"0.5456646",
"0.5431798",
"0.5430059",
"0.54243207",
"0.54058695",
"0.53918225",
"0.53908... | 0.81411666 | 0 |
Public: Returns a list of Invoices expected Endpoint: GET /api/v1/invoices/expected.json start_date Date to filter from. (Default: 1 year ago) end_date Date to filter to. (Default: 30 days from now) Returns an Array | def expected
@invoices = @account_invoices.joins(:payment_profiles)
.where(payment_profiles: { expected_payment_date: @start_date...@end_date })
respond_to do |format|
format.json { render json: @invoices.to_json(include: :payment_profiles) }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def invoices\n result = Invoice.where(created_at: params[:start_date]..(params[:end_date]))\n .order(created_at: :desc)\n .map{ |x| filter_invoice(x)}\n render json: result\n end",
"def index\n @invoices = @account_invoices.where(invoices: { created_at: @start_date...@end_date })\n end",
"... | [
"0.65829754",
"0.6296876",
"0.6225987",
"0.5496828",
"0.54664224",
"0.5445422",
"0.54397327",
"0.5352077",
"0.5324388",
"0.53200823",
"0.53158706",
"0.5313255",
"0.5307501",
"0.52753747",
"0.52633446",
"0.5248743",
"0.520947",
"0.5187716",
"0.5175296",
"0.51569676",
"0.514632... | 0.71634406 | 0 |
Public: Returns a list of expected invoicing Endpoint: GET /api/v1/invoices/payment_predictions.json start_date Date to filter from. (Default: 1 year ago) end_date Date to filter to. (Default: 30 days from now) Returns an Array | def payment_predictions
@results = Project.payment_prediction_results(@account, params, @start_date, @end_date)
@totals = Project.payment_prediction_totals(@account, params, @start_date, @end_date)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def expected\n @invoices = @account_invoices.joins(:payment_profiles)\n .where(payment_profiles: { expected_payment_date: @start_date...@end_date })\n respond_to do |format|\n format.json { render json: @invoices.to_json(include: :payment_profiles) }\n end\n end",
"... | [
"0.67105985",
"0.60273945",
"0.5545109",
"0.5475361",
"0.54315245",
"0.5406394",
"0.5298671",
"0.5297711",
"0.52594626",
"0.524325",
"0.5218555",
"0.5188006",
"0.5017222",
"0.49868855",
"0.49852183",
"0.49617335",
"0.49580267",
"0.49537116",
"0.4940902",
"0.49366722",
"0.4929... | 0.6581059 | 1 |
Public: Returns allocated amount for time period Endpoint: GET /api/v1/invoices/allocated.json | def allocated
@amount = InvoiceUsage.amount_cents_allocated_for_period(Account.find_by_site_address(request.subdomain), @start_date, @end_date)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def billable_allocation(date=Date.today)\n resource_assignments.in_date_range(date,date).to_a.sum(&:billable_allocation)\n end",
"def pending\n @ledger_entries = @organization.ledger_entries.uninvoiced.page(params[:page])\n respond_with @organization, @invoice\n end",
"def amount_available\n # pu... | [
"0.6175804",
"0.59709394",
"0.59040004",
"0.57849187",
"0.5679525",
"0.5678141",
"0.56467384",
"0.5630368",
"0.5625031",
"0.5597858",
"0.5568677",
"0.5557841",
"0.55183417",
"0.54969114",
"0.5468496",
"0.5468496",
"0.54392654",
"0.54079217",
"0.5386088",
"0.5385328",
"0.53771... | 0.7972553 | 0 |
GET /departamentos GET /departamentos.json | def index
@departamento = Departamento.new
@departamentos = Departamento.all
respond_to do |format|
format.html # index.html.erb
format.json { render json: @departamentos }
format.xls { send_data @departamentos.to_xls(
:columns => [ :id, :descripcion, :pais, :created_at, :u... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @departamentos = Departamento.all\n\n render json: @departamentos\n end",
"def show\n render json: @departamento\n end",
"def department\n @departments = @company.departments\n respond_to do |format|\n format.json { render json: @departments}\n end\n end",
"def index\n ... | [
"0.80004394",
"0.7587424",
"0.69989854",
"0.6869797",
"0.6676185",
"0.66650385",
"0.6629938",
"0.65179044",
"0.633257",
"0.63306254",
"0.6323711",
"0.62748736",
"0.6247762",
"0.6241792",
"0.62251765",
"0.62014246",
"0.6169621",
"0.6162901",
"0.6162341",
"0.6157695",
"0.615713... | 0.0 | -1 |
GET /departamentos/1 GET /departamentos/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @departamentos = Departamento.all\n\n render json: @departamentos\n end",
"def show\n render json: @departamento\n end",
"def show\n @departure = Departure.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @departure }... | [
"0.7797407",
"0.75674784",
"0.7002738",
"0.6777715",
"0.668509",
"0.65252215",
"0.65189046",
"0.6406599",
"0.640398",
"0.639036",
"0.63438296",
"0.6317379",
"0.6308145",
"0.6275918",
"0.6269102",
"0.6261625",
"0.6237571",
"0.6230271",
"0.62296253",
"0.6216064",
"0.61811304",
... | 0.0 | -1 |
POST /departamentos POST /departamentos.json | def create
@departamento = Departamento.new(departamento_params)
respond_to do |format|
if @departamento.save
format.html { redirect_to @departamento, notice: 'Departamento was successfully created.' }
format.json { render :show, status: :created, location: @departamento }
else
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @departamento = Departamento.new(departamento_params)\n\n if @departamento.save\n render json: @departamento, status: :created, location: @departamento\n else\n render json: @departamento.errors, status: :unprocessable_entity\n end\n end",
"def index\n @departamentos = Depa... | [
"0.7700536",
"0.6753591",
"0.66866124",
"0.66007453",
"0.6578314",
"0.6556611",
"0.65325373",
"0.65282226",
"0.6416415",
"0.6412363",
"0.6405381",
"0.6395685",
"0.6390314",
"0.63777196",
"0.6374034",
"0.6360101",
"0.6294451",
"0.625798",
"0.6215322",
"0.62022364",
"0.619334",... | 0.6957332 | 1 |
PATCH/PUT /departamentos/1 PATCH/PUT /departamentos/1.json | def update
respond_to do |format|
if @departamento.update(departamento_params)
format.html { redirect_to @departamento, notice: 'Departamento was successfully updated.' }
format.json { render :show, status: :ok, location: @departamento }
else
format.html { render :edit }
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @departamento = Departamento.find(params[:id])\n\n if @departamento.update(departamento_params)\n head :no_content\n else\n render json: @departamento.errors, status: :unprocessable_entity\n end\n end",
"def update\n @dept = Dept.find(params[:id])\n \n #comando para t... | [
"0.69956696",
"0.6435579",
"0.640884",
"0.6313128",
"0.62791437",
"0.62766683",
"0.6271666",
"0.62644744",
"0.62539864",
"0.62329525",
"0.62223107",
"0.6177895",
"0.6172103",
"0.6145714",
"0.6142552",
"0.613064",
"0.6130487",
"0.6127399",
"0.61230695",
"0.61057067",
"0.608353... | 0.6517977 | 1 |
DELETE /departamentos/1 DELETE /departamentos/1.json | def destroy
@departamento.destroy
respond_to do |format|
format.html { redirect_to departamentos_url, notice: 'Departamento was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @departamento.destroy\n\n head :no_content\n end",
"def destroy\n @departamentos = Departamento.find(params[:id])\n @departamentos.destroy\n\n respond_to do |format|\n format.html { redirect_to(homes_path) }\n format.xml { head :ok }\n end\n end",
"def destroy\n ... | [
"0.7723359",
"0.74976003",
"0.7445309",
"0.7390109",
"0.7277934",
"0.72778565",
"0.7255089",
"0.72418076",
"0.7234161",
"0.7211201",
"0.7203569",
"0.72028494",
"0.7196837",
"0.7195854",
"0.7193747",
"0.7189681",
"0.7181408",
"0.71761805",
"0.71735877",
"0.7164312",
"0.7163844... | 0.7507007 | 1 |
Use callbacks to share common setup or constraints between actions. | def set_departamento
@departamento = Departamento.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576"... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def departamento_params
params.require(:departamento).permit(:descripcion, :pais_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",... | 0.0 | -1 |
define the shuffling method | def shuffle array
#local varibales
random = [ ]
count = -2
x = 0
y = 0
array.each do |word|
count = count + 1
end
while y <= count
x = rand(count + 1)
if array [x] != 'used'
random.push array[x]
array [x] = 'used'
y = y + 1
end
end
puts random
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def shuffle()\n \n end",
"def shuffle!\r\n\t\trandomize!\r\n\tend",
"def shuffle # You can't use .shuffle!\n\n end",
"def shuffle!()\n\t\treplace(shuffle)\n\tend",
"def shuffle!\n @rep.shuffle!\n end",
"def shuffle()\n @x.shuffle\n \n end",
"def shuffle!()\n replace... | [
"0.9087403",
"0.8658232",
"0.8532181",
"0.823516",
"0.8155989",
"0.81477296",
"0.80802387",
"0.7934877",
"0.7908012",
"0.79014283",
"0.79014283",
"0.7872317",
"0.78696907",
"0.78598523",
"0.78598523",
"0.78339905",
"0.7825563",
"0.7790469",
"0.7779835",
"0.7779827",
"0.777159... | 0.0 | -1 |
Now use it to build your playlist: | def shuffle array
x = 0
track_number = 0
number_songs = 0
playlist = [ ]
number_songs = array.length
while x < number_songs
track_number = rand(number_songs)
if array[track_number] != ''
playlist.push array[track_number]
array[track_number] = ''
x = x + 1
else
end
end
fil... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new_playlist(m={})\n # default selection parameters\n number=60\n max_length=0\n min_rating=0\n max_rating=0\n min_length=0\n # assign if parameters got passed as arguments\n max_length = m[:length] if m.key?(:length)\n number=m[:number] if m.key?(:number)\n # make a semi-randomized list of dances\n ... | [
"0.7239903",
"0.7213797",
"0.7196936",
"0.7119489",
"0.6969878",
"0.69452393",
"0.6875388",
"0.68555415",
"0.6840699",
"0.6821243",
"0.68084717",
"0.6792354",
"0.6748365",
"0.6746564",
"0.6739948",
"0.67306095",
"0.6651281",
"0.66451025",
"0.66449654",
"0.6558522",
"0.649757"... | 0.0 | -1 |
Return the part of the file name string after the last '.' | def file_type(file_name)
@file_class.extname(file_name).gsub( /^\./, '' ).downcase
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def basename_of(filename)\n filename.sub(/(\\.[a-z]+)*$/, '')\n end",
"def name\n file.partition(base).last.gsub(/[_\\/]/, \" \").strip\n end",
"def basename\n if extension\n basename = filename.split('.')\n basename.pop\n basename.join('.')\n else\n filename\n end\... | [
"0.8252443",
"0.81058407",
"0.8060041",
"0.8036626",
"0.79518306",
"0.79147726",
"0.790183",
"0.78780484",
"0.7855087",
"0.7835426",
"0.7835426",
"0.78316844",
"0.7814328",
"0.7682622",
"0.7665357",
"0.76593095",
"0.7654219",
"0.7651827",
"0.76347667",
"0.76248354",
"0.762483... | 0.0 | -1 |
def on_summarize(plan, expr, compiled) > SQL's GROUPBY end | def on_union(plan, expr, left, right)
rewrite(plan, expr, left, Processor::Merge, [:union, right.sexpr])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def statement\n case @metric.aggregate\n when :sum\n parts = {\n select: select_statement,\n joins: dimension_joins,\n having: having_statement,\n order: order_by_statement\n }\n\n statement = ([model] + parts.keys).inject do |chain, method|\n ... | [
"0.6892328",
"0.6576139",
"0.6449434",
"0.63672525",
"0.61811316",
"0.5943344",
"0.59147406",
"0.590433",
"0.5881772",
"0.58743817",
"0.5861021",
"0.58254415",
"0.5824452",
"0.5768484",
"0.5759067",
"0.572513",
"0.5717383",
"0.56915945",
"0.55204827",
"0.55164057",
"0.5488171... | 0.0 | -1 |
GET /graveyards GET /graveyards.json | def index
@graveyards = Graveyard.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index_single_gift\n render json: @gift, include: :ages, status: :ok\n end",
"def index\n @awards = Award.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @awards }\n end\n end",
"def index\n @harvestings = Harvesting.all\n\n respond_to... | [
"0.6780234",
"0.6630112",
"0.65699345",
"0.64448184",
"0.64406955",
"0.643336",
"0.64137",
"0.63945204",
"0.6392588",
"0.6358238",
"0.6356968",
"0.63527215",
"0.634336",
"0.6339252",
"0.63316685",
"0.6295311",
"0.62796146",
"0.6277983",
"0.62731814",
"0.6271698",
"0.624078",
... | 0.6588301 | 2 |
GET /graveyards/1 GET /graveyards/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @grumble = Grumble.find(params[:id])\n render status: 200, json: @grumble.to_json\n end",
"def index_single_gift\n render json: @gift, include: :ages, status: :ok\n end",
"def show\n @gig = Gig.find(params[:id])\n\n respond_to do |format|\n format.html {render json: @gig, statu... | [
"0.6943333",
"0.68979853",
"0.6863323",
"0.67748296",
"0.66074055",
"0.6578101",
"0.6574111",
"0.6555214",
"0.6517565",
"0.6517479",
"0.65023416",
"0.6476146",
"0.64744985",
"0.64579016",
"0.6432731",
"0.64298004",
"0.6402396",
"0.6390139",
"0.6385701",
"0.63851225",
"0.63827... | 0.0 | -1 |
POST /graveyards POST /graveyards.json | def create
@graveyard = Graveyard.new(graveyard_params)
respond_to do |format|
if @graveyard.save
format.html { redirect_to @graveyard, notice: 'Graveyard was successfully created.' }
format.json { render action: 'show', status: :created, location: @graveyard }
else
format.h... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n megam_rest.post_billedhistories(to_hash)\n end",
"def create\n @scratcher = Scratcher.new(permitted_params)\n\n if @scratcher.save\n render json: @scratcher, status: :created, location: @scratcher\n else\n render json: @scratcher.errors, status: :unprocessable_entity\n ... | [
"0.58996737",
"0.5887157",
"0.5847677",
"0.5840863",
"0.58266574",
"0.58077663",
"0.58025",
"0.5792123",
"0.57785475",
"0.57739073",
"0.5757464",
"0.5757464",
"0.5748748",
"0.5742635",
"0.5721065",
"0.5714528",
"0.57092685",
"0.57051563",
"0.5685647",
"0.5679661",
"0.5670466"... | 0.0 | -1 |
PATCH/PUT /graveyards/1 PATCH/PUT /graveyards/1.json | def update
respond_to do |format|
if @graveyard.update(graveyard_params)
format.html { redirect_to @graveyard, notice: 'Graveyard was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: 'edit' }
format.json { render json: @graveyard... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def patch!\n request! :patch\n end",
"def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end",
"def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\... | [
"0.6551078",
"0.64353144",
"0.637661",
"0.6294998",
"0.62682045",
"0.62682045",
"0.62505996",
"0.62013996",
"0.6175505",
"0.6169091",
"0.61620855",
"0.6144471",
"0.6125791",
"0.60881466",
"0.6087728",
"0.6070328",
"0.6067102",
"0.60630226",
"0.60630226",
"0.6057358",
"0.60454... | 0.0 | -1 |
DELETE /graveyards/1 DELETE /graveyards/1.json | def destroy
@graveyard.destroy
respond_to do |format|
format.html { redirect_to graveyards_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @kota_stone.destroy\n respond_to do |format|\n format.html { redirect_to kota_stones_url }\n format.json { head :no_content }\n end\n end",
"def test_del\n header 'Content-Type', 'application/json'\n\n data = File.r... | [
"0.72620183",
"0.69182223",
"0.6890198",
"0.68567836",
"0.6842657",
"0.682867",
"0.6811024",
"0.68104666",
"0.67652255",
"0.67494863",
"0.6748609",
"0.6742116",
"0.67359185",
"0.6730001",
"0.6724391",
"0.67243046",
"0.6712099",
"0.6707998",
"0.67015225",
"0.6687454",
"0.66853... | 0.716806 | 2 |
Use callbacks to share common setup or constraints between actions. | def set_graveyard
@graveyard = Graveyard.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576"... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def graveyard_params
params.require(:graveyard).permit(:name, :capacity)
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.6981269",
"0.6783559",
"0.6746007",
"0.67423046",
"0.6735905",
"0.6593568",
"0.6504213",
"0.649792",
"0.6482664",
"0.6478558",
"0.64566684",
"0.64392304",
"0.6380194",
"0.6376366",
"0.636562",
"0.63208145",
"0.63006365",
"0.63001287",
"0.6292953",
"0.62927175",
"0.62911004... | 0.0 | -1 |
Add user to model changes subscription list | def toggle_subscription
authorize model
authorize Subscription
subscription_toggle
@model = model
render 'toggle_subscription'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def subscribe_author\n self.subscriptions.create user_id: self.user.id\n end",
"def subscribe\n @board.subscribers << current_user\n redirect_to board_path(@board), notice: \"Boarda abone oldunuz.\"\n end",
"def add_user(user)\n @users << user\n end",
"def change\n @user = current_user\n e... | [
"0.6481781",
"0.6179844",
"0.6135586",
"0.6052374",
"0.6048363",
"0.5958382",
"0.5954571",
"0.5928731",
"0.59276503",
"0.592729",
"0.5892201",
"0.58791727",
"0.58762056",
"0.5849924",
"0.5817234",
"0.58129823",
"0.5806352",
"0.580569",
"0.5787964",
"0.5768928",
"0.5764931",
... | 0.0 | -1 |
Just a toString mainly for plain text printer | def toString
self.instance_variables.each do |i|
puts "#{i[1..-1]}: #{self.instance_variable_get(i)}\n"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_s\n Printer.instance.print(self)\n end",
"def toString\n #Not sure if we want this or just use the getters for more\n #selective formatting\n end",
"def to_s\r\n self.each do |r|\r\n puts r.each { |p| p }.join(\" \")\r\n end\r\n end",
"def print\n puts to_s\n end",
"... | [
"0.78982353",
"0.7662912",
"0.7041532",
"0.70186704",
"0.69736916",
"0.69547665",
"0.6953023",
"0.6943698",
"0.69394237",
"0.693778",
"0.68622833",
"0.68622833",
"0.68622833",
"0.68622833",
"0.68622833",
"0.68622833",
"0.68622833",
"0.68622833",
"0.68622833",
"0.68622833",
"0... | 0.0 | -1 |
=begin Converts all instance variables in the class into json(String). Using a loop and checks for the last variable so it doesn't have a comma. =end | def toJson
json = " {\n"
self.instance_variables.each_with_index do |i,index|
json += " \"#{i[1..-1]}\": \"#{self.instance_variable_get(i)}\""
if index != self.instance_variables.size - 1
json += ",\n"
else
json += "\n"
end
end
json += " }"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_s()\n hash = {}\n self.instance_variables.each do |var|\n hash[var] = self.instance_variable_get var\n end\n hash.to_json\n end",
"def to_json(*a)\n instance_variables_hash.to_json(*a)\n end",
"def as_json\n hash = {}\n instance_variables.each{|var| hash... | [
"0.6784616",
"0.6685134",
"0.64399457",
"0.6306227",
"0.6142625",
"0.5869143",
"0.58643454",
"0.582415",
"0.5751667",
"0.5700582",
"0.5698596",
"0.56804425",
"0.5678809",
"0.567268",
"0.567268",
"0.567268",
"0.56717503",
"0.56472963",
"0.56363714",
"0.56136596",
"0.5599117",
... | 0.75539887 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.