OpenLLM-France/wikimedia huggingface dataset:
# Python Programming/Extending with ctypes

| Previous: Extending with Pyrex | Index | Next: Extending with Perl |
ctypes is a foreign function interface module for Python (included with Python 2.5 and above), which allows you to load in dynamic libraries and call C functions. This is not technically extending Python, but it serves one of the primary reasons for extending Python: to interface with external C code.

## Basics

A library is loaded using the ctypes.CDLL function. After you load the library, the functions inside the library are already usable as regular Python calls. For example, if we wanted to forego the standard Python print statement and use the standard C library function, printf, you would use this:
Of course, you must use the libName line that matches your operating system, and delete the other. If all goes well, you should see the infamous Hello World string at your console.

## Getting Return Values

ctypes assumes, by default, that any given function's return type is a signed integer of native size. Sometimes you don't want the function to return anything, and other times, you want the function to return other types. Every ctypes function has an attribute called restype. When you assign a ctypes class to restype, it automatically casts the function's return value to that type.

### Common Types

| ctypes name | C type | Python type | Notes |
| None | void | None | the None object |
| c_bool | C99 _Bool | bool | |
| c_byte | signed char | int | |
| c_char | signed char | str | length of one |
| c_char_p | char * | str | |
| c_double | double | float | |
| c_float | float | float | |
| c_int | signed int | int | |
| c_long | signed long | long | |
| c_longlong | signed long long | long | |
| c_short | signed short | long | |
| c_ubyte | unsigned char | int | |
| c_uint | unsigned int | int | |
| c_ulong | unsigned long | long | |
| c_ulonglong | unsigned long long | long | |
| c_ushort | unsigned short | int | |
| c_void_p | void * | int | |
| c_wchar | wchar_t | unicode | length of one |
| c_wchar_p | wchar_t * | unicode | |
| Previous: Extending with Pyrex | Index | Next: Extending with Perl |
# Python Programming/Extending with C++

| Previous: Extending with C | Index | Next: Extending with Pyrex |
There are different ways to extend Python with C and C++ code:
* In plain C, using Python.h
* Using Swig
* Using Boost.Python, optionally with Py++ preprocessing
* Using pybind11
* Using Cython.
This page describes Boost.Python. Before the emergence of Cython, it was the most comfortable way of writing C++ extension modules.
Boost.Python comes bundled with the Boost C++ Libraries. To install it on an Ubuntu system, you might need to run the following commands

## A Hello World Example
### setup.py

Now we can build our module with
The module `hello.so` will end up in e.g `build/lib.linux-i686-2.4`.

### Using the extension module

Change to the subdirectory where the file `hello.so` resides. In an interactive python session you can use the module as follows.

## An example with CGAL

Some, but not all, functions of the CGAL library already have Python bindings. Here an example is provided for a case without such a binding and how it might be implemented. The example is taken from the CGAL Documentation.
We then compile and run the module as follows:

## Handling Python objects and errors

One can also handle more complex data, e.g. Python objects like lists. The attributes are accessed with the extract function executed on the objects "attr" function output. We can also throw errors by telling the library that an error has occurred and returning. In the following case, we have written a C++ function called "afunction" which we want to call. The function takes an integer N and a vector of length N as input, we have to convert the python list to a vector of strings before calling the function.

## External links

* Boost.Python, boost.org
* pybind11, pypi.org
| Previous: Extending with C | Index | Next: Extending with Pyrex |
# Python Programming/Extending with R

| Previous: Extending with Perl | Index | Next: Links |
It is possible to call R functions and even modules direcly from Python. One easy way to do this is the rpy2 interface. In the following code snippet, an R module called preprocessCore from the bioconductor portal is loaded and the quantile normalization function is applied on a matrix that is created in python and then converted back to python again.
It is thus possible to handle R modules and objects.

## See also

* http://wiki.python.org/moin/IntegratingPythonWithOtherLanguages#R
* http://rpy.sourceforge.net/rpy2.html
| Previous: Extending with Perl | Index | Next: Links |
# Python Programming/Extending with Pyrex

