Examples

10+ powerful functions for reading, writing, and coding


Writing

Academic style

Input

Utilitarianism is about what kinda consequence do we have and deontology is like some moral principles. Like if I kill a dude but save two, that's good from utilitarian and bad from deontology perspective. 

Output

Utilitarianism is a consequentialist ethical theory which focuses on the consequences of an act and seeks to maximize positive outcomes, whereas deontology is a non-consequentialist ethical theory which emphasizes moral principles and the intrinsic morality of an action, regardless of the outcome. For example, from a utilitarian perspective, killing one individual but saving two may be seen as a desirable outcome; however, from a deontological perspective, it would be considered morally wrong.


Elaborate

Input

Current state-of-the-art experiments consider many parameters for crowd simulations such as the shape/size of the rooms, the number of people and their weights, panic behavior, and more. However, a parameter that has not been experimented with yet is a grouping factor.

Output

Grouping is a key factor that can affect the behavior of crowds in simulations. It can be used to study the impact of social groupings on collective behavior in dense crowds. For example, it can be used to study the impact of age, sex, or cultural differences on crowd behavior. For example, it can be used to analyze the effects of age on the likelihood of panic behavior in a crowd. Grouping can also be used to study how social networks can influence behavior in a crowd, such as how friends or family members may act differently in a crowd compared to strangers. Furthermore, it can be used to study the effects of regional factors on crowd behavior, such as the impact of cultural differences on the likelihood of violence.

Complete

Input

Here we present four different model types used for simulating infectious diseases, which are

Output

compartmental models, individual-based models, agent-based models, and network-based models. Compartmental models are mathematical models that divide a population of individuals into categories, such as those who are infected, those who are susceptible, and those who are recovered or dead. These models are used to study the spread of infectious diseases by looking at how these categories interact and change over time.


Reading

Summarize

Input

Joseph Vissarionovich Stalin[g] (born Ioseb Besarionis dze Jughashvili;[d] 18 December [O.S. 6 December] 1878[1] – 5 March 1953) was a Georgian-born revolutionary and Soviet political leader who led the Soviet Union from 1924 until his death in 1953. He held power as General Secretary of the Communist Party of the Soviet Union (1922–1952) and Chairman of the Council of Ministers of the Soviet Union (1941–1953). Initially governing the country as part of a collective leadership, he consolidated power to become a dictator by the 1930s. Ideologically adhering to the Leninist interpretation of Marxism, he formalised these ideas as Marxism–Leninism, while his own policies are called Stalinism.

Output

Joseph Stalin was a Georgian-born revolutionary and Soviet political leader who led the Soviet Union from 1924 until his death in 1953. He was the General Secretary of the Communist Party of the Soviet Union and Chairman of the Council of Ministers of the Soviet Union. Ideologically adhering to Leninist Marxism, Stalinism was the term used to describe his own policies.

Bullet points

Input

Just after the atomic bombs exploded over Hiroshima and Nagasaki, Russell wrote letters, and published articles in newspapers from 1945 to 1948, stating clearly that it was morally justified and better to go to war against the USSR using atomic bombs while the United States possessed them and before the USSR did.[163] In September 1949, one week after the USSR tested its first A-bomb, but before this became known, Russell wrote that USSR would be unable to develop nuclear weapons because following Stalin's purges only science based on Marxist principles would be practised in the Soviet Union.[164] After it became known that the USSR had carried out its nuclear bomb tests, Russell declared his position advocating the total abolition of atomic weapons.

Output

Explain to child

Input

The dynamism and imagery of the instincts together form an a priori which no man can overlook without the gravest risk to himself. Violation or neglect of instinct has painful consequences of a physiological and psychological nature for whose removal medical help, above all, is required.

Output

The text is saying that people have natural instincts that influence their thoughts and behavior. If someone ignores or goes against these instincts, it can have negative physical and mental health consequences. To fix this, medical help is necessary.

Give an example

Input

Virtue ethics is an approach to ethics that treats the concept of moral virtue as central.

Output

An example of virtue ethics in operation is a family-owned business that prioritizes the well-being of its employees. They invest in their employees' development with training, mentorship, and fair compensation and provide a healthy, safe, and supportive work environment. The business owners are motivated by the idea that creating a positive work environment is the virtuous thing to do.

Coding

Explain code

Input

def remove_common_prefix(x, prefix, ws_prefix): 

    x["compl"] = x["compl"].str[len(prefix) :] 

    if ws_prefix: 

        x["compl"] = " " + x["compl"

return

Output

The code above is a function that takes a dataframe and a prefix as input and returns a dataframe with the prefix removed from the completion column.

Matlab-to-Python

Input

primes = [];

n = 2;

while length(primes) < 10

  if is_prime(n)

    primes = [primes n];

  end

  n = n + 1;

end

disp(primes);


function is_prime = is_prime(num)

  for i = 2:num-1

    if mod(num,I) == 0

        is_prime = false;

        return;

    end

  end

  is_prime = true;

end

Output

def is_prime(num):

   for i in range(2, num):

     if num % i == 0:

         return False

   return True


primes = []

n = 2

while len(primes) < 10:

   if is_prime(n):

     primes.append(n)

   n += 1

  

print(primes)

Other Sentelo functions

[insert]

Control questions

SnoopDoggify