This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Accompanies (http://iank.it/pluggable-filters-for-django-rest-framework/) | |
class FiltersBackendBase: | |
""" | |
Base class to create FilterBackends | |
FilterBackends are complementary classes that can be | |
used with GenericFilterMixin | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from true_type import get_type | |
import csv | |
def get_percentile(data_list, score, kind='weak'): | |
""" | |
The percentile rank of a score relative to a list of scores. | |
A percentile of, for example, 80 percent means that 80 percent of the | |
scores in the data_list are below the given score. | |
In the case of gaps or ties, the exact definition depends on the type |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from real_type import get_type | |
#real type can be taken from https://github.com/ankitml/real_type or https://pypi.python.org/pypi/real_type/0.1 | |
def read_multiple_csv(files, key_header): | |
""" | |
takes a list of filesnames and a key_header string to merge the files. | |
Can merge if there are different columns in the files, different records in | |
the files. | |
Assumption - all the files should have the column named key_header | |
example : files = ['grades.csv', 'previous_grades.csv'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
/** | |
* | |
* Connect to the database defined in config file. | |
* @return - mysqli link object, Flase if error. | |
* | |
*/ | |
function connect_db() { | |
global $CFG; |
NewerOlder