| Previous: Extending with C++ | Index | Next: Extending with ctypes |
Pyrex is a compiler of Python-like source code to the C language, intended to make it relatively easy for Python programmers to write fast Python extension modules without having to learn the C language.
Cython is an actively developed derivative of Pyrex. Pyrex is no longer actively developed, the last stable release being from 2010.
Links:
* Pyrex - a Language for Writing Python Extension Modules, cosc.canterbury.ac.nz
* Pyrex (programming language), en.wikipedia.org
| Previous: Extending with C++ | Index | Next: Extending with ctypes |
# Python Programming/External commands

The traditional way of executing external commands is using os.system:
The modern way, since Python 2.4, is using subprocess module:
The traditional way of executing external commands and reading their output is via popen2 module:
The modern way, since Python 2.4, is using subprocess module:
Keywords: system commands, shell commands, processes, backtick, pipe.

## External links

* 17.1. subprocess — Subprocess management, python.org, since Python 2.4
* 15.1. os — Miscellaneous operating system interfaces, python.org
* 17.5. popen2 — Subprocesses with accessible I/O streams, python.org, deprecated since Python 2.6
# Python Programming/Extending with Perl

| Previous: Extending with ctypes | Index | Next: Extending with R |
It is possible to call Perl functions and modules in Python. One way to do that is the PyPerl Module. It is not developed actively any more and for it to work in newer versions, one has to use this version and apply the patches.
It is thus possible to handle Perl objects, change their attributes and call their methods.

## See also

* http://wiki.python.org/moin/IntegratingPythonWithOtherLanguages#Perl
| Previous: Extending with ctypes | Index | Next: Extending with R |
# Latin/Lesson 1-Revision

* 1st declension: genitive ends in -ae, nominative usually ends in -a
* 2nd declension: genitive ends in -i, nominative usually ends in -us for masculine and -um for neut.
* 3rd declension: genitive ends in -is, nominative varies
* 4th declension: genitive ends in -us, nominative usually ends in -us for m/f and -u for neut.
* 5th declension: genitive ends in -ei, nominative usually ends in -es
Notice that almost all 1st declension nouns are feminine. A mnemonic device for the common masculine ones is PAIN -- poeta (poet), agricola (farmer), incola (inhabitant), and nauta (sailor). Almost all 2nd declension nouns are either masculine or neuter.
Notice that in all cases, the accusative of neuter nouns is the same as the nominative.
1st Declension
| | sing | pl |
| Nom | -a | -ae |
| Gen | -ae | -arum |
| Dat | -ae | -is |
| Acc | -am | -as |
| Abl | -a | -is |
2nd
masculine
-us -i -i -orum -o -is -um -os -o -is
neuter
-um -a -i -orum -o -is -um -a -o -is
3rd
m/f
-? -es -is -um -i -ibus -em -es -e -ibus
neut.
-? -a -is -um -i -ibus -? -a -e -ibus
4th
m/f
-us -us -us -uum -ui -ibus -um -us -u -ibus
neut. -u -ua -us -uum -u -ibus -u -ua -u -ibus
5th -es -es -ei -erum -ei -ebus -em -es -e -ebus
A mnemonic device for the common irregular imperatives is the rhyme: dic, duc, fac, fer: there ought to be an "e", but it isn't there. dicite, ducite, facite, ferte.
1st conjugation: amo, amare, amavi, amatus
2nd conjugation: moneo, monere, monui, monitus
3rd conjugation: ago, agere, egi, actus
3rd -io : capio, capere, cepi, captus
4th conjugation: sentio, sentire, sensi, sensus
Indicative Active Present
# Latin/Lesson 2-Active v Passive

A verb's voice shows the relationship between the subject and the action expressed by the verb. Latin has two voices: active and passive.
In the active voice, the subject of the clause performs the verb on something else (the object), e.g., "The girl sees the boy."
In the passive voice, the subject of the sentence receives the action of the verb, e.g., "The boy is seen by the girl."
The personal endings in the active voice are: -ō/-m, -s, -t, -mus, -tis, -nt.
The personal endings in the passive voice (present, imperfect, future) are: -r, -ris, -tur, -mur, -mini, -ntur.
Personal Active :
| | Singular | Plural |
| 1st | -ō/-m | -mus |
| 2nd | -s | -tis |
| 3rd | -t | -nt |
Personal Passive :
| | Singular | Plural |
| 1st | -r | -mur |
| 2nd | -ris | -mini |
| 3rd | -tur | -ntur |
In the perfect, pluperfect and future perfect, the passive voice is formed by the fourth principal part plus the proper forms of sum, esse. For the perfect tense, use the present forms of esse, for the pluperfect use the imperfect forms of esse, and for the future perfect use the future forms of esse. The fourth principal part, when used in a passive construction, acts as a first-second declension adjective and is declined accordingly.
As stated before, when the passive voice is used, the subject receives the action of the verb from another agent. This agent, when it is a person, is expressed by the preposition ā/ab plus the ablative case. This construction is called the ablative of personal agent. The ablative of cause is used without a preposition when the agent is not a person.

## Examples:

* Active: Puella puerum videt. (The girl sees the boy.)
   * Passive: Puer ā puellā vidētur. (The boy is seen by the girl.)
    Puella takes ā and the ablative, as it is a personal agent.
* Active: Timor virum capit. (Fear seizes the man.)
   * Passive: Vir timore capitur. (The man is seized by fear.)
    Timore is ablative of cause.
* Active: Hostēs urbem oppugnābant. (The enemies were attacking the city.)
   * Passive: Urbs ab hostibus oppūgnābātur. (The city was being attacked by the enemies.)

## Deponent verbs

Some verbs are always passive in form, even though they have an active meaning. For example:
* filius agricolam sequitur - The son follows the farmer
* sol ortus est - The sun has risen
* agricolae hostes verentur - The farmers fear the enemies
* gladio usus sum - I used a sword
Some, called semi-deponent verbs, take on a passive form on only in the perfect. For example:
* colono confido - I trust the farmer
* colono confisus sum - I trusted the farmer
Note that some deponent and semi-deponent verbs take the accusative case (eg. vereor, vereri, veritus sum = I fear), some the ablative (eg. utor, uti, usus sum = I use) and some the dative (eg. confido, confidere, confisus sum = I trust). When you first encounter such a verb in Latin, be sure to remember the case of the object the verb is taking along with its spelling and meaning.
# Latin/Lesson 10-Idioms

* ad unum-to a man
* aequo animo-contentedly, resignedly, patiently
* aere alieno premi-to be heavily in debt
* agere gratias-to thank
* alius aliam in partem-one in one direction, another in another
* amico aliquo uti-to be on terms of intimacy with some one
* animo tenus commoveri-to be moved to the heart
* ad astra-to the stars
# Latin/Lesson 11-Translation

Lesson 20, as a bit of a reward is a little translation exercise from the Gospel of Saint Luke.
Exercise 1
Vocabulary
coming soon, at the moment consult your dictionary
Respondens Simon dixit: "Aestimo quia is, cui plus donavit". At ille dixit ei: "Recte iudicasti". Et conversus ad mulierem, dixit Simoni: "Vides hanc mulierem? Intravi in domum tuam: aquam pedibus meis non dedisti; haec autem lacrimis rigavit pedes meos et capillis suis tersit. Osculum mihi non dedisti haec autem, ex quo intravi non cessavit osculari pedes meos. Oleo caput meum non unxisti; haec autem unguento unxit pedes meos. Propter quod dico tibi: Remissa sunt peccata eius multa, quoniam dilexit multrum: cui autem minus dimittitur, minus diligit." Dixit autem ad illam: "Remissa sunt peccata tua". Et coeperunt, qui simul accumbebant, dicere intra se: "quis est hic, qui etiam peccata dimittit?". Dixit autem ad mulierem: Fides tua te salvam fecit; vade in pace!".
Et factum est deinceps, et ipse iter faciebat per civitatem et castellum praedicans et evangelizans regnum Dei, et Duodecim cum illo, et mulieres aliquae, quae erant curatae ab spiritibus malignis et infirmitatibus, Maria, quae vocatur Magdalene, de qua daemonia septem exierant, et Ioanna uxor Chuza procuratoris Herodis, et Sussanna et aliae multae, quae ministrabant eis de facultatibus suis.
# Latin/Lesson 1-Nominative/Exercise 1
## Exercise

Translate the following Latin words into English.
* dominus bonus • ludus malus • puella magna
* triclinium est magnum • ego sum magna$^1$ • es bonus$^2$
* [the] good master • [the] bad school/game • [the] big/large/great girl
* The dining room is big,large,great • I am big,large,great$^1$ • You are good$^2$
$^1$ Here the speaker is female because "magna" is a feminine adjective. $^2$ Here the speaker is referring to a male, because "bonus" is a masculine adjective.
# Pinyin/Operating

See also
# Pinyin/Opposition

Search Pinyin opposition
# Pinyin/Or

See also

## Conjunction

or: used to introduce another possibility
huoh: yohngyur jiehshaoh lihngyi keenerngxihng
# Pinyin/Orange

See also
An orange is a round citrus fruit with thick reddish-yellow skin and a lot of sweet juice.
Chéng'zi shì yuánxíng de gānjúlèi shuǐguǒ. Píhòu, hónghuángsè. Duōzhī, wèitián.
# Pinyin/Openly

See also
# Pinyin/Opinion

See also
# Pinyin/Opportunity

See also
# Pinyin/Operation

See also
# Pinyin/Oral

See also
* koouqiang d
* kooutour d
# Pinyin/Oral Health

See also
Oral health is a state of being free from chronic mouth and facial pain, oral and throat cancer, oral sores, birth defects such as cleft lip and palate, periodontal (gum) disease, tooth decay and tooth loss, and other diseases and disorders that affect the oral cavity.
Risk factors for oral diseases include unhealthy diet, tobacco use, harmful alcohol use, and poor oral hygiene.
Kǒuqiāng wèishēng shì zhǐ méiyǒu kǒubù huò miànbù téngtòng, kǒuqiāng hé yānhóu áizhèng, kǒuqiāng gǎnrǎn hé kǒuchuāng, yázhōu(yáyín)bìng, zhùyá hé yáchǐ tuōluò jí xiànzhì yǎo, jǔjué, wēixiào, shuōhuà hé shèhuì xīnlǐ jiànkāng děng gèrén nénglì de qítā jíbìng yǔ zhàng'ài de zhuàngtài.
Kǒuqiāng jíbìng de wēixiǎn yīnsù bāokuò bùjiànkāng yǐnshí, shǐyòng yāncǎo, yǒuhài shǐyòng jiǔjīng hé kǒuqiāng wèishēng bùliáng.
# Radiation Oncology/Hyperthermia/Randomized

* Front Page: Radiation Oncology | RTOG Trials | Randomized Trials
Hyperthermia Randomized Evidence

## RT +/- Hyperthermia

* Duke (1994-2001)
** Randomized. 109 patients with superficial tumors (<= 3cm depth); breast 65%, H&N 13%, melanoma 10%. Tumors had to be "heatable" on initial HT. Arm 1) RT alone vs. Arm 2) RT + HT. Hyperthermia to >43C x1 hour, 2x/week. RT dose 30-60 Gy if previous RT, otherwise 60-70 Gy in 1.8-2.0 Gy/fx
** 2005 PMID 15860867 -- "Randomized trial of hyperthermia and radiation for superficial tumors." (Jones EL, J Clin Oncol. 2005 May 1;23(13):3079-85.)
*** Outcome: CR RT 42% vs. RT+HT 66% (SS). Patients with prior RT had most benefit (68% vs. 23%, SS)
*** Toxicity: Well tolerated, 1 Grade III thermal burn
*** Conclusion: Significant local control benefit for HT
* International Collaborative Hyperthermia Group (1988-1991) -- combined results from five Phase III trials
** Randomized. 5 trials merged due to slow accrual, closed early after benefit. 306 patients. Advanced primary or recurrent BCA; 50% active disease outside treatment area. Could have had prior RT. Trials: Dutch Hyperthermia Group (DHG), Medical Research Council (MRC BrI and BrR), European Society of Hyperthermic Oncology (ESHO), and Princes Margaret (PMH). Target hyperthermia 43C. RT given in various fractions.
** 1996 PMID 8690639 -- "Radiotherapy with or without hyperthermia in the treatment of superficial localized breast cancer: results from five randomized controlled trials. International Collaborative Hyperthermia Group." (Vernon CC, Int J Radiat Oncol Biol Phys. 1996 Jul 1;35(4):731-44.)
*** Outcome: CR RT 41% vs. RT+HT 59% (SS); greatest effect in recurrent lesions in previous RT, where re-irradiation dose was low. 2-year OS ~40% (NS), 74% patients progressed outside HT area during follow-up
*** Conclusion: Combined result demonstrated efficacy of hyperthermia as adjunct to RT for treatment of recurrence
# Radiation Oncology/IMRT/IMRT Technical

* Front Page: Radiation Oncology | RTOG Trials | Randomized Trials
This page is about technical concepts related to intensity-modulated radiation therapy (IMRT). Information pertaining to clinical results of IMRT should go elsewhere.

## 3D-CRT

* U Washington PMID 15774592 -- Automatic selection of non-coplanar beam directions for three-dimensional conformal radiotherapy. (2005 Meyer J, Br J Radiol. 2005 Apr;78(928):316-27.)
** Algorithm that automatically searches all permitted beam directions
** Conclusion: "For the clinical cases the plans based on optimized beam directions were simpler and resulted in better sparing of critical structures compared with plans based on manual angle selection. The approach provides a practical alternative to elaborate and time consuming beam angle optimization schemes and is suitable for routine clinical usage."

## Optimizing leaf sequence

* Beavis, 2001 - PMID 11580181 — "Optimization of the step-and-shoot leaf sequence for delivery of intensity modulated radiation therapy using a variable division scheme."

## Homogeneity

* U. Michigan, 2002 - PMID 11955726 — "Is uniform target dose possible in IMRT plans in the head and neck?" Vineberg KA et al. Int J Radiat Oncol Biol Phys. 2002 Apr 1;52(5):1159-72.
# Radiation Oncology/IMRT/Pelvis

* Front Page: Radiation Oncology | RTOG Trials | Randomized Trials
This page is for IMRT topics that apply to any pelvic malignancy.

## Dosimetry

* U. Chicago, 2000 - PMID 11121668 — "Intensity-modulated whole pelvic radiation therapy in patients with gynecologic malignancies." Roeske JC et al. Int J Radiat Oncol Biol Phys. 2000 Dec 1;48(5):1613-21.
** 10 pts (5 cervix, 5 endometrium). LN CTV based on expanding vessel contours by 2 cm. Compared 3D-CRT "4-field box" (based on PTV) vs IMRT.
** Volume of small bowel > 30 Gy, 17.4% (IMRT) vs 33.8% (3D). Reduced volume of rectum and bladder receiving prescription dose by 23%
** Conclusion: IMRT reduces volume of small bowel irradiated.

### Pelvis + para-aortic

* U. Chicago, 2006 (2002-2005) - PMID 16730136 — "Preliminary outcome and toxicity report of extended-field, intensity-modulated radiation therapy for gynecologic malignancies." Salama JK et al. Int J Radiat Oncol Biol Phys. 2006 Jul 15;65(4):1170-6.
** 13 pts with gynecologic malignancies. CTV included pelvic and presacral LN + para-aortic LN.
** Low incidence of acute toxicity.
* UAB, 2005 - PMID 15380585 — "IMRT dose escalation for positive para-aortic lymph nodes in patients with locally advanced cervical cancer while reducing dose to bone marrow and other organs at risk." Ahmad RS et al. Int J Radiat Oncol Biol Phys. 2004 Oct 1;60(2):505-12.
** 5 cervical ca pts with positive PA LN. Treatment included pelvis + para-aortics. Compare 3 techniques: 1) AP-PA (both regions), 2) 4-field box (both regions), 3) IMRT to PA matched to 4-field box to pelvis.

### Bone marrow sparing

    See also: Radiation Oncology/Toxicity/Bone marrow
* U. Chicago
** 2003 PMID 12957265 — "Intensity-modulated radiotherapy as a means of reducing dose to bone marrow in gynecologic patients receiving whole pelvic radiotherapy." Lujan AE et al. Int J Radiat Oncol Biol Phys. 2003 Oct 1;57(2):516-21.
*** 10 pts with gynecologic cancer. Compared 3 plans: 1) standard 4-field, 2) IMRT (sparing normal tissues but not bone marrow), and 3) bone-marrow sparing IMRT.
*** Bone marrow sparing IMRT reduced amount of BM treated to >50% of prescription dose from 87.4% (std) and 75.7% (IMRT) to 60%.
** 2002 PMID 12459361 — "Impact of intensity-modulated radiotherapy on acute hematologic toxicity in women with gynecologic malignancies." Brixey CJ et al. Int J Radiat Oncol Biol Phys. 2002 Dec 1;54(5):1388-96.
*** 36 pts with gynecologic cancer, treating the pelvis using IMRT (that did not include bone marrow sparing in the cost function). Compared hematologic toxicity to 88 pts treated with standard fields.
*** No S.S. seen in grade 2 or higher WBC, ANC, and Hgb toxicity (19.4%, 9.1%, and 8.6% IMRT; 21.6%, 8.3%, 9.2% std). No grade 2 platelet toxicity. Significant difference in WBC toxicity for pts treated with chemo: 31.2% vs 60% (IMRT vs std).
*** Standard IMRT planning resulted in less bone marrow being irradiated, particularly in the iliac crests.
# Radiation Oncology/IMRT

* Front Page: Radiation Oncology | RTOG Trials | Randomized Trials

## Intensity-modulated radiation therapy (IMRT)

General:
* IMRT Overview
* Technical concepts
Specific sites:
* Pelvic IMRT
    See also: Radiation Oncology/Prostate/IMRT
# Radiation Oncology/IGRT

* Front Page: Radiation Oncology | RTOG Trials | Randomized Trials
* PMID 15606303
* Magnetic Resonance-guided radiotherapy (MRgRT) (PMID: 31167658): MRL systems overcome the limitations of conventional image-guided radiotherapy, especially in soft tissue, where target and organs at risk need accurate definition
# Radiation Oncology/IMRT/IMRT Overview

* Front Page: Radiation Oncology | RTOG Trials | Randomized Trials
This section is about how intensity-modulated radiation therapy (IMRT) works (in brief) and the history of IMRT. More technical aspects of IMRT should be placed in the section Radiation Oncology:IMRT Technical. Clinical results of IMRT should be placed elsewhere.

## History
### Timeline of IMRT

* 1992 - 1994 - proprietary IMRT development at NOMOS (initially named VISUS Medical Devices, then Cognos*centi, then NOMOS)
* 1994 - NOMOS PEACOCK system (first patient treated in 1994 at The Methodist Hospital, Houston, TX, USA)
* 1996 - First IMRT treatment with a conventional linac equipped with a multileaf collimator (MLC)

### NOMOS PEACOCK

The introduction of a commercial IMRT system into popular use began with the PEACOCK system produced by the NOMOS Corporation (Pennsylvania, USA). The PEACOCK system consists of the MIMiC, which is a "bolt-on" multileaf collimator, and a dedicated treatment planning system. Treatment with the PEACOCK is described as "serial tomotherapy" in which the treatment is delivered using non-overlapping arcs (thus "tomo" or slice therapy) with couch movement occurring between each arc (thus "serial").

## Guidelines

Guidelines for the implementation and quality assurance for IMRT.
* NCI Guidelines on the Use of IMRT in Clinical Trials:
** (July 25, 2006) "ATC Guidelines for the use of IMRT" - PDF
** (Jan 14, 2005) "The National Cancer Institute Guidelines for the Use of Intensity-Modulated Radiation Therapy in Clinical Trials" - PDF
* Advanced Technology Consortium (ATC):
** 2004 - PMID 15234063 — "Credentialing of institutions for IMRT in clinical trials." Int J Radiat Oncol Biol Phys. 2004 Jul 15;59(4):1257-9

## References

* Beavis A W. Is tomotherapy the future of IMRT? The British Journal of Radiology 77 (2004), 285-295. (PMID 15107318)