hexsha
stringlengths
40
40
size
int64
5
2.06M
ext
stringclasses
10 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
3
248
max_stars_repo_name
stringlengths
5
125
max_stars_repo_head_hexsha
stringlengths
40
78
max_stars_repo_licenses
listlengths
1
10
max_stars_count
int64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
3
248
max_issues_repo_name
stringlengths
5
125
max_issues_repo_head_hexsha
stringlengths
40
78
max_issues_repo_licenses
listlengths
1
10
max_issues_count
int64
1
67k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
3
248
max_forks_repo_name
stringlengths
5
125
max_forks_repo_head_hexsha
stringlengths
40
78
max_forks_repo_licenses
listlengths
1
10
max_forks_count
int64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
5
2.06M
avg_line_length
float64
1
1.02M
max_line_length
int64
3
1.03M
alphanum_fraction
float64
0
1
count_classes
int64
0
1.6M
score_classes
float64
0
1
count_generators
int64
0
651k
score_generators
float64
0
1
count_decorators
int64
0
990k
score_decorators
float64
0
1
count_async_functions
int64
0
235k
score_async_functions
float64
0
1
count_documentation
int64
0
1.04M
score_documentation
float64
0
1
dd99b6d2cdd53e9871b02f6e724fb47ac13372e3
12,973
py
Python
programs/loadsheet/loadsheet.py
admin-db/OnboardingTools
0f9d363d461df8c01e99157386338633828f5f92
[ "Apache-2.0" ]
3
2021-04-24T14:39:50.000Z
2021-07-20T17:11:19.000Z
programs/loadsheet/loadsheet.py
admin-db/OnboardingTools
0f9d363d461df8c01e99157386338633828f5f92
[ "Apache-2.0" ]
2
2020-07-22T21:34:33.000Z
2021-01-14T19:26:12.000Z
programs/loadsheet/loadsheet.py
admin-db/OnboardingTools
0f9d363d461df8c01e99157386338633828f5f92
[ "Apache-2.0" ]
2
2020-07-16T03:34:35.000Z
2020-07-22T21:18:12.000Z
#Copyright 2020 DB Engineering #Licensed under the Apache License, Version 2.0 (the "License"); #you may not use this file except in compliance with the License. #You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 #Unless required by applicable law or agreed to in writing, software #distributed under the License is distributed on an "AS IS" BASIS, #WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #See the License for the specific language governing permissions and #limitations under the License. __version__ = '0.0.3' __author__ = 'Trevor S., Shane S., Andrew K.' # Standard Packages import os import sys import string from typing import Optional from typing import Union from typing import Dict from typing import List from typing import Any # Open-source Packages import openpyxl import pandas as pd sys.path.append('../') # Proprietary Packages from rules.rules import Rules # Module GOBAL and CONTRAINTS # 01132021: bms specific _REQ_INPUT_HEADERS_BMS = [ 'objectid', 'deviceid', 'objectname' ] # 01132021: general _REQ_INPUT_HEADERS = _REQ_INPUT_HEADERS_BMS + ['units', 'objecttype'] _REQ_OUTPUT_HEADERS = [ 'required', 'manuallymapped', 'building', 'generaltype', 'typename', 'assetname', 'fullassetpath', 'standardfieldname' ] class Loadsheet: """ Loadsheet Library Purpose: The Loadsheet Library (loadsheet.py) is a proprietary class used to load a loadsheet Excel file into the tool Args: data - the list of dictionaries making up the loadsheet file Keys are column names, values are column values Returns: Loadsheet object Usage Example(s): 1) From records: data = {'coln1':[1,2,3], 'coln2':['a','b','c']} ls = Loadsheet(data) 2) From loadsheet excel file*: ls = Loadsheet.from_loadsheet(<loadsheet_file_path>) 3) From BMS file*: ls = Loadsheet.from_bms(<bms_file_path>) * - By default, expects header row at top Dependencies: Standard - os - sys Open-source - openpyxl - yaml - typing Proprietary - rules TODOs: - ini_config not used but will be added in future - all rows will have same headers, so add header check """ def __init__( self, data: List[Dict[str,Any]], std_header_map: Dict[str,str], #has_normalized_fields: bool= False, ): # 01132021: moved this check to import format specific method(s) # currently a quick fix for a much broader update refactor # that needs to be done # assert Loadsheet._is_valid_headers(data[0].keys(), has_normalized_fields) == True,\ # "[ERROR] loadsheet headers:\n {} \ndo not match configuration \ # headers:\n {}".format(', '.join(data[0].keys()),', '.join( # *[_REQ_INPUT_HEADERS+_REQ_OUTPUT_HEADERS if has_normalized_fields # else _REQ_INPUT_HEADERS])) # # end by sypks self._data = data self._std_header_map = std_header_map @classmethod def from_loadsheet( cls, filepath: str, has_normalized_fields: bool= False ): """ Initializes loadsheet object from existing loadsheet Excel file args: filepath - absolute filepath to loadsheet excel file has_normalized_fields - flag if has normalized fields returns: loadsheet object """ # hardcode header rows as [0] for initial release valid_file_types = { '.xlsx':'excel', '.csv':'bms_file' } file_type = os.path.splitext(filepath)[1] if file_type == '.xlsx': df = pd.read_excel(filepath, header= 0) elif file_type == '.csv': df = pd.read_csv(filepath, header= 0) std_header_map = Loadsheet._to_std_header_mapping( df.columns) df.columns = std_header_map.keys() # 01132021: check to ensure that document has required headers if not Loadsheet._is_valid_headers( df.columns, _REQ_INPUT_HEADERS, has_normalized_fields ): raise RuntimeError("[ERROR] Loadsheet headers:\n {} \nDoes not match " + "configuration headers:\n {}".format(', '.join(df.columns.tolist()),', '.join( *[_REQ_INPUT_HEADERS+_REQ_OUTPUT_HEADERS if has_normalized_fields else _REQ_INPUT_HEADERS]))) return cls( df.to_dict('records'), std_header_map ) # end by sypks @classmethod def from_bms( cls, filepath: str ): """ Initializes loadsheet object from existing BMS file args: filepath - absolute filepath to BMS file ini_config_filepath - not currently enabled, do not use returns: loadsheet object """ # hardcode header as row 0 for inital release df = pd.read_csv(filepath, header= 0) std_header_map = Loadsheet._to_std_header_mapping( df.columns) df.columns = std_header_map.keys() # 01132021: check to ensure that document has required headers if not Loadsheet._is_valid_headers( df.columns, _REQ_INPUT_HEADERS_BMS ): raise RuntimeError("[ERROR] BMS headers:\n {} \nDoes not match " "configuration headers:\n {}".format(', '.join(df.columns.tolist()),', '.join( _REQ_INPUT_HEADERS_BMS))) return cls( df.to_dict('records'), std_header_map ) # end by sypks def _rename_to_std(df): df.columns = self._std_header_map.values() @staticmethod def _to_std_headers(headers: List[str]) -> List[str]: ''' Removes all punctuation characters, spaces, and converts to all lowercase characters. Returns standardized headers to be used internally ''' delete_dict = {sp_char: '' for sp_char in string.punctuation} delete_dict[' '] = '' # space char not in sp_char by default trans_table = str.maketrans(delete_dict) return [sh.translate(trans_table).lower() for sh in headers] @staticmethod def _is_valid_headers( headers: List[str], required_input_headers: List[str], has_normalized_fields: bool= False ) -> bool: ''' Checks column names from loadsheet or BMS file are valid as defined in _REQ_INPUT_HEADERS and _REQ_OUTPUT_HEADERS ''' trans_headers = Loadsheet._to_std_headers(headers) if has_normalized_fields: return set(required_input_headers+_REQ_OUTPUT_HEADERS) == \ set(required_input_headers+_REQ_OUTPUT_HEADERS).intersection( set(trans_headers)) else: return set(required_input_headers) == \ set(required_input_headers).intersection(set(trans_headers)) @staticmethod def _to_std_header_mapping( orig_headers: List[str] ) -> Dict[str,str]: ''' Creates a dict mapping from orig headers to strandardized headers used interally ''' std_headers = Loadsheet._to_std_headers(orig_headers) return {std: orig for (std,orig) in zip(std_headers,orig_headers)} def get_std_header( self, header: str ) -> str: """ Returns standardized header used internally based on the document header passed in """ return self._std_header_map[header] def get_data_row( self, row: int ) -> Dict[str, Any]: pass def get_data_row_generator(self): pass def export_to_loadsheet(self, output_filepath): """ exports data in Loadsheet object to excel file args: output_filepath - location and name of excel file output """ df = pd.DataFrame.from_records(self._data) df.columns = [self._std_header_map[c] for c in df.columns] df.to_excel(output_filepath, index=False) def validate( self, non_null_fields: Optional[List[str]]= None ): """ Perform loadsheet validation. It will not validate the contents of the loadsheet, in terms of validity of entries, but will validate that all required fields are filled in and that no data is missing; the representations layer will handle the ontology checks. Checks: 1) Required is always in {YES, NO} 2) non-null fields are filled in where required is YES 3) there are no duplicate fullAssetPath-standardFieldName pairs Args: non_null_fields - fields that are checked to have values in step 2 by default set to None to use the following: 'building', 'generalType', 'assetName', 'fullAssetPath', 'standardFieldName', 'deviceId', 'objectType', 'objectId', 'units' Returns: None, but throws errors if any issues encountered """ # non_null_fields arg included for future user definied check to # be implemented. Initial commit does not implement this feature # Therefore we use the hardcoded non_null_fields below if non_null_fields is None: non_null_fields = [ 'building', 'generaltype', 'assetname', 'fullassetpath', 'standardfieldname', 'deviceid', 'objecttype', 'objectid', 'units' ] # convert self._data to pd.DataFrame (we will transistion to # using only dataframes internally in a future update) df = pd.DataFrame.from_records(self._data) #required is always in [YES, NO] assert self._ensure_required_correct(df), "Unacceptable values in required column" #check for null field_details null_fields = self._find_null_fields(df, non_null_fields) assert len(null_fields) == 0, '\n'.join( ["There are rows with missing fields:"]+ [f"\t\t{uid + 2}" for uid in null_fields] ) #check for duplicate fullAssetPath-standardFieldName combos repeat_uid = self._get_duplicate_asset_fields(df) assert len(repeat_uid) == 0, '\n'.join( ["There are duplicated asset-field combinations:"]+ [f"\t\t{uid}" for uid in repeat_uid] ) def validate_without_errors( self, non_null_fields: Optional[List[str]]= None ): """ Perform loadsheet validation as in validate but prints error messages instead of throwing errors """ # non_null_fields arg included for future user definied check to # be implemented. Initial commit does not implement this feature # Therefore we use the hardcoded non_null_fields below if non_null_fields is None: non_null_fields = [ 'building', 'generaltype', 'assetname', 'fullassetpath', 'standardfieldname', 'deviceid', 'objecttype', 'objectid', 'units' ] # convert self._data to pd.DataFrame (we will transistion to # using only dataframes internally in a future update) df = pd.DataFrame.from_records(self._data) #required is always in [YES, NO] if not self._ensure_required_correct(df): print("[ERROR]\tUnacceptable values in required column") #check for null field_details null_fields = self._find_null_fields(df, non_null_fields) if len(null_fields) > 0: print(f"[ERROR]\tThere are rows with missing fields:") for uid in null_fields: print(f"\t\t{uid}") #check for duplicate fullAssetPath-standardFieldName combos repeat_uid = self._get_duplicate_asset_fields(df) if len(repeat_uid) > 0: print(f"[ERROR]\tThere are duplicated asset-field combinations:") for uid in repeat_uid: print(f"\t\t{uid}") @staticmethod def _ensure_required_correct( data: pd.DataFrame ) -> bool: ''' checks that required is in {YES, NO} ''' return len(data[~data['required'].isin(['YES', 'NO'])]) == 0 @staticmethod def _find_null_fields( data: pd.DataFrame, non_null_fields: list ) -> List[str]: ''' Checks for null fields in any row marked required = YES ''' needed_columns = ['required'] needed_columns.extend(non_null_fields) relevant_df = data[needed_columns] relevant_df = relevant_df[relevant_df['required'] == 'YES'] null_data = relevant_df[relevant_df.isnull().any(axis=1)] return null_data.index.tolist() @staticmethod def _get_duplicate_asset_fields( data: pd.DataFrame ) -> List[str]: ''' finds and returns a list of duplicate FullAssetPath-StandardFieldName pairs ''' data['uid'] = data['fullassetpath'] + ' ' + data['standardfieldname'] df = data[data['required'] == 'YES'] counts = df['uid'].value_counts() df_counts = pd.DataFrame({'uid':counts.index, 'amt':counts.values}) repeat_uid = df_counts[df_counts['amt'] > 1]['uid'].tolist() return repeat_uid def apply_rules( self, rule_file: Dict ) -> None: """ Apply rules to the dataset. Will ignore any field where manuallyMapped is set to YES. args: - rule_file: path to the rule file returns: N/A Note - See rules/rules.py for further information """ r = Rules(rule_file) for row in self._data: #add output headers for output_header in _REQ_OUTPUT_HEADERS: if output_header not in row.keys(): row[output_header] = "" self._std_header_map[output_header] = output_header #add manuallyMapped if 'manuallymapped'not in row.keys(): row['manuallymapped'] = '' self._std_header_map['manuallymapped'] = "manuallymapped" #skip manuallyMapped rows if row['manuallymapped'] == 'YES': continue #apply rules else: r.ApplyRules(row) if __name__ == '__main__': k = Loadsheet.from_bms(r'C:\Users\ShaneSpencer\Downloads\OnboardingTool-master\OnboardingTool-master\resources\bms_exports\alc\US-MTV-1395.csv')
27.427061
145
0.697757
11,459
0.883296
0
0
4,658
0.359053
0
0
7,036
0.542357
dd9b08662b0371253cd734386bb9a5108ab7a965
59,491
py
Python
anita.py
utkarsh009/Bnita
0f8ea0b389907f835685c572194b1eb5580a6286
[ "BSD-3-Clause" ]
2
2017-06-12T05:40:48.000Z
2017-06-23T17:09:51.000Z
anita.py
utkarsh009/Bnita
0f8ea0b389907f835685c572194b1eb5580a6286
[ "BSD-3-Clause" ]
null
null
null
anita.py
utkarsh009/Bnita
0f8ea0b389907f835685c572194b1eb5580a6286
[ "BSD-3-Clause" ]
null
null
null
# # This is the library part of Anita, the Automated NetBSD Installation # and Test Application. # import os import pexpect import re import string import subprocess import sys import time import urllib import urlparse __version__='1.40' # Your preferred NetBSD FTP mirror site. # This is used only by the obsolete code for getting releases # by number, not by the recommended method of getting them by URL. # See http://www.netbsd.org/mirrors/#ftp for the complete list. netbsd_mirror_url = "ftp://ftp.netbsd.org/pub/NetBSD/" #netbsd_mirror_url = "ftp://ftp.fi.NetBSD.org/pub/NetBSD/" arch_qemu_map = { 'i386': 'qemu-system-i386', 'amd64': 'qemu-system-x86_64', 'sparc': 'qemu-system-sparc', # The following ones don't actually work 'sparc64': 'qemu-system-sparc64', 'macppc': 'qemu-system-ppc', } # External commands we rely on if os.uname()[0] == 'NetBSD': makefs = ["makefs", "-t", "cd9660", "-o", "rockridge"] elif os.uname()[0] == 'FreeBSD': makefs = ["mkisofs", "-r", "-o"] elif os.uname()[0] == 'Darwin': makefs = ["hdiutil", "makehybrid", "-iso", "-o"] else: # Linux distributions differ. Ubuntu has genisoimage # and mkisofs (as an alias of genisoimage); CentOS has # mkisofs only. Debian 7 has genisoimage only. if os.path.isfile('/usr/bin/genisoimage'): makefs = ["genisoimage", "-r", "-o"] else: makefs = ["mkisofs", "-r", "-o"] fnull = open(os.devnull, 'w') # Return true if the given program (+args) can be successfully run def try_program(argv): try: result = subprocess.call(argv, stdout = fnull, stderr = fnull) return result == 0 except OSError: return False # Create a directory if missing def mkdir_p(dir): if not os.path.isdir(dir): os.makedirs(dir) # Run a shell command safely and with error checking def spawn(command, args): print command, ' '.join(args[1:]) ret = os.spawnvp(os.P_WAIT, command, args) if ret != 0: raise RuntimeError("could not run " + command) # Subclass pexpect.spawn to add logging of expect() calls class pexpect_spawn_log(pexpect.spawn): def __init__(self, logf, *args, **kwargs): self.structured_log_f = logf return super(pexpect_spawn_log, self).__init__(*args, **kwargs) def expect(self, pattern, *args, **kwargs): print >>self.structured_log_f, "expect(" + repr(pattern) + ")" r = pexpect.spawn.expect(self, pattern, *args, **kwargs) print >>self.structured_log_f, "match(" + repr(self.match.group(0)) + ")" return r # Subclass urllib.FancyURLopener so that we can catch # HTTP 404 errors class MyURLopener(urllib.FancyURLopener): def http_error_default(self, url, fp, errcode, errmsg, headers): raise IOError, 'HTTP error code %d' % errcode def my_urlretrieve(url, filename): r = MyURLopener().retrieve(url, filename) if sys.version_info >= (2, 7, 12): # Work around https://bugs.python.org/issue27973 urllib.urlcleanup() return r # Download a file, cleaning up the partial file if the transfer # fails or is aborted before completion. def download_file(file, url, optional = False): try: print "Downloading", url + "...", sys.stdout.flush() my_urlretrieve(url, file) print "OK" sys.stdout.flush() except IOError, e: if optional: print "missing but optional, so that's OK" else: print e sys.stdout.flush() if os.path.exists(file): os.unlink(file) raise # Create a file of the given size, containing NULs, without holes. def make_dense_image(fn, size): f = open(fn, "w") blocksize = 64 * 1024 while size > 0: chunk = min(size, blocksize) f.write("\000" * chunk) size = size - chunk f.close() # Parse a size with optional k/M/G/T suffix and return an integer def parse_size(size): m = re.match(r'(\d+)([kMGT])?$', size) if not m: raise RuntimeError("%s: invalid size" % size) size, suffix = m.groups() mult = dict(k=1024, M=1024**2, G=1024**3, T=1024**4).get(suffix, 1) return int(size) * mult # Download "url" to the local file "file". If the file already # exists locally, do nothing. If "optional" is true, ignore download # failures and cache the absence of a missing file by creating a marker # file with the extension ".MISSING". def download_if_missing_2(url, file, optional = False): if os.path.exists(file): return if os.path.exists(file + ".MISSING"): return dir = os.path.dirname(file) mkdir_p(dir) try: download_file(file, url, optional) except: if optional: f = open(file + ".MISSING", "w") f.close() else: raise # As above, but download a file from the download directory tree # rooted at "urlbase" into a mirror tree rooted at "dirbase". The # file name to download is "relfile", which is relative to both roots. def download_if_missing(urlbase, dirbase, relfile, optional = False): url = urlbase + relfile file = os.path.join(dirbase, relfile) return download_if_missing_2(url, file, optional) def download_if_missing_3(urlbase, dirbase, relpath, optional = False): url = urlbase + "/".join(relpath) file = os.path.join(*([dirbase] + relpath)) return download_if_missing_2(url, file, optional) # Map a URL to a directory name. No two URLs should map to the same # directory. def url2dir(url): tail = [] def munge(match): index = string.find("/:+-", match.group()) if index != 0: tail.append(chr(0x60 + index) + str(match.start())) return "-" return "work-" + re.sub("[/:+-]", munge, url) + "+" + "".join(tail) # Inverse of the above; not used, but included just to show that the # mapping is invertible and therefore collision-free class InvalidDir(Exception): pass def dir2url(dir): match = re.match(r"(work-)(.*)\+(.*)", dir) work, s, tail = match.groups() if work != 'work-': raise InvalidDir() s = re.sub("-", "/", s) chars = list(s) while True: m = re.match(r"([a-z])([0-9]+)", tail) if not m: break c, i = m.groups() chars[int(i)] = "/:+-"[ord(c) - 0x60] tail = tail[m.end():] return "".join(chars) def check_arch_supported(arch, dist_type): if arch_qemu_map.get(arch) is None: raise RuntimeError(("'%s' is not the name of a " + \ "supported NetBSD port") % arch) if (arch == 'i386' or arch == 'amd64') and dist_type != 'reltree': raise RuntimeError(("NetBSD/%s must be installed from " + "a release tree, not an ISO") % arch) if (arch == 'sparc') and dist_type != 'iso': raise RuntimeError(("NetBSD/%s must be installed from " + "an ISO, not a release tree") % arch) # Expect any of a set of alternatives. The *args are alternating # patterns and actions; an action can be a string to be sent # or a function to be called with no arguments. The alternatives # will be expected repeatedly until the last one in the list has # been selected. def expect_any(child, *args): # http://stackoverflow.com/questions/11702414/split-a-list-into-half-by-even-and-odd-elements patterns = args[0:][::2] actions = args[1:][::2] while True: r = child.expect(list(patterns)) action = actions[r] if isinstance(action, str): child.send(action) else: action() if r == len(actions) - 1: break ############################################################################# # A NetBSD version. # # Subclasses should define: # # dist_url(self) # the top-level URL for the machine-dependent download tree where # the version can be downloaded, for example, # ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-5.0.2/i386/ # # mi_url(self) # The top-level URL for the machine-independent download tree, # for example, ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-5.0.2/ # # default_workdir(self) # a file name component identifying the version, for use in # constructing a unique, version-specific working directory # # arch(self) # the name of the machine architecture the version is for, # e.g., i386 def make_item(t): d = dict(zip(['filename', 'label', 'install'], t[0:3])) if isinstance(t[3], list): d['group'] = make_set_dict_list(t[3]) else: d['optional'] = t[3] return d def make_set_dict_list(list_): return [make_item(t) for t in list_] def flatten_set_dict_list(list_): def item2list(item): group = item.get('group') if group: return group else: return [item] return sum([item2list(item) for item in list_], []) class Version: # Information about the available installation file sets. As the # set of sets (sic) has evolved over time, this actually represents # the union of those sets of sets, in other words, this list should # contain all currently and historically known sets. # # This list is used for to determine # - Which sets we should attempt to download # - Which sets we should install by default # # Each array element is a tuple of four fields: # - the file name # - a regular expression matching the label used by sysinst # (taking into account that it may differ between sysinst versions) # - a flag indicating that the set should be installed by default # - a flag indicating that the set is not present in all versions # sets = make_set_dict_list([ [ 'kern-GENERIC', 'Kernel (GENERIC)', 1, 0 ], [ 'kern-GENERIC.NOACPI', 'Kernel \(GENERIC\.NOACPI\)', 0, 1 ], [ 'modules', 'Kernel [Mm]odules', 1, 1 ], [ 'base', 'Base', 1, 0 ], [ 'etc', '(System)|(System configuration files)|(Configuration files) \(/etc\)', 1, 0 ], [ 'comp', 'Compiler [Tt]ools', 1, 0 ], [ 'games', 'Games', 0, 0 ], [ 'man', '(Online )?Manual [Pp]ages', 0, 0 ], [ 'misc', 'Miscellaneous', 1, 0 ], [ 'tests', 'Test programs', 1, 1 ], [ 'text', 'Text [Pp]rocessing [Tt]ools', 0, 0 ], [ '_x11', 'X11 sets', 0, [ ['xbase', 'X11 base and clients', 0, 1 ], ['xcomp', 'X11 programming', 0, 1 ], ['xetc', 'X11 configuration', 0, 1 ], ['xfont', 'X11 fonts', 0, 1 ], ['xserver', 'X11 servers', 0, 1 ], ]], [ '_src', 'Source (and debug )?sets', 0, [ ['syssrc', 'Kernel sources', 0, 1], ['src', 'Base sources', 0, 1], ['sharesrc', 'Share sources', 0, 1], ['gnusrc', 'GNU sources', 0, 1], ['xsrc', 'X11 sources', 0, 1], ['debug', '(debug sets)|(Debug symbols)', 0, 1], ['xdebug', '(debug X11 sets)|(X11 debug symbols)', 0, 1], ]] ]) flat_sets = flatten_set_dict_list(sets) def __init__(self, sets = None): self.tempfiles = [] if sets is not None: if not any([re.match('kern-', s) for s in sets]): raise RuntimeError("no kernel set specified") # Create a Python set containing the names of the NetBSD sets we # want for O(1) lookup. Yes, the multiple meansings of the word # "set" here are confusing. sets_wanted = set(sets) for required in ['base', 'etc']: if not required in sets_wanted: raise RuntimeError("the '%s' set is required", required) for s in self.flat_sets: s['install'] = (s['filename'] in sets_wanted) sets_wanted.discard(s['filename']) if len(sets_wanted): raise RuntimeError("no such set: " + sets_wanted.pop()) def set_workdir(self, dir): self.workdir = dir # The directory where we mirror files needed for installation def download_local_mi_dir(self): return self.workdir + "/download/" def download_local_arch_dir(self): return self.download_local_mi_dir() + self.arch() + "/" # The path to the install ISO image def iso_path(self): return os.path.join(self.workdir, self.iso_name()) # The directory for the install floppy images def floppy_dir(self): return os.path.join(self.download_local_arch_dir(), "installation/floppy") def boot_iso_dir(self): return os.path.join(self.download_local_arch_dir(), "installation/cdrom") def boot_from_default(self): return None def scratch_disk(self): arch = self.arch() if arch == 'i386' or arch == 'amd64': return "wd1d" else: return "sd1c" def xen_kernel(self): arch = self.arch() if arch == 'i386': return 'netbsd-XEN3PAE_DOMU.gz' elif arch == 'amd64': return 'netbsd-XEN3_DOMU.gz' else: return None def xen_install_kernel(self): arch = self.arch() if arch == 'i386': return 'netbsd-INSTALL_XEN3PAE_DOMU.gz' elif arch == 'amd64': return 'netbsd-INSTALL_XEN3_DOMU.gz' else: return None # The list of boot floppies we should try downloading; # not all may actually exist. amd64 currently has five, # i386 has three, and older versions may have fewer. # Add a couple extra to accomodate future growth. def potential_floppies(self): return ['boot-com1.fs'] + ['boot%i.fs' % i for i in range(2, 8)] # The list of boot floppies we actually have def floppies(self): return [f for f in self.potential_floppies() \ if os.path.exists(os.path.join(self.floppy_dir(), f))] def boot_isos(self): return ['boot-com.iso'] def cleanup(self): for fn in self.tempfiles: os.unlink(fn) def set_path(self, setname): if re.match(r'.*src$', setname): return ['source', 'sets', setname + '.tgz'] else: return [self.arch(), 'binary', 'sets', setname + '.tgz'] # Download this release # The ISO class overrides this to download the ISO only def download(self): # Depending on the NetBSD version, there may be two or more # boot floppies. Treat any floppies past the first two as # optional files. i = 0 for floppy in self.potential_floppies(): download_if_missing_3(self.dist_url(), self.download_local_arch_dir(), ["installation", "floppy", floppy], True) i = i + 1 for bootcd in (self.boot_isos()): download_if_missing_3(self.dist_url(), self.download_local_arch_dir(), ["installation", "cdrom", bootcd], True) # These are used with noemu only download_if_missing_3(self.dist_url(), self.download_local_arch_dir(), ["installation", "misc", "pxeboot_ia32.bin"], True) download_if_missing_3(self.dist_url(), self.download_local_arch_dir(), ["binary", "kernel", "netbsd-INSTALL.gz"], True) for set in self.flat_sets: if set['install']: download_if_missing_3(self.mi_url(), self.download_local_mi_dir(), self.set_path(set['filename']), set['optional']) # Create an install ISO image to install from def make_iso(self): self.download() spawn(makefs[0], makefs + \ [self.iso_path(), self.download_local_mi_dir()]) self.tempfiles.append(self.iso_path()) # Get the architecture name. This is a hardcoded default for use # by the obsolete subclasses; the "URL" class overrides it. def arch(self): return "i386" # Backwards compatibility with Anita 1.2 and older def install(self): Anita(dist = self).install() def boot(self): Anita(dist = self).boot() def interact(self): Anita(dist = self).interact() # Subclass for versions where we pass in the version number explicitly class NumberedVersion(Version): def __init__(self, ver, **kwargs): Version.__init__(self, **kwargs) self.ver = ver # The file name of the install ISO (sans directory) def iso_name(self): if re.match("^[3-9]", self.ver) is not None: return "i386cd-" + self.ver + ".iso" else: return "i386cd.iso" # The directory for files related to this release def default_workdir(self): return "netbsd-" + self.ver # An official NetBSD release class Release(NumberedVersion): def __init__(self, ver, **kwargs): NumberedVersion.__init__(self, ver, **kwargs) pass def mi_url(self): return netbsd_mirror_url + "NetBSD-" + self.ver + "/" def dist_url(self): return self.mi_url() + self.arch() + "/" # A daily build class DailyBuild(NumberedVersion): def __init__(self, branch, timestamp, **kwargs): ver = re.sub("^netbsd-", "", branch) NumberedVersion.__init__(self, ver, **kwargs) self.timestamp = timestamp def default_workdir(self): return NumberedVersion.default_workdir(self) + "-" + self.timestamp def dist_url(self): branch = re.sub("[\\._]", "-", self.ver) if re.match("^[0-9]", branch): branch = "netbsd-" + branch return "http://ftp.netbsd.org/pub/NetBSD-daily/" + \ branch + "/" + self.timestamp + "/i386/" # A local build class LocalBuild(NumberedVersion): def __init__(self, ver, release_path, **kwargs): NumberedVersion.__init__(self, ver, **kwargs) self.release_path = release_path def dist_url(self): return "file://" + self.release_path + "/i386/" # The top-level URL of a release tree class URL(Version): def __init__(self, url, **kwargs): Version.__init__(self, **kwargs) self.url = url match = re.match(r'(^.*/)([^/]+)/$', url) if match is None: raise RuntimeError(("URL '%s' doesn't look like the URL of a " + \ "NetBSD distribution") % url) self.url_mi_part = match.group(1) self.m_arch = match.group(2) check_arch_supported(self.m_arch, 'reltree') def dist_url(self): return self.url def mi_url(self): return self.url_mi_part def iso_name(self): return "install_tmp.iso" def default_workdir(self): return url2dir(self.url) def arch(self): return self.m_arch # A local release directory class LocalDirectory(URL): def __init__(self, dir, **kwargs): # This could be optimized to avoid copying the files URL.__init__(self, "file://" + dir, **kwargs) # An URL or local file name pointing at an ISO image class ISO(Version): def __init__(self, iso_url, **kwargs): Version.__init__(self, **kwargs) if re.match(r'/', iso_url): self.m_iso_url = "file://" + iso_url self.m_iso_path = iso_url else: self.m_iso_url = iso_url self.m_iso_path = None # We can't determine the final ISO file name yet because the work # directory is not known at this point, but we can precalculate the # basename of it. self.m_iso_basename = os.path.basename( urllib.url2pathname(urlparse.urlparse(iso_url)[2])) m = re.match(r"(.*)cd.*iso|NetBSD-[0-9\._A-Z]+-(.*).iso", self.m_iso_basename) if m is None: raise RuntimeError("cannot guess architecture from ISO name '%s'" % self.m_iso_basename) if m.group(1) is not None: self.m_arch = m.group(1) if m.group(2) is not None: self.m_arch = m.group(2) check_arch_supported(self.m_arch, 'iso') def iso_path(self): if self.m_iso_path is not None: return self.m_iso_path else: return os.path.join(self.download_local_arch_dir(), self.m_iso_basename) def default_workdir(self): return url2dir(self.m_iso_url) def make_iso(self): self.download() def download(self): if self.m_iso_path is None: download_if_missing_2(self.m_iso_url, self.iso_path()) else: mkdir_p(self.workdir) def arch(self): return self.m_arch def boot_from_default(self): return 'cdrom-with-sets' ############################################################################# # Helper class for killing the DomU when the last reference to the # child process is dropped class DomUKiller: def __init__(self, frontend, name): self.name = name self.frontend = frontend def __del__(self): print "destroying domU", self.name spawn(self.frontend, [self.frontend, "destroy", self.name]) def vmm_is_xen(vmm): return vmm == 'xm' or vmm == 'xl' def slog(fd, tag, data): print >>fd, "%s(%s)" % (tag, repr(data)) def slog_info(fd, data): slog(fd, 'info', data) # A file-like object that escapes unprintable data and prefixes each # line with a tag, for logging I/O. class Logger: def __init__(self, tag, fd): self.tag = tag self.fd = fd def write(self, data): slog(self.fd, self.tag, data) def __getattr__(self, name): return getattr(self.fd, name) # http://stackoverflow.com/questions/616645/how-do-i-duplicate-sys-stdout-to-a-log-file-in-python class multifile(object): def __init__(self, files): self._files = files def __getattr__(self, attr, *args): return self._wrap(attr, *args) def _wrap(self, attr, *args): def g(*a, **kw): for f in self._files: res = getattr(f, attr, *args)(*a, **kw) return res return g class Anita: def __init__(self, dist, workdir = None, vmm = 'qemu', vmm_args = None, disk_size = None, memory_size = None, persist = False, boot_from = None, structured_log = None, structured_log_file = None, no_install = False, test = 'atf'): self.dist = dist if workdir: self.workdir = workdir else: self.workdir = dist.default_workdir() self.structured_log = structured_log self.structured_log_file = structured_log_file if self.structured_log_file: self.structured_log_f = open(self.structured_log_file, "w") self.unstructured_log_f = sys.stdout else: if self.structured_log: self.structured_log_f = sys.stdout self.unstructured_log_f = open("/dev/null", "w") else: self.structured_log_f = open("/dev/null", "w") self.unstructured_log_f = sys.stdout # Set the default disk size if none was given. if disk_size is None: disk_size = "1536M" self.disk_size = disk_size # Set the default memory size if none was given. if memory_size is None: if dist.arch() == 'amd64': memory_size = "128M" else: memory_size = "32M" self.memory_size_bytes = parse_size(memory_size) self.persist = persist self.boot_from = boot_from self.no_install = no_install self.qemu = arch_qemu_map.get(dist.arch()) if self.qemu is None: raise RuntimeError("NetBSD port '%s' is not supported" % dist.arch()) if self.qemu == 'qemu-system-i386' and \ not try_program(['qemu-system-i386', '--version']) \ and try_program(['qemu', '--version']): \ self.qemu = 'qemu' # Backwards compatibility if vmm == 'xen': vmm = 'xm' self.vmm = vmm if vmm_args is None: vmm_args = [] self.extra_vmm_args = vmm_args self.is_logged_in = False self.scratch_disk_args = None self.test = test def slog(self, message): slog_info(self.structured_log_f, message) # Wrapper around pexpect.spawn to let us log the command for # debugging. Note that unlike os.spawnvp, args[0] is not # the name of the command. def pexpect_spawn(self, command, args): print command, " \\\n ".join(args) return pexpect_spawn_log(self.structured_log_f, command, args) # The path to the NetBSD hard disk image def wd0_path(self): return os.path.join(self.workdir, "wd0.img") # Return the memory size rounded up to whole megabytes def memory_megs(self): megs = (self.memory_size_bytes + 2 ** 20 - 1) / 2 ** 20 if megs != self.memory_size_bytes / 2 **20: print >>sys.stderr, \ "warning: rounding up memory size of %i bytes to %i megabytes" \ % (self.memory_size_bytes, megs) return megs def configure_child(self, child): # Log reads from child child.logfile_read = multifile([self.unstructured_log_f, Logger('recv', self.structured_log_f)]) # Log writes to child child.logfile_send = multifile([self.unstructured_log_f, Logger('send', self.structured_log_f)]) child.timeout = 300 child.setecho(False) # Xen installs sometimes fail if we don't increase this # from the default of 0.1 seconds child.delayafterclose = 5.0 # Also increase this just in case child.delayafterterminate = 5.0 self.child = child def start_qemu(self, vmm_args, snapshot_system_disk): child = self.pexpect_spawn(self.qemu, [ "-m", str(self.memory_megs()), "-drive", "file=%s,format=raw,media=disk,snapshot=%s" % (self.wd0_path(), ("off", "on")[snapshot_system_disk]), "-nographic" ] + vmm_args + self.extra_vmm_args) self.configure_child(child) return child def xen_disk_arg(self, path, devno = 0, writable = True): if self.vmm == 'xm': return "disk=file:%s,0x%x,%s" % (path, devno, "rw"[writable]) else: # xl return "disk=file:%s,xvd%s,%s" % (path, chr(ord('a') + devno), "rw"[writable]) def qemu_disk_args(self, path, devno = 0, writable = True, snapshot = False): return ["-drive", "file=%s,format=raw,media=disk,snapshot=%s" % (path, ["off", "on"][snapshot])] def qemu_cdrom_args(self, path, devno): return ["-drive", "file=%s,format=raw,media=cdrom" % (path)] def string_arg(self, name, value): if self.vmm == 'xm': return '%s=%s' % (name, value) else: # xl return '%s="%s"' % (name, value) def start_xen_domu(self, vmm_args): frontend = self.vmm name = "anita-%i" % os.getpid() args = [ frontend, "create", "-c", "/dev/null", self.xen_disk_arg(os.path.abspath(self.wd0_path()), 0, True), "memory=" + str(self.memory_megs()), self.string_arg('name', name) ] + vmm_args + self.extra_vmm_args # Multiple "disk=" arguments are no longer supported with xl; # combine them if self.vmm == 'xl': disk_args = [] no_disk_args = [] for arg in args: if arg.startswith('disk='): disk_args.append(arg[5:]) else: no_disk_args.append(arg) args = no_disk_args + [ "disk=[%s]" % (','.join(["'%s'" % arg for arg in disk_args]))] child = self.pexpect_spawn(args[0], args[1:]) self.configure_child(child) # This is ugly; we reach into the child object and set an # additional attribute. The name of the attribute, # "garbage_collector" below, is arbitrary, but must not # conflict with any existing attribute of the child # object. Its purpose is only to hold a reference to the # DomUKiller object, such that when the child object is # destroyed, the destructor of the DomUKiller object # is also invoked. child.garbage_collector = DomUKiller(frontend, name) return child def start_noemu(self, vmm_args): noemu_always_args = [ '--workdir', self.workdir, '--releasedir', os.path.join(self.workdir, 'download'), '--arch', self.dist.arch() ] child = self.pexpect_spawn('sudo', ['noemu'] + noemu_always_args + vmm_args + self.extra_vmm_args) self.configure_child(child) return child def _install(self): # Download or build the install ISO self.dist.set_workdir(self.workdir) self.dist.make_iso() arch = self.dist.arch() if self.vmm != 'noemu': print "Creating hard disk image...", sys.stdout.flush() make_dense_image(self.wd0_path(), parse_size(self.disk_size)) print "done." # The name of the CD-ROM device holding the sets cd_device = None if vmm_is_xen(self.vmm): # Download XEN kernels xenkernels = [k for k in [self.dist.xen_kernel(), self.dist.xen_install_kernel()] if k] for kernel in xenkernels: download_if_missing_3(self.dist.dist_url(), self.dist.download_local_arch_dir(), ["binary", "kernel", kernel], True) vmm_args = [ self.string_arg('kernel', os.path.abspath(os.path.join(self.dist.download_local_arch_dir(), "binary", "kernel", self.dist.xen_install_kernel()))), self.xen_disk_arg(os.path.abspath(self.dist.iso_path()), 1, False) ] child = self.start_xen_domu(vmm_args) cd_device = 'xbd1d' elif self.vmm == 'qemu': # Determine what kind of media to boot from. floppy_paths = [ os.path.join(self.dist.floppy_dir(), f) \ for f in self.dist.floppies() ] boot_cd_path = os.path.join(self.dist.boot_iso_dir(), self.dist.boot_isos()[0]) if self.boot_from is None: self.boot_from = self.dist.boot_from_default() if self.boot_from is None and len(floppy_paths) == 0: self.boot_from = 'cdrom' if self.boot_from is None: self.boot_from = 'floppy' # Set up VM arguments based on the chosen boot media if self.boot_from == 'cdrom': vmm_args = self.qemu_cdrom_args(boot_cd_path, 1) vmm_args += self.qemu_cdrom_args(self.dist.iso_path(), 2) vmm_args += ["-boot", "d"] cd_device = 'cd1a' elif self.boot_from == 'floppy': vmm_args = self.qemu_cdrom_args(self.dist.iso_path(), 1) if len(floppy_paths) == 0: raise RuntimeError("found no boot floppies") vmm_args += ["-drive", "file=%s,format=raw,if=floppy" % floppy_paths[0], "-boot", "a"] cd_device = 'cd0a'; elif self.boot_from == 'cdrom-with-sets': # Single CD vmm_args = self.qemu_cdrom_args(self.dist.iso_path(), 1) vmm_args += ["-boot", "d"] cd_device = 'cd0a' child = self.start_qemu(vmm_args, snapshot_system_disk = False) elif self.vmm == 'noemu': child = self.start_noemu(['--boot-from', 'net']) else: raise RuntimeError('unknown vmm %s' % self.vmm) term = None # Do the floppy swapping dance and other pre-sysinst interaction floppy0_name = None while True: # NetBSD/i386 will prompt for a terminal type if booted from a # CD-ROM, but not when booted from floppies. Sigh. child.expect( # Group 1-2 "(insert disk (\d+), and press return...)|" + # Group 3 "(a: Installation messages in English)|" + # Group 4 "(Terminal type)|" + # Group 5 "(Installation medium to load the additional utilities from: )|" # Group 6 "(1. Install NetBSD)" ) if child.match.group(1): # We got the "insert disk" prompt # There is no floppy 0, hence the "- 1" floppy_index = int(child.match.group(2)) - 1 # Escape into qemu command mode to switch floppies child.send("\001c") # We used to wait for a (qemu) prompt here, but qemu 0.9.1 # no longer prints it # child.expect('\(qemu\)') if not floppy0_name: # Between qemu 0.9.0 and 0.9.1, the name of the floppy # device accepted by the "change" command changed from # "fda" to "floppy0" without any provision for backwards # compatibility. Deal with it. Also deal with the fact # that as of qemu 0.15, "info block" no longer prints # "type=floppy" for floppy drives. And in qemu 2.5.0, # the format changed again from "floppy0: " to # "floppy0 (#block544): ", so we no longer match the # colon and space. child.send("info block\n") child.expect(r'\n(fda|floppy0)') floppy0_name = child.match.group(1) # Now we can change the floppy child.send("change %s %s\n" % (floppy0_name, floppy_paths[floppy_index])) # Exit qemu command mode child.send("\001c\n") elif child.match.group(3): # "Installation messages in English" break elif child.match.group(4): # "Terminal type" child.send("xterm\n") term = "xterm" continue elif child.match.group(5): # "Installation medium to load the additional utilities from" # (SPARC) child.send("cdrom\n") child.expect("CD-ROM device to use") child.send("\n") child.expect("Path to instfs.tgz") child.send("\n") child.expect("Terminal type") # The default is "sun", but anita is more likely to run # in an xterm or some other ansi-like terminal than on # a sun console. child.send("xterm\n") term = "xterm" child.expect("nstall/Upgrade") child.send("I\n") elif child.match.group(6): # "1. Install NetBSD" child.send("1\n") # Confirm "Installation messages in English" child.send("\n") # i386 and amd64 ask for keyboard type here; sparc doesn't while True: child.expect("(Keyboard type)|(a: Install NetBSD to hard disk)|" + "(Shall we continue)") if child.match.group(1) or child.match.group(2): child.send("\n") elif child.match.group(3): child.expect("b: Yes") child.send("b\n") break else: raise AssertionError # Depending on the number of disks attached, we get either # "found only one disk" followed by "Hit enter to continue", # or "On which disk do you want to install". child.expect("(Hit enter to continue)|" + "(On which disk do you want to install)") if child.match.group(1): child.send("\n") elif child.match.group(2): child.send("a\n") else: raise AssertionError def choose_no(): child.expect("([a-z]): No") child.send(child.match.group(1) + "\n") def choose_yes(): child.expect("([a-z]): Yes") child.send(child.match.group(1) + "\n") # Keep track of sets we have already handled, by label. # This is needed so that parsing a pop-up submenu is not # confused by earlier output echoing past choices. labels_seen = set() def choose_sets(set_list): sets_this_screen = [] # First parse the set selection screen or popup; it's messy. while True: # Match a letter-label pair, like "h: Compiler Tools", # followed by an installation status of Yes, No, All, # or None. The label can be separated from the "Yes/No" # field either by spaces (at least two, so that there can # be single spaces within the label), or by a cursor # positioning escape sequence. In the case of the # "X11 fonts" set, we strangely get both a single space # and an escape sequence, which seems disoptimal. # # Alternatively, match the special letter "x: " which # is not followed by an installation status. child.expect( "(?:([a-z]): ([^ \x1b]+(?: [^ \x1b]+)*)(?:(?:\s\s+)|(?:\s?\x1b\[\d+;\d+H))(Yes|No|All|None))|(x: )") (letter, label, yesno, exit) = child.match.groups() if exit: if len(sets_this_screen) != 0: break else: for set in set_list: if re.match(set['label'], label) and label not in labels_seen: sets_this_screen.append({ 'set': set, 'letter': letter, 'state': yesno }) labels_seen.add(label) # Then make the actual selections for item in sets_this_screen: set = item['set'] enable = set['install'] state = item['state'] group = set.get('group') if (enable and state == "No" or \ not enable and state == "Yes") \ or group: child.send(item['letter'] + "\n") if group: # Recurse to handle sub-menu choose_sets(group) # Exit the set selection menu child.send("x\n") # Older NetBSD versions show a prompt like [re0] and ask you # to type in the interface name (or enter for the default); # newer versions show a menu. def choose_interface_oldstyle(): self.slog('old-style interface list') # Choose the first non-fwip interface while True: child.expect(r"([a-z]+)([0-9]) ") ifname = child.match.group(1) ifno = child.match.group(2) self.slog('old-style interface: <%s,%s>' % (ifname, ifno)) if ifname != 'fwip': # Found an acceptable interface child.send("%s%s\n" % (ifname, ifno)) break def choose_interface_newstyle(): self.slog('new-style interface list') child.expect('Available interfaces') # Choose the first non-fwip interface while True: # Make sure to match the digit after the interface # name so that we don't accept a partial interface # name like "fw" from "fwip0". child.expect(r"([a-z]): ([a-z]+)[0-9]") if child.match.group(2) != 'fwip': # Found an acceptable interface child.send(child.match.group(1) + "\n") break def configure_network(): child.expect("Network media type") child.send("\n") child.expect("Perform (DHCP )?autoconfiguration") child.expect("([a-z]): No") child.send(child.match.group(1) + "\n") def choose_a(): child.send("a\n") def choose_dns_server(): child.expect("([a-z]): other") child.send(child.match.group(1) + "\n") child.send("10.0.1.1\n") expect_any(child, r"Your host name", "anita-test\n", r"Your DNS domain", "netbsd.org\n", r"Your IPv4 (number)|(address)", "10.169.0.2\n", r"IPv4 Netmask", "255.255.255.0\n", r"IPv4 gateway", "10.169.0.1\n", r"IPv4 name server", "10.0.1.1\n", r"Perform IPv6 autoconfiguration", choose_no, r"Select (IPv6 )?DNS server", choose_dns_server, r"Are they OK", choose_yes) self.network_configured = True self.network_configured = False # Many different things can happen at this point: # # Versions older than 2009/08/23 21:16:17 will display a menu # for choosing the extraction verbosity # # Versions older than 2010/03/30 20:09:25 will display a menu for # choosing the CD-ROM device (newer versions will choose automatically) # # Versions older than Fri Apr 6 23:48:53 2012 UTC will ask # you to "Please choose the timezone", wheras newer ones will # instead as you to "Configure the additional items". # # At various points, we may or may not get "Hit enter to continue" # prompts (and some of them seem to appear nondeterministically) # # i386/amd64 can ask whether to use normal or serial console bootblocks # # Try to deal with all of the possible options. # # We specify a longer timeout than the default here, because the # set extraction can take a long time on slower machines. # # It has happened (at least with NetBSD 3.0.1) that sysinst paints the # screen twice. This can cause problem because we will then respond # twice, and the second response will be interpreted as a response to # a subsequent prompt. Therefore, we check whether the match is the # same as the previous one and ignore it if so. # # OTOH, -current as of 2009.08.23.20.57.40 will issue the message "Hit # enter to continue" twice in a row, first as a result of MAKEDEV # printing a warning messages "MAKEDEV: dri0: unknown device", and # then after "sysinst will give you the opportunity to configure # some essential things first". We match the latter text separately # so that the "Hit enter to continue" matches are not consecutive. # # The changes of Apr 6 2012 broght with them a new redraw problem, # which is worked around using the seen_essential_things variable. # prevmatch = [] seen_essential_things = 0 loop = 0 while True: loop = loop + 1 if loop == 20: raise RuntimeError("loop detected") child.expect( # Group 1 "(a: Progress bar)|" + # Group 2 "(a: CD-ROM)|" + # Group 3-4 "(([cx]): Continue)|" + # Group 5 "(Hit enter to continue)|" + # Group 6 "(b: Use serial port com0)|" + # Group 7 "(Please choose the timezone)|" + # Group 8 "(essential things)|" + # Group 9 "(Configure the additional items)|" + # Group 10 "(Multiple CDs found)|" + # Group 11 "(The following are the http site)|" + # Group 12 "(Is the network information you entered accurate)|" + # Group 13-14 (old-style / new-style) "(I have found the following network interfaces)|(Which network device would you like to use)|" + # Group 15 "(No allows you to continue anyway)|" + # Group 16 r"(Can't connect to)|" + # Group 17 "(not-in-use)|" + # Group 18 "(not-in-use)|" + # Group 19 "(not-in-use)|" + # Group 20-21 "(([a-z]): Custom installation)|" + # Group 22 "(a: This is the correct geometry)|" + # Group 23 "(a: Use one of these disks)|" + # Group 24 "(a: Set sizes of NetBSD partitions)", 10800) if child.match.groups() == prevmatch: self.slog('ignoring repeat match') continue prevmatch = child.match.groups() if child.match.group(1): # (a: Progress bar) child.send("\n") elif child.match.group(2): # (a: CD-ROM) if self.vmm == 'noemu': child.send("c\n") # install from HTTP # We next end up at either "Which device shall I" # or "The following are the http site" depending on # the NetBSD version. else: child.send("a\n") # install from CD-ROM elif child.match.group(3): # CDROM device selection if cd_device != 'cd0a': child.send("a\n" + cd_device + "\n") # (([cx]): Continue) # In 3.0.1, you type "c" to continue, whereas in -current, # you type "x". Handle both cases. child.send(child.match.group(4) + "\n") elif child.match.group(5): # (Hit enter to continue) if seen_essential_things >= 2: # This must be a redraw pass else: child.send("\n") elif child.match.group(6): # (b: Use serial port com0) child.send("bx\n") elif child.match.group(7): # (Please choose the timezone) # "Press 'x' followed by RETURN to quit the timezone selection" child.send("x\n") # The strange non-deterministic "Hit enter to continue" prompt has # also been spotted after executing the sed commands to set the # root password cipher, with 2010.10.27.10.42.12 source. while True: child.expect("(([a-z]): DES)|(root password)|(Hit enter to continue)") if child.match.group(1): # DES child.send(child.match.group(2) + "\n") elif child.match.group(3): # root password break elif child.match.group(4): # (Hit enter to continue) child.send("\n") else: raise AssertionError # Don't set a root password child.expect("b: No") child.send("b\n") child.expect("a: /bin/sh") child.send("\n") # "The installation of NetBSD-3.1 is now complete. The system # should boot from hard disk. Follow the instructions in the # INSTALL document about final configuration of your system. # The afterboot(8) manpage is another recommended reading; it # contains a list of things to be checked after the first # complete boot." # # We are supposed to get a single "Hit enter to continue" # prompt here, but sometimes we get a weird spurious one # after running chpass above. while True: child.expect("(Hit enter to continue)|(x: Exit)") if child.match.group(1): child.send("\n") elif child.match.group(2): child.send("x\n") break else: raise AssertionError break elif child.match.group(8): # (essential things) seen_essential_things += 1 elif child.match.group(9): # (Configure the additional items) child.expect("x: Finished configuring") child.send("x\n") break elif child.match.group(10): # (Multiple CDs found) # This happens if we have a boot CD and a CD with sets; # we need to choose the latter. child.send("b\n") elif child.match.group(11): # (The following are the http site) # \027 is control-w, which clears the field child.send("a\n\02710.169.0.1\n") # IP address child.send("b\n\027\n") # Directory = empty string if not self.network_configured: child.send("j\n") # Configure network choose_interface_newstyle() configure_network() # We get 'Hit enter to continue' if this sysinst # version tries ping6 even if we have not configured # IPv6 expect_any(child, r'Hit enter to continue', '\r', r'x: Get Distribution', 'x\n') r = child.expect(["Install from", "/usr/bin/ftp"]) if r == 0: # ...and I'm back at the "Install from" menu? # Probably the same bug reported as install/49440. child.send("c\n") # HTTP # And again... child.expect("The following are the http site") child.expect("x: Get Distribution") child.send("x\n") elif r == 1: pass else: assert(0) elif child.match.group(12): # "Is the network information you entered accurate" child.expect("([a-z]): Yes") child.send(child.match.group(1) + "\n") elif child.match.group(13): # "(I have found the following network interfaces)" choose_interface_oldstyle() configure_network() elif child.match.group(14): # "(Which network device would you like to use)" choose_interface_newstyle() configure_network() elif child.match.group(15): choose_no() child.expect("No aborts the install process") choose_yes() elif child.match.group(16): self.slog("network problems detected") child.send("\003") # control-c time.sleep(2) child.send("ifconfig -a\n") time.sleep(2) # would run netstat here but it's not on the install media child.expect("foo") # gather input time.sys.exit(1) elif child.match.group(20): # Custom installation is choice "d" in 6.0, # but choice "c" or "b" in older versions # We could use "Minimal", but it doesn't exist in # older versions. child.send(child.match.group(21) + "\n") # Enable/disable sets. choose_sets(self.dist.sets) # On non-Xen i386/amd64 we first get group 22 or 23, # then group 24; on sparc and Xen, we just get group 24. elif (child.match.group(22) or child.match.group(23)): if child.match.group(22): child.send("\n") elif child.match.group(23): child.send("a\n") child.expect("Choose disk") child.send("0\n") child.expect("b: Use the entire disk") child.send("b\n") while True: child.expect(r'(Your disk currently has a non-NetBSD partition)|' + r'(Do you want to install the NetBSD bootcode)|' + r'(Do you want to update the bootcode)') if child.match.group(1): # Your disk currently has a non-NetBSD partition child.expect("a: Yes") child.send("\n") elif child.match.group(2) or child.match.group(3): # Install or replace bootcode child.expect("a: Yes") child.send("\n") break elif child.match.group(24): # (a: Set sizes of NetBSD partitions) child.send("a\n") child.expect("Accept partition sizes") # Press cursor-down enough times to get to the end of the list, # to the "Accept partition sizes" entry, then press # enter to continue. Previously, we used control-N ("\016"), # but if it gets echoed (which has happened), it is interpreted by # the terminal as "enable line drawing character set", leaving the # terminal in an unusable state. if term == 'xterm': # For unknown reasons, when using a terminal type of "xterm", # sysinst puts the terminal in "application mode", causing the # cursor keys to send a different escape sequence than the default. cursor_down = "\033OB" else: # Use the default ANSI cursor-down escape sequence cursor_down = "\033[B" child.send(cursor_down * 8 + "\n") child.expect("x: Partition sizes ok") child.send("\n") child.expect("Please enter a name for your NetBSD disk") child.send("\n") # "This is your last chance to quit this process..." child.expect("Shall we continue") child.expect("b: Yes") child.send("b\n") # newfs is run at this point else: raise AssertionError # Installation is finished, halt the system. # Historically, i386 and amd64, you get a root shell, # while sparc just halts. # Since Fri Apr 6 23:48:53 2012 UTC, you are kicked # back into the main menu. while True: child.expect("(Hit enter to continue)|(x: Exit Install System)|(#)|(halting machine)|(halted by root)") if child.match.group(1): child.send("\n") elif child.match.group(2): # Back in menu child.send("x\n") elif child.match.group(3): # Root shell prompt child.send("halt\n") else: # group 4 or 5: halted break child.close() # Make sure all refs go away child = None self.child = None self.dist.cleanup() # Install NetBSD if not installed already def install(self): # This is needed for Xen and noemu, where we get the kernel # from the dist rather than the installed image self.dist.set_workdir(self.workdir) if self.vmm == 'noemu': self.dist.download() self._install() else: # Already installed? if os.path.exists(self.wd0_path()): return try: self._install() except: if os.path.exists(self.wd0_path()): os.unlink(self.wd0_path()) raise # Boot the virtual machine (installing it first if it's not # installed already). The vmm_args argument applies when # booting, but not when installing. Does not wait for # a login prompt. def start_boot(self, vmm_args = None): if vmm_args is None: vmm_args = [] if not self.no_install: self.install() if self.vmm == 'qemu': child = self.start_qemu(vmm_args, snapshot_system_disk = not self.persist) # "-net", "nic,model=ne2k_pci", "-net", "user" elif vmm_is_xen(self.vmm): child = self.start_xen_domu(vmm_args + [self.string_arg('kernel', os.path.abspath(os.path.join(self.dist.download_local_arch_dir(), "binary", "kernel", self.dist.xen_kernel())))]) elif self.vmm == 'noemu': child = self.start_noemu(vmm_args + ['--boot-from', 'disk']) else: raise RuntimeError('unknown vmm %s' % vmm) self.child = child return child # Like start_boot(), but wait for a login prompt. def boot(self, vmm_args = None): self.start_boot(vmm_args) self.child.expect("login:") # Can't close child here because we still need it if called from # interact() return self.child # Deprecated def interact(self): child = self.boot() console_interaction(child) def run_tests(self, timeout = 10800): results_by_net = (self.vmm == 'noemu') # Create a scratch disk image for exporting test results from the VM. # The results are stored in tar format because that is more portable # and easier to manipulate than a file system image, especially if the # host is a non-NetBSD system. # # If we are getting the results back by tftp, this file will # be overwritten. scratch_disk_path = os.path.join(self.workdir, "tests-results.img") if vmm_is_xen(self.vmm): scratch_disk = 'xbd1d' else: scratch_disk = self.dist.scratch_disk() mkdir_p(self.workdir) scratch_image_megs = 100 make_dense_image(scratch_disk_path, parse_size('%dM' % scratch_image_megs)) # Leave a 10% safety margin max_result_size_k = scratch_image_megs * 900 if vmm_is_xen(self.vmm): self.scratch_disk_args = [self.xen_disk_arg(os.path.abspath(scratch_disk_path), 1, True)] elif self.vmm == 'qemu': self.scratch_disk_args = self.qemu_disk_args(os.path.abspath(scratch_disk_path), 1, True, False) elif self.vmm == 'noemu': self.scratch_disk_args = [] elif self.scratch_disk_args is None: raise RuntimeError('unknown vmm') child = self.boot(self.scratch_disk_args) self.login() if self.test == "kyua": if self.shell_cmd("grep -q 'MKKYUA.*=.*yes' /etc/release") != 0: raise RuntimeError("kyua is not installed.") test_cmd = ( "kyua " + "--loglevel=error " + "--logfile=/tmp/tests/kyua-test.log " + "test " + "--store=/tmp/tests/store.db; " + "echo $? >/tmp/tests/test.status; " + "kyua " + "report " + "--store=/tmp/tests/store.db " + "| tail -n 3; " + "kyua " + "--loglevel=error " + "--logfile=/tmp/tests/kyua-report-html.log " + "report-html " + "--store=/tmp/tests/store.db " + "--output=/tmp/tests/html; ") elif self.test == "atf": atf_aux_files = ['/usr/share/xsl/atf/tests-results.xsl', '/usr/share/xml/atf/tests-results.dtd', '/usr/share/examples/atf/tests-results.css'] test_cmd = ( "{ atf-run; echo $? >/tmp/tests/test.status; } | " + "tee /tmp/tests/test.tps | " + "atf-report -o ticker:- -o xml:/tmp/tests/test.xml; " + "(cd /tmp && for f in %s; do cp $f tests/; done;); " % ' '.join(atf_aux_files)) else: raise RuntimeError('unknown testing framework %s' % self.test) exit_status = self.shell_cmd( "df -k | sed 's/^/df-pre-test /'; " + "mkdir /tmp/tests && " + "cd /usr/tests && " + test_cmd + ("{ cd /tmp && " + # Make sure the files will fit on the scratch disk "test `du -sk tests | awk '{print $1}'` -lt %d && " % max_result_size_k + # To guard against accidentally overwriting the wrong # disk image, check that the disk contains nothing # but nulls. "test `</dev/r%s tr -d '\\000' | wc -c` = 0 && " % scratch_disk + # "disklabel -W /dev/rwd1d && " + "tar cf /dev/r%s tests; " % scratch_disk + "}; " if not results_by_net else \ "{ cd /tmp && tar cf tests-results.img tests && echo put tests-results.img | tftp 10.169.0.1; };") + "df -k | sed 's/^/df-post-test /'; " + "ps -glaxw | sed 's/^/ps-post-test /'; " + "vmstat -s; " + "sh -c 'exit `cat /tmp/tests/test.status`'", timeout) # We give tar an explicit path to extract to guard against # the possibility of an arbitrary file overwrite attack if # anita is used to test an untrusted virtual machine. tarfile = open(scratch_disk_path, "r") subprocess.call(["tar", "xf", "-", "tests"], cwd = self.workdir, stdin = tarfile) # For backwards compatibility, point workdir/atf to workdir/tests. compat_link = os.path.join(self.workdir, 'atf') if not os.path.lexists(compat_link): os.symlink('tests', compat_link) return exit_status # Backwards compatibility run_atf_tests = run_tests # Log in, if not logged in already def login(self): if self.is_logged_in: return login(self.child) self.is_logged_in = True # Run a shell command def shell_cmd(self, cmd, timeout = -1): self.login() return shell_cmd(self.child, cmd, timeout) # Halt the VM def halt(self): self.login() self.child.send("halt\n") try: # Wait for text confirming the halt, or EOF self.child.expect("(The operating system has halted)|(entering state S5)", timeout = 60) except pexpect.EOF: # Didn't see the text but got an EOF; that's OK. print "EOF" except pexpect.TIMEOUT: # This is unexpected but mostly harmless print "timeout waiting for halt confirmation:", e def console_interaction(child): # We need this in pexpect 2.x or everything will be printed twice child.logfile = None child.interact() # Calling this directly is deprecated, use Anita.login() def login(child): child.send("\n") child.expect("login:") child.send("root\n") # This used to be "\n# ", but that doesn't work if the machine has # a hostname child.expect("# ") def net_setup(child): child.send("dhclient ne2\n") child.expect("bound to.*\n# ") # Generate a root shell prompt string that is less likely to appear in # the console output by accident than the default of "# ". Must end with "# ". def gen_shell_prompt(): return 'anita-root-shell-prompt-%s# ' % str(time.time()) # Quote a prompt in /bin/sh syntax, with some extra quotes # in the middle so that an echoed command to set the prompt is not # mistaken for the prompt itself. def quote_prompt(s): midpoint = len(s) / 2 return "".join("'%s'" % part for part in (s[0:midpoint], s[midpoint:])) # Calling this directly is deprecated, use Anita.shell_cmd() def shell_cmd(child, cmd, timeout = -1): child.send("exec /bin/sh\n") child.expect("# ") prompt = gen_shell_prompt() child.send("PS1=" + quote_prompt(prompt) + "\n") prompt_re = prompt child.expect(prompt_re) child.send(cmd + "\n") child.expect(prompt_re, timeout) child.send("echo exit_status=$?=\n") child.expect("exit_status=(\d+)=") r = int(child.match.group(1)) child.expect(prompt_re, timeout) return r def test(child): raise RuntimeError("global test() function is gone, use Anita.run_tests()") #############################################################################
34.933059
120
0.599351
48,824
0.820696
0
0
0
0
0
0
25,172
0.423123
dd9b53c1d51423e3d8a448dcde0235338b5a8f9d
5,356
py
Python
solitude/testing/context.py
incerto-crypto/solitude
1b21a2ca4912da212d413322953ceb4ec2983c17
[ "BSD-3-Clause" ]
7
2019-03-25T21:48:42.000Z
2022-02-25T08:21:35.000Z
solitude/testing/context.py
incerto-crypto/solitude
1b21a2ca4912da212d413322953ceb4ec2983c17
[ "BSD-3-Clause" ]
null
null
null
solitude/testing/context.py
incerto-crypto/solitude
1b21a2ca4912da212d413322953ceb4ec2983c17
[ "BSD-3-Clause" ]
null
null
null
# Copyright (c) 2019, Solitude Developers # # This source code is licensed under the BSD-3-Clause license found in the # COPYING file in the root directory of this source tree from typing import Mapping, Union, Optional # noqa import os import shutil import tempfile from functools import wraps from collections import OrderedDict from solitude._internal.error_util import type_assert, RaiseForParam from solitude.server import ETHTestServer, kill_all_servers # noqa from solitude.client import ContractBase, ETHClient, EventLog # noqa from solitude.common import ContractObjectList from solitude.compiler import Compiler # noqa from solitude import Factory, read_config_file class TestingContext: def __init__(self, cfg: dict): """Create a testing context containing configured instances of the client, server and compiler. Contracts from Project.ObjectDir (if not null) are added to the client's collection. A server is started if Testing.RunServer is true. In this case, the client is connected to the new server endpoint address, whatever it is, overriding the client endpoint configuration. :param cfg: configuration dictionary """ self._cfg = cfg self._factory = Factory(self._cfg) self._client = None # type: ETHClient self._server = None # type: ETHTestServer self._compiler = None # type: Compiler self._server_started = False endpoint = None project_tools = self._factory.get_required() if "Solc" in project_tools: self._compiler = self._factory.create_compiler() if "GanacheCli" in project_tools: self._server = self._factory.create_server() if self._cfg["Testing.RunServer"]: self._server.start() self._server_started = True # ovverride endpoint for client endpoint = self._server.endpoint self._client = self._factory.create_client( endpoint=endpoint) object_dir = self._cfg["Project.ObjectDir"] if object_dir is not None: objects = ContractObjectList() objects.add_directory(object_dir) self._client.update_contracts(objects) @property def cfg(self): """Configuration""" return self._cfg @property def client(self): """Client instance""" return self._client @property def server(self): """Server instance""" return self._server @property def compiler(self): """Compiler instance""" return self._compiler def teardown(self): """Teardown the testing context, terminating the test server if any.""" if self._server_started: self._server.stop() @wraps(ETHClient.account) def account(self, address): return self._client.account(address) @wraps(ETHClient.address) def address(self, account_id: int): return self._client.address(account_id) @wraps(ETHClient.deploy) def deploy(self, contract_selector: str, args=(), wrapper=ContractBase): return self._client.deploy(contract_selector, args, wrapper) @wraps(ETHClient.capture) def capture(self, pattern): # noqa return self._client.capture(pattern) @wraps(ETHClient.get_accounts) def get_accounts(self, reload=False) -> list: return self._client.get_accounts() @wraps(ETHClient.get_events) def get_events(self): return self._client.get_events() @wraps(ETHClient.clear_events) def clear_events(self): return self._client.clear_events() @wraps(ETHClient.get_current_account) def get_current_account(self): return self._client.get_current_account() @wraps(ETHClient.mine_block) def mine_block(self) -> None: return self._client.mine_block() @wraps(ETHClient.increase_blocktime_offset) def increase_blocktime_offset(self, seconds: int) -> int: return self._client.increase_blocktime_offset(seconds) @wraps(ETHClient.get_last_blocktime) def get_last_blocktime(self) -> int: return self._client.get_last_blocktime() def SOL_new( cfg: Union[dict, str]="solitude.yaml", relative_to: Optional[str]=None) -> TestingContext: """Create a new testing context :param cfg: configuration dictionary or path. If `cfg` is a string, it is interpreted as a path to the yaml or json file containing the configuration dictionary. :param relative_to: a path, or None; if `cfg` is a path and `relative_to` is not None, make the path of the configuration file `cfg` relative to the parent directory of `relative_to`. This can be used with `__file__` to make the configuration file location relative to the test script. """ with RaiseForParam("cfg"): type_assert(cfg, (dict, str)) if isinstance(cfg, str): path = cfg if relative_to is not None: rel_dir = os.path.dirname( os.path.abspath(relative_to)) path = os.path.join(rel_dir, path) cfg_dict = read_config_file(path) else: cfg_dict = cfg try: return TestingContext(cfg_dict) except Exception: kill_all_servers() raise
32.460606
92
0.668969
3,542
0.661314
0
0
1,687
0.314974
0
0
1,512
0.2823
dd9c212b2612a151f4e10e08866ba944cee12a2b
2,883
py
Python
openwater/zone/model.py
jeradM/openwater
740b7e76622a1ee909b970d9e5c612a840466cec
[ "MIT" ]
null
null
null
openwater/zone/model.py
jeradM/openwater
740b7e76622a1ee909b970d9e5c612a840466cec
[ "MIT" ]
null
null
null
openwater/zone/model.py
jeradM/openwater
740b7e76622a1ee909b970d9e5c612a840466cec
[ "MIT" ]
null
null
null
from abc import ABC, abstractmethod from datetime import datetime from typing import TYPE_CHECKING, Dict, Any, List, Optional if TYPE_CHECKING: from openwater.core import OpenWater class ZoneRun: def __init__(self, id: int, zone_id: int, start: datetime, duration: int): self.id = id self.zone_id = zone_id self.start = start self.duration = duration def to_dict(self) -> dict: return { "id": self.id, "zone_id": self.zone_id, "start": self.start, "duration": self.duration, } def to_db(self) -> dict: return self.to_dict() class BaseZone(ABC): def __init__( self, ow: "OpenWater", id: int, name: str, zone_type: str, is_master: bool, attrs: dict, open_offset: int = 0, close_offset: int = 0, last_run: Optional[ZoneRun] = None, ): self._ow = ow self.id = id self.name = name self.zone_type = zone_type self.is_master = is_master self.attrs = attrs self.open_offset = open_offset self.close_offset = close_offset self.last_run = last_run self.master_zones: Optional[List[BaseZone]] = None @classmethod def of(cls, ow: "OpenWater", data: Dict[str, Any]): return cls( ow=ow, id=data.get("id"), name=data["name"], zone_type=data["zone_type"], is_master=data["is_master"], open_offset=data["open_offset"], close_offset=data["close_offset"], attrs=data["attrs"], ) def to_dict(self): return { "id": self.id, "name": self.name, "zone_type": self.zone_type, "is_master": self.is_master, "open_offset": self.open_offset, "close_offset": self.close_offset, "open": self.is_open(), "attrs": dict(self.attrs, **self.extra_attrs), "last_run": self.last_run, "master_zones": self.master_zones, } def to_db(self): return { "id": self.id, "name": self.name, "zone_type": self.zone_type, "is_master": self.is_master, "open": self.is_open(), "attrs": dict(self.attrs, **self.extra_attrs), } @abstractmethod def is_open(self) -> bool: pass @abstractmethod async def open(self) -> None: pass @abstractmethod async def close(self) -> None: pass @abstractmethod def get_zone_type(self) -> str: pass @property def extra_attrs(self) -> dict: return {} def __eq__(self, other): return self.id == other.id def __hash__(self): return hash(self.id)
25.289474
78
0.539369
2,691
0.933403
0
0
696
0.241415
85
0.029483
259
0.089837
dd9c57daac230a88704ee45525c7ddcffe34b216
2,339
py
Python
shrinkaddrspace/fix_preinit.py
vusec/midfat
9eb8d3c5188c0c262ad5f5de84f9e26530e38a4c
[ "Apache-2.0" ]
6
2017-06-02T00:16:57.000Z
2018-12-08T20:49:19.000Z
shrinkaddrspace/fix_preinit.py
vusec/midfat
9eb8d3c5188c0c262ad5f5de84f9e26530e38a4c
[ "Apache-2.0" ]
null
null
null
shrinkaddrspace/fix_preinit.py
vusec/midfat
9eb8d3c5188c0c262ad5f5de84f9e26530e38a4c
[ "Apache-2.0" ]
3
2019-05-12T08:52:48.000Z
2019-08-08T11:17:52.000Z
#!/usr/bin/env python import struct from elftools.elf.elffile import ELFFile def elf_get_preinit(elffile): preinit_offset = None preinit_funcs = tuple() for sec in elffile.iter_sections(): if sec.name == '.preinit_array': sz = sec['sh_size'] preinit_offset = sec['sh_offset'] ptrsize = struct.calcsize("P") num_funcs = sz / ptrsize elffile.stream.seek(preinit_offset) buf = elffile.stream.read(sz) preinit_funcs = struct.unpack_from("%dP" % num_funcs, buf) return preinit_offset, preinit_funcs def elf_get_symbol(elffile, symname): for sec in elffile.iter_sections(): if sec.name == '.symtab': for symbol in sec.iter_symbols(): if symbol.name == symname: return symbol['st_value'] return None def main(): import argparse parser = argparse.ArgumentParser(description="Move a certain preinit " "function to the front of the preinit array in an ELF binary.") parser.add_argument("binary", help="The ELF binary") parser.add_argument("preinit_name", help="Name of the preinit function") args = parser.parse_args() with open(args.binary, 'rb+') as f: elffile = ELFFile(f) func_loc = elf_get_symbol(elffile, args.preinit_name) if func_loc is None: print "Could not find function %s in binary %s" % \ (args.preinit_name, args.binary) sys.exit(1) preinit_loc, preinit_funcs = elf_get_preinit(elffile) if preinit_loc is None: print "Could not find preinit-array location in binary %s" % \ args.binary sys.exit(1) print "Original preinit-array:", map(hex, preinit_funcs) if func_loc not in preinit_funcs: print "Could not find func %s(%x) in preinit-array in binary %s" % \ (args.preinit_name, func_loc, args.binary) sys.exit(1) preinit_funcs = sorted(preinit_funcs, key=lambda addr: 0 if addr == func_loc else 1) print "New preinit-array:", map(hex, preinit_funcs) f.seek(preinit_loc) f.write(struct.pack("%dP" % len(preinit_funcs), *preinit_funcs)) if __name__ == '__main__': main()
32.486111
80
0.607525
0
0
0
0
0
0
0
0
455
0.194528
dd9d9e745268a05b2a5397b1a32f3f6189d22b3b
41
py
Python
ppq/utils/__init__.py
openppl-public/ppq
0fdea7d4982bc57feb6bb8548c7f012707fbd607
[ "Apache-2.0" ]
100
2021-12-31T09:34:06.000Z
2022-03-25T02:54:51.000Z
ppq/utils/__init__.py
openppl-public/ppq
0fdea7d4982bc57feb6bb8548c7f012707fbd607
[ "Apache-2.0" ]
12
2021-12-31T10:28:15.000Z
2022-03-31T07:08:44.000Z
ppq/utils/__init__.py
openppl-public/ppq
0fdea7d4982bc57feb6bb8548c7f012707fbd607
[ "Apache-2.0" ]
21
2021-12-31T09:51:02.000Z
2022-03-30T12:21:55.000Z
from .attribute import process_attribute
20.5
40
0.878049
0
0
0
0
0
0
0
0
0
0
dda05eca52f0bd879e75366f591fdb92e3e9abbd
855
py
Python
tests/test_views.py
pennlabs/django-shortener
a8f362863d4d8f13916e9e924ed316384f588373
[ "MIT" ]
3
2018-11-04T15:46:01.000Z
2020-01-06T13:49:46.000Z
tests/test_views.py
pennlabs/shortener
a8f362863d4d8f13916e9e924ed316384f588373
[ "MIT" ]
1
2019-07-30T04:31:19.000Z
2019-07-30T04:31:19.000Z
tests/test_views.py
pennlabs/shortener
a8f362863d4d8f13916e9e924ed316384f588373
[ "MIT" ]
2
2021-02-22T18:12:27.000Z
2021-09-16T18:51:47.000Z
import hashlib from django.test import TestCase from django.urls import reverse from shortener.models import Url class RedirectViewTestCase(TestCase): def setUp(self): self.redirect = "https://pennlabs.org" self.url, _ = Url.objects.get_or_create(long_url=self.redirect) def test_exists(self): try: hashed = hashlib.sha3_256(self.redirect.encode("utf-8")).hexdigest() except AttributeError: hashed = hashlib.sha256(self.redirect.encode("utf-8")).hexdigest() response = self.client.get(reverse("shortener:index", args=[hashed[:5]])) self.assertRedirects(response, self.redirect, fetch_redirect_response=False) def test_no_exists(self): response = self.client.get(reverse("shortener:index", args=["abcd"])) self.assertEqual(response.status_code, 404)
34.2
84
0.691228
737
0.861988
0
0
0
0
0
0
76
0.088889
dda073c654623fd4431b83697b75b0c9003f460a
1,758
py
Python
Models/Loss/__init__.py
bobo0810/classification
b27397308c5294dcc30a5aaddab4692becfc45d3
[ "MIT" ]
null
null
null
Models/Loss/__init__.py
bobo0810/classification
b27397308c5294dcc30a5aaddab4692becfc45d3
[ "MIT" ]
null
null
null
Models/Loss/__init__.py
bobo0810/classification
b27397308c5294dcc30a5aaddab4692becfc45d3
[ "MIT" ]
null
null
null
import torch import torch.nn as nn from timm.loss import LabelSmoothingCrossEntropy from pytorch_metric_learning import losses class create_class_loss(nn.Module): """ 常规分类 - 损失函数入口 """ def __init__(self, name): super(create_class_loss, self).__init__() assert name in ["cross_entropy", "label_smooth"] self.loss = self.init_loss(name) def forward(self, predict, target): return self.loss(predict, target) def init_loss(self, name): """ 常规分类 """ loss_dict = { "cross_entropy": nn.CrossEntropyLoss, "label_smooth": LabelSmoothingCrossEntropy, } loss = loss_dict[name]() return loss class create_metric_loss(nn.Module): """ 度量学习 - 损失函数入口 """ def __init__(self, name, num_classes, embedding_size): """ name: 损失函数名称 num_classes: 类别数 embedding_size: 特征维度 """ super(create_metric_loss, self).__init__() assert name in ["cosface", "arcface", "subcenter_arcface", "circleloss"] self.loss = self.init_loss(name, num_classes, embedding_size) def forward(self, predict, target, hard_tuples): return self.loss(predict, target, hard_tuples) def init_loss(self, name, num_classes, embedding_size): loss_dict = { "cosface": losses.CosFaceLoss, "arcface": losses.ArcFaceLoss, "subcenter_arcface": losses.SubCenterArcFaceLoss, } if name in loss_dict.keys(): loss = loss_dict[name]( num_classes=num_classes, embedding_size=embedding_size ) elif name == "circleloss": loss = losses.CircleLoss() return loss
27.46875
80
0.609215
1,699
0.927402
0
0
0
0
0
0
406
0.221616
dda150ca1f3fdf6e22fc599876192f67eb4fbf8e
1,195
py
Python
tests/main.py
caspervg/geontology
e5660629f57747d05cfe6e15721bca23039a672d
[ "MIT" ]
1
2015-12-25T10:46:27.000Z
2015-12-25T10:46:27.000Z
tests/main.py
caspervg/geontology
e5660629f57747d05cfe6e15721bca23039a672d
[ "MIT" ]
null
null
null
tests/main.py
caspervg/geontology
e5660629f57747d05cfe6e15721bca23039a672d
[ "MIT" ]
null
null
null
from rdflib import URIRef from rdflib.namespace import DC, RDF, OWL, RDFS from geontology import GeoOntology ont = GeoOntology("geo_ontology.ttl", frmt='n3') # print ont.serialize() graph = ont.graph print "InfoColumns" for s, p, o in graph.triples( (None, RDFS.subClassOf, URIRef('http://move.ugent.be/geodata/ontology/InfoColumn'))): print "[%s, %s, %s]" % (s, p, o) for _s, _p, _o in graph.triples( (None, RDF.type, s)): print " [%s, %s, %s]" % (_s, _p, _o) for __s, __p, __o in graph.triples( (_s, None, None)): print " [%s, %s, %s]" % (__s, __p, __o) print "\n\nGeoColumns" for s, p, o in graph.triples( (None, RDFS.subClassOf, URIRef('http://move.ugent.be/geodata/ontology/GeoColumn'))): print "[%s, %s, %s]" % (s, p, o) for _s, _p, _o in graph.triples( (None, RDF.type, s)): print " [%s, %s, %s]" % (_s, _p, _o) for __s, __p, __o in graph.triples( (_s, None, None)): print " [%s, %s, %s]" % (__s, __p, __o) if (None, URIRef('http://move.ugent.be/geodata/ontology/defines'), DC.date) in graph: print "some defines"
29.146341
93
0.551464
0
0
0
0
0
0
0
0
336
0.281172
dda2bd0af7d3de24450c99ea2968e3067f121da2
1,397
py
Python
VGG_GRU/TrainTestlist/Emotiw/getTraintest_Emotiw.py
XiaoYee/emotion_classification
6122e1b575bce5235169f155295b549a8f721ca1
[ "MIT" ]
74
2018-06-29T06:46:33.000Z
2022-02-26T19:15:55.000Z
VGG_GRU/TrainTestlist/Emotiw/getTraintest_Emotiw.py
JIangjiang1108/emotion_classification
6122e1b575bce5235169f155295b549a8f721ca1
[ "MIT" ]
6
2018-07-02T09:29:05.000Z
2020-01-30T14:21:26.000Z
VGG_GRU/TrainTestlist/Emotiw/getTraintest_Emotiw.py
JIangjiang1108/emotion_classification
6122e1b575bce5235169f155295b549a8f721ca1
[ "MIT" ]
23
2018-06-29T12:52:40.000Z
2020-12-02T12:55:13.000Z
import os import os.path as osp import argparse import random parser = argparse.ArgumentParser(description='Emotiw dataset list producer') args = parser.parse_args() train = "/home/quxiaoye/disk/FR/Emotiw2018/data/Train_AFEW_all/Emotiw-faces" test = "/home/quxiaoye/disk/FR/Emotiw2018/data/Val_AFEW/Emotiw-faces" train_path = osp.join(train) test_path = osp.join(test) Face_category = open("./TrainTestlist/Emotiw/Emotiw_TRAIN.txt","w") Face_category_test = open("./TrainTestlist/Emotiw/Emotiw_VAL.txt","w") train_img_folders = os.listdir(train_path) train_img_folders.sort() for i in range(len(train_img_folders)): path_folder = osp.join(train_path,train_img_folders[i]) emotion_folders = os.listdir(path_folder) emotion_folders.sort() for emotion_folder in emotion_folders: path_write = osp.join(path_folder,emotion_folder) Face_category.write(path_write+" "+train_img_folders[i]+"\n") Face_category.close() test_img_folders = os.listdir(test_path) test_img_folders.sort() for i in range(len(test_img_folders)): path_folder = osp.join(test_path,test_img_folders[i]) emotion_folders = os.listdir(path_folder) emotion_folders.sort() for emotion_folder in emotion_folders: path_write = osp.join(path_folder,emotion_folder) Face_category_test.write(path_write+" "+test_img_folders[i]+"\n") Face_category_test.close()
29.723404
76
0.7602
0
0
0
0
0
0
0
0
260
0.186113
06b3cc12c35c6a81cb3cf69f89310f5caed75723
141
py
Python
config_default.py
wecassidy/pishow
310f935688e0b3ceeb8fe11bd0fda902c041dd45
[ "MIT" ]
null
null
null
config_default.py
wecassidy/pishow
310f935688e0b3ceeb8fe11bd0fda902c041dd45
[ "MIT" ]
null
null
null
config_default.py
wecassidy/pishow
310f935688e0b3ceeb8fe11bd0fda902c041dd45
[ "MIT" ]
null
null
null
IMG_DIR = "/path/to/pictures" IMG_POLL_RATE = 1 # minute DWELL_TIME = 5 # seconds FADE_TIME = 1 # seconds REFRESH_RATE = 10 # milliseconds
17.625
32
0.723404
0
0
0
0
0
0
0
0
59
0.41844
06b3ddf241a1d83947506562980f958105dbb002
5,050
py
Python
src/stdlib.py
tweakoz/zed64
c0231444418999191182d53d9319bf7978422bfb
[ "CC-BY-3.0" ]
4
2015-06-04T01:14:43.000Z
2018-06-16T05:45:57.000Z
src/stdlib.py
tweakoz/zed64
c0231444418999191182d53d9319bf7978422bfb
[ "CC-BY-3.0" ]
null
null
null
src/stdlib.py
tweakoz/zed64
c0231444418999191182d53d9319bf7978422bfb
[ "CC-BY-3.0" ]
null
null
null
####################################################################### ## ## Zed64 MetroComputer ## ## Unless a module otherwise marked, ## Copyright 2014, Michael T. Mayers (michael@tweakoz.com ## Provided under the Creative Commons Attribution License 3.0 ## Please see https://creativecommons.org/licenses/by/3.0/us/legalcode ## ####################################################################### #!/usr/bin/python from myhdl import * import sys, os, md5, string import localopts hvcount_bits = 12 ################################################33 def SigReset(): return ResetSignal(0, active=1, async=True) def SigWord(size=1,def_val=0): return Signal(intbv(def_val)[size:]) def SigBool(def_val=False): return Signal(intbv(def_val)[1:]) def SigNyb(def_val=0): return Signal(intbv(def_val)[4:]) def SigByte(def_val=0): return Signal(intbv(def_val)[8:]) def SigAdr16(def_val=0): return Signal(intbv(def_val)[16:]) def SigMod64(def_val=0): return modbv(def_val)[64:] def SigMod(w=4,def_val=0): return modbv(def_val)[w:] def pixdimval(value): return modbv(value)[hvcount_bits:] def SigPixCnt(initval=0): return Signal(pixdimval(initval)) def Sel2(output,inpa,inpb,sel): @always_comb def logic(): if sel: output.next = inpb else: output.next = inpa __verilog__ = \ """assign %(output)s = %(sel)s ? %(inpb)s : %(inpa)s;""" output.driven = "wire" return logic def SigColorChannel(): return Signal(intbv(0)[4:]) ################################################33 def Gen2( x ): return x(), x() def Gen3( x ): return x(), x(), x() ################################################33 class UcfLine: def __init__(self,txt,newline=True): self.txt = txt self.newline = newline def gen(self): str = "%s" % self.txt if self.newline: str += ";\n" return str class UcfNet: def __init__(self,name,loc,std,constraints=None): self.name = name self.loc = loc self.std = std self.constraints = constraints self.txt = None def gen(self): str = 'NET "%s" LOC="%s" | IOSTANDARD="%s";\n' % (self.name,self.loc,self.std) if self.constraints!=None: str += 'NET "%s" %s;\n' % (self.name,self.constraints) return str class UcfGen: def __init__(self,ucf_name,def_std="LVCMOS33"): self.ucf_name = ucf_name self.nets = list() self.def_std = def_std self.addsep() self.addline("# UCF : %s autogenerated with tozedakit\n" % ucf_name, False) self.addsep() def addline(self,txt,newline=True): lin = UcfLine(txt,newline) self.nets.append(lin) def addnet(self,name,loc,std=None,constraints=None): if std==None: std=self.def_std net = UcfNet( name, loc, std, constraints ) self.nets.append(net) def addnetarray(self,basename,locs,std=None): loclist = string.split(locs) index = 0 for item in loclist: self.addnet( "%s<%d>"%(basename,index) ,item, std ) index += 1 def addsep(self): self.addline("##############################################\n",False) def emit(self,filename): fout = open(filename,"wt") for item in self.nets: fout.write("%s"%item.gen()) fout.close() ################################################33 def pushdir(newdir): olddir = os.getcwd() os.chdir(newdir) return olddir def popdir(a): os.chdir(a) ################################################33 class verilog_params: def __init__(self,outfolder,timescale,ios): self.outfolder = outfolder self.timescale = timescale self.ios = ios ################################################33 states = enum( "Reset", "StateA", "StateB", "StateC", encoding="one_hot" ) def FSM(reset,clock): st = Signal(states.Reset) @always(clock.posedge) def gen(): if reset: st.next = states.Reset else: if st==states.Reset: st.next = states.StateA elif st==states.StateA: st.next = states.StateC elif st==states.StateB: st.next = states.StateA elif st==states.StateC: st.next = states.StateB else: st.next = states.Reset return instances() timescale = "1ns/1ps" __all__ = [ 'timescale', "verilog_params", "SigReset", "SigWord", "SigMod", 'pixdimval', 'SigColorChannel', 'SigBool', 'SigMod64', 'SigPixCnt', 'SigByte', 'SigNyb', 'SigAdr16', 'Sel2', 'Gen2', 'Gen3', 'UcfGen', 'pushdir','popdir']
24.278846
86
0.50198
1,886
0.373465
0
0
583
0.115446
0
0
1,189
0.235446
06bb33b3d53b354d7a98d017485acac1da8698a5
1,127
py
Python
py/1081. Smallest Subsequence of Distinct Characters.py
longwangjhu/LeetCode
a5c33e8d67e67aedcd439953d96ac7f443e2817b
[ "MIT" ]
3
2021-08-07T07:01:34.000Z
2021-08-07T07:03:02.000Z
py/1081. Smallest Subsequence of Distinct Characters.py
longwangjhu/LeetCode
a5c33e8d67e67aedcd439953d96ac7f443e2817b
[ "MIT" ]
null
null
null
py/1081. Smallest Subsequence of Distinct Characters.py
longwangjhu/LeetCode
a5c33e8d67e67aedcd439953d96ac7f443e2817b
[ "MIT" ]
null
null
null
# https://leetcode.com/problems/smallest-subsequence-of-distinct-characters/ # Return the lexicographically smallest subsequence of s that contains all the # distinct characters of s exactly once. # Note: This question is the same as 316: https://leetcode.com/problems/remove- # duplicate-letters/ ################################################################################ # record last postion of each char # use stack and pop previous chars when i) new char is smaller and ii) we can add the popped char back later class Solution: def smallestSubsequence(self, s: str) -> str: last_pos = {} for idx, char in enumerate(s): last_pos[char] = idx stack = [] for idx, char in enumerate(s): if char not in stack: # pop the previous chars if the new char is smaller # but only when we can add the popped char back: idx < last_pos[popped_char] while stack and char < stack[-1] and idx < last_pos[stack[-1]]: stack.pop() stack.append(char) return ''.join(stack)
38.862069
108
0.585626
598
0.530612
0
0
0
0
0
0
644
0.571429
06bbd57d69031c72132de965a30424f3da29237c
2,207
py
Python
ebs-snapshot-manager.py
phanirajendra/aws-ebs-snapshots-lambda
0464ec54de7e812163e33db73d1cb9d46c35c029
[ "Apache-2.0" ]
null
null
null
ebs-snapshot-manager.py
phanirajendra/aws-ebs-snapshots-lambda
0464ec54de7e812163e33db73d1cb9d46c35c029
[ "Apache-2.0" ]
null
null
null
ebs-snapshot-manager.py
phanirajendra/aws-ebs-snapshots-lambda
0464ec54de7e812163e33db73d1cb9d46c35c029
[ "Apache-2.0" ]
1
2020-05-17T14:45:51.000Z
2020-05-17T14:45:51.000Z
import boto3 import re import datetime import time ec = boto3.client('ec2') iam = boto3.client('iam') """ This function looks at *all* snapshots that have the tags "Type:Automated" and "DeleteOn" containing the current day formatted as YYYY-MM-DD. The function will delete the if the todays date is > than the "DeleteOn". """ def lambda_handler(event, context): account_ids = list() try: """ You can replace this try/except by filling in `account_ids` yourself. Get your account ID with: > import boto3 > iam = boto3.client('iam') > print iam.get_user()['User']['Arn'].split(':')[4] """ iam.get_user() except Exception as e: # use the exception message to get the account ID the function executes under account_ids.append(re.search(r'(arn:aws:sts::)([0-9]+)', str(e)).groups()[1]) today = datetime.datetime.now() print "\tDelete snapshots < %s " % today filters = [ { 'Name': 'tag:Type', 'Values': ['Automated'] }, ] snapshot_response = ec.describe_snapshots(OwnerIds=account_ids, Filters=filters) for snap in snapshot_response['Snapshots']: skipping_this_one = False snapshot_delete_on = "" for tag in snap['Tags']: if tag['Key'] == 'KeepForever': skipping_this_one = True if tag['Key'] == 'DeleteOn': snapshot_delete_on = tag['Value'] if skipping_this_one == True: print "\tSkipping snapshot %s marked KeepForever" % snap['SnapshotId'] # do nothing else else: if snapshot_delete_on == "": print "\There is no DeleteOn Tag for this backup: %s" % snap['SnapshotId'] continue snapshot_expires = datetime.datetime.strptime(snapshot_delete_on, "%Y-%m-%d") if snapshot_expires < today: print "\tDeleting %s with expiry date %s" % (snap['SnapshotId'], snapshot_delete_on) ec.delete_snapshot(SnapshotId=snap['SnapshotId']) else: print "\tKeeping %s until %s" % (snap['SnapshotId'], snapshot_delete_on)
34.484375
100
0.593113
0
0
0
0
0
0
0
0
939
0.425464
06bd33902db8a6c06128727e29c0eae037cf9894
378
py
Python
Cartwheel/lib/Python26/Lib/site-packages/OpenGL/GL/NV/fragment_program.py
MontyThibault/centre-of-mass-awareness
58778f148e65749e1dfc443043e9fc054ca3ff4d
[ "MIT" ]
null
null
null
Cartwheel/lib/Python26/Lib/site-packages/OpenGL/GL/NV/fragment_program.py
MontyThibault/centre-of-mass-awareness
58778f148e65749e1dfc443043e9fc054ca3ff4d
[ "MIT" ]
null
null
null
Cartwheel/lib/Python26/Lib/site-packages/OpenGL/GL/NV/fragment_program.py
MontyThibault/centre-of-mass-awareness
58778f148e65749e1dfc443043e9fc054ca3ff4d
[ "MIT" ]
null
null
null
'''OpenGL extension NV.fragment_program This module customises the behaviour of the OpenGL.raw.GL.NV.fragment_program to provide a more Python-friendly API ''' from OpenGL import platform, constants, constant, arrays from OpenGL import extensions, wrapper from OpenGL.GL import glget import ctypes from OpenGL.raw.GL.NV.fragment_program import * ### END AUTOGENERATED SECTION
31.5
56
0.812169
0
0
0
0
0
0
0
0
191
0.505291
06be7d0ae668828822753247461cfec9b2e4f3d3
675
py
Python
kpm/commands/push.py
ericchiang/kpm
3653b1dba8359f086a6a21d3a5003e80a46083a7
[ "Apache-2.0" ]
121
2016-08-05T17:54:27.000Z
2022-02-21T14:21:59.000Z
kpm/commands/push.py
ericchiang/kpm
3653b1dba8359f086a6a21d3a5003e80a46083a7
[ "Apache-2.0" ]
82
2016-08-07T01:42:41.000Z
2017-05-05T17:35:45.000Z
kpm/commands/push.py
ericchiang/kpm
3653b1dba8359f086a6a21d3a5003e80a46083a7
[ "Apache-2.0" ]
30
2016-08-15T13:12:10.000Z
2022-02-21T14:22:00.000Z
from appr.commands.push import PushCmd as ApprPushCmd from kpm.manifest_jsonnet import ManifestJsonnet class PushCmd(ApprPushCmd): default_media_type = 'kpm' def _kpm(self): self.filter_files = True self.manifest = ManifestJsonnet() ns, name = self.manifest.package['name'].split("/") if not self.namespace: self.namespace = ns if not self.pname: self.pname = name self.package_name = "%s/%s" % (self.namespace, self.pname) if not self.version or self.version == "default": self.version = self.manifest.package['version'] self.metadata = self.manifest.metadata()
32.142857
66
0.638519
568
0.841481
0
0
0
0
0
0
39
0.057778
06be9a64516dc7d92276fa93579a7f01f96fc979
360
py
Python
QASMToQuEST/errors.py
oerc0122/QASMParser
701b6f25f498ea67670f2d85ae0f2e6920aea267
[ "MIT" ]
5
2019-05-10T08:17:57.000Z
2021-12-19T05:06:18.000Z
QASMToQuEST/errors.py
oerc0122/QASMParser
701b6f25f498ea67670f2d85ae0f2e6920aea267
[ "MIT" ]
14
2019-04-11T11:28:08.000Z
2020-02-13T15:18:56.000Z
QASMToQuEST/errors.py
oerc0122/QASMParser
701b6f25f498ea67670f2d85ae0f2e6920aea267
[ "MIT" ]
2
2019-05-10T08:17:23.000Z
2021-12-18T16:37:02.000Z
""" Define the errors which may occur """ langMismatchWarning = "Classical language {} does not match output language {}" langNotDefWarning = "Language {0} translation not found, check QASMToQuEST/langs/{0}.py exists" noLangSpecWarning = "No language specified for screen print" noSpecWarning = "Neither language nor output with recognised language specified"
45
95
0.786111
0
0
0
0
0
0
0
0
277
0.769444
06bfd7cd414a9434b1f295b51c26d7407c29f08d
383
py
Python
problem_29/distinct_powers.py
plilja/project-euler
646d1989cf15e903ef7e3c6e487284847d522ec9
[ "Apache-2.0" ]
null
null
null
problem_29/distinct_powers.py
plilja/project-euler
646d1989cf15e903ef7e3c6e487284847d522ec9
[ "Apache-2.0" ]
null
null
null
problem_29/distinct_powers.py
plilja/project-euler
646d1989cf15e903ef7e3c6e487284847d522ec9
[ "Apache-2.0" ]
null
null
null
from common.matrix import Matrix def distinct_powers(n): m = Matrix(n + 2, n + 2) for i in range(2, n + 1): m[i][2] = i ** 2 for j in range(3, n + 1): m[i][j] = m[i][j - 1] * i distinct_values = set() for i in range(2, n + 1): for j in range(2, n + 1): distinct_values |= {m[i][j]} return len(distinct_values)
21.277778
40
0.488251
0
0
0
0
0
0
0
0
0
0
06c21871e9ad89697d51562c488828bc64f7390f
1,436
py
Python
1-python/python/transpose.py
Domin-Imperial/Domin-Respository
2e531aabc113ed3511f349107695847b5c4e4320
[ "MIT" ]
null
null
null
1-python/python/transpose.py
Domin-Imperial/Domin-Respository
2e531aabc113ed3511f349107695847b5c4e4320
[ "MIT" ]
null
null
null
1-python/python/transpose.py
Domin-Imperial/Domin-Respository
2e531aabc113ed3511f349107695847b5c4e4320
[ "MIT" ]
1
2021-05-24T20:09:38.000Z
2021-05-24T20:09:38.000Z
# exercism exercise "transpose" def transpose(lines: str) -> str: input_list = lines.split('\n') # or splitlines input_height = len(input_list) input_width = get_input_width(input_list) output_list = [] for colnum in range(input_width): output = '' for rownum in range(input_height): output += get_char(input_list, rownum, colnum) output = output.rstrip('*').replace('*', ' ') output_list.append(output) return '\n'.join(output_list) def get_char(input_list, rownum, colnum): # row = input_list[rownum] # if colnum >= len(row): # return '*' # return row[colnum] try: return input_list[rownum][colnum] except IndexError: return '*' def get_input_width(input_list): # max_length = 0 # for i in range(len(input_list)): # row = input_list[i] # if len(row) > max_length: # max_length = len(row) # max_length = 0 # for row in input_list: # if len(row) > max_length: # max_length = len(row) # list comprehension # lengths = [len(x) for x in input_list] # list of ints # max_length = max(lengths) # generator expression # an expression that acts like a sequence, that's not built yet max_length = max((len(x) for x in input_list), default=0) return max_length print(transpose("AB\nC")) print(repr(transpose("AB\nC").split('\n')))
27.615385
67
0.612117
0
0
0
0
0
0
0
0
598
0.416435
06c29fb490c1f0aa4c9251b922a903b4e7ce1750
548
py
Python
tests/create_file.py
stompsjo/RadClass
3bce664fbc1ea48c067e035adb18cc064db5df4b
[ "BSD-3-Clause" ]
null
null
null
tests/create_file.py
stompsjo/RadClass
3bce664fbc1ea48c067e035adb18cc064db5df4b
[ "BSD-3-Clause" ]
2
2021-05-11T15:11:17.000Z
2021-07-02T17:42:35.000Z
tests/create_file.py
stompsjo/RadClass
3bce664fbc1ea48c067e035adb18cc064db5df4b
[ "BSD-3-Clause" ]
null
null
null
import h5py def create_file(filename, datapath, labels, live, timestamps, spectra): # Creating sample dataset f = h5py.File(filename, "w") # data structure for MUSE files dset1 = f.create_dataset(datapath + labels['live'], (1000,)) dset2 = f.create_dataset(datapath + labels['timestamps'], (1000,)) dset3 = f.create_dataset(datapath + labels['spectra'], (10,1000)) # store randomized data in test file dset1[...] = live dset2[...] = timestamps dset3[...] = spectra # close test file f.close()
30.444444
71
0.642336
0
0
0
0
0
0
0
0
139
0.25365
06c2aad42518b04959fd06448a4c2d1ef11c34fe
4,318
py
Python
core/models.py
mcflydesigner/innorussian
70bec97ad349f340bd66cd8234d94f8829540397
[ "MIT" ]
1
2021-04-12T18:54:37.000Z
2021-04-12T18:54:37.000Z
core/models.py
mcflydesigner/InnoRussian
70bec97ad349f340bd66cd8234d94f8829540397
[ "MIT" ]
null
null
null
core/models.py
mcflydesigner/InnoRussian
70bec97ad349f340bd66cd8234d94f8829540397
[ "MIT" ]
null
null
null
from django.db import models from django.utils.timezone import now from django.core.validators import FileExtensionValidator from django.contrib.auth import get_user_model from django.contrib.postgres.fields import ArrayField from django.db.models import (Func, Value, CharField, IntegerField) from .shortcuts import upload_to """ Models of core app. The architecture is done in the following way. An user accesses the content sequentially: Category -> Subcategory -> List of words """ class Category(models.Model): """ The model for categories """ name = models.CharField('Name', max_length=55, unique=True) # Here we use FileField instead of ImageField to allow only .svg extension for images. picture = models.FileField('Picture', upload_to=upload_to('categories/pictures/'), validators=[FileExtensionValidator(allowed_extensions=['svg'])]) class Meta: verbose_name_plural = 'categories' ordering = ['id'] def __str__(self): return self.name + '(' + str(self.id) + ')' class SubCategory(models.Model): """ The model for subcategories which are connected with the corresponding categories. One subcategory can be connected to different categories(many to many relationship). """ categoryId = models.ManyToManyField(Category) name = models.CharField('Name', max_length=55, unique=True) # Here we use FileField instead of ImageField to allow only .svg extension for images. picture = models.FileField('Picture', upload_to=upload_to('subcategories/pictures/'), validators=[FileExtensionValidator(allowed_extensions=['svg'])]) class Meta: verbose_name_plural = 'subcategories' ordering = ['id'] def __str__(self): return self.name + '(' + str(self.id) + ')' class TypesOfCard(models.TextChoices): """ Each card must have a type for the convenience of the user(sorting) """ WORD = 'W', 'Word' DIALOGUE = 'D', 'Dialogue' SENTENCE = 'S', 'Sentence' class Card(models.Model): """ Model for the cards with the content. The card can be connected to different categories at the same time(many to many relationship) """ subCategoryId = models.ManyToManyField(SubCategory) content = models.TextField('Content') # The card must have exactly one type out of TypesOfCard type = models.CharField(max_length=1, choices=TypesOfCard.choices, default=TypesOfCard.WORD) # notes = models.CharField('Notes', blank=True, max_length=255) # Pronunciation for the card is optional pronunciation = models.FileField('Pronunciation', upload_to=upload_to('cards/sounds/'), validators=[FileExtensionValidator(allowed_extensions=['mp3'])], null=True, blank=True) # Translit of pronunciation is optional translit_of_pronunciation = models.TextField('Translit of pronunciation', null=True, blank=True) class Meta: ordering = ['-pk'] def __str__(self): return self.content + '(' + str(self.id) + ')' class Favourite(models.Model): """ Model for user's favourite cards. """ card = models.ForeignKey(Card, on_delete=models.CASCADE) owner = models.ForeignKey(get_user_model(), on_delete=models.CASCADE) # For sorting by `default` data_added = models.DateTimeField(default=now) class Meta: ordering = ['-data_added'] def __str__(self): return 'card ' + str(self.card.id) + ' -> user ' + str(self.owner.id) + \ ' (' + str(self.id) + ') ' class ArrayPosition(Func): """ Class to solve one of the Django's problems. This class is used for filtering(user's sorting option) the cards. """ function = 'array_position' def __init__(self, items, *expressions, **extra): if isinstance(items[0], int): base_field = IntegerField() else: base_field = CharField(max_length=max(len(i) for i in items)) first_arg = Value(list(items), output_field=ArrayField(base_field)) expressions = (first_arg,) + expressions super().__init__(*expressions, **extra)
35.393443
101
0.652154
3,795
0.878879
0
0
0
0
0
0
1,557
0.360584
06c565b07d3d63057b60da7cadb5483464d2b8ef
250
py
Python
tests/tushare_to_MongoDB.py
sibuzu/OnePy
464fca1c68a10f90ad128da3bfb03f05d2fc24bc
[ "MIT" ]
null
null
null
tests/tushare_to_MongoDB.py
sibuzu/OnePy
464fca1c68a10f90ad128da3bfb03f05d2fc24bc
[ "MIT" ]
null
null
null
tests/tushare_to_MongoDB.py
sibuzu/OnePy
464fca1c68a10f90ad128da3bfb03f05d2fc24bc
[ "MIT" ]
null
null
null
import OnePy as op instrument = "000001" ktype = "D" start = "2017-01-01" end = None test = op.Tushare_to_MongoDB(database=instrument, collection=ktype) test.data_to_db(code=instrument, start=start, end=end, ktype=ktype, autype="qfq", index=False)
25
94
0.748
0
0
0
0
0
0
0
0
28
0.112
06c71c090d4fa330c0d0b447373205ef201db5b3
1,836
py
Python
costar_models/python/costar_models/datasets/h5f_generator.py
cpaxton/costar_plan
be5c12f9d0e9d7078e6a5c283d3be059e7f3d040
[ "Apache-2.0" ]
66
2018-10-31T04:58:53.000Z
2022-03-17T02:32:25.000Z
costar_models/python/costar_models/datasets/h5f_generator.py
cpaxton/costar_plan
be5c12f9d0e9d7078e6a5c283d3be059e7f3d040
[ "Apache-2.0" ]
8
2018-10-23T21:19:25.000Z
2018-12-03T02:08:41.000Z
costar_models/python/costar_models/datasets/h5f_generator.py
cpaxton/costar_plan
be5c12f9d0e9d7078e6a5c283d3be059e7f3d040
[ "Apache-2.0" ]
25
2018-10-19T00:54:17.000Z
2021-10-10T08:28:15.000Z
from __future__ import print_function import h5py as h5f import numpy as np import six import os from .npy_generator import NpzGeneratorDataset from .image import * class H5fGeneratorDataset(NpzGeneratorDataset): ''' Placeholder class for use with the ctp training tool. This one generates samples from an h5f encoded set of data. The Npz generator version implements a generic version of this that just takes the load function so all we need to do is implement things so they'll load a particular class. ''' def __init__(self, *args, **kwargs): super(H5fGeneratorDataset, self).__init__(*args, **kwargs) self.file_extension = 'h5' self.file = None # Interface for with statement def __enter__(self): return self.file def __exit__(self, *args): self.file.close() self.file = None def _load(self, filename, verbose=0): ''' Helper to load the hdf5 file data into a dictionary of numpy arrays in memory. ''' if verbose > 0: print('loading hf5 filename: ' + str(filename)) debug_str = 'loading data:\n' dataset = h5f.File(filename, 'r') self.file = dataset # TODO: fix up this horrible code for k, v in six.iteritems(dataset): if verbose > 0: debug_str += 'key: ' + str(k) if k == "image_type" or k == "type_image": if verbose > 0: debug_str += ' skipped\n' continue if verbose > 0: debug_str += ' added\n' if k == "image": self.load_jpeg.append(k) elif k == "depth_image": self.load_png.append(k) if verbose > 0: print(debug_str) return self
30.098361
86
0.582789
1,667
0.907952
0
0
0
0
0
0
606
0.330065
06c7a3448e8983e9a265c812e501b174dd35b66d
5,821
py
Python
SegmentationAlgorithms/CBSMoT.py
JRose6/TrajLib
2a5749bf6e9517835801926d6a5e92564ef2c7f0
[ "Apache-2.0" ]
null
null
null
SegmentationAlgorithms/CBSMoT.py
JRose6/TrajLib
2a5749bf6e9517835801926d6a5e92564ef2c7f0
[ "Apache-2.0" ]
null
null
null
SegmentationAlgorithms/CBSMoT.py
JRose6/TrajLib
2a5749bf6e9517835801926d6a5e92564ef2c7f0
[ "Apache-2.0" ]
null
null
null
import Distances as d import pandas as pd import numpy as np class CBSmot: nano_to_seconds = 1000000000 def count_neighbors(self, traj, position, max_dist): neighbors = 0 yet = True j = position + 1 while j < len(traj.index) and yet: if d.Distances.calculate_two_point_distance(traj.iloc[position]['lat'], traj.iloc[position]['lon'], traj.iloc[j]['lat'], traj.iloc[j]['lon']) < max_dist: neighbors += 1 else: yet = False j += 1 return neighbors def centroid(self, subtraj): x = 0 y = 0 for index, row in subtraj.iterrows(): x += row['lat'] y += row['lon'] return [x/len(subtraj.index), y/len(subtraj.index)] def clean_stops(self, stops, min_time): stops_aux = stops.copy() for stop in stops: p1 = stop.index.values[0] p2 = stop.index.values[-1] if (p2 - p1).item() / CBSmot.nano_to_seconds < min_time: stops_aux.remove(stop) return stops_aux def clean_stops_segment(self, stops, min_time, index): stops_aux = stops.copy() i = 0 curr_idx=0 for stop in stops: p1 = stop.index.values[0] p2 = stop.index.values[-1] if (p2 - p1).item() / CBSmot.nano_to_seconds < min_time: stops_aux.pop(i) index.pop(i) else: i += 1 return index, stops_aux def merge_stop(self, stops, max_dist, time_tolerance): i = 0 while i < len(stops): if (i+1) < len(stops): s1 = stops[i] s2 = stops[i+1] p2 = s2.index.values[0] p1 = s1.index.values[-1] if (p2 - p1).item() / CBSmot.nano_to_seconds <= time_tolerance: c1 = self.centroid(s1) c2 = self.centroid(s2) if d.Distances.calculate_two_point_distance(c1[0], c1[1], c2[0], c2[1]) <= max_dist: stops.pop(i+1) s1.append(s2, ignore_index=True) stops[i] = s1 i -= 1 i += 1 return stops def merge_stop_segment(self, stops, max_dist, time_tolerance, index): i = 0 while i < len(stops): if (i+1) < len(stops): s1 = stops[i] s2 = stops[i+1] p2 = s2.index.values[0] p1 = s1.index.values[-1] if (p2 - p1).item() / CBSmot.nano_to_seconds <= time_tolerance: c1 = self.centroid(s1) c2 = self.centroid(s2) if d.Distances.calculate_two_point_distance(c1[0], c1[1], c2[0], c2[1]) <= max_dist: index_i = index[i] index_i_1 = index[i+1] stops.pop(i+1) index.pop(i+1) s1.append(s2, ignore_index=True) stops[i] = s1 index[i] = [index_i[0], index_i_1[-1]] i -= 1 i += 1 return index, stops def find_stops(self, traj, max_dist, min_time, time_tolerance, merge_tolerance): neighborhood = [0]*len(traj.index) stops = [] traj.sort_index(inplace=True) j = 0 while j < len(traj.index): valor = self.count_neighbors(traj, j, max_dist) neighborhood[j] = valor j += valor j += 1 for i in range(len(neighborhood)): if neighborhood[i] > 0: p1 = pd.to_datetime(traj.iloc[i].name) p2 = pd.to_datetime(traj.iloc[i + neighborhood[i]-1].name) diff = (p2 - p1).total_seconds() if diff >= time_tolerance: stops.append(traj.loc[p1:p2]) stops = self.merge_stop(stops, max_dist, merge_tolerance) stops = self.clean_stops(stops, min_time) return stops def segment_stops_moves(self, traj, max_dist, min_time, time_tolerance, merge_tolerance): neighborhood = [0]*len(traj.index) stops = [] index = [] traj.sort_index(inplace=True) j = 0 while j < len(traj.index): valor = self.count_neighbors(traj, j, max_dist) neighborhood[j] = valor j += valor j += 1 #print(neighborhood) for i in range(len(neighborhood)): if neighborhood[i] > 0: p1 = pd.to_datetime(traj.iloc[i].name) p2 = pd.to_datetime(traj.iloc[i + neighborhood[i]-1].name) diff = (p2 - p1).total_seconds() if diff >= time_tolerance: stops.append(traj.loc[p1:p2]) index.append([p1, p2]) #print(len(index)) index, stops = self.merge_stop_segment(stops, max_dist, merge_tolerance, index) #print(len(index)) index, stops = self.clean_stops_segment(stops, min_time, index) #print(len(index)) return index, stops @staticmethod def get_quantile(traj,area): if area>1 or area<0: raise ValueError("Area must be >=0 and <=1") distances = [1] for i in range(len(traj)-1): p1 = traj.iloc[i] p2 = traj.iloc[i+1] distances.append(d.Distances.calculate_two_point_distance(p1.lat,p1.lon,p2.lat,p2.lon)) return np.quantile(distances,area,overwrite_input=True)
35.932099
104
0.489263
5,758
0.989177
0
0
419
0.071981
0
0
130
0.022333
06c9a2b8530162b36b57399f64b942d4d2384eb7
164
py
Python
apps/presupuesto/admin.py
edilio/cubanoshaciamiami.com
541a22998b7c7ad3acda784c5657bfdf79cc7f07
[ "MIT" ]
null
null
null
apps/presupuesto/admin.py
edilio/cubanoshaciamiami.com
541a22998b7c7ad3acda784c5657bfdf79cc7f07
[ "MIT" ]
null
null
null
apps/presupuesto/admin.py
edilio/cubanoshaciamiami.com
541a22998b7c7ad3acda784c5657bfdf79cc7f07
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import TipoDeGasto, PresupuestoDeGasto admin.site.register(TipoDeGasto) admin.site.register(PresupuestoDeGasto)
27.333333
52
0.829268
0
0
0
0
0
0
0
0
0
0
06c9d2978cf880b3371f69c40666eeeea090512c
13,838
py
Python
Support/validate.py
sgarbesi/javascript-eslint.tmbundle
b117fe0133582676113a96fc9804795c033d0b78
[ "BSD-3-Clause" ]
1
2015-05-01T14:24:39.000Z
2015-05-01T14:24:39.000Z
Support/validate.py
sgarbesi/javascript-eslint.tmbundle
b117fe0133582676113a96fc9804795c033d0b78
[ "BSD-3-Clause" ]
null
null
null
Support/validate.py
sgarbesi/javascript-eslint.tmbundle
b117fe0133582676113a96fc9804795c033d0b78
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/env python # encoding: utf-8 """ Validate a JavaScript file using eslint. Author: Nate Silva Copyright 2014 Nate Silva License: MIT """ from __future__ import print_function import sys import os import re import time import json import subprocess import tempfile import hashlib import shutil def find_up_the_tree(dir_name, filename, max_depth=30): """ Search for the named file in the dir_name or any of its parent directories, up to the root directory. """ while True: if max_depth <= 0: return None full_path = os.path.abspath(os.path.join(dir_name, filename)) if os.path.isfile(full_path): return full_path (drive, path) = os.path.splitdrive(dir_name) is_root = (path == os.sep or path == os.altsep) if is_root: return None max_depth -= 1 dir_name = os.path.abspath(os.path.join(dir_name, os.pardir)) def find_eslintrc(start_dir): """ Locates the most relevant .eslintrc file. Of the following locations, the first to be found will be used: 1. An .eslintrc file in the start_dir or any of its parents. 2. If the file has not been saved yet, ~/.eslintrc will be used. start_dir is normally set to the directory of the file being validated. When start_dir is not provided (which happens with files that are not saved yet), ~/.eslintrc is the only candidate that is considered. If no relevant .eslintrc is found, the return value is None. """ if start_dir: # locate the nearest .eslintrc eslintrc = find_up_the_tree(start_dir, '.eslintrc') if eslintrc: return eslintrc # last ditch: look for .eslintrc in the user’s home directory home_eslintrc = os.path.expanduser('~/.eslintrc') if os.path.isfile(home_eslintrc): return home_eslintrc return None def show_error_message(message): context = { 'message': message, 'timestamp': time.strftime('%c') } my_dir = os.path.abspath(os.path.dirname(__file__)) error_ejs_path = os.path.join(my_dir, 'error.ejs') error_ejs = open(error_ejs_path, 'r').read() template_path = os.path.join(my_dir, 'template.html') template = open(template_path, 'r').read() template = template.replace('{{ TM_BUNDLE_SUPPORT }}', os.environ['TM_BUNDLE_SUPPORT']) template = template.replace('{{ EJS_TEMPLATE }}', json.dumps(error_ejs)) template = template.replace('{{ CONTEXT }}', json.dumps(context)) print(template) def get_marker_directory(): """ Create the directory that will hold "marker" files that we use to detect which files have a validation window open. Used to implement the following feature: Normally, when you hit Cmd-S, the validation window appears only if there is a warning or error. Assume you had previously validated a file, and the validation window showing its errors is still open. Now you fix the errors and press Cmd-S. We want that validation window to update to show no errors. In order to do this, we have to somehow detect if TextMate has a validation window open for the current file. It’s not easy. We use marker files. This script creates a marker file before returning the HTML document that will be shown in the validation window. When the HTML document detects that it is being hidden (closed), it runs a TextMate.system command to delete its marker file. """ baseDir = os.path.join(tempfile.gettempdir(), 'javascript-eslint-tmbundle') if not os.path.isdir(baseDir): os.makedirs(baseDir) today = time.strftime('%Y-%m-%d') markerDir = os.path.join(baseDir, today) if not os.path.isdir(markerDir): os.makedirs(markerDir) # Deletion should happen automatically, but to be clean(er), # delete any previous-day marker dirs. children = os.listdir(baseDir) children = [_ for _ in children if _ != today] children = [os.path.join(baseDir, _) for _ in children] children = [_ for _ in children if os.path.isdir(_)] [shutil.rmtree(_, True) for _ in children] return markerDir def validate(quiet=False): # locate the .eshintrc to use eslintrc = find_eslintrc(os.environ.get('TM_DIRECTORY', None)) # Copy stdin to a named temporary file: at this time eslint # doesn’t support reading from stdin. file_to_validate = tempfile.NamedTemporaryFile(suffix='.js') if os.environ['TM_SCOPE'].startswith('source.js'): shutil.copyfileobj(sys.stdin, file_to_validate) else: # If we are validating an HTML file with embedded # JavaScript, only copy content within the # <script>…</script> tags to the subprocess. start_tag = re.compile('(\<\s*script)[\s\>]', re.IGNORECASE) end_tag = re.compile('\<\/\s*script[\s\>]', re.IGNORECASE) state = 'IGNORE' for line in sys.stdin: while line: if state == 'IGNORE': match = start_tag.search(line) if match: # found a script tag line = ' ' * match.end(1) + line[match.end(1):] state = 'LOOK_FOR_END_OF_OPENING_TAG' else: file_to_validate.write('\n') line = None elif state == 'LOOK_FOR_END_OF_OPENING_TAG': gt_pos = line.find('>') if gt_pos != -1: line = ' ' * (gt_pos + 1) + line[gt_pos + 1:] state = 'PIPE_TO_OUTPUT' else: file_to_validate.write('\n') line = None elif state == 'PIPE_TO_OUTPUT': match = end_tag.search(line) if match: # found closing </script> tag file_to_validate.write(line[:match.start()]) line = line[match.end():] state = 'IGNORE' else: file_to_validate.write(line) line = None file_to_validate.flush() # build eslint args args = [ os.environ.get('TM_JAVASCRIPT_ESLINT_ESLINT', 'eslint'), '-f', 'compact' ] if eslintrc: args.append('-c') args.append(eslintrc) args.append(file_to_validate.name) # Build env for our command: ESLint (and Node) are often # installed to /usr/local/bin, which may not be on the # bundle’s PATH in a default install of TextMate. env = os.environ.copy() path_parts = env['PATH'].split(':') if '/bin' not in path_parts: path_parts.append('/bin') if '/usr/bin' not in path_parts: path_parts.append('/usr/bin') if '/usr/local/bin' not in path_parts: path_parts.append('/usr/local/bin') env['PATH'] = ':'.join(path_parts) try: eslint = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env) (child_stdout, child_stderr) = eslint.communicate() if child_stderr: msg = [ 'Hi there. This is the “JavaScript ESLint” bundle for ' + 'TextMate. I validate your code using ESLint.', '', 'I had the following problem running <code>eslint</code>:', '', '<code>%s</code>' % child_stderr, '', '<h4>How to disable validation</h4>', 'If you mistakenly installed this validation tool and want to ' + 'disable it, you can do so in TextMate:', '', '<ol>' + '<li>On the TextMate menu, choose ' + '<i>Bundles</i> > <i>Edit Bundles…</i></li>' + '<li>Locate “JavaScript ESLint”</li>' + '<li>Uncheck “Enable this item”</li>' + '<li>Close the Bundle Editor and choose “Save”</li>' + '</ol>' ] show_error_message('<br>'.join(msg)) sys.exit() except OSError as e: msg = [ 'Hi there. This is the “JavaScript ESLint” bundle for ' + 'TextMate. I validate your code using ESLint.', '', 'I had the following problem running <code>eslint</code>:', '', '<code>%s</code>' % e, '', '<h4>How to fix it</h4>', 'Make sure the <code>eslint</code> and <code>node</code> ' + 'commands are on the <code>PATH</code>.', '', '<ol>' + '<li>Go to <i>TextMate</i> > <i>Preferences…</i> > ' + '<i>Variables</i></li>' + '<li>Ensure the <code>PATH</code> is enabled there and that ' + 'it includes the location of your <code>eslint</code> ' + 'and <code>node</code> commands.</li>' '</ol>', 'The path currently used by TextMate bundles is:', '', '<div style="overflow:auto"><code>%s</code></div>' % env['PATH'], '<h4>How to disable validation</h4>', 'If you mistakenly installed this validation tool and want to ' + 'disable it, you can do so in TextMate:', '', '<ol>' + '<li>On the TextMate menu, choose ' + '<i>Bundles</i> > <i>Edit Bundles…</i></li>' + '<li>Locate “JavaScript ESLint”</li>' + '<li>Uncheck “Enable this item”</li>' + '<li>Close the Bundle Editor and choose “Save”</li>' + '</ol>' ] show_error_message('<br>'.join(msg)) sys.exit() # parse the results rx = re.compile('^[^:]+\: line (?P<line>\d+), col (?P<character>\d+), ' + '(?P<code>\w+) - (?P<reason>.+?)(\s\((?P<shortname>[\w\-]+)\))?$') issues = [] for line in child_stdout.split('\n'): line = line.strip() if not line: continue m = rx.match(line) if not m: continue issue = { 'line': int(m.group('line')), 'character': int(m.group('character')) + 1, 'code': m.group('code'), 'reason': m.group('reason') } if m.group('shortname'): issue['shortname'] = m.group('shortname') issues.append(issue) # normalize line numbers input_start_line = int(os.environ['TM_INPUT_START_LINE']) - 1 for issue in issues: issue['line'] += input_start_line # add URLs to the issues if 'TM_FILEPATH' in os.environ: url_maker = lambda x: \ 'txmt://open?url=file://%s&amp;line=%d&amp;column=%d' % \ (os.environ['TM_FILEPATH'], x['line'], x['character']) else: url_maker = lambda x: \ 'txmt://open?line=%d&amp;column=%d' % (x['line'], x['character']) for issue in issues: issue['url'] = url_maker(issue) # context data we will send to JavaScript context = { 'eslintrc': eslintrc, 'issues': issues, 'timestamp': time.strftime('%c') } if 'TM_FILEPATH' in os.environ: context['fileUrl'] = \ 'txmt://open?url=file://%s' % os.environ['TM_FILEPATH'] context['targetFilename'] = os.path.basename(os.environ['TM_FILEPATH']) else: context['fileUrl'] = 'txmt://open?line=1&amp;column=0' context['targetFilename'] = '(current unsaved file)' # Identify the marker file that we will use to indicate the # TM_FILEPATH of the file currently shown in the validation # window. markerDir = get_marker_directory() hash = hashlib.sha224(context['fileUrl']).hexdigest() context['markerFile'] = os.path.join(markerDir, hash + '.marker') context['errorCount'] = \ len([_ for _ in context['issues'] if _['code'][0] == 'E']) context['warningCount'] = \ len([_ for _ in context['issues'] if _['code'][0] == 'W']) if context['errorCount'] == 0 and context['warningCount'] == 0: # There are no errors or warnings. We can bail out if all of # the following are True: # # * There is no validation window currently open for # this document. # * quiet is True. if not os.path.exists(context['markerFile']): if quiet: return # create the marker file markerFile = open(context['markerFile'], 'w+') markerFile.close() # read and prepare the template my_dir = os.path.abspath(os.path.dirname(__file__)) content_ejs_path = os.path.join(my_dir, 'content.ejs') content_ejs = open(content_ejs_path, 'r').read() template_path = os.path.join(my_dir, 'template.html') template = open(template_path, 'r').read() template = template.replace('{{ TM_BUNDLE_SUPPORT }}', os.environ['TM_BUNDLE_SUPPORT']) template = template.replace('{{ EJS_TEMPLATE }}', json.dumps(content_ejs)) template = template.replace('{{ CONTEXT }}', json.dumps(context)) # print(template) # @sgarbesi Tooltips for Textmate if context['errorCount'] == 0 and context['warningCount'] == 0: print('Lint Free!') return template = '%s Errors / %s Warnings' % (context['errorCount'], context['warningCount']) template = '%s\r\n---' % (template) for issue in context['issues']: template = '%s\r\n%s: L%s: %s' % (template, issue['code'], issue['line'], issue['reason']) print(template) if __name__ == '__main__': quiet = ('-q' in sys.argv or '--quiet' in sys.argv) validate(quiet)
33.833741
98
0.568001
0
0
0
0
0
0
0
0
6,160
0.443612
06cdfe64d4ce6044067a25d0bf7f0ef2fa35cf39
240
py
Python
Home_Work_2_B_Naychuk_Anastasiya/Task2.py
NaychukAnastasiya/goiteens-python3-naychuk
a79d0af238a15f58a822bb5d8e4d48227d4a7bc1
[ "MIT" ]
null
null
null
Home_Work_2_B_Naychuk_Anastasiya/Task2.py
NaychukAnastasiya/goiteens-python3-naychuk
a79d0af238a15f58a822bb5d8e4d48227d4a7bc1
[ "MIT" ]
null
null
null
Home_Work_2_B_Naychuk_Anastasiya/Task2.py
NaychukAnastasiya/goiteens-python3-naychuk
a79d0af238a15f58a822bb5d8e4d48227d4a7bc1
[ "MIT" ]
null
null
null
# y = f(X) # y = 2*x -10 # x>0 # y = 0# x=0 # y = 2 * abs(x) -1 # x<0 print("Введіть число") x = float(input()) y = 0 if x > 0: y = 2*x -10 elif x == 0: y = 0 else: #x<0 y = 2 * abs(x) -1 print ("y: ",y)
13.333333
26
0.375
0
0
0
0
0
0
0
0
107
0.424603
06d128fc6f207aa019def30c73ff71c2d5f4ad72
8,745
py
Python
imagenet_pytorch/utils.py
lishuliang/Emotion-Recognition
a8aea1b71b2508e6157410089b20ab463fe901f5
[ "MIT" ]
1
2019-03-16T08:11:53.000Z
2019-03-16T08:11:53.000Z
imagenet_pytorch/utils.py
lishuliang/Emotion-Recognition
a8aea1b71b2508e6157410089b20ab463fe901f5
[ "MIT" ]
null
null
null
imagenet_pytorch/utils.py
lishuliang/Emotion-Recognition
a8aea1b71b2508e6157410089b20ab463fe901f5
[ "MIT" ]
null
null
null
import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.optim import torch.utils.data import torch.nn.functional as F from torch.nn import init class attention(nn.Module): def __init__(self, input_channels, map_size): super(attention, self).__init__() self.pool = nn.AvgPool2d(kernel_size=map_size) self.fc1 = nn.Linear(in_features=input_channels, out_features=input_channels // 2) self.fc2 = nn.Linear(in_features=input_channels // 2, out_features=input_channels) def forward(self, x): output = self.pool(x) output = output.view(output.size()[0], output.size()[1]) output = self.fc1(output) output = F.relu(output) output = self.fc2(output) output = F.sigmoid(output) output = output.view(output.size()[0], output.size()[1], 1, 1) output = torch.mul(x, output) return output class transition(nn.Module): def __init__(self, if_att, current_size, input_channels, keep_prob): super(transition, self).__init__() self.input_channels = input_channels self.keep_prob = keep_prob self.bn = nn.BatchNorm2d(self.input_channels) self.conv = nn.Conv2d(self.input_channels, self.input_channels, kernel_size=1, bias=False) # self.dropout = nn.Dropout2d(1 - self.keep_prob) self.pool = nn.AvgPool2d(kernel_size=2) self.if_att = if_att if self.if_att == True: self.attention = attention( input_channels=self.input_channels, map_size=current_size) def forward(self, x): output = self.bn(x) output = F.relu(output) output = self.conv(output) if self.if_att == True: output = self.attention(output) # output = self.dropout(output) output = self.pool(output) return output class global_pool(nn.Module): def __init__(self, input_size, input_channels): super(global_pool, self).__init__() self.input_size = input_size self.input_channels = input_channels self.bn = nn.BatchNorm2d(self.input_channels) self.pool = nn.AvgPool2d(kernel_size=self.input_size) def forward(self, x): output = self.bn(x) output = F.relu(output) output = self.pool(output) return output class compress(nn.Module): def __init__(self, input_channels, keep_prob): super(compress, self).__init__() self.keep_prob = keep_prob self.bn = nn.BatchNorm2d(input_channels) self.conv = nn.Conv2d(input_channels, input_channels // 2, kernel_size=1, padding=0, bias=False) def forward(self, x): output = self.bn(x) output = F.relu(output) output = self.conv(output) # output = F.dropout2d(output, 1 - self.keep_prob) return output class clique_block(nn.Module): def __init__(self, input_channels, channels_per_layer, layer_num, loop_num, keep_prob): super(clique_block, self).__init__() self.input_channels = input_channels self.channels_per_layer = channels_per_layer self.layer_num = layer_num self.loop_num = loop_num self.keep_prob = keep_prob # conv 1 x 1 self.conv_param = nn.ModuleList([nn.Conv2d(self.channels_per_layer, self.channels_per_layer, kernel_size=1, padding=0, bias=False) for i in range((self.layer_num + 1) ** 2)]) for i in range(1, self.layer_num + 1): self.conv_param[i] = nn.Conv2d( self.input_channels, self.channels_per_layer, kernel_size=1, padding=0, bias=False) for i in range(1, self.layer_num + 1): self.conv_param[i * (self.layer_num + 2)] = None for i in range(0, self.layer_num + 1): self.conv_param[i * (self.layer_num + 1)] = None self.forward_bn = nn.ModuleList([nn.BatchNorm2d( self.input_channels + i * self.channels_per_layer) for i in range(self.layer_num)]) self.forward_bn_b = nn.ModuleList( [nn.BatchNorm2d(self.channels_per_layer) for i in range(self.layer_num)]) self.loop_bn = nn.ModuleList([nn.BatchNorm2d( self.channels_per_layer * (self.layer_num - 1)) for i in range(self.layer_num)]) self.loop_bn_b = nn.ModuleList( [nn.BatchNorm2d(self.channels_per_layer) for i in range(self.layer_num)]) # conv 3 x 3 self.conv_param_bottle = nn.ModuleList([nn.Conv2d(self.channels_per_layer, self.channels_per_layer, kernel_size=3, padding=1, bias=False) for i in range(self.layer_num)]) def forward(self, x): # key: 1, 2, 3, 4, 5, update every loop self.blob_dict = {} # save every loops results self.blob_dict_list = [] # first forward for layer_id in range(1, self.layer_num + 1): bottom_blob = x # bottom_param = self.param_dict['0_' + str(layer_id)] bottom_param = self.conv_param[layer_id].weight for layer_id_id in range(1, layer_id): # pdb.set_trace() bottom_blob = torch.cat( (bottom_blob, self.blob_dict[str(layer_id_id)]), 1) # bottom_param = torch.cat((bottom_param, self.param_dict[str(layer_id_id) + '_' + str(layer_id)]), 1) bottom_param = torch.cat( (bottom_param, self.conv_param[layer_id_id * (self.layer_num + 1) + layer_id].weight), 1) next_layer = self.forward_bn[layer_id - 1](bottom_blob) next_layer = F.relu(next_layer) # conv 1 x 1 next_layer = F.conv2d( next_layer, bottom_param, stride=1, padding=0) # conv 3 x 3 next_layer = self.forward_bn_b[layer_id - 1](next_layer) next_layer = F.relu(next_layer) next_layer = F.conv2d( next_layer, self.conv_param_bottle[layer_id - 1].weight, stride=1, padding=1) # next_layer = F.dropout2d(next_layer, 1 - self.keep_prob) self.blob_dict[str(layer_id)] = next_layer self.blob_dict_list.append(self.blob_dict) # loop for loop_id in range(self.loop_num): for layer_id in range(1, self.layer_num + 1): layer_list = [l_id for l_id in range(1, self.layer_num + 1)] layer_list.remove(layer_id) bottom_blobs = self.blob_dict[str(layer_list[0])] # bottom_param = self.param_dict[layer_list[0] + '_' + str(layer_id)] bottom_param = self.conv_param[layer_list[0] * (self.layer_num + 1) + layer_id].weight for bottom_id in range(len(layer_list) - 1): bottom_blobs = torch.cat( (bottom_blobs, self.blob_dict[str(layer_list[bottom_id + 1])]), 1) # bottom_param = torch.cat((bottom_param, self.param_dict[layer_list[bottom_id+1]+'_'+str(layer_id)]), 1) bottom_param = torch.cat( (bottom_param, self.conv_param[layer_list[bottom_id + 1] * (self.layer_num + 1) + layer_id].weight), 1) bottom_blobs = self.loop_bn[layer_id - 1](bottom_blobs) bottom_blobs = F.relu(bottom_blobs) # conv 1 x 1 mid_blobs = F.conv2d( bottom_blobs, bottom_param, stride=1, padding=0) # conv 3 x 3 top_blob = self.loop_bn_b[layer_id - 1](mid_blobs) top_blob = F.relu(top_blob) top_blob = F.conv2d( top_blob, self.conv_param_bottle[layer_id - 1].weight, stride=1, padding=1) self.blob_dict[str(layer_id)] = top_blob self.blob_dict_list.append(self.blob_dict) assert len(self.blob_dict_list) == 1 + self.loop_num # output block_feature_I = self.blob_dict_list[0]['1'] for layer_id in range(2, self.layer_num + 1): block_feature_I = torch.cat( (block_feature_I, self.blob_dict_list[0][str(layer_id)]), 1) block_feature_I = torch.cat((x, block_feature_I), 1) block_feature_II = self.blob_dict_list[self.loop_num]['1'] for layer_id in range(2, self.layer_num + 1): block_feature_II = torch.cat( (block_feature_II, self.blob_dict_list[self.loop_num][str(layer_id)]), 1) return block_feature_I, block_feature_II
43.507463
145
0.5992
8,532
0.975643
0
0
0
0
0
0
707
0.080846
06d1d332e24aee96ce48f604359996ef77a12eea
1,349
py
Python
setup.py
jopo666/HistoPrep
1b74c346b38c7ca44f92269246571f5f850836af
[ "MIT" ]
11
2021-04-21T10:37:22.000Z
2021-12-19T22:32:59.000Z
setup.py
jopo666/HistoPrep
1b74c346b38c7ca44f92269246571f5f850836af
[ "MIT" ]
1
2021-02-24T09:15:13.000Z
2021-04-19T06:38:58.000Z
setup.py
jopo666/HistoPrep
1b74c346b38c7ca44f92269246571f5f850836af
[ "MIT" ]
1
2021-09-16T05:00:21.000Z
2021-09-16T05:00:21.000Z
import setuptools exec(open('histoprep/_version.py').read()) with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read() setuptools.setup( name="histoprep", version=__version__, author="jopo666", scripts=['HistoPrep'], author_email="jopo@birdlover.com", description="Preprocessing module for large histological images.", long_description=long_description, long_description_content_type="text/markdown", url="https://github.com/jopo666/HistoPrep", packages=setuptools.find_packages(include=['histoprep','histoprep.*']), install_requires=[ 'opencv-python==4.5.1.48', 'openslide-python==1.1.2', 'pandas==1.2.1', 'Pillow==8.0.0', 'seaborn==0.11.0', 'numpy==1.19.2', 'tqdm==4.60.0', 'aicspylibczi==2.8.0', 'shapely==1.7.1', 'scikit-learn==0.24.1', 'ipywidgets==7.6.3', ], classifiers=[ "Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Development Status :: 3 - Alpha", "Intended Audience :: Science/Research", "Topic :: Scientific/Engineering :: Bio-Informatics", ], keywords='image-analysis preprocessing histology openslide', python_requires='>=3.8', )
32.119048
75
0.614529
0
0
0
0
0
0
0
0
723
0.535953
06d23d367076f35c30b175f7a472c7335658ae54
389
py
Python
setup.py
cprogrammer1994/python-depth-sort
5399d6d0791eb897d0cac16d2e38b26041478a82
[ "MIT" ]
null
null
null
setup.py
cprogrammer1994/python-depth-sort
5399d6d0791eb897d0cac16d2e38b26041478a82
[ "MIT" ]
null
null
null
setup.py
cprogrammer1994/python-depth-sort
5399d6d0791eb897d0cac16d2e38b26041478a82
[ "MIT" ]
null
null
null
import platform from setuptools import Extension, setup target = platform.system().lower() extra_compile_args = [] if target.startswith('linux'): extra_compile_args.append('-std=c++11') ext = Extension( name='depth_sort', sources=['depth_sort.cpp'], extra_compile_args=extra_compile_args, ) setup( name='depth_sort', version='0.1.0', ext_modules=[ext], )
16.913043
43
0.691517
0
0
0
0
0
0
0
0
66
0.169666
06d28dfe07994e25ac5013d571490aa1301605ee
15,260
py
Python
train.py
Kiwi-PUJ/DataTraining
706642996e884b47a0aa7dfb19da33a7234a311e
[ "CC0-1.0" ]
3
2021-06-04T00:07:54.000Z
2021-06-09T01:14:07.000Z
train.py
Kiwi-PUJ/DataTraining
706642996e884b47a0aa7dfb19da33a7234a311e
[ "CC0-1.0" ]
null
null
null
train.py
Kiwi-PUJ/DataTraining
706642996e884b47a0aa7dfb19da33a7234a311e
[ "CC0-1.0" ]
null
null
null
## @package Training_app # Training code developed with Tensorflow Keras. Content: Unet, Unet++ and FCN # # @version 1 # # Pontificia Universidad Javeriana # # Electronic Enginnering # # Developed by: # - Andrea Juliana Ruiz Gomez # Mail: <andrea_ruiz@javeriana.edu.co> # GitHub: andrearuizg # - Pedro Eli Ruiz Zarate # Mail: <pedro.ruiz@javeriana.edu.co> # GitHub: PedroRuizCode # # With support of: # - Francisco Carlos Calderon Bocanegra # Mail: <calderonf@javeriana.edu.co> # GitHub: calderonf # - John Alberto Betancout Gonzalez # Mail: <john@kiwibot.com> # GitHub: JohnBetaCode import os from time import time import numpy as np import cv2 from glob import glob from sklearn.model_selection import train_test_split import tensorflow as tf from tensorflow.keras.layers import * from tensorflow.keras.models import Model from tensorflow.keras.metrics import Recall, Precision from tensorflow.keras.callbacks import (EarlyStopping, ModelCheckpoint, ReduceLROnPlateau, CSVLogger, TensorBoard) ## Load data # Load the data # @param path Path of the image def load_data(path): images_train = sorted(glob(os.path.join(path, "images/train/*"))) masks_train = sorted(glob(os.path.join(path, "masks/train/*"))) images_valid = sorted(glob(os.path.join(path, "images/valid/*"))) masks_valid = sorted(glob(os.path.join(path, "masks/valid/*"))) train_x, valid_x = images_train, images_valid train_y, valid_y = masks_train, masks_valid return (train_x, train_y), (valid_x, valid_y) ## Read image # Read the images # @param path Path of the image def read_image(path): path = path.decode() x = cv2.imread(path, cv2.IMREAD_COLOR) x = cv2.resize(x, (256, 256)) x = x / 255.0 return x ## Read mask # Read the mask of the images # @param path Path of the mask def read_mask(path): path = path.decode() x = cv2.imread(path, cv2.IMREAD_GRAYSCALE) x = cv2.resize(x, (256, 256)) x = x / 1.0 x = np.expand_dims(x, axis=-1) return x ## Parse # Read images and masks and convert to TensorFlow dataformat # @param x Images # @param y Masks def tf_parse(x, y): def _parse(x, y): x = read_image(x) y = read_mask(y) return x, y x, y = tf.numpy_function(_parse, [x, y], [tf.float64, tf.float64]) x.set_shape([256, 256, 3]) y.set_shape([256, 256, 1]) return x, y ## Dataset # Read images and masks and convert to TensorFlow format # @param x Images # @param y Masks # @param batch Batch size def tf_dataset(x, y, batch): dataset = tf.data.Dataset.from_tensor_slices((x, y)) options = tf.data.Options() options.experimental_distribute.auto_shard_policy = ( tf.data.experimental.AutoShardPolicy.OFF) dataset = dataset.with_options(options) dataset = dataset.map(tf_parse) dataset = dataset.batch(batch) dataset = dataset.repeat() return dataset ## Down sample function # Make the down sample of the layer # @param x Input # @param filters The dimensionality of the output space # @param kernel_size Height and width of the 2D convolution window # @param padding Padding # @param strides Strides of the convolution along the height and width def down_block(x, filters, kernel_size=(3, 3), padding="same", strides=1): c = Conv2D(filters, kernel_size, padding=padding, strides=strides, activation="relu")(x) c = BatchNormalization()(c) c = Conv2D(filters, kernel_size, padding=padding, strides=strides, activation="relu")(c) c = BatchNormalization()(c) p = MaxPool2D((2, 2), (2, 2))(c) return c, p ## Up sample function # Make the up sample of the layer # @param x Input # @param skip The skip connection is made to avoid the loss of accuracy # in the downsampling layers. In case the image becomes so small that # it has no information, the weights are calculated with the skip layer. # @param filters The dimensionality of the output space # @param kernel_size Height and width of the 2D convolution window # @param padding Padding # @param strides Strides of the convolution along the height and width def up_block(x, skip, filters, kernel_size=(3, 3), padding="same", strides=1): us = UpSampling2D((2, 2))(x) concat = Concatenate()([us, skip]) c = Conv2D(filters, kernel_size, padding=padding, strides=strides, activation="relu")(concat) c = BatchNormalization()(c) c = Conv2D(filters, kernel_size, padding=padding, strides=strides, activation="relu")(c) c = BatchNormalization()(c) return c ## Bottleneck function # Added to reduce the number of feature maps in the network # @param x Input # @param filters The dimensionality of the output space # @param kernel_size Height and width of the 2D convolution window # @param padding Padding # @param strides Strides of the convolution along the height and width def bottleneck(x, filters, kernel_size=(3, 3), padding="same", strides=1): c = Conv2D(filters, kernel_size, padding=padding, strides=strides, activation="relu")(x) c = BatchNormalization()(c) c = Conv2D(filters, kernel_size, padding=padding, strides=strides, activation="relu")(c) c = BatchNormalization()(c) return c ## Unet 1 # Unet implementation # @param f Filters dimensionality def UNet_1(f): inputs = Input((256, 256, 3)) p0 = inputs c1, p1 = down_block(p0, f[0]) # 256 -> 128 c2, p2 = down_block(p1, f[1]) # 128 -> 64 c3, p3 = down_block(p2, f[2]) # 64 -> 32 c4, p4 = down_block(p3, f[3]) # 32 -> 16 bn = bottleneck(p4, f[4]) u3 = up_block(bn, c4, f[3]) # 16 -> 32 u4 = up_block(u3, c3, f[2]) # 32 -> 64 u5 = up_block(u4, c2, f[1]) # 64 -> 128 u6 = up_block(u5, c1, f[0]) # 128 -> 256 # Classifying layer outputs = Dropout(0.1)(u6) outputs = Conv2D(1, (1, 1), padding="same", activation="sigmoid")(outputs) model = Model(inputs, outputs) return model ## Unet 2 # Unet implementation # @param f Filters dimensionality def UNet_2(f): inputs = Input((256, 256, 3)) p0 = inputs c1, p1 = down_block(p0, f[0]) # 256 -> 128 c2, p2 = down_block(p1, f[1]) # 128 -> 64 c3, p3 = down_block(p2, f[2]) # 64 -> 32 c4, p4 = down_block(p3, f[3]) # 32 -> 16 c5, p5 = down_block(p4, f[4]) # 16 -> 8 c6, p6 = down_block(p5, f[5]) # 8 -> 4 bn = bottleneck(p6, f[6]) u1 = up_block(bn, c6, f[5]) # 4 -> 8 u2 = up_block(u1, c5, f[4]) # 8 -> 16 u3 = up_block(u2, c4, f[3]) # 16 -> 32 u4 = up_block(u3, c3, f[2]) # 32 -> 64 u5 = up_block(u4, c2, f[1]) # 64 -> 128 u6 = up_block(u5, c1, f[0]) # 128 -> 256 # Classifying layer outputs = Dropout(0.1)(u6) outputs = Conv2D(1, (1, 1), padding="same", activation="sigmoid")(outputs) model = Model(inputs, outputs) return model ## Unet++ 1 # Unet++ implementation # @param f Filters dimensionality def UNetpp_1(f): inputs = Input((256, 256, 3)) p0 = inputs c1, p1 = down_block(p0, f[0]) # 256 -> 128 c2, p2 = down_block(p1, f[1]) # 128 -> 64 c3, p3 = down_block(p2, f[2]) # 64 -> 32 c4, p4 = down_block(p3, f[3]) # 32 -> 16 u11 = up_block(c2, c1, f[0]) # 128 -> 256 u21 = up_block(c3, c2, f[1]) # 64 -> 128 u31 = up_block(c4, c3, f[2]) # 32 -> 64 u21_1 = Concatenate()([c2, u21]) u22 = up_block(u31, u21_1, f[1]) # 128 -> 256 u11_1 = Concatenate()([c1, u11]) u12 = up_block(u21, u11_1, f[0]) # 64 -> 128 u12_1 = Concatenate()([u11_1, u12]) u13 = up_block(u22, u12_1, f[0]) # 128 -> 256 bn = bottleneck(p4, f[4]) u3 = up_block(bn, c4, f[3]) # 16 -> 32 u31_1 = Concatenate()([c3, u31]) u4 = up_block(u3, u31_1, f[2]) # 32 -> 64 u22_1 = Concatenate()([u21_1, u22]) u5 = up_block(u4, u22_1, f[1]) # 64 -> 128 u13_1 = Concatenate()([u12_1, u13]) u6 = up_block(u5, u13_1, f[0]) # 128 -> 256 # Classifying layer outputs = Dropout(0.1)(u6) outputs = Conv2D(1, (1, 1), padding="same", activation="sigmoid")(outputs) model = Model(inputs, outputs) return model ## Unet++ 2 # Unet++ implementation # @param f Filters dimensionality def UNetpp_2(f): inputs = Input((256, 256, 3)) p0 = inputs c1, p1 = down_block(p0, f[0]) # 256 -> 128 c2, p2 = down_block(p1, f[1]) # 128 -> 64 c3, p3 = down_block(p2, f[2]) # 64 -> 32 c4, p4 = down_block(p3, f[3]) # 32 -> 16 c5, p5 = down_block(p4, f[4]) # 16 -> 8 c6, p6 = down_block(p5, f[5]) # 8 -> 4 u11 = up_block(c2, c1, f[0]) # 128 -> 256 u21 = up_block(c3, c2, f[1]) # 64 -> 128 u31 = up_block(c4, c3, f[2]) # 32 -> 64 u41 = up_block(c5, c4, f[3]) # 16 -> 32 u51 = up_block(c6, c5, f[4]) # 8 -> 16 u11_1 = Concatenate()([c1, u11]) u12 = up_block(u21, u11_1, f[0]) # 128 -> 256 u21_1 = Concatenate()([c2, u21]) u22 = up_block(u31, u21_1, f[1]) # 64 -> 128 u31_1 = Concatenate()([c3, u31]) u32 = up_block(u41, u31_1, f[2]) # 32 -> 64 u41_1 = Concatenate()([c4, u41]) u42 = up_block(u51, u41_1, f[3]) # 16 -> 32 u12_1 = Concatenate()([u11_1, u12]) u13 = up_block(u22, u12_1, f[0]) # 128 -> 256 u22_1 = Concatenate()([u21_1, u22]) u23 = up_block(u32, u22_1, f[1]) # 64 -> 128 u32_1 = Concatenate()([u31_1, u32]) u33 = up_block(u42, u32_1, f[2]) # 32 -> 64 u13_1 = Concatenate()([u12_1, u13]) u14 = up_block(u23, u13_1, f[0]) # 128 -> 256 u23_1 = Concatenate()([u22_1, u23]) u24 = up_block(u33, u23_1, f[1]) # 64 -> 128 u14_1 = Concatenate()([u13_1, u14]) u15 = up_block(u24, u14_1, f[0]) # 128 -> 256 bn = bottleneck(p6, f[6]) u1 = up_block(bn, c6, f[5]) # 4 -> 8 u51_1 = Concatenate()([c5, u51]) u2 = up_block(u1, u51_1, f[4]) # 8 -> 16 u42_1 = Concatenate()([u41_1, u42]) u3 = up_block(u2, u42_1, f[3]) # 16 -> 32 u33_1 = Concatenate()([u32_1, u33]) u4 = up_block(u3, u33_1, f[2]) # 32 -> 64 u24_1 = Concatenate()([u23_1, u24]) u5 = up_block(u4, u24_1, f[1]) # 64 -> 128 u15_1 = Concatenate()([u14_1, u15]) u6 = up_block(u5, u15_1, f[0]) # 128 -> 256 # Classifying layer outputs = Dropout(0.1)(u6) outputs = Conv2D(1, (1, 1), padding="same", activation="sigmoid")(outputs) model = Model(inputs, outputs) return model ## FCN 1 # Fully Convolutional Network implementation # @param f Filters dimensionality def FCN_1(f): inputs = Input((256, 256, 3)) p0 = inputs c1, p1 = down_block(p0, f[0]) # 256 -> 128 c2, p2 = down_block(p1, f[1]) # 128 -> 64 c3, p3 = down_block(p2, f[2]) # 64 -> 32 c4, p4 = down_block(p3, f[3]) # 32 -> 16 bn = bottleneck(p4, f[4]) pr1 = Conv2D(1, (4, 4), activation='relu', padding='same', strides=1)(bn) pr2 = Conv2D(1, (8, 8), activation='relu', padding='same', strides=1)(p3) pr3 = Conv2D(1, (16, 16), activation='relu', padding='same', strides=1)(p2) us1 = UpSampling2D((2, 2))(pr1) add1 = Add()([us1, pr2]) us2 = UpSampling2D((2, 2))(add1) add2 = Add()([us2, pr3]) us3 = UpSampling2D((4, 4))(add2) # Classifying layer outputs = Dropout(0.1)(us3) outputs = Conv2D(1, (32, 32), activation='sigmoid', padding='same')(outputs) model = Model(inputs, outputs) return model ## FCN 2 # Fully Convolutional Network implementation # @param f Filters dimensionality def FCN_2(f): inputs = Input((256, 256, 3)) p0 = inputs c1, p1 = down_block(p0, f[0]) # 256 -> 128 c2, p2 = down_block(p1, f[1]) # 128 -> 64 c3, p3 = down_block(p2, f[2]) # 64 -> 32 c4, p4 = down_block(p3, f[3]) # 32 -> 16 c5, p5 = down_block(p4, f[4]) # 16 -> 8 c6, p6 = down_block(p5, f[5]) # 8 -> 4 bn = bottleneck(p6, f[6]) pr1 = Conv2D(1, (1, 1), activation='relu', padding='same', strides=1)(bn) pr2 = Conv2D(1, (2, 2), activation='relu', padding='same', strides=1)(p5) pr3 = Conv2D(1, (4, 4), activation='relu', padding='same', strides=1)(p4) pr4 = Conv2D(1, (8, 8), activation='relu', padding='same', strides=1)(p3) pr5 = Conv2D(1, (16, 16), activation='relu', padding='same', strides=1)(p2) us1 = UpSampling2D((2, 2))(pr1) add1 = Add()([us1, pr2]) us2 = UpSampling2D((2, 2))(add1) add2 = Add()([us2, pr3]) us3 = UpSampling2D((2, 2))(add2) add3 = Add()([us3, pr4]) us4 = UpSampling2D((2, 2))(add3) add4 = Add()([us4, pr5]) us5 = UpSampling2D((4, 4))(add4) # Classifying layer outputs = Dropout(0.1)(us5) outputs = Conv2D(1, (32, 32), activation='sigmoid', padding='same')(outputs) model = Model(inputs, outputs) return model ## Training # CNN training def training(m_name): ## Dataset path = "media/" (train_x, train_y), (valid_x, valid_y) = load_data(path) ## Hyperparameters batch = 15 epochs = 190 train_dataset = tf_dataset(train_x, train_y, batch=batch) valid_dataset = tf_dataset(valid_x, valid_y, batch=batch) ## Time t0 = time() ## Filters f = [16, 32, 64, 128, 256, 512, 1024] if m_name == "unetv1": model = UNet_1(f) elif m_name == "unetv2": model = UNet_2(f) elif m_name == "unetppv1": model = UNetpp_1(f) elif m_name == "unetppv2": model = UNetpp_2(f) elif m_name == "fcnv1": model = FCN_1(f) else: model = FCN_2(f) m_sum = 'files/model_summary_%s_BN.txt' % m_name m_log = 'logs/%s_BN/scalars/' % m_name m_h5 = 'files/model_%s_BN.h5' % m_name m_data = 'files/data_%s_BN.csv' % m_name m_time = 'files/time_%s_BN.txt' % m_name model.compile(optimizer="adam", loss="binary_crossentropy", metrics=["acc", Precision(), Recall()]) with open(m_sum, 'w') as fh: model.summary(print_fn=lambda x: fh.write(x + '\n')) train_steps = len(train_x) // batch valid_steps = len(valid_x) // batch if len(train_x) % batch != 0: train_steps += 1 if len(valid_x) % batch != 0: valid_steps += 1 logdir = m_log tensorboard_callback = TensorBoard(log_dir=logdir) callbacks = [ ModelCheckpoint(m_h5), ReduceLROnPlateau(monitor='val_loss', factor=0.1, patience=10), CSVLogger(m_data), tensorboard_callback, EarlyStopping(monitor='val_loss', patience=33, restore_best_weights=False) ] model.fit(train_dataset, validation_data=valid_dataset, steps_per_epoch=train_steps, validation_steps=valid_steps, epochs=epochs, callbacks=callbacks) time_tr = open(m_time, 'w') time_tr.write(str(time() - t0)) if __name__ == "__main__": strategy = tf.distribute.MirroredStrategy() print('Number of devices: {}'.format(strategy.num_replicas_in_sync)) model_l = ["unetv1", "unetv2", "unetppv1", "unetppv2", "fcnv1", "fcnv2"] for model in model_l: with strategy.scope(): print("\n\n\n\n\n Training", model, "model\n\n\n\n\n") training(model)
29.921569
80
0.602687
0
0
0
0
0
0
0
0
4,142
0.271429
06d2f75b09d1b2bbd785ce87a1527c0fb7ae9040
12,133
py
Python
src_RealData/FCN_Object.py
XYZsake/DRFNS
73fc5683db5e9f860846e22c8c0daf73b7103082
[ "MIT" ]
42
2018-10-07T08:19:01.000Z
2022-02-08T17:41:24.000Z
src_RealData/FCN_Object.py
XYZsake/DRFNS
73fc5683db5e9f860846e22c8c0daf73b7103082
[ "MIT" ]
11
2018-12-22T00:15:46.000Z
2021-12-03T10:29:32.000Z
src_RealData/FCN_Object.py
XYZsake/DRFNS
73fc5683db5e9f860846e22c8c0daf73b7103082
[ "MIT" ]
14
2018-08-26T06:47:06.000Z
2021-07-24T11:52:58.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- import tensorflow as tf import copy from tf_image_segmentation.models.fcn_8s import FCN_8s from tf_image_segmentation.utils.tf_records import read_tfrecord_and_decode_into_image_annotation_pair_tensors from tf_image_segmentation.utils.training import get_valid_logits_and_labels from tf_image_segmentation.utils.inference import adapt_network_for_any_size_input from tf_image_segmentation.utils.visualization import visualize_segmentation_adaptive from tf_image_segmentation.utils.augmentation import (distort_randomly_image_color, flip_randomly_left_right_image_with_annotation, scale_randomly_image_with_annotation_with_fixed_size_output) import os from glob import glob import numpy as np from scipy import misc slim = tf.contrib.slim from utils import ComputeMetrics class FCN8(): """ FCN8 object for performing training, testing and validating. """ def __init__(self, checkpoint, save_dir, record, size, num_labels, n_print, split='train'): self.checkpoint8 = checkpoint self.Setuped = False self.checkpointnew = save_dir self.record = record self.size = size self.num_labels = num_labels self.n_print = n_print self.setup_record() self.class_labels = range(num_labels) self.class_labels.append(255) if split != "validation": self.fcn_8s_checkpoint_path = glob(self.checkpoint8 + "/*.data*")[0].split(".data")[0] else: self.setup_val(record) def setup_record(self): """ Setup record reading. """ filename_queue = tf.train.string_input_producer( [self.record], num_epochs=10) self.image, self.annotation = read_tfrecord_and_decode_into_image_annotation_pair_tensors(filename_queue) self.resized_image, resized_annotation = scale_randomly_image_with_annotation_with_fixed_size_output(self.image, self.annotation, (self.size, self.size)) self.resized_annotation = tf.squeeze(resized_annotation) def setup_train8(self, lr): """ Setups queues and model evaluation. """ image_batch, annotation_batch = tf.train.shuffle_batch( [self.resized_image, self.resized_annotation], batch_size=1, capacity=3000, num_threads=2, min_after_dequeue=1000) upsampled_logits_batch, fcn_8s_variables_mapping = FCN_8s(image_batch_tensor=image_batch, number_of_classes=self.num_labels, is_training=True) valid_labels_batch_tensor, valid_logits_batch_tensor = get_valid_logits_and_labels(annotation_batch_tensor=annotation_batch, logits_batch_tensor=upsampled_logits_batch, class_labels=self.class_labels) # Count true positives, true negatives, false positives and false negatives. actual = tf.contrib.layers.flatten(tf.cast(annotation_batch, tf.int64)) self.predicted_img = tf.argmax(upsampled_logits_batch, axis=3) cross_entropies = tf.nn.softmax_cross_entropy_with_logits(logits=valid_logits_batch_tensor, labels=valid_labels_batch_tensor) self.cross_entropy_sum = tf.reduce_mean(cross_entropies) pred = tf.argmax(upsampled_logits_batch, dimension=3) probabilities = tf.nn.softmax(upsampled_logits_batch) with tf.variable_scope("adam_vars"): self.train_step = tf.train.AdamOptimizer(learning_rate=lr).minimize(self.cross_entropy_sum) # Variable's initialization functions self.init_fn = slim.assign_from_checkpoint_fn(model_path=self.fcn_8s_checkpoint_path, var_list=fcn_8s_variables_mapping) global_vars_init_op = tf.global_variables_initializer() self.merged_summary_op = tf.summary.merge_all() self.summary_string_writer = tf.summary.FileWriter("./log_8_{}".format(lr)) if not os.path.exists(self.checkpointnew): os.makedirs(self.checkpointnew) #The op for initializing the variables. local_vars_init_op = tf.local_variables_initializer() self.combined_op = tf.group(local_vars_init_op, global_vars_init_op) # We need this to save only model variables and omit # optimization-related and other variables. model_variables = slim.get_model_variables() self.saver = tf.train.Saver(model_variables) def train8(self, iters, lr): """ Trains the model. """ self.setup_train8(lr) model_save = os.path.join(self.checkpointnew, self.checkpointnew) with tf.Session() as sess: sess.run(self.combined_op) self.init_fn(sess) coord = tf.train.Coordinator() threads = tf.train.start_queue_runners(coord=coord) # 10 epochs for i in xrange(0, iters): cross_entropy, summary_string, _ = sess.run([self.cross_entropy_sum, self.merged_summary_op, self.train_step ]) if i % self.n_print == 0: self.summary_string_writer.add_summary(summary_string, i) save_path = self.saver.save(sess, model_save) print("Model saved in file: %s" % save_path) coord.request_stop() coord.join(threads) save_path = self.saver.save(sess, model_save) print("Model saved in file: %s" % save_path) def test8(self, steps, restore, p1): """ Tests the model. """ # Fake batch for image and annotation by adding # leading empty axis. image_batch_tensor = tf.expand_dims(self.image, axis=0) annotation_batch_tensor = tf.expand_dims(self.annotation, axis=0) # Be careful: after adaptation, network returns final labels # and not logits FCN_8s_bis = adapt_network_for_any_size_input(FCN_8s, 32) pred, fcn_16s_variables_mapping = FCN_8s_bis(image_batch_tensor=image_batch_tensor, number_of_classes=self.num_labels, is_training=False) prob = [h for h in [s for s in [t for t in pred.op.inputs][0].op.inputs][0].op.inputs][0] initializer = tf.local_variables_initializer() saver = tf.train.Saver() loss, roc = 0., 0. acc, F1, recall = 0., 0., 0. precision, jac, AJI = 0., 0., 0. with tf.Session() as sess: sess.run(initializer) saver.restore(sess, restore) coord = tf.train.Coordinator() threads = tf.train.start_queue_runners(coord=coord) for i in xrange(steps): image_np, annotation_np, pred_np, prob_np = sess.run([self.image, self.annotation, pred, prob]) prob_float = np.exp(-prob_np[0,:,:,0]) / (np.exp(-prob_np[0,:,:,0]) + np.exp(-prob_np[0,:,:,1])) prob_int8 = misc.imresize(prob_float, size=image_np[:,:,0].shape) prob_float = (prob_int8.copy().astype(float) / 255) out = ComputeMetrics(prob_float, annotation_np[:,:,0], p1, 0.5) acc += out[0] roc += out[1] jac += out[2] recall += out[3] precision += out[4] F1 += out[5] AJI += out[6] coord.request_stop() coord.join(threads) loss, acc, F1 = np.array([loss, acc, F1]) / steps recall, precision, roc = np.array([recall, precision, roc]) / steps jac, AJI = np.array([jac, AJI]) / steps return loss, acc, F1, recall, precision, roc, jac, AJI def setup_val(self, tfname): """ Setups the model in case we need to validate. """ self.restore = glob(os.path.join(self.checkpoint8, "FCN__*", "*.data*" ))[0].split(".data")[0] filename_queue = tf.train.string_input_producer( [tfname], num_epochs=10) self.image_queue, self.annotation_queue = read_tfrecord_and_decode_into_image_annotation_pair_tensors(filename_queue) self.image = tf.placeholder_with_default(self.image, shape=[None, None, 3]) self.annotation = tf.placeholder_with_default(self.annotation_queue, shape=[None, None, 1]) self.resized_image, resized_annotation = scale_randomly_image_with_annotation_with_fixed_size_output(self.image, self.annotation, (self.size, self.size)) self.resized_annotation = tf.squeeze(resized_annotation) image_batch_tensor = tf.expand_dims(self.image, axis=0) annotation_batch_tensor = tf.expand_dims(self.annotation, axis=0) # Be careful: after adaptation, network returns final labels # and not logits FCN_8s_bis = adapt_network_for_any_size_input(FCN_8s, 32) self.pred, fcn_16s_variables_mapping = FCN_8s_bis(image_batch_tensor=image_batch_tensor, number_of_classes=self.num_labels, is_training=False) self.prob = [h for h in [s for s in [t for t in self.pred.op.inputs][0].op.inputs][0].op.inputs][0] initializer = tf.local_variables_initializer() self.saver = tf.train.Saver() with tf.Session() as sess: sess.run(initializer) self.saver.restore(sess, self.restore) def validation(self, DG_TEST, steps, p1, p2, save_organ): """ Validates the model. """ tmp_name = os.path.basename(save_organ) + ".tfRecord" res = [] print "DOing this {}".format(save_organ) with tf.Session() as sess: sess.run(tf.global_variables_initializer()) self.saver.restore(sess, self.restore) #coord = tf.train.Coordinator() #threads = tf.train.start_queue_runners(coord=coord) for i in xrange(steps): Xval, Yval = DG_TEST.Batch(0, 1) feed_dict = {self.image: Xval[0], self.annotation: Yval[0]} image_np, annotation_np, pred_np, prob_np = sess.run([self.image, self.annotation, self.pred, self.prob], feed_dict=feed_dict) prob_float = np.exp(-prob_np[0,:,:,0]) / (np.exp(-prob_np[0,:,:,0]) + np.exp(-prob_np[0,:,:,1])) prob_int8 = misc.imresize(prob_float, size=image_np[:,:,0].shape) prob_float = (prob_int8.copy().astype(float) / 255) out = ComputeMetrics(prob_float, annotation_np[:,:,0], p1, 0.5, rgb=image_np, save_path=save_organ, ind=i) out = [0.] + list(out) res.append(out) return res def copy(self): """ Copies itself and returns a copied version of himself. """ return copy.deepcopy(self)
45.784906
161
0.570675
11,204
0.923432
0
0
0
0
0
0
1,216
0.100223
06d355973fd78ec8f3b614057e835f98f36682ef
379
py
Python
qt__pyqt__pyside__pyqode/qt_ini.py
DazEB2/SimplePyScripts
1dde0a42ba93fe89609855d6db8af1c63b1ab7cc
[ "CC-BY-4.0" ]
117
2015-12-18T07:18:27.000Z
2022-03-28T00:25:54.000Z
qt__pyqt__pyside__pyqode/qt_ini.py
DazEB2/SimplePyScripts
1dde0a42ba93fe89609855d6db8af1c63b1ab7cc
[ "CC-BY-4.0" ]
8
2018-10-03T09:38:46.000Z
2021-12-13T19:51:09.000Z
qt__pyqt__pyside__pyqode/qt_ini.py
DazEB2/SimplePyScripts
1dde0a42ba93fe89609855d6db8af1c63b1ab7cc
[ "CC-BY-4.0" ]
28
2016-08-02T17:43:47.000Z
2022-03-21T08:31:12.000Z
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' try: from PyQt4.QtCore import QSettings except: from PyQt5.QtCore import QSettings if __name__ == '__main__': config = QSettings('config.ini', QSettings.IniFormat) counter = int(config.value('counter', 0)) config.setValue('counter', counter + 1) config.setValue('key2', 'abc')
18.95
57
0.664908
0
0
0
0
0
0
0
0
106
0.279683
06d39356c17a9b2e38d63f8d9aaf9f0140911fdf
46
py
Python
wafw00f/__init__.py
nofunofunofunofun/wafw00f
a1c3f3a045077d893cd9ed970f5d687b590abfa5
[ "BSD-3-Clause" ]
1
2022-03-22T09:15:04.000Z
2022-03-22T09:15:04.000Z
wafw00f/__init__.py
nofunofunofunofun/wafw00f
a1c3f3a045077d893cd9ed970f5d687b590abfa5
[ "BSD-3-Clause" ]
null
null
null
wafw00f/__init__.py
nofunofunofunofun/wafw00f
a1c3f3a045077d893cd9ed970f5d687b590abfa5
[ "BSD-3-Clause" ]
1
2021-01-11T17:26:14.000Z
2021-01-11T17:26:14.000Z
#!/usr/bin/env python __version__ = '0.9.6'
9.2
21
0.630435
0
0
0
0
0
0
0
0
28
0.608696
06d4487239efe1a625efc060f8606eba1b8fb684
3,410
py
Python
tests/api_tests.py
muhozi/WeConnect
46825d6ae27a7addbe8f7f2e298f5ee07cd9cf5f
[ "MIT" ]
3
2018-04-07T07:39:19.000Z
2018-04-13T14:15:26.000Z
tests/api_tests.py
muhozi/WeConnect
46825d6ae27a7addbe8f7f2e298f5ee07cd9cf5f
[ "MIT" ]
8
2018-03-01T21:11:05.000Z
2022-03-21T22:16:43.000Z
tests/api_tests.py
muhozi/WeConnect
46825d6ae27a7addbe8f7f2e298f5ee07cd9cf5f
[ "MIT" ]
3
2018-04-24T03:34:44.000Z
2018-07-19T09:53:08.000Z
""" Main test """ import unittest import uuid from api import APP from flask import json from api.models.user import User from api.models.business import Business from api.helpers import get_token class MainTests(unittest.TestCase): """ Main test """ url_prefix = '/api/v1/' def setUp(self): """ Set up test data """ self.app = APP.test_client() self.app.testing = True self.sample_user = { 'id': uuid.uuid4().hex, 'username': 'Muhozi', 'email': 'emery@andela.com', 'password': 'secret', 'confirm_password': 'secret' } self.exist_user = { 'id': uuid.uuid4().hex, 'username': 'Kudo', 'email': 'kaka@andela.com', 'password': 'secret', 'confirm_password': 'secret' } self.business_data = { 'id': uuid.uuid4().hex, 'name': 'Inzora rooftop coffee', 'description': 'We have best coffee for you,', 'country': 'Kenya', 'city': 'Nairobi' } save_user = User() save_user.save({ 'id': self.sample_user['id'], 'username': self.sample_user['username'], 'email': self.sample_user['email'], 'password': self.sample_user['password'], 'confirm_password': self.sample_user['confirm_password'] }) # Save business for reviews testing self.rev_business_data = { 'id': uuid.uuid4().hex, 'name': 'KFC', 'description': 'Finger lickin\' good', 'country': 'Kenya', 'city': 'Nairobi' } # Add user(owner) to the business data dict self.rev_business_data['user_id'] = self.sample_user['id'] # Save business in the storage list for testing Business.save(self.rev_business_data) with APP.test_request_context(): # Orphan id: User id that will be used to create an orphan token orphan_id = uuid.uuid4().hex save_user.save({ 'id': orphan_id, 'username': "uname", 'email': "anyemail@gmail.com", 'password': self.exist_user['password'], 'confirm_password': self.exist_user['confirm_password'] }) # Issue a token the the test user (sample_user) # Store test token in auth storage auth_token list token = get_token(self.sample_user['id']) # Orphan token: User token that do not have any registered business orphan_token = get_token(orphan_id) expired_token = get_token(self.sample_user['id'], -3600) # Create bad signature token # Bad signature: #nt secret key from the one used in our API used # to hash tokens other_signature_token = get_token( self.sample_user['id'], 3600, 'other_signature') User().add_token(token) User().add_token(expired_token) User().add_token(orphan_token) User().add_token(other_signature_token) self.test_token = token self.expired_test_token = expired_token self.other_signature_token = other_signature_token self.orphan_test_token = orphan_token
35.520833
79
0.550733
3,206
0.940176
0
0
0
0
0
0
1,177
0.345161
06d6a4324acde5c358d0bd6522e052a2ede943db
423
py
Python
cookbook/c05/p03_print_sepend.py
itpubs/python3-cookbook
140f5e4cc0416b9674edca7f4c901b1f58fc1415
[ "Apache-2.0" ]
3
2018-09-19T06:44:13.000Z
2019-03-24T10:07:07.000Z
cookbook/c05/p03_print_sepend.py
itpubs/python3-cookbook
140f5e4cc0416b9674edca7f4c901b1f58fc1415
[ "Apache-2.0" ]
2
2020-09-19T17:10:23.000Z
2020-10-17T16:43:52.000Z
cookbook/c05/p03_print_sepend.py
itpubs/python3-cookbook
140f5e4cc0416b9674edca7f4c901b1f58fc1415
[ "Apache-2.0" ]
1
2020-12-22T06:33:18.000Z
2020-12-22T06:33:18.000Z
#!/usr/bin/env python # -*- encoding: utf-8 -*- """ Topic: print分隔符和结尾符 Desc : """ def print_sepend(): print('ACME', 50, 91.5) print('ACME', 50, 91.5, sep=',') print('ACME', 50, 91.5, sep=',', end='!!\n') for i in range(5): print(i) for i in range(5): print(i, end=' ') print() row = ['ACME', 50, 91.5] print(*row, sep=',') if __name__ == '__main__': print_sepend()
17.625
48
0.501182
0
0
0
0
0
0
0
0
147
0.336384
06da3baaeb27b37984af143aca6a52ab058a5588
122
py
Python
src/config/config_loader.py
roybenyosef/loc-to-spot
1db54a8481317f5cd2f746974dcdda2a632d02ec
[ "MIT" ]
null
null
null
src/config/config_loader.py
roybenyosef/loc-to-spot
1db54a8481317f5cd2f746974dcdda2a632d02ec
[ "MIT" ]
null
null
null
src/config/config_loader.py
roybenyosef/loc-to-spot
1db54a8481317f5cd2f746974dcdda2a632d02ec
[ "MIT" ]
null
null
null
import yaml def read_config(): file_stream = open("config/config.yaml", "r") return yaml.safe_load(file_stream)
17.428571
49
0.704918
0
0
0
0
0
0
0
0
23
0.188525
06da67599586f6f3ad731d357524246723f211dc
331
py
Python
python/demo-django/code/character/models.py
denisroldan/talentum-2015-examples
4980f49dca56a55d26722f4f6d1fdd88e06f38dd
[ "MIT" ]
null
null
null
python/demo-django/code/character/models.py
denisroldan/talentum-2015-examples
4980f49dca56a55d26722f4f6d1fdd88e06f38dd
[ "MIT" ]
null
null
null
python/demo-django/code/character/models.py
denisroldan/talentum-2015-examples
4980f49dca56a55d26722f4f6d1fdd88e06f38dd
[ "MIT" ]
null
null
null
from django.db import models from game.models import Game class Character(models.Model): name = models.CharField(max_length=250) game = models.ManyToManyField(Game, related_name='characters') def __unicode__(self): return "{0}".format(self.name) def __str__(self): return "{0}".format(self.name)
25.461538
66
0.694864
271
0.818731
0
0
0
0
0
0
22
0.066465
06dacdda970f273fddcf69cadb01b1f2dd499e8c
296
py
Python
sim_test_model.py
feiyanke/simpy
bde9d09e47596e0bfe66dc7001f556bafd03acc5
[ "MIT" ]
1
2019-01-28T09:13:58.000Z
2019-01-28T09:13:58.000Z
sim_test_model.py
feiyanke/simpy
bde9d09e47596e0bfe66dc7001f556bafd03acc5
[ "MIT" ]
null
null
null
sim_test_model.py
feiyanke/simpy
bde9d09e47596e0bfe66dc7001f556bafd03acc5
[ "MIT" ]
2
2019-01-28T09:13:59.000Z
2020-12-13T09:48:20.000Z
import math import matplotlib.pyplot as plt from simpy import model ax1 = plt.subplot(121) ax2 = plt.subplot(122) model_sin = model.TimedFunctionModel(math.sin) model_cos = model.TimedFunctionModel(math.cos) scope = model.ScopeModel(ax1, ax2) def run(): scope(model_sin(), model_cos())
17.411765
46
0.75
0
0
0
0
0
0
0
0
0
0
06db5fed30a40e13ffe36a7460de36bf7c61b325
655
py
Python
monthlysal.py
aja512/Python-Lab
8f9c57d6d7f835e31a595223cdddf9c52ebe1cc9
[ "Apache-2.0" ]
null
null
null
monthlysal.py
aja512/Python-Lab
8f9c57d6d7f835e31a595223cdddf9c52ebe1cc9
[ "Apache-2.0" ]
null
null
null
monthlysal.py
aja512/Python-Lab
8f9c57d6d7f835e31a595223cdddf9c52ebe1cc9
[ "Apache-2.0" ]
null
null
null
bs=input("Enter basic salary:") days=input("Enter no. of working days:") ovrti=input("Enter no. of overtime working hrs:") deduct=0 if days<6: deduct=3500 salary=calci(bs,days,ovrti,deduct) elif days>=6 and days<=12: deduct=1000 salary= calci(bs,days,ovrti,deduct) elif days>=13 and days<=18: deduct=800 salary=calci(bs,days,ovrti,deduct) else: deduct=0 salary=calci(bs,days,ovrti,deduct) def calci(bs,days,ovrti,deduct): sal=0 emp=str(input('Enter type of Employee:')) if emp=='Permanent': bonus=22500 sal=bs+ovrti*500+bonus-deduct print(sal) else: bonus=2500 sal=bs+ovrti*500+bonus-deduct print(sal)
22.586207
49
0.690076
0
0
0
0
0
0
0
0
121
0.184733
06db8ba3ca98cc15e56e2db049c572bc5f7c97a3
2,760
py
Python
Day_10_classes_and_objects/day10_uzd1.py
ValRCS/Python_TietoEvry_Sep2021
e11dac38deb17ba695ce8ad9dab9cf78b4adb99d
[ "MIT" ]
null
null
null
Day_10_classes_and_objects/day10_uzd1.py
ValRCS/Python_TietoEvry_Sep2021
e11dac38deb17ba695ce8ad9dab9cf78b4adb99d
[ "MIT" ]
null
null
null
Day_10_classes_and_objects/day10_uzd1.py
ValRCS/Python_TietoEvry_Sep2021
e11dac38deb17ba695ce8ad9dab9cf78b4adb99d
[ "MIT" ]
null
null
null
# class Song: # Song is name of Class, start with Capital letter # def __init__(self, title="", author="", lyrics=tuple()): # constructor method called upon creation of object # self.title = title # self.author = author # self.lyrics = lyrics # # print(f"New Song made by Author: {self.author=} Title: {self.title=}") # # def sing(self): # method definition which is function associated with objects # print(f"New Song Title: {self.title}") # print(f"Lyrics made by Author: {self.author}") # for line in self.lyrics: # print(line) # return self # # def yell(self): # for line in self.lyrics: # print(line.upper()) # return self # can be put inside the class or it's better to make _print_lyrics static inside the class? class Song: def __init__(self, title, author, lyrics): self.title = title self.author = author self.lyrics = lyrics if title == '': title = 'Unknown' if author == '': author = 'Unknown' print(f"\n\nNew song made:\nTitle: {title} \nAuthor: {author}") @classmethod # this means that this method is a class method can be called without any objects def print_lines(cls, lyrics, line_count=-1): all_lines_count = len(lyrics) if line_count == -1: line_count = len(lyrics) elif line_count <= 0: print("no lines to print") elif all_lines_count < line_count: print(f"only {all_lines_count} lines can be printed:\n") for i in lyrics[:line_count]: print(i) def sing(self, lines_present=-1): x = '_' * (len(self.author + self.title) + 3) print(x, '\nSinging:') self.print_lines(self.lyrics, lines_present) return self def yell(self, lines_present=-1): x = '_' * (len(self.author + self.title) + 3) lines_upper = [line.upper() for line in self.lyrics] print(x, '\nYELLING:') self.print_lines(lines_upper, lines_present) return self class Rap(Song): def break_it(self, lines_present=-1, drop="yeah"): x = '_' * (len(self.author + self.title) + 3) lyrics = [line.replace(' ', f' {drop.upper()} ') + ' ' + drop.upper() for line in self.lyrics] print(x, '\nRapping:') self.print_lines(lyrics, lines_present) return self ziemelmeita = Song('Ziemeļmeita', 'Jumprava', ['Gāju meklēt ziemeļmeitu', 'Garu, tālu ceļu veicu']) ziemelmeita.sing(1).yell(10).sing().sing(-3) zrap = Rap("Ziemeļmeita", "Jumprava", ["Gāju meklēt ziemeļmeitu", "Garu, tālu ceļu veicu"]) zrap.break_it(1, "yah").yell(1) ziemelmeita.sing().yell().sing(1)
34.5
115
0.595652
1,601
0.577561
0
0
488
0.176046
0
0
1,284
0.463203
06dc17868ef7177e219fa324d4ee2030cbe721d0
51
py
Python
appengine/src/greenday_core/settings/__init__.py
meedan/montage
4da0116931edc9af91f226876330645837dc9bcc
[ "Apache-2.0" ]
6
2018-07-31T16:48:07.000Z
2020-02-01T03:17:51.000Z
appengine/src/greenday_core/settings/__init__.py
meedan/montage
4da0116931edc9af91f226876330645837dc9bcc
[ "Apache-2.0" ]
41
2018-08-07T16:43:07.000Z
2020-06-05T18:54:50.000Z
appengine/src/greenday_core/settings/__init__.py
meedan/montage
4da0116931edc9af91f226876330645837dc9bcc
[ "Apache-2.0" ]
1
2018-08-07T16:40:18.000Z
2018-08-07T16:40:18.000Z
""" Modules to configure Django's settings """
12.75
42
0.647059
0
0
0
0
0
0
0
0
50
0.980392
06dc1c17dd56d7e1a1011a34a1e1d9b273c1982c
1,956
py
Python
rurina2/widgets/text.py
TeaCondemns/rurina
43725ebea5872953125271a9abb300a4e3a80a64
[ "MIT" ]
null
null
null
rurina2/widgets/text.py
TeaCondemns/rurina
43725ebea5872953125271a9abb300a4e3a80a64
[ "MIT" ]
null
null
null
rurina2/widgets/text.py
TeaCondemns/rurina
43725ebea5872953125271a9abb300a4e3a80a64
[ "MIT" ]
null
null
null
from constants import STYLE_NORMAL, STYLE_BOLD, STYLE_ITALIC from prefabs.text import write_autoline from widgets.widget import WidgetByRect from base_node import get_surface from prefabs.surface import blit from shape import Rect import pygame class Text(WidgetByRect): def __init__( self, font: pygame.font.Font, value: str = '', text_color=pygame.Color('white'), linespacing: int = 0, *args, **kwargs ): super().__init__(*args, **kwargs) self.font = font self.value = value self.text_color = text_color self.linespacing = linespacing self.sprite.region_enabled = True @property def can_be_drawn(self): return self.visible and self.alpha > 0 and self.scale != 0 and len(self.value) > 0 @property def style(self) -> int: __style = STYLE_NORMAL if self.font.get_bold(): __style |= STYLE_BOLD if self.font.get_italic(): __style |= STYLE_ITALIC return __style @style.setter def style(self, value): self.font.set_bold(value & STYLE_BOLD) self.font.set_italic(value & STYLE_ITALIC) def draw(self, surface: pygame.Surface = ...) -> None: if self.can_be_drawn: surface = get_surface(surface) self.sprite.draw(surface) blit( surface, write_autoline( self.value, self.font, Rect(0, 0, *self.rect.size), self.text_color, self.gravity, pygame.Surface(self.rect.size, pygame.SRCALPHA, 32), self.linespacing ), self.rect.rpos, self.ralpha, self.rscale ) super().draw(surface) __all__ = [ 'Text' ]
25.402597
90
0.541922
1,681
0.859407
0
0
499
0.255112
0
0
15
0.007669
06dcdfc975ea640979bb4f316bbb031845b68fa5
5,350
py
Python
Chapter05/B12322_05_code upload/topic_categorization.py
PacktPublishing/Python-Machine-Learning-By-Example-Second-Edition
830ad0124dc72c3a24929ff1b67081a66894f1f9
[ "MIT" ]
31
2019-05-25T11:28:23.000Z
2022-02-09T15:19:20.000Z
Chapter05/B12322_05_code upload/topic_categorization.py
PacktPublishing/Python-Machine-Learning-By-Example-Second-Edition
830ad0124dc72c3a24929ff1b67081a66894f1f9
[ "MIT" ]
null
null
null
Chapter05/B12322_05_code upload/topic_categorization.py
PacktPublishing/Python-Machine-Learning-By-Example-Second-Edition
830ad0124dc72c3a24929ff1b67081a66894f1f9
[ "MIT" ]
22
2019-02-27T20:11:39.000Z
2022-03-07T21:46:38.000Z
''' Source codes for Python Machine Learning By Example 2nd Edition (Packt Publishing) Chapter 5: Classifying Newsgroup Topic with Support Vector Machine Author: Yuxi (Hayden) Liu ''' from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.datasets import fetch_20newsgroups from nltk.corpus import names from nltk.stem import WordNetLemmatizer all_names = set(names.words()) lemmatizer = WordNetLemmatizer() def is_letter_only(word): return word.isalpha() from nltk.corpus import stopwords stop_words = stopwords.words('english') def clean_text(docs): docs_cleaned = [] for doc in docs: doc = doc.lower() doc_cleaned = ' '.join(lemmatizer.lemmatize(word) for word in doc.split() if is_letter_only(word) and word not in all_names and word not in stop_words) docs_cleaned.append(doc_cleaned) return docs_cleaned # Binary classification categories = ['comp.graphics', 'sci.space'] data_train = fetch_20newsgroups(subset='train', categories=categories, random_state=42) data_test = fetch_20newsgroups(subset='test', categories=categories, random_state=42) cleaned_train = clean_text(data_train.data) label_train = data_train.target cleaned_test = clean_text(data_test.data) label_test = data_test.target from collections import Counter Counter(label_train) tfidf_vectorizer = TfidfVectorizer(stop_words='english', max_features=None) term_docs_train = tfidf_vectorizer.fit_transform(cleaned_train) term_docs_test = tfidf_vectorizer.transform(cleaned_test) from sklearn.svm import SVC svm = SVC(kernel='linear', C=1.0, random_state=42) svm.fit(term_docs_train, label_train) accuracy = svm.score(term_docs_test, label_test) print('The accuracy of binary classification is: {0:.1f}%'.format(accuracy*100)) # Multiclass classification categories = [ 'alt.atheism', 'talk.religion.misc', 'comp.graphics', 'sci.space', 'rec.sport.hockey' ] data_train = fetch_20newsgroups(subset='train', categories=categories, random_state=42) data_test = fetch_20newsgroups(subset='test', categories=categories, random_state=42) cleaned_train = clean_text(data_train.data) label_train = data_train.target cleaned_test = clean_text(data_test.data) label_test = data_test.target term_docs_train = tfidf_vectorizer.fit_transform(cleaned_train) term_docs_test = tfidf_vectorizer.transform(cleaned_test) svm = SVC(kernel='linear', C=1.0, random_state=42) svm.fit(term_docs_train, label_train) accuracy = svm.score(term_docs_test, label_test) print('The accuracy of 5-class classification is: {0:.1f}%'.format(accuracy*100)) from sklearn.metrics import classification_report prediction = svm.predict(term_docs_test) report = classification_report(label_test, prediction) print(report) # Grid search categories = None data_train = fetch_20newsgroups(subset='train', categories=categories, random_state=42) data_test = fetch_20newsgroups(subset='test', categories=categories, random_state=42) cleaned_train = clean_text(data_train.data) label_train = data_train.target cleaned_test = clean_text(data_test.data) label_test = data_test.target tfidf_vectorizer = TfidfVectorizer(stop_words='english', max_features=None) term_docs_train = tfidf_vectorizer.fit_transform(cleaned_train) term_docs_test = tfidf_vectorizer.transform(cleaned_test) parameters = {'C': [0.1, 1, 10, 100]} svc_libsvm = SVC(kernel='linear') from sklearn.model_selection import GridSearchCV grid_search = GridSearchCV(svc_libsvm, parameters, n_jobs=-1, cv=5) import timeit start_time = timeit.default_timer() grid_search.fit(term_docs_train, label_train) print("--- %0.3fs seconds ---" % (timeit.default_timer() - start_time)) print(grid_search.best_params_) print(grid_search.best_score_) svc_libsvm_best = grid_search.best_estimator_ accuracy = svc_libsvm_best.score(term_docs_test, label_test) print('The accuracy of 20-class classification is: {0:.1f}%'.format(accuracy*100)) from sklearn.svm import LinearSVC svc_linear = LinearSVC() grid_search = GridSearchCV(svc_linear, parameters, n_jobs=-1, cv=5) start_time = timeit.default_timer() grid_search.fit(term_docs_train, label_train) print("--- %0.3fs seconds ---" % (timeit.default_timer() - start_time)) print(grid_search.best_params_) print(grid_search.best_score_) svc_linear_best = grid_search.best_estimator_ accuracy = svc_linear_best.score(term_docs_test, label_test) print('TThe accuracy of 20-class classification is: {0:.1f}%'.format(accuracy*100)) # Pipeline from sklearn.pipeline import Pipeline pipeline = Pipeline([ ('tfidf', TfidfVectorizer(stop_words='english')), ('svc', LinearSVC()), ]) parameters_pipeline = { 'tfidf__max_df': (0.25, 0.5, 1.0), 'tfidf__max_features': (10000, None), 'tfidf__sublinear_tf': (True, False), 'tfidf__smooth_idf': (True, False), 'svc__C': (0.3, 1, 3), } grid_search = GridSearchCV(pipeline, parameters_pipeline, n_jobs=-1, cv=5) start_time = timeit.default_timer() grid_search.fit(cleaned_train, label_train) print("--- %0.3fs seconds ---" % (timeit.default_timer() - start_time)) print(grid_search.best_params_) print(grid_search.best_score_) pipeline_best = grid_search.best_estimator_ accuracy = pipeline_best.score(cleaned_test, label_test) print('The accuracy of 20-class classification is: {0:.1f}%'.format(accuracy*100))
31.470588
108
0.774393
0
0
0
0
0
0
0
0
900
0.168224
06de4f84c6d45b4b9c062aad81f802376fdf7b81
9,076
py
Python
lib/enthought/traits/ui/key_bindings.py
mattfoster/matplotlib
0b47697b19b77226c633ec6a3d74a2199a153315
[ "PSF-2.0", "BSD-3-Clause" ]
1
2016-05-08T18:33:12.000Z
2016-05-08T18:33:12.000Z
lib/enthought/traits/ui/key_bindings.py
mattfoster/matplotlib
0b47697b19b77226c633ec6a3d74a2199a153315
[ "PSF-2.0", "BSD-3-Clause" ]
null
null
null
lib/enthought/traits/ui/key_bindings.py
mattfoster/matplotlib
0b47697b19b77226c633ec6a3d74a2199a153315
[ "PSF-2.0", "BSD-3-Clause" ]
null
null
null
#------------------------------------------------------------------------------- # # Written by: David C. Morrill # # Date: 05/20/2005 # # (c) Copyright 2005 by Enthought, Inc. # # Classes defined: KeyBinding, KeyBindings # #------------------------------------------------------------------------------- """ Defines KeyBinding and KeyBindings classes, which manage the mapping of keystroke events into method calls on controller objects that are supplied by the application. """ #------------------------------------------------------------------------------- # Imports: #------------------------------------------------------------------------------- from enthought.traits.api \ import TraitError, HasStrictTraits, Str, List, Any, Instance, Event from enthought.traits.ui.api \ import View, Item, ListEditor, KeyBindingEditor, toolkit #------------------------------------------------------------------------------- # Key binding trait definition: #------------------------------------------------------------------------------- # Trait definition for key bindings Binding = Str( event = 'binding', editor = KeyBindingEditor() ) #------------------------------------------------------------------------------- # 'KeyBinding' class: #------------------------------------------------------------------------------- class KeyBinding ( HasStrictTraits ): """ Binds one or two keystrokes to a method. """ #--------------------------------------------------------------------------- # Trait definitions: #--------------------------------------------------------------------------- # First key binding binding1 = Binding # Second key binding binding2 = Binding # Description of what application function the method performs description = Str # Name of controller method the key is bound to method_name = Str # KeyBindings object that "owns" the KeyBinding owner = Instance( 'KeyBindings' ) #--------------------------------------------------------------------------- # Traits view definitions: #--------------------------------------------------------------------------- traits_view = View( [ 'binding1', 'binding2', 'description~#', '-<>' ] ) #--------------------------------------------------------------------------- # Handles a binding trait being changed: #--------------------------------------------------------------------------- def _binding_changed ( self ): if self.owner is not None: self.owner.binding_modified = self #------------------------------------------------------------------------------- # 'KeyBindings' class: #------------------------------------------------------------------------------- class KeyBindings ( HasStrictTraits ): """ A set of key bindings. """ #--------------------------------------------------------------------------- # Trait definitions: #--------------------------------------------------------------------------- # Set of defined key bindings (added dynamically) #bindings = List( KeyBinding ) # Optional prefix to add to each method name prefix = Str # Optional suffix to add to each method name suffix = Str # Event fired when one of the contained KeyBinding objects is changed binding_modified = Event( KeyBinding ) # Control that currently has the focus (if any) focus_owner = Any #--------------------------------------------------------------------------- # Traits view definitions: #--------------------------------------------------------------------------- traits_view = View( [ Item( 'bindings@#', editor = ListEditor( style = 'custom' ) ), '|{Click on a first or second column entry, then ' 'press the key to assign to the corresponding ' 'function}<>' ], title = 'Update Key Bindings', kind = 'livemodal', resizable = True, width = 0.4, height = 0.4, help = False ) #--------------------------------------------------------------------------- # Initializes the object: #--------------------------------------------------------------------------- def __init__ ( self, *bindings, **traits ): super( KeyBindings, self ).__init__( **traits ) n = len( bindings ) self.add_trait( 'bindings', List( KeyBinding, minlen = n, maxlen = n, mode = 'list' ) ) self.bindings = [ binding.set( owner = self ) for binding in bindings ] #--------------------------------------------------------------------------- # Processes a keyboard event: #--------------------------------------------------------------------------- def do ( self, event, controller, *args ): """ Processes a keyboard event. """ key_name = toolkit().key_event_to_name( event ) for binding in self.bindings: if (key_name == binding.binding1) or (key_name == binding.binding2): method_name = '%s%s%s' % ( self.prefix, binding.method_name, self.suffix ) return (getattr( controller, method_name )( *args ) != False) return False #--------------------------------------------------------------------------- # Merges another set of key bindings into this set: #--------------------------------------------------------------------------- def merge ( self, key_bindings ): """ Merges another set of key bindings into this set. """ binding_dic = {} for binding in self.bindings: binding_dic[ binding.method_name ] = binding for binding in key_bindings.bindings: binding2 = binding_dic.get( binding.method_name ) if binding2 is not None: binding2.binding1 = binding.binding1 binding2.binding2 = binding.binding2 #--------------------------------------------------------------------------- # Returns the current binding for a specified key (if any): #--------------------------------------------------------------------------- def key_binding_for ( self, binding, key_name ): """ Returns the current binding for a specified key (if any). """ if key_name != '': for a_binding in self.bindings: if ((a_binding is not binding) and ((key_name == a_binding.binding1) or (key_name == a_binding.binding2))): return a_binding return None #--------------------------------------------------------------------------- # Handles a binding being changed: #--------------------------------------------------------------------------- def _binding_modified_changed ( self, binding ): binding1 = binding.binding1 binding2 = binding.binding2 for a_binding in self.bindings: if binding is not a_binding: if binding1 == a_binding.binding1: a_binding.binding1 = '' if binding1 == a_binding.binding2: a_binding.binding2 = '' if binding2 == a_binding.binding1: a_binding.binding1 = '' if binding2 == a_binding.binding2: a_binding.binding2 = '' #--------------------------------------------------------------------------- # Handles the focus owner being changed: #--------------------------------------------------------------------------- def _focus_owner_changed ( self, old, new ): if old is not None: old.border_size = 0 #-- object overrides ----------------------------------------------------------- #--------------------------------------------------------------------------- # Restores the state of a previously pickled object: #--------------------------------------------------------------------------- def __setstate__ ( self, state ): """ Restores the state of a previously pickled object. """ n = len( state[ 'bindings' ] ) self.add_trait( 'bindings', List( KeyBinding, minlen = n, maxlen = n ) ) self.__dict__.update( state ) self.bindings = self.bindings[:]
42.213953
80
0.368114
7,519
0.828449
0
0
0
0
0
0
4,688
0.516527
06e007230d32188f666bcfa817cb0d72deaa62d6
639
py
Python
cocos#275--HTMLLabel/html_label_test.py
los-cocos/etc_code
71c642a5e0f7ff8049cb5fb4ecac3f166ca20280
[ "MIT" ]
2
2016-08-28T19:41:47.000Z
2018-12-14T22:01:26.000Z
cocos#275--HTMLLabel/html_label_test.py
los-cocos/etc_code
71c642a5e0f7ff8049cb5fb4ecac3f166ca20280
[ "MIT" ]
null
null
null
cocos#275--HTMLLabel/html_label_test.py
los-cocos/etc_code
71c642a5e0f7ff8049cb5fb4ecac3f166ca20280
[ "MIT" ]
2
2015-09-21T06:55:12.000Z
2020-05-29T14:34:34.000Z
#!/usr/bin/env python3 # -*-coding:utf-8 -* import cocos from cocos.text import HTMLLabel from cocos.director import director class TestLayer(cocos.layer.Layer): def __init__(self): super(TestLayer, self).__init__() x, y = director.get_window_size() self.text = HTMLLabel("""<center><font color=white size=4> Image here --><img src="grossini.png"><-- here.</font></center>""", (100, y//2)) self.add(self.text) def main(): director.init() test_layer = TestLayer() main_scene = cocos.scene.Scene(test_layer) director.run(main_scene) if __name__ == '__main__': main()
24.576923
68
0.640063
334
0.522692
0
0
0
0
0
0
155
0.242567
06e062374abeb59d36c97a31d852af3b3fb9d03c
4,284
py
Python
depronoun.py
rui-bettencourt/AutomaticSentenceDivision
4cb29897103189791c932aaea42c8d5b4ecd8bcd
[ "MIT" ]
null
null
null
depronoun.py
rui-bettencourt/AutomaticSentenceDivision
4cb29897103189791c932aaea42c8d5b4ecd8bcd
[ "MIT" ]
null
null
null
depronoun.py
rui-bettencourt/AutomaticSentenceDivision
4cb29897103189791c932aaea42c8d5b4ecd8bcd
[ "MIT" ]
null
null
null
# from nltk.tokenize import word_tokenize from xml.dom import minidom import progressbar from time import sleep input_file = 'data/dataset_output.txt' num_lines = sum(1 for line in open(input_file)) read_file = open(input_file, 'r') write_output_file = open('data/dataset_output_no_pronouns.txt', 'w') pronouns = ['him','her'] pronouns_objects = ['it'] names = [] objects = [] special_objects = [] pronoun_error_counter_p = 0 pronoun_error_counter_o = 0 pronoun_misplacements = 0 # parse an xml file by name mydoc_names = minidom.parse('Names.xml') mydoc_objects = minidom.parse('Objects.xml') names_raw = mydoc_names.getElementsByTagName('name') for elem in names_raw: names.append(elem.firstChild.data) objects_raw = mydoc_objects.getElementsByTagName('object') category_raw = mydoc_objects.getElementsByTagName('category') for elem in objects_raw: if ' ' not in elem.attributes['name'].value: objects.append(elem.attributes['name'].value) else: complex_word = [] for word in elem.attributes['name'].value.split(' '): complex_word.append(word) special_objects.append(complex_word) for elem in category_raw: if ' ' not in elem.attributes['name'].value: objects.append(elem.attributes['name'].value) else: complex_word = [] for word in elem.attributes['name'].value.split(' '): complex_word.append(word) special_objects.append(complex_word) names.sort() objects.sort() print("The availabe names are: ") print(names) print("\n\n") print("The availabe objects are: ") print(objects) print("\n\n") print("The availabe special objects are: ") print(special_objects) print("\n\n") bar = progressbar.ProgressBar(maxval=num_lines, \ widgets=[progressbar.Bar('=', '[', ']'), ' ', progressbar.Percentage()]) bar.start() ##### Actual code i = 0 for line in read_file: i += 1 used_name = None used_object = None words = word_tokenize(line) if any(pronoun in words for pronoun in pronouns): #Loop the tokenized line for the pronoun and name for word in words: if word in names: used_name = word if word in pronouns and used_name is not None: #if a pronoun was found and previously also a name, replace that pronoun by the name words[words.index(word)] = used_name elif word in pronouns and used_name is None: print("PRONOUN WITH NO NAME!") pronoun_error_counter_p += 1 if any(pronoun in words for pronoun in pronouns_objects): #Loop the tokenized line for the pronoun and object for word in words: if word in objects: used_object = word if word in names: used_name = word if word in pronouns_objects and used_object is not None: words[words.index(word)] = "the " + used_object elif word in pronouns_objects and used_object is None: # print("PRONOUN WITH NO NAME!") success = False for special in special_objects: correct_special = True for item in special: if item not in words: correct_special = False break if correct_special: to_add = ' '.join(special) words[words.index(word)] = "the " + to_add success = True if not success and used_name is not None: words[words.index(word)] = used_name pronoun_misplacements += 1 elif not success: pronoun_error_counter_o += 1 #Write the output into a file write_output_file.write(' '.join(words).replace(' .','.') + '\n') # print("Iter: " + str(i)) bar.update(i) bar.finish() print("Success! With " + str(pronoun_error_counter_p) + " sentences that had a pronoun but no name and " + str(pronoun_error_counter_o) + " with no object.") print("A total of " + str(pronoun_misplacements) + " were considered as pronoun misplacements and the it was replace by a name")
33.46875
157
0.614613
0
0
0
0
0
0
0
0
837
0.195378
06e4f094f267243cc672eb7459a8a3c1167d18f8
2,794
py
Python
pyaws/utils/userinput.py
mwozniczak/pyaws
af8f6d64ff47fd2ef2eb9fef25680e4656523fa3
[ "MIT" ]
null
null
null
pyaws/utils/userinput.py
mwozniczak/pyaws
af8f6d64ff47fd2ef2eb9fef25680e4656523fa3
[ "MIT" ]
null
null
null
pyaws/utils/userinput.py
mwozniczak/pyaws
af8f6d64ff47fd2ef2eb9fef25680e4656523fa3
[ "MIT" ]
null
null
null
""" Python3 Module Summary: User Input Manipulation """ import re from string import ascii_lowercase def bool_assignment(arg, patterns=None): """ Summary: Enforces correct bool argment assignment Arg: :arg (*): arg which must be interpreted as either bool True or False Returns: bool assignment | TYPE: bool """ arg = str(arg) # only eval type str try: if patterns is None: patterns = ( (re.compile(r'^(true|false)$', flags=re.IGNORECASE), lambda x: x.lower() == 'true'), (re.compile(r'^(yes|no)$', flags=re.IGNORECASE), lambda x: x.lower() == 'yes'), (re.compile(r'^(y|n)$', flags=re.IGNORECASE), lambda x: x.lower() == 'y') ) if not arg: return '' # default selected else: for pattern, func in patterns: if pattern.match(arg): return func(arg) except Exception as e: raise e def range_bind(min_value, max_value, value): """ binds number to a type and range """ if value not in range(min_value, max_value + 1): value = min(value, max_value) value = max(min_value, value) return int(value) def userchoice_mapping(choice): """ Summary: Maps the number of an option presented to the user to the correct letters in sequential a-z series when choice parameter is provided as a number. When given a letter as an input parameter (choice is a single letter), returns the integer number corresponding to the letter in the alphabet (a-z) Examples: - userchoice_mapping(3) returns 'c' - userchoice_mapping('z') returns 26 (integer) Args: choice, TYPE: int or str Returns: ascii (lowercase), TYPE: str OR None """ # prepare mapping dict containing all 26 letters map_dict = {} letters = ascii_lowercase for index in range(1, 27): map_dict[index] = letters[index - 1] # process user input try: if isinstance(choice, str): if choice in letters: for k, v in map_dict.items(): if v == choice.lower(): return k elif int(choice) in range(1, 27): # integer string provided return map_dict[int(choice)] else: # not in letters or integer string outside range return None elif choice not in range(1, 27): return None except KeyError: # integer outside range provided return None except ValueError: # string outside range provided return None return map_dict[choice]
30.043011
100
0.566929
0
0
0
0
0
0
0
0
1,203
0.430565
06e51ad894ceaca1307a132e1efdb1fe4242fe80
17,008
py
Python
batches.py
NRHelmi/ldbc_snb_data_converter
42eb5dfbe8b46bcb4d8ad56e1fd988e7635deea3
[ "Apache-2.0" ]
2
2021-01-22T10:07:18.000Z
2021-02-09T18:13:28.000Z
batches.py
NRHelmi/ldbc_snb_data_converter
42eb5dfbe8b46bcb4d8ad56e1fd988e7635deea3
[ "Apache-2.0" ]
5
2021-02-11T23:12:05.000Z
2021-05-21T12:16:29.000Z
batches.py
szarnyasg/ldbc-example-graph
1fd52bc60d50cf5184ee1331369d754db2b8489f
[ "Apache-2.0" ]
1
2022-03-24T20:02:23.000Z
2022-03-24T20:02:23.000Z
import duckdb from datetime import date from dateutil.relativedelta import relativedelta import os import shutil con = duckdb.connect(database='ldbc.duckdb', read_only=False) # batches are selected from the [network_start_date, network_end_date) interval, # each batch denotes a [batch_start_date, batch_end_date) where # batch_end_date = batch_start_date + batch_size network_start_date = date(2011, 1, 1) network_end_date = date(2014, 1, 1) batch_size = relativedelta(years=1) if os.path.isdir("batches"): shutil.rmtree("batches") os.mkdir("batches") batch_start_date = network_start_date while batch_start_date < network_end_date: batch_end_date = batch_start_date + batch_size interval = [batch_start_date, batch_end_date] print(f"Batch: {interval}") ######################################## cleanup ####################################### # clean insert tables con.execute("DELETE FROM Person") # INS1 con.execute("DELETE FROM Person_hasInterest_Tag") con.execute("DELETE FROM Person_studyAt_University") con.execute("DELETE FROM Person_workAt_Company") con.execute("DELETE FROM Person_likes_Post") # INS2 con.execute("DELETE FROM Person_likes_Comment") # INS3 con.execute("DELETE FROM Forum") # INS4 con.execute("DELETE FROM Forum_hasTag_Tag") con.execute("DELETE FROM Forum_hasMember_Person") # INS5 con.execute("DELETE FROM Post") # INS6 con.execute("DELETE FROM Post_hasTag_Tag") con.execute("DELETE FROM Comment") # INS7 con.execute("DELETE FROM Comment_hasTag_Tag") # INS8 con.execute("DELETE FROM Person_knows_Person") # clean delete tables con.execute("DELETE FROM Person_Delete_candidates") # DEL1 con.execute("DELETE FROM Person_likes_Post_Delete_candidates") # DEL2 con.execute("DELETE FROM Person_likes_Comment_Delete_candidates") # DEL3 con.execute("DELETE FROM Forum_Delete_candidates") # DEL4 con.execute("DELETE FROM Forum_hasMember_Person_Delete_candidates") # DEL5 con.execute("DELETE FROM Post_Delete_candidates") # DEL6 con.execute("DELETE FROM Comment_Delete_candidates") # DEL7 con.execute("DELETE FROM Person_knows_Person_Delete_candidates") # DEL8 ######################################## inserts ####################################### insertion_params = [batch_start_date, batch_end_date, batch_end_date] # INS1 con.execute(""" INSERT INTO Person SELECT creationDate, id, firstName, lastName, gender, birthday, locationIP, browserUsed, isLocatedIn_City, speaks, email FROM Raw_Person WHERE creationDate >= ? AND creationDate < ? AND deletionDate >= ? """, insertion_params) con.execute(""" INSERT INTO Person_hasInterest_Tag SELECT creationDate, id, hasInterest_Tag FROM Raw_Person_hasInterest_Tag WHERE creationDate >= ? AND creationDate < ? AND deletionDate >= ? """, insertion_params) con.execute(""" INSERT INTO Person_studyAt_University SELECT creationDate, id, studyAt_University, classYear FROM Raw_Person_studyAt_University WHERE creationDate >= ? AND creationDate < ? AND deletionDate >= ? """, insertion_params) con.execute(""" INSERT INTO Person_workAt_Company SELECT creationDate, id, workAt_Company, workFrom FROM Raw_Person_workAt_Company WHERE creationDate >= ? AND creationDate < ? AND deletionDate >= ? """, insertion_params) # INS2 con.execute(""" INSERT INTO Person_likes_Post SELECT creationDate, id, likes_Post FROM Raw_Person_likes_Post WHERE creationDate >= ? AND creationDate < ? AND deletionDate >= ? """, insertion_params) # INS3 con.execute(""" INSERT INTO Person_likes_Comment SELECT creationDate, id, likes_Comment FROM Raw_Person_likes_Comment WHERE creationDate >= ? AND creationDate < ? AND deletionDate >= ? """, insertion_params) # INS4 con.execute(""" INSERT INTO Forum SELECT creationDate, id, title, hasModerator_Person FROM Raw_Forum WHERE creationDate >= ? AND creationDate < ? AND deletionDate >= ? """, insertion_params) con.execute(""" INSERT INTO Forum_hasTag_Tag SELECT creationDate, id, hasTag_Tag FROM Raw_Forum_hasTag_Tag WHERE creationDate >= ? AND creationDate < ? AND deletionDate >= ? """, insertion_params) # INS5 con.execute(""" INSERT INTO Forum_hasMember_Person SELECT creationDate, id, hasMember_Person FROM Raw_Forum_hasMember_Person WHERE creationDate >= ? AND creationDate < ? AND deletionDate >= ? """, insertion_params) # INS6 con.execute(""" INSERT INTO Post SELECT creationDate, id, imageFile, locationIP, browserUsed, language, content, length, hasCreator_Person, Forum_containerOf, isLocatedIn_Country FROM Raw_Post WHERE creationDate >= ? AND creationDate < ? AND deletionDate >= ? """, insertion_params) con.execute(""" INSERT INTO Post_hasTag_Tag SELECT creationDate, id, hasTag_Tag FROM Raw_Post_hasTag_Tag WHERE creationDate >= ? AND creationDate < ? AND deletionDate >= ? """, insertion_params) # INS7 con.execute(""" INSERT INTO Comment SELECT creationDate, id, locationIP, browserUsed, content, length, hasCreator_Person, isLocatedIn_Country, replyOf_Post, replyOf_Comment FROM Raw_Comment WHERE creationDate >= ? AND creationDate < ? AND deletionDate >= ? """, insertion_params) con.execute(""" INSERT INTO Comment_hasTag_Tag SELECT creationDate, id, hasTag_Tag FROM Raw_Comment_hasTag_Tag WHERE creationDate >= ? AND creationDate < ? AND deletionDate >= ? """, insertion_params) # INS8 con.execute(""" INSERT INTO Person_knows_Person SELECT creationDate, Person1id, Person2id FROM Raw_Person_knows_Person WHERE creationDate >= ? AND creationDate < ? AND deletionDate >= ? """, insertion_params) ######################################## deletes ####################################### deletion_params = [batch_start_date, batch_start_date, batch_end_date] # DEL1 (Persons are always explicitly deleted) con.execute(""" INSERT INTO Person_Delete_candidates SELECT deletionDate, id FROM Raw_Person WHERE creationDate < ? AND deletionDate >= ? AND deletionDate < ? """, deletion_params) # DEL2 con.execute(""" INSERT INTO Person_likes_Post_Delete_candidates SELECT deletionDate, id, likes_Post FROM Raw_Person_likes_Post WHERE explicitlyDeleted AND creationDate < ? AND deletionDate >= ? AND deletionDate < ? """, deletion_params) # DEL3 con.execute(""" INSERT INTO Person_likes_Comment_Delete_candidates SELECT deletionDate, id, likes_Comment FROM Raw_Person_likes_Comment WHERE explicitlyDeleted AND creationDate < ? AND deletionDate >= ? AND deletionDate < ? """, deletion_params) # DEL4 (Forums are always explicitly deleted -- TODO: check in generated data for walls/albums/groups) con.execute(""" INSERT INTO Forum_Delete_candidates SELECT deletionDate, id FROM Raw_Forum WHERE creationDate < ? AND deletionDate >= ? AND deletionDate < ? """, deletion_params) # DEL5 con.execute(""" INSERT INTO Forum_hasMember_Person_Delete_candidates SELECT deletionDate, id, hasMember_Person FROM Raw_Forum_hasMember_Person WHERE explicitlyDeleted AND creationDate < ? AND deletionDate >= ? AND deletionDate < ? """, deletion_params) # DEL6 con.execute(""" INSERT INTO Post_Delete_candidates SELECT deletionDate, id FROM Raw_Post WHERE explicitlyDeleted AND creationDate < ? AND deletionDate >= ? AND deletionDate < ? """, deletion_params) # DEL7 con.execute(""" INSERT INTO Comment_Delete_candidates SELECT deletionDate, id FROM Raw_Comment WHERE explicitlyDeleted AND creationDate < ? AND deletionDate >= ? AND deletionDate < ? """, deletion_params) # DEL8 con.execute(""" INSERT INTO Person_knows_Person_Delete_candidates SELECT deletionDate, Person1id, Person2id FROM Raw_Person_knows_Person WHERE explicitlyDeleted AND creationDate < ? AND deletionDate >= ? AND deletionDate < ? """, deletion_params) ######################################## export ######################################## batch_dir = f"batches/{batch_start_date}" os.mkdir(f"{batch_dir}") os.mkdir(f"{batch_dir}/inserts") os.mkdir(f"{batch_dir}/deletes") # inserts con.execute(f"COPY (SELECT strftime(creationDate, '%Y-%m-%dT%H:%M:%S.%g+00:00') AS creationDate, id, firstName, lastName, gender, birthday, locationIP, browserUsed, isLocatedIn_City, speaks, email FROM Person) TO 'batches/{batch_start_date}/inserts/Person.csv' (HEADER, FORMAT CSV, DELIMITER '|')") #INS1 con.execute(f"COPY (SELECT strftime(creationDate, '%Y-%m-%dT%H:%M:%S.%g+00:00') AS creationDate, id, hasInterest_Tag FROM Person_hasInterest_Tag) TO 'batches/{batch_start_date}/inserts/Person_hasInterest_Tag.csv' (HEADER, FORMAT CSV, DELIMITER '|')") con.execute(f"COPY (SELECT strftime(creationDate, '%Y-%m-%dT%H:%M:%S.%g+00:00') AS creationDate, id, studyAt_University, classYear FROM Person_studyAt_University) TO 'batches/{batch_start_date}/inserts/Person_studyAt_University.csv' (HEADER, FORMAT CSV, DELIMITER '|')") con.execute(f"COPY (SELECT strftime(creationDate, '%Y-%m-%dT%H:%M:%S.%g+00:00') AS creationDate, id, workAt_Company, workFrom FROM Person_workAt_Company) TO 'batches/{batch_start_date}/inserts/Person_workAt_Company.csv' (HEADER, FORMAT CSV, DELIMITER '|')") con.execute(f"COPY (SELECT strftime(creationDate, '%Y-%m-%dT%H:%M:%S.%g+00:00') AS creationDate, id, likes_Post FROM Person_likes_Post) TO 'batches/{batch_start_date}/inserts/Person_likes_Post.csv' (HEADER, FORMAT CSV, DELIMITER '|')") #INS2 con.execute(f"COPY (SELECT strftime(creationDate, '%Y-%m-%dT%H:%M:%S.%g+00:00') AS creationDate, id, likes_Comment FROM Person_likes_Comment) TO 'batches/{batch_start_date}/inserts/Person_likes_Comment.csv' (HEADER, FORMAT CSV, DELIMITER '|')") #INS3 con.execute(f"COPY (SELECT strftime(creationDate, '%Y-%m-%dT%H:%M:%S.%g+00:00') AS creationDate, id, title, hasModerator_Person FROM Forum) TO 'batches/{batch_start_date}/inserts/Forum.csv' (HEADER, FORMAT CSV, DELIMITER '|')") #INS4 con.execute(f"COPY (SELECT strftime(creationDate, '%Y-%m-%dT%H:%M:%S.%g+00:00') AS creationDate, id, hasTag_Tag FROM Forum_hasTag_Tag) TO 'batches/{batch_start_date}/inserts/Forum_hasTag_Tag.csv' (HEADER, FORMAT CSV, DELIMITER '|')") con.execute(f"COPY (SELECT strftime(creationDate, '%Y-%m-%dT%H:%M:%S.%g+00:00') AS creationDate, id, hasMember_Person FROM Forum_hasMember_Person) TO 'batches/{batch_start_date}/inserts/Forum_hasMember_Person.csv' (HEADER, FORMAT CSV, DELIMITER '|')") #INS5 con.execute(f"COPY (SELECT strftime(creationDate, '%Y-%m-%dT%H:%M:%S.%g+00:00') AS creationDate, id, imageFile, locationIP, browserUsed, language, content, length, hasCreator_Person, Forum_containerOf, isLocatedIn_Country FROM Post) TO 'batches/{batch_start_date}/inserts/Post.csv' (HEADER, FORMAT CSV, DELIMITER '|')") #INS6 con.execute(f"COPY (SELECT strftime(creationDate, '%Y-%m-%dT%H:%M:%S.%g+00:00') AS creationDate, id, hasTag_Tag FROM Post_hasTag_Tag) TO 'batches/{batch_start_date}/inserts/Post_hasTag_Tag.csv' (HEADER, FORMAT CSV, DELIMITER '|')") con.execute(f"COPY (SELECT strftime(creationDate, '%Y-%m-%dT%H:%M:%S.%g+00:00') AS creationDate, id, locationIP, browserUsed, content, length, hasCreator_Person, isLocatedIn_Country, replyOf_Post, replyOf_Comment FROM Comment) TO 'batches/{batch_start_date}/inserts/Comment.csv' (HEADER, FORMAT CSV, DELIMITER '|')") #INS7 con.execute(f"COPY (SELECT strftime(creationDate, '%Y-%m-%dT%H:%M:%S.%g+00:00') AS creationDate, id, hasTag_Tag FROM Comment_hasTag_Tag) TO 'batches/{batch_start_date}/inserts/Comment_hasTag_Tag.csv' (HEADER, FORMAT CSV, DELIMITER '|')") con.execute(f"COPY (SELECT strftime(creationDate, '%Y-%m-%dT%H:%M:%S.%g+00:00') AS creationDate, Person1id, Person2id FROM Person_knows_Person) TO 'batches/{batch_start_date}/inserts/Person_knows_Person.csv' (HEADER, FORMAT CSV, DELIMITER '|')") #INS8 # deletes con.execute(f"COPY (SELECT strftime(deletionDate, '%Y-%m-%dT%H:%M:%S.%g+00:00') AS deletionDate, id FROM Person_Delete_candidates) TO 'batches/{batch_start_date}/deletes/Person.csv' (HEADER, FORMAT CSV, DELIMITER '|')") #DEL1 con.execute(f"COPY (SELECT strftime(deletionDate, '%Y-%m-%dT%H:%M:%S.%g+00:00') AS deletionDate, src, trg FROM Person_likes_Post_Delete_candidates) TO 'batches/{batch_start_date}/deletes/Person_likes_Post.csv' (HEADER, FORMAT CSV, DELIMITER '|')") #DEL2 con.execute(f"COPY (SELECT strftime(deletionDate, '%Y-%m-%dT%H:%M:%S.%g+00:00') AS deletionDate, src, trg FROM Person_likes_Comment_Delete_candidates) TO 'batches/{batch_start_date}/deletes/Person_likes_Comment.csv' (HEADER, FORMAT CSV, DELIMITER '|')") #DEL3 con.execute(f"COPY (SELECT strftime(deletionDate, '%Y-%m-%dT%H:%M:%S.%g+00:00') AS deletionDate, id FROM Forum_Delete_candidates) TO 'batches/{batch_start_date}/deletes/Forum.csv' (HEADER, FORMAT CSV, DELIMITER '|')") #DEL4 con.execute(f"COPY (SELECT strftime(deletionDate, '%Y-%m-%dT%H:%M:%S.%g+00:00') AS deletionDate, src, trg FROM Forum_hasMember_Person_Delete_candidates) TO 'batches/{batch_start_date}/deletes/Forum_hasMember_Person.csv' (HEADER, FORMAT CSV, DELIMITER '|')") #DEL5 con.execute(f"COPY (SELECT strftime(deletionDate, '%Y-%m-%dT%H:%M:%S.%g+00:00') AS deletionDate, id FROM Post_Delete_candidates) TO 'batches/{batch_start_date}/deletes/Post.csv' (HEADER, FORMAT CSV, DELIMITER '|')") #DEL6 con.execute(f"COPY (SELECT strftime(deletionDate, '%Y-%m-%dT%H:%M:%S.%g+00:00') AS deletionDate, id FROM Comment_Delete_candidates) TO 'batches/{batch_start_date}/deletes/Comment.csv' (HEADER, FORMAT CSV, DELIMITER '|')") #DEL7 con.execute(f"COPY (SELECT strftime(deletionDate, '%Y-%m-%dT%H:%M:%S.%g+00:00') AS deletionDate, src, trg FROM Person_knows_Person_Delete_candidates) TO 'batches/{batch_start_date}/deletes/Person_knows_Person.csv' (HEADER, FORMAT CSV, DELIMITER '|')") #DEL8 ############################# set interval for next iteration ########################## batch_start_date = batch_end_date
50.619048
350
0.596954
0
0
0
0
0
0
0
0
14,060
0.82667
06e980c4f9e4c64a9ff9ed3aae6e787174a3969c
193
py
Python
College grade 2/Python 3/Lab_2/Ansel/exercise 1.py
SimonH19009/Lzu_Data-science
bd35c5e156b0db21c3585c11dce15fba0b7003e2
[ "MIT" ]
1
2022-03-06T05:30:44.000Z
2022-03-06T05:30:44.000Z
College grade 2/Python 3/Lab_2/Ansel/exercise 1.py
SimonH19009/Lzu_Data-science
bd35c5e156b0db21c3585c11dce15fba0b7003e2
[ "MIT" ]
null
null
null
College grade 2/Python 3/Lab_2/Ansel/exercise 1.py
SimonH19009/Lzu_Data-science
bd35c5e156b0db21c3585c11dce15fba0b7003e2
[ "MIT" ]
1
2022-03-06T06:07:40.000Z
2022-03-06T06:07:40.000Z
try: a=int(input("Please enter a number:")) if 9<a<100: a = str(a) print(a[0]) print(a[1]) else: print("no correct") except: print("no correct")
17.545455
42
0.487047
0
0
0
0
0
0
0
0
48
0.248705
06eb8e9951d11356b784f19e2310c1cacd28857e
122
py
Python
gameLogic/__init__.py
JoelEager/pyTanks-Server
4455c0475980ea1372f11d7ec41d95990b3c8f44
[ "MIT" ]
5
2017-09-04T09:36:40.000Z
2019-10-31T20:52:13.000Z
gameLogic/__init__.py
JoelEager/pyTanks-Server
4455c0475980ea1372f11d7ec41d95990b3c8f44
[ "MIT" ]
3
2018-12-28T08:09:51.000Z
2019-01-04T20:36:47.000Z
gameLogic/__init__.py
JoelEager/pyTanks-Server
4455c0475980ea1372f11d7ec41d95990b3c8f44
[ "MIT" ]
1
2018-12-28T08:12:36.000Z
2018-12-28T08:12:36.000Z
""" Contains all the logic for running the game (game clock, per-frame logic, game state update generation, and so on) """
40.666667
114
0.737705
0
0
0
0
0
0
0
0
122
1
06f25df0cac2fd1a3b4a6fa7c42cbde635e84014
1,131
py
Python
hypothesis/nn/neuromodulation/base.py
boyali/hypothesis-sre
f44d25eb281d49663d49d134ee73ad542849714b
[ "BSD-3-Clause" ]
45
2019-02-13T14:16:35.000Z
2022-02-23T21:30:02.000Z
hypothesis/nn/neuromodulation/base.py
boyali/hypothesis-sre
f44d25eb281d49663d49d134ee73ad542849714b
[ "BSD-3-Clause" ]
1
2020-01-13T08:29:50.000Z
2020-01-22T10:28:02.000Z
hypothesis/nn/neuromodulation/base.py
boyali/hypothesis-sre
f44d25eb281d49663d49d134ee73ad542849714b
[ "BSD-3-Clause" ]
8
2019-04-23T14:25:08.000Z
2021-07-28T15:05:31.000Z
import hypothesis import torch from hypothesis.nn.util import list_modules_with_type def allocate_neuromodulated_activation(activation, allocator): class LambdaNeuromodulatedActivation(BaseNeuromodulatedModule): def __init__(self): super(LambdaNeuromodulatedActivation, self).__init__( controller=allocator(), activation=activation) return LambdaNeuromodulatedActivation def list_neuromodulated_modules(module): desired_type = BaseNeuromodulatedModule return list_modules_with_type(module, desired_type) class BaseNeuromodulatedModule(torch.nn.Module): def __init__(self, controller, activation=hypothesis.default.activation, **kwargs): super(BaseNeuromodulatedModule, self).__init__() self.activation = activation(**kwargs) self.bias = torch.randn(1, 1) self.controller = controller def forward(self, x, context=None): if context is not None: self.update(context) return self.activation(x + self.bias) def update(self, context): self.bias = self.controller(context)
26.928571
87
0.715296
783
0.692308
0
0
0
0
0
0
0
0
06f368aa1460565e63ed4a80b862ae97a70212cf
1,151
py
Python
2.py
zweed4u/dailycodingproblem
6e40eaad347e283f86a11adeff01c6426211a0be
[ "MIT" ]
null
null
null
2.py
zweed4u/dailycodingproblem
6e40eaad347e283f86a11adeff01c6426211a0be
[ "MIT" ]
null
null
null
2.py
zweed4u/dailycodingproblem
6e40eaad347e283f86a11adeff01c6426211a0be
[ "MIT" ]
null
null
null
#!/usr/bin/python3 """ Good morning! Here's your coding interview problem for today. This problem was asked by Uber. Given an array of integers, return a new array such that each element at index i of the new array is the product of all the numbers in the original array except the one at i. For example, if our input was [1, 2, 3, 4, 5], the expected output would be [120, 60, 40, 30, 24]. If our input was [3, 2, 1], the expected output would be [2, 3, 6]. Follow-up: what if you can't use division? """ def func(in_array): out_array = [] for number in in_array: product = 1 for v in in_array: if number == v: continue product *= v out_array.append(product) return out_array def division_func(in_array): # Using folllow up as hint for a solution using division out_array = [] for number in in_array: product = 1 for v in in_array: product *= v out_array.append(int(product/number)) return out_array print(division_func([1,2,3,4,5])) print(division_func([3, 2, 1])) print(func([1,2,3,4,5])) print(func([3, 2, 1]))
28.775
174
0.636838
0
0
0
0
0
0
0
0
564
0.490009
06fbcffd6a9d16ac26a727dde7c14ddf62ce182c
3,685
py
Python
ldap_login/management/commands/importLDAPusers.py
knightsamar/change_agent
53e8b6335f5f6856ae12dba6a509e4147c68a004
[ "Apache-2.0" ]
null
null
null
ldap_login/management/commands/importLDAPusers.py
knightsamar/change_agent
53e8b6335f5f6856ae12dba6a509e4147c68a004
[ "Apache-2.0" ]
null
null
null
ldap_login/management/commands/importLDAPusers.py
knightsamar/change_agent
53e8b6335f5f6856ae12dba6a509e4147c68a004
[ "Apache-2.0" ]
null
null
null
from django.core.management.base import NoArgsCommand, CommandError; from ldap_login.ldapUtils import ldapManager; from ldap_login.models import user,group,Role; from datetime import datetime; import traceback; class Command(NoArgsCommand): """Import LDAP users from Active Directory. Uses the ldapUtils backend. Creates the users in our databases else uses existings users. Updates group bindings and full names for existing and new users also. """ args = None; help = "imports LDAP users from Active Directory into database" can_import_settings = True exclusion_list = ['exam','Domain Controllers']; #list of OUs we do not want to handle at all. def handle_noargs(self, **options): #**options is a dictionary of keyword parameters beyond those defined try: l = ldapManager(); groups = l.getGroups() for g in groups: if g in self.exclusion_list : continue; print "-" * 60 print '\nProcessing group %s' % g; #does this group exist in our database ? try: groupObj = group.objects.get(name=g); print "Using existing group %s" % g except group.DoesNotExist: groupObj = group(name=g,created_on=datetime.now()); groupObj.save(); print "Created group %s" % g; finally: users = l.getUsers(ou=g,attrs=['sAMAccountName','displayName']); for u in users: print "-" * 20 username = u['sAMAccountName'][0]; #because we get a dictionary of lists from ldap! print '\nSearching for existing user with username : %s ' % username; try: userObj = user.objects.get(pk=username) print "Using existing user %s " % userObj except user.DoesNotExist: userObj = user(pk=username); userObj.created_on = datetime.now(); print "Created user %s " % userObj; except Exception as e: print 'An unknown exception occured! '; print e; print traceback.print_exc(); finally: #so that we update these properties for all user if 'displayName' in u: userObj.fullname = u['displayName'][0] #because it's a dictionary of lists! else: userObj.fullname = userObj.pk #Don't forget to assign role! if username.startswith('0') or username.startswith('1'): userObj.role = Role.objects.get_or_create(name='student')[0] else: userObj.role = Role.objects.get_or_create(name='faculty')[0] userObj.save(); #the following must be done after saving #refer: http://stackoverflow.com/questions/7837033/valueerror-cannot-add-instance-is-on-database-default-value-is-on-databas userObj.groups.add(groupObj); #add this user to the group; except KeyError as e: print 'KeyError happened in the structure :' print e.message print 'Structure:', u print except Exception as e: print 'Some unexpected exception occured!'; print e; print traceback.print_exc()
46.64557
131
0.536228
3,459
0.93867
0
0
0
0
0
0
1,202
0.326187
06fe538ead84c59a5f996694a885042a2b6cbe93
822
py
Python
rocketchat_API/APISections/subscriptions.py
dudanogueira/rocketchat_API
190952f07ce04a356c79ad29e9d1e01dea620ba6
[ "MIT" ]
210
2017-03-20T13:36:24.000Z
2022-03-30T17:37:02.000Z
rocketchat_API/APISections/subscriptions.py
dudanogueira/rocketchat_API
190952f07ce04a356c79ad29e9d1e01dea620ba6
[ "MIT" ]
144
2017-03-21T13:50:22.000Z
2022-03-28T09:43:26.000Z
rocketchat_API/APISections/subscriptions.py
dudanogueira/rocketchat_API
190952f07ce04a356c79ad29e9d1e01dea620ba6
[ "MIT" ]
103
2017-03-20T13:54:54.000Z
2022-03-22T05:00:18.000Z
from rocketchat_API.APISections.base import RocketChatBase class RocketChatSubscriptions(RocketChatBase): def subscriptions_get(self, **kwargs): """Get all subscriptions.""" return self.call_api_get("subscriptions.get", kwargs=kwargs) def subscriptions_get_one(self, room_id, **kwargs): """Get the subscription by room id.""" return self.call_api_get("subscriptions.getOne", roomId=room_id, kwargs=kwargs) def subscriptions_unread(self, room_id, **kwargs): """Mark messages as unread by roomId or from a message""" return self.call_api_post("subscriptions.unread", roomId=room_id, kwargs=kwargs) def subscriptions_read(self, rid, **kwargs): """Mark room as read""" return self.call_api_post("subscriptions.read", rid=rid, kwargs=kwargs)
41.1
88
0.708029
760
0.924574
0
0
0
0
0
0
229
0.278589
06fefeedf2e0b5eb6fdb9935285ddf733447d30c
1,081
py
Python
accounts/models.py
Phist0ne/webvirtcloud
d94ca38e5c8b5bb1323d33067ee6b991775cc390
[ "Apache-2.0" ]
2
2018-03-14T09:46:49.000Z
2019-05-14T11:45:14.000Z
accounts/models.py
JamesLinus/webvirtcloud
d94ca38e5c8b5bb1323d33067ee6b991775cc390
[ "Apache-2.0" ]
1
2018-03-01T04:05:25.000Z
2018-10-01T08:30:00.000Z
accounts/models.py
caicloud/webvirtcloud
d94ca38e5c8b5bb1323d33067ee6b991775cc390
[ "Apache-2.0" ]
1
2019-06-11T19:54:08.000Z
2019-06-11T19:54:08.000Z
from django.db import models from django.contrib.auth.models import User from instances.models import Instance class UserInstance(models.Model): user = models.ForeignKey(User) instance = models.ForeignKey(Instance) is_change = models.BooleanField(default=False) is_delete = models.BooleanField(default=False) is_vnc = models.BooleanField(default=False) def __unicode__(self): return self.instance.name class UserSSHKey(models.Model): user = models.ForeignKey(User) keyname = models.CharField(max_length=25) keypublic = models.CharField(max_length=500) def __unicode__(self): return self.keyname class UserAttributes(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) can_clone_instances = models.BooleanField(default=False) max_instances = models.IntegerField(default=1) max_cpus = models.IntegerField(default=1) max_memory = models.IntegerField(default=2048) max_disk_size = models.IntegerField(default=20) def __unicode__(self): return self.user.username
30.885714
63
0.747456
962
0.889917
0
0
0
0
0
0
0
0
6600b5f654aa204f83a56f1407440180c9d9fa01
8,744
py
Python
sdk/python/pulumi_cloudflare/custom_ssl.py
vijayraavi/pulumi-cloudflare
ba61514d650fc7a5a2667147519de213c07344b8
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
sdk/python/pulumi_cloudflare/custom_ssl.py
vijayraavi/pulumi-cloudflare
ba61514d650fc7a5a2667147519de213c07344b8
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
sdk/python/pulumi_cloudflare/custom_ssl.py
vijayraavi/pulumi-cloudflare
ba61514d650fc7a5a2667147519de213c07344b8
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import json import warnings import pulumi import pulumi.runtime from typing import Union from . import utilities, tables class CustomSsl(pulumi.CustomResource): custom_ssl_options: pulumi.Output[dict] """ The certificate, private key and associated optional parameters, such as bundle_method, geo_restrictions, and type. * `bundle_method` (`str`) - Method of building intermediate certificate chain. A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it. Valid values are `ubiquitous` (default), `optimal`, `force`. * `certificate` (`str`) - Certificate certificate and the intermediate(s) * `geo_restrictions` (`str`) - Specifies the region where your private key can be held locally. Valid values are `us`, `eu`, `highest_security`. * `private_key` (`str`) - Certificate's private key * `type` (`str`) - Whether to enable support for legacy clients which do not include SNI in the TLS handshake. Valid values are `legacy_custom` (default), `sni_custom`. """ custom_ssl_priorities: pulumi.Output[list] expires_on: pulumi.Output[str] hosts: pulumi.Output[list] issuer: pulumi.Output[str] modified_on: pulumi.Output[str] priority: pulumi.Output[float] signature: pulumi.Output[str] status: pulumi.Output[str] uploaded_on: pulumi.Output[str] zone_id: pulumi.Output[str] """ The DNS zone id to the custom ssl cert should be added. """ def __init__(__self__, resource_name, opts=None, custom_ssl_options=None, custom_ssl_priorities=None, zone_id=None, __props__=None, __name__=None, __opts__=None): """ Provides a Cloudflare custom ssl resource. :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[dict] custom_ssl_options: The certificate, private key and associated optional parameters, such as bundle_method, geo_restrictions, and type. :param pulumi.Input[str] zone_id: The DNS zone id to the custom ssl cert should be added. The **custom_ssl_options** object supports the following: * `bundle_method` (`pulumi.Input[str]`) - Method of building intermediate certificate chain. A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it. Valid values are `ubiquitous` (default), `optimal`, `force`. * `certificate` (`pulumi.Input[str]`) - Certificate certificate and the intermediate(s) * `geo_restrictions` (`pulumi.Input[str]`) - Specifies the region where your private key can be held locally. Valid values are `us`, `eu`, `highest_security`. * `private_key` (`pulumi.Input[str]`) - Certificate's private key * `type` (`pulumi.Input[str]`) - Whether to enable support for legacy clients which do not include SNI in the TLS handshake. Valid values are `legacy_custom` (default), `sni_custom`. The **custom_ssl_priorities** object supports the following: * `id` (`pulumi.Input[str]`) * `priority` (`pulumi.Input[float]`) > This content is derived from https://github.com/terraform-providers/terraform-provider-cloudflare/blob/master/website/docs/r/custom_ssl.html.markdown. """ if __name__ is not None: warnings.warn("explicit use of __name__ is deprecated", DeprecationWarning) resource_name = __name__ if __opts__ is not None: warnings.warn("explicit use of __opts__ is deprecated, use 'opts' instead", DeprecationWarning) opts = __opts__ if opts is None: opts = pulumi.ResourceOptions() if not isinstance(opts, pulumi.ResourceOptions): raise TypeError('Expected resource options to be a ResourceOptions instance') if opts.version is None: opts.version = utilities.get_version() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') __props__ = dict() __props__['custom_ssl_options'] = custom_ssl_options __props__['custom_ssl_priorities'] = custom_ssl_priorities if zone_id is None: raise TypeError("Missing required property 'zone_id'") __props__['zone_id'] = zone_id __props__['expires_on'] = None __props__['hosts'] = None __props__['issuer'] = None __props__['modified_on'] = None __props__['priority'] = None __props__['signature'] = None __props__['status'] = None __props__['uploaded_on'] = None super(CustomSsl, __self__).__init__( 'cloudflare:index/customSsl:CustomSsl', resource_name, __props__, opts) @staticmethod def get(resource_name, id, opts=None, custom_ssl_options=None, custom_ssl_priorities=None, expires_on=None, hosts=None, issuer=None, modified_on=None, priority=None, signature=None, status=None, uploaded_on=None, zone_id=None): """ Get an existing CustomSsl resource's state with the given name, id, and optional extra properties used to qualify the lookup. :param str resource_name: The unique name of the resulting resource. :param str id: The unique provider ID of the resource to lookup. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[dict] custom_ssl_options: The certificate, private key and associated optional parameters, such as bundle_method, geo_restrictions, and type. :param pulumi.Input[str] zone_id: The DNS zone id to the custom ssl cert should be added. The **custom_ssl_options** object supports the following: * `bundle_method` (`pulumi.Input[str]`) - Method of building intermediate certificate chain. A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it. Valid values are `ubiquitous` (default), `optimal`, `force`. * `certificate` (`pulumi.Input[str]`) - Certificate certificate and the intermediate(s) * `geo_restrictions` (`pulumi.Input[str]`) - Specifies the region where your private key can be held locally. Valid values are `us`, `eu`, `highest_security`. * `private_key` (`pulumi.Input[str]`) - Certificate's private key * `type` (`pulumi.Input[str]`) - Whether to enable support for legacy clients which do not include SNI in the TLS handshake. Valid values are `legacy_custom` (default), `sni_custom`. The **custom_ssl_priorities** object supports the following: * `id` (`pulumi.Input[str]`) * `priority` (`pulumi.Input[float]`) > This content is derived from https://github.com/terraform-providers/terraform-provider-cloudflare/blob/master/website/docs/r/custom_ssl.html.markdown. """ opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) __props__ = dict() __props__["custom_ssl_options"] = custom_ssl_options __props__["custom_ssl_priorities"] = custom_ssl_priorities __props__["expires_on"] = expires_on __props__["hosts"] = hosts __props__["issuer"] = issuer __props__["modified_on"] = modified_on __props__["priority"] = priority __props__["signature"] = signature __props__["status"] = status __props__["uploaded_on"] = uploaded_on __props__["zone_id"] = zone_id return CustomSsl(resource_name, opts=opts, __props__=__props__) def translate_output_property(self, prop): return tables._CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop def translate_input_property(self, prop): return tables._SNAKE_TO_CAMEL_CASE_TABLE.get(prop) or prop
60.722222
440
0.688358
8,435
0.964661
0
0
2,984
0.341263
0
0
5,798
0.663083
66012301064b5709a93a6fcc63e250bae442c6d6
1,804
py
Python
main.py
PortosKo/Python_Lesson_2
160c569f17d21cc1f2e48227b526a49594e90d59
[ "MIT" ]
null
null
null
main.py
PortosKo/Python_Lesson_2
160c569f17d21cc1f2e48227b526a49594e90d59
[ "MIT" ]
null
null
null
main.py
PortosKo/Python_Lesson_2
160c569f17d21cc1f2e48227b526a49594e90d59
[ "MIT" ]
null
null
null
#Задачи на циклы и оператор условия------ #---------------------------------------- ''' # Задача 1 Вывести на экран циклом пять строк из нулей, причем каждая строка должна быть пронумерована. ''' print ('Задача1') x = 0 for x in range (1,6,): print (x,0) ''' Задача 2 Пользователь в цикле вводит 10 цифр. Найти количество введеных пользователем цифр 5. ''' print ('Задача2') x = 98535254155 count = 0 while (x // 10) > 0: if x % 10 == 5: count += 1 x = x // 10 print(count) ''' Задача 3 Найти сумму ряда чисел от 1 до 100. Полученный результат вывести на экран. ''' print ('Задача3') sum = 0 for i in range(1,101): sum+=i print(sum) ''' Задача 4 Найти произведение ряда чисел от 1 до 10. Полученный результат вывести на экран. ''' print ('Задача4') for x in range(1,10): x += x print(x) ''' Задача 5 #Вывести цифры числа на каждой строчке. ''' print('Задача5') integer_number = 2129 print(integer_number%10,integer_number//10) while integer_number>0: print(integer_number%10) integer_number = integer_number//10 ''' Задача 6 Найти сумму цифр числа. ''' print('задача6') num = int(input('Введите число:')) sum = 0 while num: sum = sum + num % 10 num = num // 10 print('Сумма числа =', sum) ''' Задача 7 Найти произведение цифр числа. ''' print('Задача7') num = int(input('Введите число:')) mult = 1 while num: mult = mult * (num % 10) num = num // 10 print('Произведение цифр =', mult) ''' Задача 8 Дать ответ на вопрос: есть ли среди цифр числа 5? ''' integer_number = 213413 while integer_number>0: if integer_number%10 == 5: print('Yes') break integer_number = integer_number//10 else: print('No') ''' Задача 9 Найти максимальную цифру в числе ''' ''' Задача 10 Найти количество цифр 5 в числе '''
15.288136
92
0.636364
0
0
0
0
0
0
0
0
1,551
0.64197
660235efa168bc77f41850e9696ac1ce83979716
5,062
py
Python
config_loader/loader.py
egabancho/config-loader
af45c7bef3afe4dee930754386a1763a28574d6c
[ "MIT" ]
null
null
null
config_loader/loader.py
egabancho/config-loader
af45c7bef3afe4dee930754386a1763a28574d6c
[ "MIT" ]
null
null
null
config_loader/loader.py
egabancho/config-loader
af45c7bef3afe4dee930754386a1763a28574d6c
[ "MIT" ]
null
null
null
"""Configuration loader class.""" import ast import logging import os import types from operator import attrgetter import pkg_resources logger = logging.getLogger(__name__) class Config(object): """Configuration loader, it's like a normal dictionary with super-powers. It will load configuration in the following order: 1. Load configuration from ``config_loader.module`` entry points group, following the alphabetical ascending order in case of multiple entry points defined. 2. Load from file path, if provided via environment variable. 3. Load from keyword arguments when provided. 4. Load configuration from environment variables with the prefix ``env_prefix``. Once the object is created it can be updated, as a normal dictionary or, using any of the ``from_`` methods provided. :param env_var: Name of an environment variable pointing to a configuration file. :param env_prefix: Environment variable prefix, it will iterate over all environment variables and load the ones matching the prefix. :param entry_point_name: Name of the entry point used to add configuration files from outside modules. :param kwargs_config: Dictionary with ad-hoc configuration variables. """ def __init__( self, env_var='CONFIG_SETTINGS', env_prefix='CONFIG_', entry_point_name='config_loader.module', **kwargs_config ): """Initialize new configuration loader instance.""" self._internal_config = None self.env_var = env_var self.env_prefix = env_prefix self.entry_point_name = entry_point_name self.extra_config = kwargs_config @property def _config(self): """Hide internal configuration for lazy loading.""" if self._internal_config is None: self._internal_config = dict() self.build() return self._internal_config def __getattr__(self, name): """Fallback to the internal dictionary if attr not found.""" return getattr(self._config, name) def __repr__(self): """Get repr from the internal dictionary.""" return self._config.__repr__() def __getitem__(self, key): """Allow for square bracket notation.""" return self._config.__getitem__(key) def __setitem__(self, key, value): """Allow for square bracket notation.""" return self._config.__setitem(key, value) def build(self): """Build internal configuration.""" self.from_entry_point(self.entry_point_name) self.from_envvar(self.env_var) self._config.update(self.extra_config) self.from_env(self.env_prefix) def from_entry_point(self, entry_point_name): """Update values from module defined by entry point. Configurations are loaded in alphabetical ascending order. :param entry_point_name: The name of the entry point. """ eps = sorted( pkg_resources.iter_entry_points(entry_point_name), key=attrgetter('name'), ) for ep in eps: self.from_object(ep.load()) def from_envvar(self, variable_name): """Update values from an env variable pointing to a configuration file. :param variable_name: The name of the environment variable. """ filename = os.environ.get(variable_name, None) if filename: self.from_pyfile(filename) else: logger.debug('Cannot find env file') def from_pyfile(self, filename): """Update the values in the config from a Python file. :param filename: The filename of the config. """ if not os.path.exists(filename): logger.warn('File %s does not exists', filename) return d = types.ModuleType('config') d.__file__ = filename with open(filename, mode='rb') as config_file: exec(compile(config_file.read(), filename, 'exec'), d.__dict__) self.from_object(d) def from_object(self, obj): """Update the values from the given object. :param obj: An object to import cfg values from. """ for key in dir(obj): if key.isupper(): self._config[key] = getattr(obj, key) def from_env(self, prefix): """Load configuration from environment variables. :param prefix: The prefix used to filter the environment variables. """ prefix_len = len(prefix) for varname, value in os.environ.items(): if not varname.startswith(prefix): continue # Prepare values varname = varname[prefix_len:] value = value or self.get(varname) # Evaluate value try: value = ast.literal_eval(value) except (SyntaxError, ValueError): pass # Set value self._config[varname] = value
32.87013
79
0.633544
4,883
0.964638
0
0
239
0.047215
0
0
2,340
0.462268
6603d02ce7ae8ff687520b5fd3b5f402880ef876
1,616
py
Python
tginviter/storage/base_storage.py
cuamckuu/tg-inviter
80b8d4664d1e2628b46ac1a6d58f8495c408d4b4
[ "MIT" ]
20
2020-08-24T19:11:38.000Z
2022-03-17T19:24:50.000Z
tginviter/storage/base_storage.py
bequirky12/tg-inviter
5cad1bc1afce101be03a2cee805931e77b7f6842
[ "MIT" ]
null
null
null
tginviter/storage/base_storage.py
bequirky12/tg-inviter
5cad1bc1afce101be03a2cee805931e77b7f6842
[ "MIT" ]
8
2021-02-05T11:51:21.000Z
2022-03-22T08:48:44.000Z
import abc from typing import AbstractSet class BaseStorage(abc.ABC): """Abstract base class for storing invite link tokens""" def insert(self, token: str, *, payload: dict, max_uses=1): """Insert token to storage. Shoud call super().insert(...)""" if type(payload) != dict: raise TypeError("Only dict payloads supported") if any([x not in payload for x in ["joinchat_key", "channel_id"]]): raise ValueError("Payload requires channel_id and joinchat_key") if type(payload["channel_id"]) != int: raise TypeError("Value of 'channel_id' should be int") if type(payload["joinchat_key"]) != str: raise TypeError("Value of 'joinchat_key' should be str") @abc.abstractmethod def uses_left(self, token: str) -> int: """Return amount of unused invitations for token""" pass @abc.abstractmethod def count_new_use(self, token: str): """Increase token usages count""" pass @abc.abstractmethod def get_payload(self, token: str) -> dict: """Return payload assosciated with given token""" pass @abc.abstractmethod def get_channel_ids(self) -> AbstractSet[int]: """Return set of all inserted channel_ids""" pass @abc.abstractmethod def is_subscribed(self, channel_id: int, user_id: int) -> bool: """Check if user is in channel's whitelist""" pass @abc.abstractmethod def add_subscription(self, channel_id: int, user_id: int): """Subscribe user to be in channel whitelist""" pass
31.076923
76
0.631188
1,571
0.972153
0
0
829
0.512995
0
0
590
0.365099
660466e84335250fcffeb29f786f70f54055b5a4
874
py
Python
docker/run.py
lvxiaojie111/2019NCCCU-
5b2d2b3a6e70e5b447ccaecd02fbead4763db82d
[ "Apache-2.0" ]
3
2020-10-18T02:16:37.000Z
2020-10-18T02:30:03.000Z
docker/run.py
lvxiaojie111/2019NCCCU-
5b2d2b3a6e70e5b447ccaecd02fbead4763db82d
[ "Apache-2.0" ]
null
null
null
docker/run.py
lvxiaojie111/2019NCCCU-
5b2d2b3a6e70e5b447ccaecd02fbead4763db82d
[ "Apache-2.0" ]
null
null
null
#! /usr/bin/env python # -*- coding: utf-8 -*- import numpy as np import os import pandas as pd import testmodel import imageio if __name__ == "__main__": #################### 不可修改区域开始 ###################### testpath = '/home/data/' #测试集路径。包含验证码图片文件 result_folder_path = '/code/result/submission.csv' #结果输出文件路径 #################### 不可修改区域结束 ###################### # testpath = './test/' #测试集路径。包含验证码图片文件 # result_folder_path = './result/submission.csv' #结果输出文件路径 print("reading start!") pic_names = [str(x) + ".jpg" for x in range(1, 5001)] pics = [imageio.imread(testpath + pic_name) for pic_name in pic_names] print("reading end!") ### 调用自己的工程文件,并这里生成结果文件(dataframe) result = testmodel.model(testpath) print(result) # 注意路径不能更改,index需要设置为None result.to_csv(result_folder_path, index=None) ### 参考代码结束:输出标准结果文件
32.37037
74
0.613272
0
0
0
0
0
0
0
0
666
0.606557
6604fb1cbe01eb3c82eaa8f6e34b1bd3c2c37677
359
py
Python
app/api/v1/__init__.py
Ethan-Ceng/Flask-CMS
2fe2664e9ae60affe277e9c3b50c18a2e32e422b
[ "MIT" ]
null
null
null
app/api/v1/__init__.py
Ethan-Ceng/Flask-CMS
2fe2664e9ae60affe277e9c3b50c18a2e32e422b
[ "MIT" ]
null
null
null
app/api/v1/__init__.py
Ethan-Ceng/Flask-CMS
2fe2664e9ae60affe277e9c3b50c18a2e32e422b
[ "MIT" ]
null
null
null
from flask import Blueprint from app.api.v1 import user, book, client, token def create_blueprint(): bp_v1 = Blueprint('v1', __name__) user.api.register(bp_v1, url_prefix='/client') user.api.register(bp_v1, url_prefix='/user') book.api.register(bp_v1, url_prefix='/book') book.api.register(bp_v1, url_prefix='/token') return bp_v1
25.642857
50
0.707521
0
0
0
0
0
0
0
0
35
0.097493
66055a1c87077054947e4816c06f4763187ad5d0
3,125
py
Python
draugr/visualisation/seaborn_utilities/seaborn_enums.py
cnHeider/draugr
b95e0bb1fa5efa581bfb28ff604f296ed2e6b7d6
[ "Apache-2.0" ]
3
2019-09-27T08:04:59.000Z
2020-12-02T06:14:45.000Z
draugr/visualisation/seaborn_utilities/seaborn_enums.py
cnHeider/draugr
b95e0bb1fa5efa581bfb28ff604f296ed2e6b7d6
[ "Apache-2.0" ]
64
2019-09-27T08:03:42.000Z
2022-03-28T15:07:30.000Z
draugr/visualisation/seaborn_utilities/seaborn_enums.py
cnHeider/draugr
b95e0bb1fa5efa581bfb28ff604f296ed2e6b7d6
[ "Apache-2.0" ]
1
2020-10-01T00:18:57.000Z
2020-10-01T00:18:57.000Z
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = "Christian Heider Nielsen" __doc__ = r""" Created on 26-01-2021 """ from enum import Enum from typing import Tuple import numpy from matplotlib import patheffects, pyplot __all__ = ["plot_median_labels", "show_values_on_bars"] from draugr.visualisation.matplotlib_utilities.styles.annotation import ( semi_opaque_round_tight_bbox, ) class MatplotlibHorizontalAlignment(Enum): Center = "center" Right = "right" Left = "left" class MatplotlibVerticalAlignment(Enum): Center = "center" Top = "top" Bottom = "bottom" Baseline = "baseline" CenterBaseline = "center_baseline" def plot_median_labels( ax: pyplot.Axes, *, has_fliers: bool = False, # text_size: int = 10, # text_weight: str = "normal", stroke_width: int = 0, precision: int = 3, color: str = "black", edgecolor: str = "black", # also the stroke color ha: str = "center", va: str = "center", # bottom bbox: Tuple = semi_opaque_round_tight_bbox, ) -> None: """ """ lines = ax.get_lines() # depending on fliers, toggle between 5 and 6 lines per box lines_per_box = 5 + int(has_fliers) # iterate directly over all median lines, with an interval of lines_per_box # this enables labeling of grouped data without relying on tick positions for median_line in lines[4 : len(lines) : lines_per_box]: # get center of median line mean_x = sum(median_line._x) / len(median_line._x) mean_y = sum(median_line._y) / len(median_line._y) text = ax.text( mean_x, mean_y, f"{round(mean_y, precision)}", ha=ha, va=va, # fontweight=text_weight, # size=text_size, color=color, # edgecolor=edgecolor bbox=bbox, ) # print text to center coordinates if stroke_width: # create small black border around white text # for better readability on multi-colored boxes text.set_path_effects( [ patheffects.Stroke(linewidth=stroke_width, foreground=edgecolor), patheffects.Normal(), ] ) def show_values_on_bars(axs: pyplot.Axes, h_v: str = "v", space: float = 0.4) -> None: """ """ def _show_on_single_plot(ax): if h_v == "v": for p in ax.patches: _x = p.get_x() + p.get_width() / 2 _y = p.get_y() + p.get_height() value = int(p.get_height()) ax.text(_x, _y, value, ha="center") elif h_v == "h": for p in ax.patches: _x = p.get_x() + p.get_width() + float(space) _y = p.get_y() + p.get_height() value = int(p.get_width()) ax.text(_x, _y, value, ha="left") if isinstance(axs, numpy.ndarray): for idx, ax in numpy.ndenumerate(axs): _show_on_single_plot(ax) else: _show_on_single_plot(axs)
28.935185
86
0.57632
267
0.08544
0
0
0
0
0
0
836
0.26752
6606cccffcd956e1fc4991eb79ef12938f47ff11
523
py
Python
get_gecko_driver/platforms.py
zaironjacobs/get-gecko-driver
33a4a90c3a96b2e5519722f3dfab075b57e6482d
[ "MIT" ]
3
2021-08-16T14:49:55.000Z
2022-03-20T14:44:13.000Z
get_gecko_driver/platforms.py
zaironjacobs/get-gecko-driver
33a4a90c3a96b2e5519722f3dfab075b57e6482d
[ "MIT" ]
null
null
null
get_gecko_driver/platforms.py
zaironjacobs/get-gecko-driver
33a4a90c3a96b2e5519722f3dfab075b57e6482d
[ "MIT" ]
1
2022-02-19T08:41:57.000Z
2022-02-19T08:41:57.000Z
class Platforms: @property def win(self): return 'win' @property def linux(self): return 'linux' @property def macos(self): return 'macos' @property def win_32(self): return 'win32' @property def win_64(self): return 'win64' @property def linux_32(self): return 'linux32' @property def linux_64(self): return 'linux64' @property def list(self): return [self.win, self.linux, self.macos]
15.382353
49
0.552581
522
0.998088
0
0
458
0.875717
0
0
51
0.097514
66085420dcc9a5728829c81982cb5b8af048ece5
1,061
py
Python
py/callback_dashboard.py
pnvnd/plotly
ede0bb0bb92484c2e3bf4e3631fa97f547e02c16
[ "Unlicense" ]
null
null
null
py/callback_dashboard.py
pnvnd/plotly
ede0bb0bb92484c2e3bf4e3631fa97f547e02c16
[ "Unlicense" ]
null
null
null
py/callback_dashboard.py
pnvnd/plotly
ede0bb0bb92484c2e3bf4e3631fa97f547e02c16
[ "Unlicense" ]
1
2022-01-22T17:19:25.000Z
2022-01-22T17:19:25.000Z
from dash import dash, dcc, html from dash.dependencies import Input, Output import plotly.graph_objs as go import pandas as pd url = 'csv/covidtesting.csv' df = pd.read_csv(url) app = dash.Dash() # list = df.columns[1:] # filter_options = [] # for option in list: # filter_options.append({'label': str(option), 'value': option}) app.layout = html.Div([ dcc.Graph(id='graphs'), dcc.Dropdown( id='option-picker', options=[{"label": x, "value": x} for x in df.columns[1:]], value=df.columns[1] ) ]) @app.callback( Output('graphs', 'figure'), [Input('option-picker', 'value')]) def update_figure(selected_option): # fig = px.line(df, x='Reported Date', y=selected_option) # return fig return { 'data': [go.Scatter(x=df['Reported Date'], y=df[selected_option], mode='lines')], 'layout': go.Layout( title='COVID Data', xaxis={'title': 'Date'}, yaxis={'title': 'Number of Cases'} ) } if __name__ == '__main__': app.run_server()
24.113636
89
0.597549
0
0
0
0
468
0.441093
0
0
394
0.371348
6608592b97fcda5eb8dc5fb8cb22369434750380
4,288
py
Python
appface.py
iljoong/FaceTag
c43fce89c92ce6de2f397580d80aa834d3e2dbb6
[ "MIT" ]
2
2021-11-12T15:30:55.000Z
2021-11-14T13:53:13.000Z
appface.py
iljoong/FaceTag
c43fce89c92ce6de2f397580d80aa834d3e2dbb6
[ "MIT" ]
1
2018-07-31T08:30:33.000Z
2018-08-01T04:44:52.000Z
appface.py
iljoong/FaceTag
c43fce89c92ce6de2f397580d80aa834d3e2dbb6
[ "MIT" ]
1
2021-11-12T15:31:00.000Z
2021-11-12T15:31:00.000Z
############################################################################################### from keras.models import Model, load_model from PIL import Image import numpy as np import time import cv2 import os import logging import pymongo #import dlib import requests import appconfig import json cascade = cv2.CascadeClassifier('./face/haarcascade_frontalface_default.xml') eyeCascade = cv2.CascadeClassifier('./face/haarcascade_eye.xml') img_size = 200 labels = [] def loadModel(): global labels try: modelpath = os.environ.get('MODELPATH') logging.debug("modelpath = %s" % modelpath) if (modelpath != None and modelpath != ""): model = load_model(modelpath) modeltags = os.environ.get('MODELTAGS', 'tag1;tag2;tag3;tag4;tag5;tag6;tag7;tag8;tag9;tag10') logging.debug("modeltags = %s" % modeltags) labels = modeltags.split(';') else: model = None except Exception as e: raise e return model def loadCollection(): # mongodb mongouri = os.environ.get('MONGOURI', 'mongodb://localhost:27017') mongodb = os.environ.get('MONGODB', 'facedb') mongocoll = os.environ.get('MONGOCOLL', 'face') logging.debug("env: {}, {}, {}".format(mongouri, mongodb, mongocoll)) try: conn = pymongo.MongoClient(mongouri) #conn = pymongo.MongoClient(mongoip, 27017) db = conn.get_database(mongodb) except Exception as e: raise e return db.get_collection(mongocoll) def detectFaceCV(gray): start_time = time.time() faces = [] try: rects = cascade.detectMultiScale(gray, scaleFactor=1.3, minNeighbors=4, minSize=(30, 30),flags=cv2.CASCADE_SCALE_IMAGE) for rect in rects: (x, y, w, h) = rect roi = gray[y:y+h, x:x+w] eyes = eyeCascade.detectMultiScale(roi) if len(eyes): faces.append(rect) except Exception as e: print(e) return faces, time.time() - start_time """ hog_face_detector = dlib.get_frontal_face_detector() def detectFaceHog(gray): start_time = time.time() rects = [] try: rects = hog_face_detector(gray, 1) faces = [ [rect.left(), rect.top(), rect.right()-rect.left(), rect.bottom()-rect.top()] for rect in rects ] except Exception as e: print(e) return faces, time.time() - start_time cnn_face_detector = dlib.cnn_face_detection_model_v1("../face/mmod_human_face_detector.dat") def detectFaceCNN(gray): start_time = time.time() rects = [] try: rects = cnn_face_detector(gray, 1) faces = [ [rect.rect.left(), rect.rect.top(), rect.rect.right()-rect.rect.left(), rect.rect.bottom()-rect.rect.top()] for rect in rects ] except Exception as e: print(e) return faces, time.time() - start_time """ def classifyFace(model, frame): global labels if (model == None): return ("none", 0.0) img = cv2.resize(frame, (img_size, img_size), interpolation = cv2.INTER_AREA) x = np.expand_dims(img, axis=0) x = x.astype(float) x /= 255. start_time = time.time() classes = model.predict(x) result = np.squeeze(classes) result_indices = np.argmax(result) logging.debug("classify time: {:.2f} sec".format(time.time() - start_time)) return labels[result_indices], result[result_indices]*100 def classifyFaceCV(model, frame): _, roi = cv2.imencode('.png', frame) start_time = time.time() apiurl = 'https://southcentralus.api.cognitive.microsoft.com/customvision/v2.0/Prediction/%s/image?iterationId=%s' headers = {"Content-Type": "application/octet-stream", "Prediction-Key": appconfig.api_key } r = requests.post(apiurl % (appconfig.api_id, appconfig.api_iter), headers=headers, data=roi.tostring()) if (r.status_code == 200): # JSON parse pred = json.loads(r.content.decode("utf-8")) conf = float(pred['predictions'][0]['probability']) label = pred['predictions'][0]['tagName'] logging.debug("classify time: {:.2f} sec".format(time.time() - start_time)) return label, conf*100 else: return "none", 0.0
28.586667
145
0.614039
0
0
0
0
0
0
0
0
1,598
0.372668
6608e0e22e04d214ade1044f1d502d28fa22890a
5,488
py
Python
src/object2.py
vmlaker/sherlock
4827803400907cb892b73f74736b151463fcda27
[ "MIT" ]
62
2015-01-01T16:26:36.000Z
2022-03-07T11:38:57.000Z
src/object2.py
vmlaker/sherlock
4827803400907cb892b73f74736b151463fcda27
[ "MIT" ]
null
null
null
src/object2.py
vmlaker/sherlock
4827803400907cb892b73f74736b151463fcda27
[ "MIT" ]
13
2015-08-01T10:54:13.000Z
2020-12-05T02:19:23.000Z
"""Object detection pipeline.""" import multiprocessing import datetime import time import sys import cv2 import numpy as np import socket import sharedmem import mpipe import coils import util DEVICE = int(sys.argv[1]) WIDTH = int(sys.argv[2]) HEIGHT = int(sys.argv[3]) DURATION = float(sys.argv[4]) # In seconds, or -(port#) if negative. # Create a process-shared table keyed on timestamps # and holding references to allocated image memory. images = multiprocessing.Manager().dict() class Detector(mpipe.OrderedWorker): """Detects objects.""" def __init__(self, classifier, color): self._classifier = classifier self._color = color def doTask(self, tstamp): """Run object detection.""" result = list() try: image = images[tstamp] size = np.shape(image)[:2] rects = self._classifier.detectMultiScale( image, scaleFactor=1.3, minNeighbors=3, minSize=tuple([x/20 for x in size]), maxSize=tuple([x/2 for x in size]), ) if len(rects): for a,b,c,d in rects: result.append((a,b,c,d, self._color)) except: print('Error in detector !!!') return result # Monitor framerates for the given seconds past. framerate = coils.RateTicker((2,)) class Postprocessor(mpipe.OrderedWorker): def doTask(self, (tstamp, rects,)): """Augment the input image with results of processing.""" # Make a flat list from a list of lists . rects = [item for sublist in rects for item in sublist] # Draw rectangles. for x1, y1, x2, y2, color in rects: cv2.rectangle( images[tstamp], (x1, y1), (x1+x2, y1+y2), color=color, thickness=2, ) # Write image dimensions and framerate. size = np.shape(images[tstamp])[:2] fps_text = '{:.2f} fps'.format(*framerate.tick()) util.writeOSD( images[tstamp], ('{0}x{1}'.format(size[1], size[0]), fps_text), ) return tstamp cv2.namedWindow('object detection 2', cv2.cv.CV_WINDOW_NORMAL) class Viewer(mpipe.OrderedWorker): """Displays image in a window.""" def doTask(self, tstamp): try: image = images[tstamp] cv2.imshow('object detection 2', image) cv2.waitKey(1) except: print('Error in viewer !!!') return tstamp # Create the detector stages. detector_stages = list() for classi in util.cascade.classifiers: detector_stages.append( mpipe.Stage( Detector, 1, classifier=classi, color=util.cascade.colors[classi]), ) # Assemble the image processing pipeline: # # detector(s) viewer # || || # filter_detector --> postproc --> filter_viewer # filter_detector = mpipe.FilterStage( detector_stages, max_tasks=1, cache_results=True, ) postproc = mpipe.Stage(Postprocessor) filter_viewer = mpipe.FilterStage( (mpipe.Stage(Viewer),), max_tasks=2, drop_results=True, ) filter_detector.link(postproc) postproc.link(filter_viewer) pipe_iproc = mpipe.Pipeline(filter_detector) # Create an auxiliary process (modeled as a one-task pipeline) # that simply pulls results from the image processing pipeline, # and deallocates associated shared memory after allowing # the designated amount of time to pass. def deallocate(tdelta): for tstamp in pipe_iproc.results(): elapsed = datetime.datetime.now() - tstamp if tdelta - elapsed > datetime.timedelta(): time.sleep(tdelta.total_seconds()) del images[tstamp] pipe_dealloc = mpipe.Pipeline(mpipe.UnorderedStage(deallocate)) pipe_dealloc.put(datetime.timedelta(microseconds=1e6)) # Start it up right away. # Create the OpenCV video capture object. cap = cv2.VideoCapture(DEVICE) cap.set(3, WIDTH) cap.set(4, HEIGHT) # Run the video capture loop, allocating shared memory # and feeding the image processing pipeline. # Run for configured duration, or (if duration < 0) until we # connect to socket (duration re-interpreted as port number.) now = datetime.datetime.now() end = now + datetime.timedelta(seconds=abs(DURATION)) while end > now or DURATION < 0: if DURATION < 0: # Bail if we connect to socket. try: socket.socket().connect(('', int(abs(DURATION)))) print('stopping') break except: pass # Mark the timestamp. This is the index by which # image procesing stages will access allocated memory. now = datetime.datetime.now() # Capture the image. hello, image = cap.read() # Allocate shared memory for a copy of the input image. shape = np.shape(image) dtype = image.dtype image_in = sharedmem.empty(shape, dtype) # Copy the input image to its shared memory version. image_in[:] = image.copy() # Add to the images table. images[now] = image_in # Input image. # Put the timestamp on the image processing pipeline. pipe_iproc.put(now) # Signal pipelines to stop, and wait for deallocator # to free all memory. pipe_iproc.put(None) pipe_dealloc.put(None) for result in pipe_dealloc.results(): pass # The end.
29.347594
81
0.622085
1,936
0.35277
0
0
0
0
0
0
1,725
0.314322
6609a45086c57a15190dcecf91e35dfc73259aed
78
py
Python
answers/001/answer1.py
PyLadiesTokyo/pyladies-tokyo-homework
3727451d073eb6e9b48f3cd0561c3b64b109f3a5
[ "Apache-2.0" ]
null
null
null
answers/001/answer1.py
PyLadiesTokyo/pyladies-tokyo-homework
3727451d073eb6e9b48f3cd0561c3b64b109f3a5
[ "Apache-2.0" ]
null
null
null
answers/001/answer1.py
PyLadiesTokyo/pyladies-tokyo-homework
3727451d073eb6e9b48f3cd0561c3b64b109f3a5
[ "Apache-2.0" ]
1
2020-12-27T13:05:44.000Z
2020-12-27T13:05:44.000Z
# 1から10までの整数を表示する for num in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]: print(num)
26
44
0.538462
0
0
0
0
0
0
0
0
42
0.411765
660ac2d8937432f3e9a4b2a9a74404def921da17
132
py
Python
lab2_typyOperacje/2.15.py
Damian9449/Python
dc9091e15356733821bbb6a768b7d5e428640340
[ "MIT" ]
1
2017-11-15T13:03:40.000Z
2017-11-15T13:03:40.000Z
lab2_typyOperacje/2.15.py
Damian9449/Python
dc9091e15356733821bbb6a768b7d5e428640340
[ "MIT" ]
null
null
null
lab2_typyOperacje/2.15.py
Damian9449/Python
dc9091e15356733821bbb6a768b7d5e428640340
[ "MIT" ]
null
null
null
#!/usr/bin/python L = [1, 3, 6, 77, 34, 45, 26, 81] result = "" for number in L: result = result + str(number) print(result)
13.2
33
0.575758
0
0
0
0
0
0
0
0
19
0.143939
660bd601b31c2cdb55bcbc98f8dc987a833cfa02
2,743
py
Python
af_scripts/tmp/blendShapeEditor.py
aaronfang/small-Scripts
890b10ab19fa9cdf2415aaf2dc08b81cc64fc79d
[ "MIT" ]
1
2018-03-08T16:34:00.000Z
2018-03-08T16:34:00.000Z
af_scripts/tmp/blendShapeEditor.py
aaronfang/personal_scripts
890b10ab19fa9cdf2415aaf2dc08b81cc64fc79d
[ "MIT" ]
null
null
null
af_scripts/tmp/blendShapeEditor.py
aaronfang/personal_scripts
890b10ab19fa9cdf2415aaf2dc08b81cc64fc79d
[ "MIT" ]
null
null
null
import maya.cmds as cmds class blendShapeEditor(object): def __init__(self): self.blendshape_node = blendshape_node = [] self.target_nodes = target_nodes = [] def prepareOrginialGeo(self,*args): sel = cmds.ls(sl=True)[0] if '_org' in sel: blendshape_base_geo = cmds.duplicate(sel,n="{0}_blendshape".format(sel.split('_org')[0])) layers = cmds.ls(type='displayLayer') if "org_geo_layer" not in layers: org_layer = cmds.createDisplayLayer(n="org_geo_layer",e=True) cmds.editDisplayLayerMembers(org_layer,sel,blendshape_base_geo,noRecurse=True) cmds.setAttr("{0}.displayType".format(org_layer),2) elif "org_geo_layer" in layers: cmds.editDisplayLayerMembers(org_layer,sel,noRecurse=True) cmds.setAttr("{0}.displayType".format(org_layer),2) else: cmds.confirmDialog(m="Please Select The Orginial Geo!") cmds.select(sel,blendshape_base_geo,r=True) def createBlendShape(self,*args): objs = cmds.ls(sl=True,fl=True) blendshape_node = cmds.blendShape(objs[0:-1],objs[-1],n="{0}_blendshape".format(objs[-1])) if len(blendshape_node)>0: for obj in objs[0:-1]: cmds.setAttr("{0}.visibility".format(obj),False) def _UI(self,*args): target_nodes = cmds.blendShape(blendshape_node[0],q=True,t=True) target_weights = cmds.blendShape(blendshape_node[0],q=True,w=True) if len(target_nodes)>0: w = 300 if cmds.window('blendshapeWin',exists=True):cmds.deleteUI('blendshapeWin',window=True) cmds.window('blendshapeWin',t='BlendShape Editor',w=w,rtf=1,mxb=0,mnb=0,s=0) #cmds.columnLayout("mainColumn",p="blendshapeWin",columnAttach=('both', 2), rowSpacing=10, columnWidth=w) cmds.rowColumnLayout('mainRowColumn',p='blendshapeWin',numberOfColumns=3, columnWidth=[(1, 100), (2, 150), (3, 50)] ) for i,tgt in enumerate(target_nodes): cmds.text(p='mainRowColumn',l=tgt) cmds.floatSlider("{0}FltSld".format(tgt),p='mainRowColumn',v=target_weights[i],max=1,min=0,cc=self.updateTargetValue) cmds.button(p='mainRowColumn',l='Edit') cmds.showWindow('blendshapeWin') def updateTargetValue(self,*args): for i,tgt in enumerate(target_nodes): last_value = cmds.blendShape(blendshape_node[0],q=True,w=True) cur_value = cmds.floatSlider("{0}FltSld".format(tgt),q=True,v=True) if cur_value != last_value: cmds.blendShape(blendshape_node[0],e=True,w=(i,cur_value)) blendShapeEditor()._UI()
49.872727
133
0.629603
2,682
0.977762
0
0
0
0
0
0
473
0.172439
660c4602652eeabae6b9b5b5f22abc8c78653e52
134
py
Python
bugtests/test000.py
doom38/jython_v2.2.1
0803a0c953c294e6d14f9fc7d08edf6a3e630a15
[ "CNRI-Jython" ]
null
null
null
bugtests/test000.py
doom38/jython_v2.2.1
0803a0c953c294e6d14f9fc7d08edf6a3e630a15
[ "CNRI-Jython" ]
null
null
null
bugtests/test000.py
doom38/jython_v2.2.1
0803a0c953c294e6d14f9fc7d08edf6a3e630a15
[ "CNRI-Jython" ]
null
null
null
""" Basic test, just raises a TestWarning """ import support raise support.TestWarning('A test of TestWarning. It is not an error')
16.75
70
0.738806
0
0
0
0
0
0
0
0
88
0.656716
660dfb4d814fae5a38c519d53465f866ae0f301e
5,511
py
Python
model.py
braemt/attentive-multi-task-deep-reinforcement-learning
921feefce98076f88c892f0b7e6db8572f596763
[ "MIT" ]
12
2019-04-07T02:04:48.000Z
2022-03-22T12:57:47.000Z
model.py
braemt/attentive-multi-task-deep-reinforcement-learning
921feefce98076f88c892f0b7e6db8572f596763
[ "MIT" ]
null
null
null
model.py
braemt/attentive-multi-task-deep-reinforcement-learning
921feefce98076f88c892f0b7e6db8572f596763
[ "MIT" ]
7
2019-04-07T02:04:49.000Z
2020-12-28T10:30:27.000Z
import numpy as np import tensorflow as tf def normalized_columns_initializer(std=1.0): def _initializer(shape, dtype=None, partition_info=None): out = np.random.randn(*shape).astype(np.float32) out *= std / np.sqrt(np.square(out).sum(axis=0, keepdims=True)) return tf.constant(out) return _initializer def flatten(x): return tf.reshape(x, [-1, np.prod(x.get_shape().as_list()[1:])]) def conv2d(x, num_filters, name, filter_size=(3, 3), stride=(1, 1), pad="SAME", dtype=tf.float32, collections=None, trainable=True): with tf.variable_scope(name): stride_shape = [1, stride[0], stride[1], 1] filter_shape = [filter_size[0], filter_size[1], int(x.get_shape()[3]), num_filters] # there are "num input feature maps * filter height * filter width" # inputs to each hidden unit fan_in = np.prod(filter_shape[:3]) # each unit in the lower layer receives a gradient from: # "num output feature maps * filter height * filter width" / # pooling size fan_out = np.prod(filter_shape[:2]) * num_filters # initialize weights with random weights w_bound = np.sqrt(6. / (fan_in + fan_out)) w = tf.get_variable("W", filter_shape, dtype, tf.random_uniform_initializer(-w_bound, w_bound), collections=collections, trainable=trainable) b = tf.get_variable("b", [1, 1, 1, num_filters], initializer=tf.constant_initializer(0.0), collections=collections, trainable=trainable) return tf.nn.conv2d(x, w, stride_shape, pad) + b def linear(x, size, name, initializer=None, bias_init=0, trainable=True): w = tf.get_variable(name + "/W", [x.get_shape()[1], size], initializer=initializer, trainable=trainable) b = tf.get_variable(name + "/b", [size], initializer=tf.constant_initializer(bias_init), trainable=trainable) return tf.matmul(x, w) + b def categorical_sample(logits, d): value = tf.squeeze(tf.multinomial(logits - tf.reduce_max(logits, [1], keep_dims=True), 1), [1]) return tf.one_hot(value, d) def policy_distribution(logits): return tf.nn.softmax(logits) class FFPolicy(object): def __init__(self, ob_space, ac_spaces, tasks): self.x = tf.placeholder(tf.float32, [None] + list(ob_space)) self.task = tf.placeholder(tf.uint8, [None]) self.all_entropy = [] self.all_logits = [] self.all_actions = [] self.all_vfs = [] self.nns = int((tasks + 2) / 4) + 1 x = tf.nn.relu(conv2d(self.x, 32, "c1", [3, 3], [2, 2])) x = tf.nn.relu(conv2d(x, 32, "c2", [3, 3], [1, 1])) shared_layer = x for i in range(self.nns + 1): with tf.variable_scope("nn_" + str(i)): x = tf.nn.relu(conv2d(shared_layer, 16, "c3", [3, 3], [1, 1])) x = flatten(x) if i == self.nns: x = tf.nn.relu(linear(x, self.nns * tasks, "task_in", normalized_columns_initializer(0.01))) one_hot_task = tf.one_hot(self.task, tasks) x = tf.concat([x, one_hot_task], -1) x = tf.nn.relu(linear(x, 256, "h1", normalized_columns_initializer(0.01))) if i < self.nns: self.all_logits.append(linear(x, max(ac_spaces), "action", normalized_columns_initializer(0.01))) self.all_actions.append(tf.nn.softmax(self.all_logits[-1])) self.all_vfs.append(tf.reshape(linear(x, 1, "value", normalized_columns_initializer(1.0)), [-1])) else: self.w_logits = linear(x, self.nns, "attention", normalized_columns_initializer(0.01)) self.w = tf.nn.softmax(self.w_logits) self.logits = [] self.vf = [] self.sample = [] self.evaluation_policy_dist = [] logits = tf.log( tf.clip_by_value(tf.einsum('ij,jik->ik', self.w, tf.convert_to_tensor(self.all_actions)), 1e-8, 1e+8)) vf = tf.einsum('ij,ji->i', self.w, tf.convert_to_tensor(self.all_vfs)) for j in range(tasks): with tf.variable_scope("task_" + str(j)): x = linear(logits, ac_spaces[j], "logits", normalized_columns_initializer(0.01)) self.logits.append(x) self.vf.append(vf) self.sample.append(categorical_sample(self.logits[-1], ac_spaces[j])[0, :]) self.evaluation_policy_dist.append(policy_distribution(self.logits[-1])) self.var_list = tf.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES, tf.get_variable_scope().name) def act(self, ob, task): sess = tf.get_default_session() result = sess.run([self.sample[task], self.vf[task]], {self.x: [ob], self.task: [task]}) result[1] = result[1][0] return result def value(self, ob, task): sess = tf.get_default_session() return sess.run(self.vf[task], {self.x: [ob], self.task: [task]})[0] def evaluation(self, ob, task): sess = tf.get_default_session() return sess.run([self.sample[task], self.vf[task], self.logits[task], self.evaluation_policy_dist[task]], {self.x: [ob], self.task: [task]})
46.310924
119
0.577209
3,313
0.601161
0
0
0
0
0
0
380
0.068953
660ea1a100d2f6604cf5b576d0992caedb50b349
632
py
Python
src/data/852.py
NULLCT/LOMC
79a16474a8f21310e0fb47e536d527dd5dc6d655
[ "MIT" ]
null
null
null
src/data/852.py
NULLCT/LOMC
79a16474a8f21310e0fb47e536d527dd5dc6d655
[ "MIT" ]
null
null
null
src/data/852.py
NULLCT/LOMC
79a16474a8f21310e0fb47e536d527dd5dc6d655
[ "MIT" ]
null
null
null
from collections import deque n, q = map(int, input().split()) graph = [[] for _ in range(n + 1)] for i in range(n - 1): a, b = map(int, input().split()) graph[a].append(b) graph[b].append(a) CD = [] for i in range(q): e, f = map(int, input().split()) CD.append([e, f]) dist = [-1] * (n + 1) dist[0] = 0 dist[1] = 0 d = deque() d.append(1) while d: v = d.popleft() for i in graph[v]: if dist[i] != -1: continue dist[i] = dist[v] + 1 d.append(i) for i, j in CD: x = dist[i] + dist[j] if x % 2 == 0: print("Town") else: print("Road")
16.631579
36
0.47943
0
0
0
0
0
0
0
0
12
0.018987
6611e568c85da823794769b3aacdd4d28bc257c0
265,414
py
Python
stashboard/contrib/status_images.py
l1kw1d/stashboard
3e4b18a8168c102d1e1d7f88fec22bcbfc530d23
[ "MIT" ]
761
2015-01-01T05:28:26.000Z
2022-03-24T10:07:31.000Z
stashboard/contrib/status_images.py
l1kw1d/stashboard
3e4b18a8168c102d1e1d7f88fec22bcbfc530d23
[ "MIT" ]
11
2015-02-05T23:43:47.000Z
2019-01-10T13:43:42.000Z
stashboard/contrib/status_images.py
l1kw1d/stashboard
3e4b18a8168c102d1e1d7f88fec22bcbfc530d23
[ "MIT" ]
226
2015-01-05T15:04:45.000Z
2022-03-23T11:41:00.000Z
# Copyright (c) 2010 Twilio Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. images = [ { "url": "/images/status/address-book--arrow.png", "name": "address-book--arrow" }, { "url": "/images/status/address-book--exclamation.png", "name": "address-book--exclamation" }, { "url": "/images/status/address-book--minus.png", "name": "address-book--minus" }, { "url": "/images/status/address-book--pencil.png", "name": "address-book--pencil" }, { "url": "/images/status/address-book--plus.png", "name": "address-book--plus" }, { "url": "/images/status/address-book-blue.png", "name": "address-book-blue" }, { "url": "/images/status/address-book-open.png", "name": "address-book-open" }, { "url": "/images/status/address-book.png", "name": "address-book" }, { "url": "/images/status/alarm-clock--arrow.png", "name": "alarm-clock--arrow" }, { "url": "/images/status/alarm-clock--exclamation.png", "name": "alarm-clock--exclamation" }, { "url": "/images/status/alarm-clock--minus.png", "name": "alarm-clock--minus" }, { "url": "/images/status/alarm-clock--pencil.png", "name": "alarm-clock--pencil" }, { "url": "/images/status/alarm-clock--plus.png", "name": "alarm-clock--plus" }, { "url": "/images/status/alarm-clock-blue.png", "name": "alarm-clock-blue" }, { "url": "/images/status/alarm-clock-select-remain.png", "name": "alarm-clock-select-remain" }, { "url": "/images/status/alarm-clock-select.png", "name": "alarm-clock-select" }, { "url": "/images/status/alarm-clock.png", "name": "alarm-clock" }, { "url": "/images/status/anchor.png", "name": "anchor" }, { "url": "/images/status/application--arrow.png", "name": "application--arrow" }, { "url": "/images/status/application--exclamation.png", "name": "application--exclamation" }, { "url": "/images/status/application--minus.png", "name": "application--minus" }, { "url": "/images/status/application--pencil.png", "name": "application--pencil" }, { "url": "/images/status/application--plus.png", "name": "application--plus" }, { "url": "/images/status/application-block.png", "name": "application-block" }, { "url": "/images/status/application-blog.png", "name": "application-blog" }, { "url": "/images/status/application-blue.png", "name": "application-blue" }, { "url": "/images/status/application-browser.png", "name": "application-browser" }, { "url": "/images/status/application-detail.png", "name": "application-detail" }, { "url": "/images/status/application-dialog.png", "name": "application-dialog" }, { "url": "/images/status/application-dock-090.png", "name": "application-dock-090" }, { "url": "/images/status/application-dock-180.png", "name": "application-dock-180" }, { "url": "/images/status/application-dock-270.png", "name": "application-dock-270" }, { "url": "/images/status/application-dock-tab.png", "name": "application-dock-tab" }, { "url": "/images/status/application-dock.png", "name": "application-dock" }, { "url": "/images/status/application-document.png", "name": "application-document" }, { "url": "/images/status/application-documents.png", "name": "application-documents" }, { "url": "/images/status/application-export.png", "name": "application-export" }, { "url": "/images/status/application-form.png", "name": "application-form" }, { "url": "/images/status/application-home.png", "name": "application-home" }, { "url": "/images/status/application-icon.png", "name": "application-icon" }, { "url": "/images/status/application-image.png", "name": "application-image" }, { "url": "/images/status/application-import.png", "name": "application-import" }, { "url": "/images/status/application-list.png", "name": "application-list" }, { "url": "/images/status/application-monitor.png", "name": "application-monitor" }, { "url": "/images/status/application-network.png", "name": "application-network" }, { "url": "/images/status/application-rename.png", "name": "application-rename" }, { "url": "/images/status/application-resize-actual.png", "name": "application-resize-actual" }, { "url": "/images/status/application-resize-full.png", "name": "application-resize-full" }, { "url": "/images/status/application-resize.png", "name": "application-resize" }, { "url": "/images/status/application-run.png", "name": "application-run" }, { "url": "/images/status/application-search-result.png", "name": "application-search-result" }, { "url": "/images/status/application-share.png", "name": "application-share" }, { "url": "/images/status/application-sidebar-collapse.png", "name": "application-sidebar-collapse" }, { "url": "/images/status/application-sidebar-expand.png", "name": "application-sidebar-expand" }, { "url": "/images/status/application-sidebar-list.png", "name": "application-sidebar-list" }, { "url": "/images/status/application-sidebar.png", "name": "application-sidebar" }, { "url": "/images/status/application-small-blue.png", "name": "application-small-blue" }, { "url": "/images/status/application-small-list-blue.png", "name": "application-small-list-blue" }, { "url": "/images/status/application-small-list.png", "name": "application-small-list" }, { "url": "/images/status/application-small.png", "name": "application-small" }, { "url": "/images/status/application-split-tile.png", "name": "application-split-tile" }, { "url": "/images/status/application-split-vertical.png", "name": "application-split-vertical" }, { "url": "/images/status/application-split.png", "name": "application-split" }, { "url": "/images/status/application-table.png", "name": "application-table" }, { "url": "/images/status/application-task.png", "name": "application-task" }, { "url": "/images/status/application-terminal.png", "name": "application-terminal" }, { "url": "/images/status/application-text-image.png", "name": "application-text-image" }, { "url": "/images/status/application-text.png", "name": "application-text" }, { "url": "/images/status/application-tree.png", "name": "application-tree" }, { "url": "/images/status/application-wave.png", "name": "application-wave" }, { "url": "/images/status/application.png", "name": "application" }, { "url": "/images/status/applications-blue.png", "name": "applications-blue" }, { "url": "/images/status/applications-stack.png", "name": "applications-stack" }, { "url": "/images/status/applications.png", "name": "applications" }, { "url": "/images/status/arrow-000-medium.png", "name": "arrow-000-medium" }, { "url": "/images/status/arrow-000-small.png", "name": "arrow-000-small" }, { "url": "/images/status/arrow-045-medium.png", "name": "arrow-045-medium" }, { "url": "/images/status/arrow-045-small.png", "name": "arrow-045-small" }, { "url": "/images/status/arrow-045.png", "name": "arrow-045" }, { "url": "/images/status/arrow-090-medium.png", "name": "arrow-090-medium" }, { "url": "/images/status/arrow-090-small.png", "name": "arrow-090-small" }, { "url": "/images/status/arrow-090.png", "name": "arrow-090" }, { "url": "/images/status/arrow-135-medium.png", "name": "arrow-135-medium" }, { "url": "/images/status/arrow-135-small.png", "name": "arrow-135-small" }, { "url": "/images/status/arrow-135.png", "name": "arrow-135" }, { "url": "/images/status/arrow-180-medium.png", "name": "arrow-180-medium" }, { "url": "/images/status/arrow-180-small.png", "name": "arrow-180-small" }, { "url": "/images/status/arrow-180.png", "name": "arrow-180" }, { "url": "/images/status/arrow-225-medium.png", "name": "arrow-225-medium" }, { "url": "/images/status/arrow-225-small.png", "name": "arrow-225-small" }, { "url": "/images/status/arrow-225.png", "name": "arrow-225" }, { "url": "/images/status/arrow-270-medium.png", "name": "arrow-270-medium" }, { "url": "/images/status/arrow-270-small.png", "name": "arrow-270-small" }, { "url": "/images/status/arrow-270.png", "name": "arrow-270" }, { "url": "/images/status/arrow-315-medium.png", "name": "arrow-315-medium" }, { "url": "/images/status/arrow-315-small.png", "name": "arrow-315-small" }, { "url": "/images/status/arrow-315.png", "name": "arrow-315" }, { "url": "/images/status/arrow-branch-000-left.png", "name": "arrow-branch-000-left" }, { "url": "/images/status/arrow-branch-090-left.png", "name": "arrow-branch-090-left" }, { "url": "/images/status/arrow-branch-090.png", "name": "arrow-branch-090" }, { "url": "/images/status/arrow-branch-180-left.png", "name": "arrow-branch-180-left" }, { "url": "/images/status/arrow-branch-180.png", "name": "arrow-branch-180" }, { "url": "/images/status/arrow-branch-270-left.png", "name": "arrow-branch-270-left" }, { "url": "/images/status/arrow-branch-270.png", "name": "arrow-branch-270" }, { "url": "/images/status/arrow-branch.png", "name": "arrow-branch" }, { "url": "/images/status/arrow-circle-045-left.png", "name": "arrow-circle-045-left" }, { "url": "/images/status/arrow-circle-135-left.png", "name": "arrow-circle-135-left" }, { "url": "/images/status/arrow-circle-135.png", "name": "arrow-circle-135" }, { "url": "/images/status/arrow-circle-225-left.png", "name": "arrow-circle-225-left" }, { "url": "/images/status/arrow-circle-225.png", "name": "arrow-circle-225" }, { "url": "/images/status/arrow-circle-315-left.png", "name": "arrow-circle-315-left" }, { "url": "/images/status/arrow-circle-315.png", "name": "arrow-circle-315" }, { "url": "/images/status/arrow-circle-double-135.png", "name": "arrow-circle-double-135" }, { "url": "/images/status/arrow-circle-double.png", "name": "arrow-circle-double" }, { "url": "/images/status/arrow-circle.png", "name": "arrow-circle" }, { "url": "/images/status/arrow-continue-000-top.png", "name": "arrow-continue-000-top" }, { "url": "/images/status/arrow-continue-090-left.png", "name": "arrow-continue-090-left" }, { "url": "/images/status/arrow-continue-090.png", "name": "arrow-continue-090" }, { "url": "/images/status/arrow-continue-180-top.png", "name": "arrow-continue-180-top" }, { "url": "/images/status/arrow-continue-180.png", "name": "arrow-continue-180" }, { "url": "/images/status/arrow-continue-270-left.png", "name": "arrow-continue-270-left" }, { "url": "/images/status/arrow-continue-270.png", "name": "arrow-continue-270" }, { "url": "/images/status/arrow-continue.png", "name": "arrow-continue" }, { "url": "/images/status/arrow-curve-000-double.png", "name": "arrow-curve-000-double" }, { "url": "/images/status/arrow-curve-000-left.png", "name": "arrow-curve-000-left" }, { "url": "/images/status/arrow-curve-090-left.png", "name": "arrow-curve-090-left" }, { "url": "/images/status/arrow-curve-090.png", "name": "arrow-curve-090" }, { "url": "/images/status/arrow-curve-180-double.png", "name": "arrow-curve-180-double" }, { "url": "/images/status/arrow-curve-180-left.png", "name": "arrow-curve-180-left" }, { "url": "/images/status/arrow-curve-180.png", "name": "arrow-curve-180" }, { "url": "/images/status/arrow-curve-270-left.png", "name": "arrow-curve-270-left" }, { "url": "/images/status/arrow-curve-270.png", "name": "arrow-curve-270" }, { "url": "/images/status/arrow-curve.png", "name": "arrow-curve" }, { "url": "/images/status/arrow-in.png", "name": "arrow-in" }, { "url": "/images/status/arrow-join-090.png", "name": "arrow-join-090" }, { "url": "/images/status/arrow-join-180.png", "name": "arrow-join-180" }, { "url": "/images/status/arrow-join-270.png", "name": "arrow-join-270" }, { "url": "/images/status/arrow-join.png", "name": "arrow-join" }, { "url": "/images/status/arrow-merge-000-left.png", "name": "arrow-merge-000-left" }, { "url": "/images/status/arrow-merge-090-left.png", "name": "arrow-merge-090-left" }, { "url": "/images/status/arrow-merge-090.png", "name": "arrow-merge-090" }, { "url": "/images/status/arrow-merge-180-left.png", "name": "arrow-merge-180-left" }, { "url": "/images/status/arrow-merge-180.png", "name": "arrow-merge-180" }, { "url": "/images/status/arrow-merge-270-left.png", "name": "arrow-merge-270-left" }, { "url": "/images/status/arrow-merge-270.png", "name": "arrow-merge-270" }, { "url": "/images/status/arrow-merge.png", "name": "arrow-merge" }, { "url": "/images/status/arrow-move.png", "name": "arrow-move" }, { "url": "/images/status/arrow-out.png", "name": "arrow-out" }, { "url": "/images/status/arrow-repeat-once.png", "name": "arrow-repeat-once" }, { "url": "/images/status/arrow-repeat.png", "name": "arrow-repeat" }, { "url": "/images/status/arrow-resize-045.png", "name": "arrow-resize-045" }, { "url": "/images/status/arrow-resize-090.png", "name": "arrow-resize-090" }, { "url": "/images/status/arrow-resize-135.png", "name": "arrow-resize-135" }, { "url": "/images/status/arrow-resize.png", "name": "arrow-resize" }, { "url": "/images/status/arrow-return-000-left.png", "name": "arrow-return-000-left" }, { "url": "/images/status/arrow-return-090-left.png", "name": "arrow-return-090-left" }, { "url": "/images/status/arrow-return-090.png", "name": "arrow-return-090" }, { "url": "/images/status/arrow-return-180-left.png", "name": "arrow-return-180-left" }, { "url": "/images/status/arrow-return-180.png", "name": "arrow-return-180" }, { "url": "/images/status/arrow-return-270-left.png", "name": "arrow-return-270-left" }, { "url": "/images/status/arrow-return-270.png", "name": "arrow-return-270" }, { "url": "/images/status/arrow-return.png", "name": "arrow-return" }, { "url": "/images/status/arrow-retweet.png", "name": "arrow-retweet" }, { "url": "/images/status/arrow-skip-090.png", "name": "arrow-skip-090" }, { "url": "/images/status/arrow-skip-180.png", "name": "arrow-skip-180" }, { "url": "/images/status/arrow-skip-270.png", "name": "arrow-skip-270" }, { "url": "/images/status/arrow-skip.png", "name": "arrow-skip" }, { "url": "/images/status/arrow-split-090.png", "name": "arrow-split-090" }, { "url": "/images/status/arrow-split-180.png", "name": "arrow-split-180" }, { "url": "/images/status/arrow-split-270.png", "name": "arrow-split-270" }, { "url": "/images/status/arrow-split.png", "name": "arrow-split" }, { "url": "/images/status/arrow-step-out.png", "name": "arrow-step-out" }, { "url": "/images/status/arrow-step-over.png", "name": "arrow-step-over" }, { "url": "/images/status/arrow-step.png", "name": "arrow-step" }, { "url": "/images/status/arrow-stop-090.png", "name": "arrow-stop-090" }, { "url": "/images/status/arrow-stop-180.png", "name": "arrow-stop-180" }, { "url": "/images/status/arrow-stop-270.png", "name": "arrow-stop-270" }, { "url": "/images/status/arrow-stop.png", "name": "arrow-stop" }, { "url": "/images/status/arrow-switch-090.png", "name": "arrow-switch-090" }, { "url": "/images/status/arrow-switch-180.png", "name": "arrow-switch-180" }, { "url": "/images/status/arrow-switch-270.png", "name": "arrow-switch-270" }, { "url": "/images/status/arrow-switch.png", "name": "arrow-switch" }, { "url": "/images/status/arrow-transition-090.png", "name": "arrow-transition-090" }, { "url": "/images/status/arrow-transition-180.png", "name": "arrow-transition-180" }, { "url": "/images/status/arrow-transition-270.png", "name": "arrow-transition-270" }, { "url": "/images/status/arrow-transition.png", "name": "arrow-transition" }, { "url": "/images/status/arrow-turn-000-left.png", "name": "arrow-turn-000-left" }, { "url": "/images/status/arrow-turn-090-left.png", "name": "arrow-turn-090-left" }, { "url": "/images/status/arrow-turn-090.png", "name": "arrow-turn-090" }, { "url": "/images/status/arrow-turn-180-left.png", "name": "arrow-turn-180-left" }, { "url": "/images/status/arrow-turn-180.png", "name": "arrow-turn-180" }, { "url": "/images/status/arrow-turn-270-left.png", "name": "arrow-turn-270-left" }, { "url": "/images/status/arrow-turn-270.png", "name": "arrow-turn-270" }, { "url": "/images/status/arrow-turn.png", "name": "arrow-turn" }, { "url": "/images/status/arrow.png", "name": "arrow" }, { "url": "/images/status/asterisk.png", "name": "asterisk" }, { "url": "/images/status/auction-hammer--arrow.png", "name": "auction-hammer--arrow" }, { "url": "/images/status/auction-hammer--exclamation.png", "name": "auction-hammer--exclamation" }, { "url": "/images/status/auction-hammer--minus.png", "name": "auction-hammer--minus" }, { "url": "/images/status/auction-hammer--pencil.png", "name": "auction-hammer--pencil" }, { "url": "/images/status/auction-hammer--plus.png", "name": "auction-hammer--plus" }, { "url": "/images/status/auction-hammer-gavel.png", "name": "auction-hammer-gavel" }, { "url": "/images/status/auction-hammer.png", "name": "auction-hammer" }, { "url": "/images/status/balance--arrow.png", "name": "balance--arrow" }, { "url": "/images/status/balance--exclamation.png", "name": "balance--exclamation" }, { "url": "/images/status/balance--minus.png", "name": "balance--minus" }, { "url": "/images/status/balance--pencil.png", "name": "balance--pencil" }, { "url": "/images/status/balance--plus.png", "name": "balance--plus" }, { "url": "/images/status/balance-unbalance.png", "name": "balance-unbalance" }, { "url": "/images/status/balance.png", "name": "balance" }, { "url": "/images/status/balloon--arrow.png", "name": "balloon--arrow" }, { "url": "/images/status/balloon--exclamation.png", "name": "balloon--exclamation" }, { "url": "/images/status/balloon--minus.png", "name": "balloon--minus" }, { "url": "/images/status/balloon--pencil.png", "name": "balloon--pencil" }, { "url": "/images/status/balloon--plus.png", "name": "balloon--plus" }, { "url": "/images/status/balloon-ellipsis.png", "name": "balloon-ellipsis" }, { "url": "/images/status/balloon-facebook-left.png", "name": "balloon-facebook-left" }, { "url": "/images/status/balloon-facebook.png", "name": "balloon-facebook" }, { "url": "/images/status/balloon-left.png", "name": "balloon-left" }, { "url": "/images/status/balloon-quotation.png", "name": "balloon-quotation" }, { "url": "/images/status/balloon-small-left.png", "name": "balloon-small-left" }, { "url": "/images/status/balloon-small.png", "name": "balloon-small" }, { "url": "/images/status/balloon-smiley.png", "name": "balloon-smiley" }, { "url": "/images/status/balloon-sound.png", "name": "balloon-sound" }, { "url": "/images/status/balloon-twitter-left.png", "name": "balloon-twitter-left" }, { "url": "/images/status/balloon-twitter-retweet.png", "name": "balloon-twitter-retweet" }, { "url": "/images/status/balloon-twitter.png", "name": "balloon-twitter" }, { "url": "/images/status/balloon.png", "name": "balloon" }, { "url": "/images/status/balloons-facebook.png", "name": "balloons-facebook" }, { "url": "/images/status/balloons-twitter.png", "name": "balloons-twitter" }, { "url": "/images/status/balloons.png", "name": "balloons" }, { "url": "/images/status/bandaid--arrow.png", "name": "bandaid--arrow" }, { "url": "/images/status/bandaid--exclamation.png", "name": "bandaid--exclamation" }, { "url": "/images/status/bandaid--minus.png", "name": "bandaid--minus" }, { "url": "/images/status/bandaid--pencil.png", "name": "bandaid--pencil" }, { "url": "/images/status/bandaid--plus.png", "name": "bandaid--plus" }, { "url": "/images/status/bandaid-small.png", "name": "bandaid-small" }, { "url": "/images/status/bandaid.png", "name": "bandaid" }, { "url": "/images/status/bank--arrow.png", "name": "bank--arrow" }, { "url": "/images/status/bank--exclamation.png", "name": "bank--exclamation" }, { "url": "/images/status/bank--minus.png", "name": "bank--minus" }, { "url": "/images/status/bank--pencil.png", "name": "bank--pencil" }, { "url": "/images/status/bank--plus.png", "name": "bank--plus" }, { "url": "/images/status/bank.png", "name": "bank" }, { "url": "/images/status/barcode-2d.png", "name": "barcode-2d" }, { "url": "/images/status/barcode.png", "name": "barcode" }, { "url": "/images/status/battery--arrow.png", "name": "battery--arrow" }, { "url": "/images/status/battery--exclamation.png", "name": "battery--exclamation" }, { "url": "/images/status/battery--minus.png", "name": "battery--minus" }, { "url": "/images/status/battery--pencil.png", "name": "battery--pencil" }, { "url": "/images/status/battery--plus.png", "name": "battery--plus" }, { "url": "/images/status/battery-charge.png", "name": "battery-charge" }, { "url": "/images/status/battery-empty.png", "name": "battery-empty" }, { "url": "/images/status/battery-full.png", "name": "battery-full" }, { "url": "/images/status/battery-low.png", "name": "battery-low" }, { "url": "/images/status/battery-plug.png", "name": "battery-plug" }, { "url": "/images/status/battery.png", "name": "battery" }, { "url": "/images/status/beaker--arrow.png", "name": "beaker--arrow" }, { "url": "/images/status/beaker--exclamation.png", "name": "beaker--exclamation" }, { "url": "/images/status/beaker--minus.png", "name": "beaker--minus" }, { "url": "/images/status/beaker--pencil.png", "name": "beaker--pencil" }, { "url": "/images/status/beaker--plus.png", "name": "beaker--plus" }, { "url": "/images/status/beaker-empty.png", "name": "beaker-empty" }, { "url": "/images/status/beaker.png", "name": "beaker" }, { "url": "/images/status/bean--arrow.png", "name": "bean--arrow" }, { "url": "/images/status/bean--exclamation.png", "name": "bean--exclamation" }, { "url": "/images/status/bean--minus.png", "name": "bean--minus" }, { "url": "/images/status/bean--pencil.png", "name": "bean--pencil" }, { "url": "/images/status/bean--plus.png", "name": "bean--plus" }, { "url": "/images/status/bean-green.png", "name": "bean-green" }, { "url": "/images/status/bean-small-green.png", "name": "bean-small-green" }, { "url": "/images/status/bean-small.png", "name": "bean-small" }, { "url": "/images/status/bean.png", "name": "bean" }, { "url": "/images/status/beans.png", "name": "beans" }, { "url": "/images/status/bell--arrow.png", "name": "bell--arrow" }, { "url": "/images/status/bell--exclamation.png", "name": "bell--exclamation" }, { "url": "/images/status/bell--minus.png", "name": "bell--minus" }, { "url": "/images/status/bell--pencil.png", "name": "bell--pencil" }, { "url": "/images/status/bell--plus.png", "name": "bell--plus" }, { "url": "/images/status/bell-small.png", "name": "bell-small" }, { "url": "/images/status/bell.png", "name": "bell" }, { "url": "/images/status/bin--arrow.png", "name": "bin--arrow" }, { "url": "/images/status/bin--exclamation.png", "name": "bin--exclamation" }, { "url": "/images/status/bin--minus.png", "name": "bin--minus" }, { "url": "/images/status/bin--pencil.png", "name": "bin--pencil" }, { "url": "/images/status/bin--plus.png", "name": "bin--plus" }, { "url": "/images/status/bin-full.png", "name": "bin-full" }, { "url": "/images/status/bin-metal-full.png", "name": "bin-metal-full" }, { "url": "/images/status/bin-metal.png", "name": "bin-metal" }, { "url": "/images/status/bin.png", "name": "bin" }, { "url": "/images/status/binocular--arrow.png", "name": "binocular--arrow" }, { "url": "/images/status/binocular--exclamation.png", "name": "binocular--exclamation" }, { "url": "/images/status/binocular--minus.png", "name": "binocular--minus" }, { "url": "/images/status/binocular--pencil.png", "name": "binocular--pencil" }, { "url": "/images/status/binocular--plus.png", "name": "binocular--plus" }, { "url": "/images/status/binocular-small.png", "name": "binocular-small" }, { "url": "/images/status/binocular.png", "name": "binocular" }, { "url": "/images/status/block--arrow.png", "name": "block--arrow" }, { "url": "/images/status/block--exclamation.png", "name": "block--exclamation" }, { "url": "/images/status/block--minus.png", "name": "block--minus" }, { "url": "/images/status/block--pencil.png", "name": "block--pencil" }, { "url": "/images/status/block--plus.png", "name": "block--plus" }, { "url": "/images/status/block-share.png", "name": "block-share" }, { "url": "/images/status/block-small.png", "name": "block-small" }, { "url": "/images/status/block.png", "name": "block" }, { "url": "/images/status/blog--arrow.png", "name": "blog--arrow" }, { "url": "/images/status/blog--exclamation.png", "name": "blog--exclamation" }, { "url": "/images/status/blog--minus.png", "name": "blog--minus" }, { "url": "/images/status/blog--pencil.png", "name": "blog--pencil" }, { "url": "/images/status/blog--plus.png", "name": "blog--plus" }, { "url": "/images/status/blog-blue.png", "name": "blog-blue" }, { "url": "/images/status/blog.png", "name": "blog" }, { "url": "/images/status/blogs-stack.png", "name": "blogs-stack" }, { "url": "/images/status/blogs.png", "name": "blogs" }, { "url": "/images/status/blueprint--arrow.png", "name": "blueprint--arrow" }, { "url": "/images/status/blueprint--exclamation.png", "name": "blueprint--exclamation" }, { "url": "/images/status/blueprint--minus.png", "name": "blueprint--minus" }, { "url": "/images/status/blueprint--pencil.png", "name": "blueprint--pencil" }, { "url": "/images/status/blueprint--plus.png", "name": "blueprint--plus" }, { "url": "/images/status/blueprint-horizontal.png", "name": "blueprint-horizontal" }, { "url": "/images/status/blueprint.png", "name": "blueprint" }, { "url": "/images/status/blueprints.png", "name": "blueprints" }, { "url": "/images/status/bluetooth.png", "name": "bluetooth" }, { "url": "/images/status/bomb.png", "name": "bomb" }, { "url": "/images/status/book--arrow.png", "name": "book--arrow" }, { "url": "/images/status/book--exclamation.png", "name": "book--exclamation" }, { "url": "/images/status/book--minus.png", "name": "book--minus" }, { "url": "/images/status/book--pencil.png", "name": "book--pencil" }, { "url": "/images/status/book--plus.png", "name": "book--plus" }, { "url": "/images/status/book-bookmark.png", "name": "book-bookmark" }, { "url": "/images/status/book-brown.png", "name": "book-brown" }, { "url": "/images/status/book-open-bookmark.png", "name": "book-open-bookmark" }, { "url": "/images/status/book-open-next.png", "name": "book-open-next" }, { "url": "/images/status/book-open-previous.png", "name": "book-open-previous" }, { "url": "/images/status/book-open.png", "name": "book-open" }, { "url": "/images/status/book-question.png", "name": "book-question" }, { "url": "/images/status/book-small-brown.png", "name": "book-small-brown" }, { "url": "/images/status/book-small.png", "name": "book-small" }, { "url": "/images/status/book.png", "name": "book" }, { "url": "/images/status/bookmark--arrow.png", "name": "bookmark--arrow" }, { "url": "/images/status/bookmark--exclamation.png", "name": "bookmark--exclamation" }, { "url": "/images/status/bookmark--minus.png", "name": "bookmark--minus" }, { "url": "/images/status/bookmark--pencil.png", "name": "bookmark--pencil" }, { "url": "/images/status/bookmark--plus.png", "name": "bookmark--plus" }, { "url": "/images/status/bookmark-export.png", "name": "bookmark-export" }, { "url": "/images/status/bookmark-import.png", "name": "bookmark-import" }, { "url": "/images/status/bookmark-small.png", "name": "bookmark-small" }, { "url": "/images/status/bookmark.png", "name": "bookmark" }, { "url": "/images/status/books-brown.png", "name": "books-brown" }, { "url": "/images/status/books-stack.png", "name": "books-stack" }, { "url": "/images/status/books.png", "name": "books" }, { "url": "/images/status/border-all.png", "name": "border-all" }, { "url": "/images/status/border-bottom-double.png", "name": "border-bottom-double" }, { "url": "/images/status/border-bottom-thick.png", "name": "border-bottom-thick" }, { "url": "/images/status/border-bottom.png", "name": "border-bottom" }, { "url": "/images/status/border-color.png", "name": "border-color" }, { "url": "/images/status/border-dash.png", "name": "border-dash" }, { "url": "/images/status/border-down.png", "name": "border-down" }, { "url": "/images/status/border-draw.png", "name": "border-draw" }, { "url": "/images/status/border-horizontal-all.png", "name": "border-horizontal-all" }, { "url": "/images/status/border-horizontal.png", "name": "border-horizontal" }, { "url": "/images/status/border-inside.png", "name": "border-inside" }, { "url": "/images/status/border-left.png", "name": "border-left" }, { "url": "/images/status/border-outside-thick.png", "name": "border-outside-thick" }, { "url": "/images/status/border-outside.png", "name": "border-outside" }, { "url": "/images/status/border-right.png", "name": "border-right" }, { "url": "/images/status/border-top-bottom-double.png", "name": "border-top-bottom-double" }, { "url": "/images/status/border-top-bottom-thick.png", "name": "border-top-bottom-thick" }, { "url": "/images/status/border-top-bottom.png", "name": "border-top-bottom" }, { "url": "/images/status/border-top.png", "name": "border-top" }, { "url": "/images/status/border-up.png", "name": "border-up" }, { "url": "/images/status/border-vertical-all.png", "name": "border-vertical-all" }, { "url": "/images/status/border-vertical.png", "name": "border-vertical" }, { "url": "/images/status/border-weight.png", "name": "border-weight" }, { "url": "/images/status/border.png", "name": "border" }, { "url": "/images/status/box--arrow.png", "name": "box--arrow" }, { "url": "/images/status/box--exclamation.png", "name": "box--exclamation" }, { "url": "/images/status/box--minus.png", "name": "box--minus" }, { "url": "/images/status/box--pencil.png", "name": "box--pencil" }, { "url": "/images/status/box--plus.png", "name": "box--plus" }, { "url": "/images/status/box-label.png", "name": "box-label" }, { "url": "/images/status/box-search-result.png", "name": "box-search-result" }, { "url": "/images/status/box-share.png", "name": "box-share" }, { "url": "/images/status/box-small.png", "name": "box-small" }, { "url": "/images/status/box.png", "name": "box" }, { "url": "/images/status/briefcase--arrow.png", "name": "briefcase--arrow" }, { "url": "/images/status/briefcase--exclamation.png", "name": "briefcase--exclamation" }, { "url": "/images/status/briefcase--minus.png", "name": "briefcase--minus" }, { "url": "/images/status/briefcase--pencil.png", "name": "briefcase--pencil" }, { "url": "/images/status/briefcase--plus.png", "name": "briefcase--plus" }, { "url": "/images/status/briefcase-small.png", "name": "briefcase-small" }, { "url": "/images/status/briefcase.png", "name": "briefcase" }, { "url": "/images/status/brightness-control-up.png", "name": "brightness-control-up" }, { "url": "/images/status/brightness-control.png", "name": "brightness-control" }, { "url": "/images/status/brightness-low.png", "name": "brightness-low" }, { "url": "/images/status/brightness-small-low.png", "name": "brightness-small-low" }, { "url": "/images/status/brightness-small.png", "name": "brightness-small" }, { "url": "/images/status/brightness.png", "name": "brightness" }, { "url": "/images/status/broom--arrow.png", "name": "broom--arrow" }, { "url": "/images/status/broom--exclamation.png", "name": "broom--exclamation" }, { "url": "/images/status/broom--minus.png", "name": "broom--minus" }, { "url": "/images/status/broom--pencil.png", "name": "broom--pencil" }, { "url": "/images/status/broom--plus.png", "name": "broom--plus" }, { "url": "/images/status/broom-code.png", "name": "broom-code" }, { "url": "/images/status/broom.png", "name": "broom" }, { "url": "/images/status/bug--arrow.png", "name": "bug--arrow" }, { "url": "/images/status/bug--exclamation.png", "name": "bug--exclamation" }, { "url": "/images/status/bug--minus.png", "name": "bug--minus" }, { "url": "/images/status/bug--pencil.png", "name": "bug--pencil" }, { "url": "/images/status/bug--plus.png", "name": "bug--plus" }, { "url": "/images/status/bug.png", "name": "bug" }, { "url": "/images/status/building--arrow.png", "name": "building--arrow" }, { "url": "/images/status/building--exclamation.png", "name": "building--exclamation" }, { "url": "/images/status/building--minus.png", "name": "building--minus" }, { "url": "/images/status/building--pencil.png", "name": "building--pencil" }, { "url": "/images/status/building--plus.png", "name": "building--plus" }, { "url": "/images/status/building-low.png", "name": "building-low" }, { "url": "/images/status/building-medium.png", "name": "building-medium" }, { "url": "/images/status/building-network.png", "name": "building-network" }, { "url": "/images/status/building-old.png", "name": "building-old" }, { "url": "/images/status/building-small.png", "name": "building-small" }, { "url": "/images/status/building.png", "name": "building" }, { "url": "/images/status/burn--arrow.png", "name": "burn--arrow" }, { "url": "/images/status/burn--exclamation.png", "name": "burn--exclamation" }, { "url": "/images/status/burn--minus.png", "name": "burn--minus" }, { "url": "/images/status/burn--pencil.png", "name": "burn--pencil" }, { "url": "/images/status/burn--plus.png", "name": "burn--plus" }, { "url": "/images/status/burn-small.png", "name": "burn-small" }, { "url": "/images/status/burn.png", "name": "burn" }, { "url": "/images/status/cake--arrow.png", "name": "cake--arrow" }, { "url": "/images/status/cake--exclamation.png", "name": "cake--exclamation" }, { "url": "/images/status/cake--minus.png", "name": "cake--minus" }, { "url": "/images/status/cake--pencil.png", "name": "cake--pencil" }, { "url": "/images/status/cake--plus.png", "name": "cake--plus" }, { "url": "/images/status/cake-plain.png", "name": "cake-plain" }, { "url": "/images/status/cake.png", "name": "cake" }, { "url": "/images/status/calculator--arrow.png", "name": "calculator--arrow" }, { "url": "/images/status/calculator--exclamation.png", "name": "calculator--exclamation" }, { "url": "/images/status/calculator--minus.png", "name": "calculator--minus" }, { "url": "/images/status/calculator--pencil.png", "name": "calculator--pencil" }, { "url": "/images/status/calculator--plus.png", "name": "calculator--plus" }, { "url": "/images/status/calculator-gray.png", "name": "calculator-gray" }, { "url": "/images/status/calculator-scientific.png", "name": "calculator-scientific" }, { "url": "/images/status/calculator.png", "name": "calculator" }, { "url": "/images/status/calendar--arrow.png", "name": "calendar--arrow" }, { "url": "/images/status/calendar--exclamation.png", "name": "calendar--exclamation" }, { "url": "/images/status/calendar--minus.png", "name": "calendar--minus" }, { "url": "/images/status/calendar--pencil.png", "name": "calendar--pencil" }, { "url": "/images/status/calendar--plus.png", "name": "calendar--plus" }, { "url": "/images/status/calendar-blue.png", "name": "calendar-blue" }, { "url": "/images/status/calendar-day.png", "name": "calendar-day" }, { "url": "/images/status/calendar-delete.png", "name": "calendar-delete" }, { "url": "/images/status/calendar-empty.png", "name": "calendar-empty" }, { "url": "/images/status/calendar-export.png", "name": "calendar-export" }, { "url": "/images/status/calendar-import.png", "name": "calendar-import" }, { "url": "/images/status/calendar-insert.png", "name": "calendar-insert" }, { "url": "/images/status/calendar-list.png", "name": "calendar-list" }, { "url": "/images/status/calendar-month.png", "name": "calendar-month" }, { "url": "/images/status/calendar-next.png", "name": "calendar-next" }, { "url": "/images/status/calendar-previous.png", "name": "calendar-previous" }, { "url": "/images/status/calendar-relation.png", "name": "calendar-relation" }, { "url": "/images/status/calendar-search-result.png", "name": "calendar-search-result" }, { "url": "/images/status/calendar-select-days-span.png", "name": "calendar-select-days-span" }, { "url": "/images/status/calendar-select-days.png", "name": "calendar-select-days" }, { "url": "/images/status/calendar-select-month.png", "name": "calendar-select-month" }, { "url": "/images/status/calendar-select-week.png", "name": "calendar-select-week" }, { "url": "/images/status/calendar-select.png", "name": "calendar-select" }, { "url": "/images/status/calendar-small-month.png", "name": "calendar-small-month" }, { "url": "/images/status/calendar-small.png", "name": "calendar-small" }, { "url": "/images/status/calendar-task.png", "name": "calendar-task" }, { "url": "/images/status/calendar.png", "name": "calendar" }, { "url": "/images/status/camcorder--arrow.png", "name": "camcorder--arrow" }, { "url": "/images/status/camcorder--exclamation.png", "name": "camcorder--exclamation" }, { "url": "/images/status/camcorder--minus.png", "name": "camcorder--minus" }, { "url": "/images/status/camcorder--pencil.png", "name": "camcorder--pencil" }, { "url": "/images/status/camcorder--plus.png", "name": "camcorder--plus" }, { "url": "/images/status/camcorder-image.png", "name": "camcorder-image" }, { "url": "/images/status/camcorder.png", "name": "camcorder" }, { "url": "/images/status/camera--arrow.png", "name": "camera--arrow" }, { "url": "/images/status/camera--exclamation.png", "name": "camera--exclamation" }, { "url": "/images/status/camera--minus.png", "name": "camera--minus" }, { "url": "/images/status/camera--pencil.png", "name": "camera--pencil" }, { "url": "/images/status/camera--plus.png", "name": "camera--plus" }, { "url": "/images/status/camera-black.png", "name": "camera-black" }, { "url": "/images/status/camera-lens.png", "name": "camera-lens" }, { "url": "/images/status/camera-small-black.png", "name": "camera-small-black" }, { "url": "/images/status/camera-small.png", "name": "camera-small" }, { "url": "/images/status/camera.png", "name": "camera" }, { "url": "/images/status/car--arrow.png", "name": "car--arrow" }, { "url": "/images/status/car--exclamation.png", "name": "car--exclamation" }, { "url": "/images/status/car--minus.png", "name": "car--minus" }, { "url": "/images/status/car--pencil.png", "name": "car--pencil" }, { "url": "/images/status/car--plus.png", "name": "car--plus" }, { "url": "/images/status/car-red.png", "name": "car-red" }, { "url": "/images/status/car.png", "name": "car" }, { "url": "/images/status/card--arrow.png", "name": "card--arrow" }, { "url": "/images/status/card--exclamation.png", "name": "card--exclamation" }, { "url": "/images/status/card--minus.png", "name": "card--minus" }, { "url": "/images/status/card--pencil.png", "name": "card--pencil" }, { "url": "/images/status/card--plus.png", "name": "card--plus" }, { "url": "/images/status/card-address.png", "name": "card-address" }, { "url": "/images/status/card-export.png", "name": "card-export" }, { "url": "/images/status/card-import.png", "name": "card-import" }, { "url": "/images/status/card-small.png", "name": "card-small" }, { "url": "/images/status/card.png", "name": "card" }, { "url": "/images/status/cards-address.png", "name": "cards-address" }, { "url": "/images/status/cards-bind-address.png", "name": "cards-bind-address" }, { "url": "/images/status/cards-bind.png", "name": "cards-bind" }, { "url": "/images/status/cards-stack.png", "name": "cards-stack" }, { "url": "/images/status/cards.png", "name": "cards" }, { "url": "/images/status/cassette--arrow.png", "name": "cassette--arrow" }, { "url": "/images/status/cassette--exclamation.png", "name": "cassette--exclamation" }, { "url": "/images/status/cassette--minus.png", "name": "cassette--minus" }, { "url": "/images/status/cassette--pencil.png", "name": "cassette--pencil" }, { "url": "/images/status/cassette--plus.png", "name": "cassette--plus" }, { "url": "/images/status/cassette-label.png", "name": "cassette-label" }, { "url": "/images/status/cassette-small.png", "name": "cassette-small" }, { "url": "/images/status/cassette.png", "name": "cassette" }, { "url": "/images/status/category.png", "name": "category" }, { "url": "/images/status/chain--arrow.png", "name": "chain--arrow" }, { "url": "/images/status/chain--exclamation.png", "name": "chain--exclamation" }, { "url": "/images/status/chain--minus.png", "name": "chain--minus" }, { "url": "/images/status/chain--pencil.png", "name": "chain--pencil" }, { "url": "/images/status/chain--plus.png", "name": "chain--plus" }, { "url": "/images/status/chain-small.png", "name": "chain-small" }, { "url": "/images/status/chain-unchain.png", "name": "chain-unchain" }, { "url": "/images/status/chain.png", "name": "chain" }, { "url": "/images/status/chart--arrow.png", "name": "chart--arrow" }, { "url": "/images/status/chart--exclamation.png", "name": "chart--exclamation" }, { "url": "/images/status/chart--minus.png", "name": "chart--minus" }, { "url": "/images/status/chart--pencil.png", "name": "chart--pencil" }, { "url": "/images/status/chart--plus.png", "name": "chart--plus" }, { "url": "/images/status/chart-down-color.png", "name": "chart-down-color" }, { "url": "/images/status/chart-down.png", "name": "chart-down" }, { "url": "/images/status/chart-up-color.png", "name": "chart-up-color" }, { "url": "/images/status/chart-up.png", "name": "chart-up" }, { "url": "/images/status/chart.png", "name": "chart" }, { "url": "/images/status/chevron-expand.png", "name": "chevron-expand" }, { "url": "/images/status/chevron-small-expand.png", "name": "chevron-small-expand" }, { "url": "/images/status/chevron-small.png", "name": "chevron-small" }, { "url": "/images/status/chevron.png", "name": "chevron" }, { "url": "/images/status/cigarette-stop.png", "name": "cigarette-stop" }, { "url": "/images/status/cigarette.png", "name": "cigarette" }, { "url": "/images/status/clapperboard--arrow.png", "name": "clapperboard--arrow" }, { "url": "/images/status/clapperboard--exclamation.png", "name": "clapperboard--exclamation" }, { "url": "/images/status/clapperboard--minus.png", "name": "clapperboard--minus" }, { "url": "/images/status/clapperboard--pencil.png", "name": "clapperboard--pencil" }, { "url": "/images/status/clapperboard--plus.png", "name": "clapperboard--plus" }, { "url": "/images/status/clapperboard.png", "name": "clapperboard" }, { "url": "/images/status/clipboard--arrow.png", "name": "clipboard--arrow" }, { "url": "/images/status/clipboard--exclamation.png", "name": "clipboard--exclamation" }, { "url": "/images/status/clipboard--minus.png", "name": "clipboard--minus" }, { "url": "/images/status/clipboard--pencil.png", "name": "clipboard--pencil" }, { "url": "/images/status/clipboard--plus.png", "name": "clipboard--plus" }, { "url": "/images/status/clipboard-empty.png", "name": "clipboard-empty" }, { "url": "/images/status/clipboard-list.png", "name": "clipboard-list" }, { "url": "/images/status/clipboard-paste-document-text.png", "name": "clipboard-paste-document-text" }, { "url": "/images/status/clipboard-paste-image.png", "name": "clipboard-paste-image" }, { "url": "/images/status/clipboard-paste-word.png", "name": "clipboard-paste-word" }, { "url": "/images/status/clipboard-paste.png", "name": "clipboard-paste" }, { "url": "/images/status/clipboard-search-result.png", "name": "clipboard-search-result" }, { "url": "/images/status/clipboard-sign-out.png", "name": "clipboard-sign-out" }, { "url": "/images/status/clipboard-sign.png", "name": "clipboard-sign" }, { "url": "/images/status/clipboard-task.png", "name": "clipboard-task" }, { "url": "/images/status/clipboard-text.png", "name": "clipboard-text" }, { "url": "/images/status/clipboard.png", "name": "clipboard" }, { "url": "/images/status/clock--arrow.png", "name": "clock--arrow" }, { "url": "/images/status/clock--exclamation.png", "name": "clock--exclamation" }, { "url": "/images/status/clock--minus.png", "name": "clock--minus" }, { "url": "/images/status/clock--pencil.png", "name": "clock--pencil" }, { "url": "/images/status/clock--plus.png", "name": "clock--plus" }, { "url": "/images/status/clock-frame.png", "name": "clock-frame" }, { "url": "/images/status/clock-history-frame.png", "name": "clock-history-frame" }, { "url": "/images/status/clock-history.png", "name": "clock-history" }, { "url": "/images/status/clock-select-remain.png", "name": "clock-select-remain" }, { "url": "/images/status/clock-select.png", "name": "clock-select" }, { "url": "/images/status/clock-small.png", "name": "clock-small" }, { "url": "/images/status/clock.png", "name": "clock" }, { "url": "/images/status/color--arrow.png", "name": "color--arrow" }, { "url": "/images/status/color--exclamation.png", "name": "color--exclamation" }, { "url": "/images/status/color--minus.png", "name": "color--minus" }, { "url": "/images/status/color--pencil.png", "name": "color--pencil" }, { "url": "/images/status/color--plus.png", "name": "color--plus" }, { "url": "/images/status/color-adjustment-green.png", "name": "color-adjustment-green" }, { "url": "/images/status/color-adjustment-red.png", "name": "color-adjustment-red" }, { "url": "/images/status/color-adjustment.png", "name": "color-adjustment" }, { "url": "/images/status/color-small.png", "name": "color-small" }, { "url": "/images/status/color-swatch-small.png", "name": "color-swatch-small" }, { "url": "/images/status/color-swatch.png", "name": "color-swatch" }, { "url": "/images/status/color-swatches.png", "name": "color-swatches" }, { "url": "/images/status/color.png", "name": "color" }, { "url": "/images/status/compass--arrow.png", "name": "compass--arrow" }, { "url": "/images/status/compass--exclamation.png", "name": "compass--exclamation" }, { "url": "/images/status/compass--minus.png", "name": "compass--minus" }, { "url": "/images/status/compass--pencil.png", "name": "compass--pencil" }, { "url": "/images/status/compass--plus.png", "name": "compass--plus" }, { "url": "/images/status/compass.png", "name": "compass" }, { "url": "/images/status/compile-error.png", "name": "compile-error" }, { "url": "/images/status/compile-warning.png", "name": "compile-warning" }, { "url": "/images/status/compile.png", "name": "compile" }, { "url": "/images/status/computer--arrow.png", "name": "computer--arrow" }, { "url": "/images/status/computer--exclamation.png", "name": "computer--exclamation" }, { "url": "/images/status/computer--minus.png", "name": "computer--minus" }, { "url": "/images/status/computer--pencil.png", "name": "computer--pencil" }, { "url": "/images/status/computer--plus.png", "name": "computer--plus" }, { "url": "/images/status/computer-network.png", "name": "computer-network" }, { "url": "/images/status/computer-off.png", "name": "computer-off" }, { "url": "/images/status/computer.png", "name": "computer" }, { "url": "/images/status/construction.png", "name": "construction" }, { "url": "/images/status/contrast-control-up.png", "name": "contrast-control-up" }, { "url": "/images/status/contrast-control.png", "name": "contrast-control" }, { "url": "/images/status/contrast-low.png", "name": "contrast-low" }, { "url": "/images/status/contrast-small-low.png", "name": "contrast-small-low" }, { "url": "/images/status/contrast-small.png", "name": "contrast-small" }, { "url": "/images/status/contrast.png", "name": "contrast" }, { "url": "/images/status/control-000-small.png", "name": "control-000-small" }, { "url": "/images/status/control-090-small.png", "name": "control-090-small" }, { "url": "/images/status/control-090.png", "name": "control-090" }, { "url": "/images/status/control-180-small.png", "name": "control-180-small" }, { "url": "/images/status/control-180.png", "name": "control-180" }, { "url": "/images/status/control-270-small.png", "name": "control-270-small" }, { "url": "/images/status/control-270.png", "name": "control-270" }, { "url": "/images/status/control-cursor.png", "name": "control-cursor" }, { "url": "/images/status/control-double-000-small.png", "name": "control-double-000-small" }, { "url": "/images/status/control-double-090-small.png", "name": "control-double-090-small" }, { "url": "/images/status/control-double-090.png", "name": "control-double-090" }, { "url": "/images/status/control-double-180-small.png", "name": "control-double-180-small" }, { "url": "/images/status/control-double-180.png", "name": "control-double-180" }, { "url": "/images/status/control-double-270-small.png", "name": "control-double-270-small" }, { "url": "/images/status/control-double-270.png", "name": "control-double-270" }, { "url": "/images/status/control-double.png", "name": "control-double" }, { "url": "/images/status/control-eject-small.png", "name": "control-eject-small" }, { "url": "/images/status/control-eject.png", "name": "control-eject" }, { "url": "/images/status/control-pause-record-small.png", "name": "control-pause-record-small" }, { "url": "/images/status/control-pause-record.png", "name": "control-pause-record" }, { "url": "/images/status/control-pause-small.png", "name": "control-pause-small" }, { "url": "/images/status/control-pause.png", "name": "control-pause" }, { "url": "/images/status/control-power-small.png", "name": "control-power-small" }, { "url": "/images/status/control-power.png", "name": "control-power" }, { "url": "/images/status/control-record-small.png", "name": "control-record-small" }, { "url": "/images/status/control-record.png", "name": "control-record" }, { "url": "/images/status/control-skip-000-small.png", "name": "control-skip-000-small" }, { "url": "/images/status/control-skip-090-small.png", "name": "control-skip-090-small" }, { "url": "/images/status/control-skip-090.png", "name": "control-skip-090" }, { "url": "/images/status/control-skip-180-small.png", "name": "control-skip-180-small" }, { "url": "/images/status/control-skip-180.png", "name": "control-skip-180" }, { "url": "/images/status/control-skip-270-small.png", "name": "control-skip-270-small" }, { "url": "/images/status/control-skip-270.png", "name": "control-skip-270" }, { "url": "/images/status/control-skip.png", "name": "control-skip" }, { "url": "/images/status/control-stop-000-small.png", "name": "control-stop-000-small" }, { "url": "/images/status/control-stop-090-small.png", "name": "control-stop-090-small" }, { "url": "/images/status/control-stop-090.png", "name": "control-stop-090" }, { "url": "/images/status/control-stop-180-small.png", "name": "control-stop-180-small" }, { "url": "/images/status/control-stop-180.png", "name": "control-stop-180" }, { "url": "/images/status/control-stop-270-small.png", "name": "control-stop-270-small" }, { "url": "/images/status/control-stop-270.png", "name": "control-stop-270" }, { "url": "/images/status/control-stop-square-small.png", "name": "control-stop-square-small" }, { "url": "/images/status/control-stop-square.png", "name": "control-stop-square" }, { "url": "/images/status/control-stop.png", "name": "control-stop" }, { "url": "/images/status/control.png", "name": "control" }, { "url": "/images/status/controller.png", "name": "controller" }, { "url": "/images/status/cookie--arrow.png", "name": "cookie--arrow" }, { "url": "/images/status/cookie--exclamation.png", "name": "cookie--exclamation" }, { "url": "/images/status/cookie--minus.png", "name": "cookie--minus" }, { "url": "/images/status/cookie--pencil.png", "name": "cookie--pencil" }, { "url": "/images/status/cookie--plus.png", "name": "cookie--plus" }, { "url": "/images/status/cookie-bite.png", "name": "cookie-bite" }, { "url": "/images/status/cookie-chocolate.png", "name": "cookie-chocolate" }, { "url": "/images/status/cookie.png", "name": "cookie" }, { "url": "/images/status/cookies.png", "name": "cookies" }, { "url": "/images/status/counter-count-up.png", "name": "counter-count-up" }, { "url": "/images/status/counter-count.png", "name": "counter-count" }, { "url": "/images/status/counter-reset.png", "name": "counter-reset" }, { "url": "/images/status/counter-stop.png", "name": "counter-stop" }, { "url": "/images/status/counter.png", "name": "counter" }, { "url": "/images/status/create-json.py", "name": "create-json" }, { "url": "/images/status/creative-commons.png", "name": "creative-commons" }, { "url": "/images/status/credit-card--arrow.png", "name": "credit-card--arrow" }, { "url": "/images/status/credit-card--exclamation.png", "name": "credit-card--exclamation" }, { "url": "/images/status/credit-card--minus.png", "name": "credit-card--minus" }, { "url": "/images/status/credit-card--pencil.png", "name": "credit-card--pencil" }, { "url": "/images/status/credit-card--plus.png", "name": "credit-card--plus" }, { "url": "/images/status/credit-card-green.png", "name": "credit-card-green" }, { "url": "/images/status/credit-card.png", "name": "credit-card" }, { "url": "/images/status/credit-cards.png", "name": "credit-cards" }, { "url": "/images/status/cross-button.png", "name": "cross-button" }, { "url": "/images/status/cross-circle-frame.png", "name": "cross-circle-frame" }, { "url": "/images/status/cross-circle.png", "name": "cross-circle" }, { "url": "/images/status/cross-octagon-frame.png", "name": "cross-octagon-frame" }, { "url": "/images/status/cross-octagon.png", "name": "cross-octagon" }, { "url": "/images/status/cross-script.png", "name": "cross-script" }, { "url": "/images/status/cross-shield.png", "name": "cross-shield" }, { "url": "/images/status/cross-small-circle.png", "name": "cross-small-circle" }, { "url": "/images/status/cross-small-white.png", "name": "cross-small-white" }, { "url": "/images/status/cross-small.png", "name": "cross-small" }, { "url": "/images/status/cross-white.png", "name": "cross-white" }, { "url": "/images/status/cross.png", "name": "cross" }, { "url": "/images/status/crown--arrow.png", "name": "crown--arrow" }, { "url": "/images/status/crown--exclamation.png", "name": "crown--exclamation" }, { "url": "/images/status/crown--minus.png", "name": "crown--minus" }, { "url": "/images/status/crown--pencil.png", "name": "crown--pencil" }, { "url": "/images/status/crown--plus.png", "name": "crown--plus" }, { "url": "/images/status/crown-bronze.png", "name": "crown-bronze" }, { "url": "/images/status/crown-silver.png", "name": "crown-silver" }, { "url": "/images/status/crown.png", "name": "crown" }, { "url": "/images/status/cup--arrow.png", "name": "cup--arrow" }, { "url": "/images/status/cup--exclamation.png", "name": "cup--exclamation" }, { "url": "/images/status/cup--minus.png", "name": "cup--minus" }, { "url": "/images/status/cup--pencil.png", "name": "cup--pencil" }, { "url": "/images/status/cup--plus.png", "name": "cup--plus" }, { "url": "/images/status/cup-empty.png", "name": "cup-empty" }, { "url": "/images/status/cup.png", "name": "cup" }, { "url": "/images/status/currency-dollar-aud.png", "name": "currency-dollar-aud" }, { "url": "/images/status/currency-dollar-cad.png", "name": "currency-dollar-cad" }, { "url": "/images/status/currency-dollar-nzd.png", "name": "currency-dollar-nzd" }, { "url": "/images/status/currency-dollar-usd.png", "name": "currency-dollar-usd" }, { "url": "/images/status/currency-euro.png", "name": "currency-euro" }, { "url": "/images/status/currency-pound.png", "name": "currency-pound" }, { "url": "/images/status/currency-yen.png", "name": "currency-yen" }, { "url": "/images/status/currency.png", "name": "currency" }, { "url": "/images/status/cursor-question.png", "name": "cursor-question" }, { "url": "/images/status/cursor-small.png", "name": "cursor-small" }, { "url": "/images/status/cursor.png", "name": "cursor" }, { "url": "/images/status/cutlery-fork.png", "name": "cutlery-fork" }, { "url": "/images/status/cutlery-knife.png", "name": "cutlery-knife" }, { "url": "/images/status/cutlery-spoon.png", "name": "cutlery-spoon" }, { "url": "/images/status/cutlery.png", "name": "cutlery" }, { "url": "/images/status/dashboard--arrow.png", "name": "dashboard--arrow" }, { "url": "/images/status/dashboard--exclamation.png", "name": "dashboard--exclamation" }, { "url": "/images/status/dashboard--minus.png", "name": "dashboard--minus" }, { "url": "/images/status/dashboard--pencil.png", "name": "dashboard--pencil" }, { "url": "/images/status/dashboard--plus.png", "name": "dashboard--plus" }, { "url": "/images/status/dashboard.png", "name": "dashboard" }, { "url": "/images/status/database--arrow.png", "name": "database--arrow" }, { "url": "/images/status/database--exclamation.png", "name": "database--exclamation" }, { "url": "/images/status/database--minus.png", "name": "database--minus" }, { "url": "/images/status/database--pencil.png", "name": "database--pencil" }, { "url": "/images/status/database--plus.png", "name": "database--plus" }, { "url": "/images/status/database-delete.png", "name": "database-delete" }, { "url": "/images/status/database-export.png", "name": "database-export" }, { "url": "/images/status/database-import.png", "name": "database-import" }, { "url": "/images/status/database-insert.png", "name": "database-insert" }, { "url": "/images/status/database-network.png", "name": "database-network" }, { "url": "/images/status/database-share.png", "name": "database-share" }, { "url": "/images/status/database-small.png", "name": "database-small" }, { "url": "/images/status/database.png", "name": "database" }, { "url": "/images/status/databases-relation.png", "name": "databases-relation" }, { "url": "/images/status/databases.png", "name": "databases" }, { "url": "/images/status/desktop-empty.png", "name": "desktop-empty" }, { "url": "/images/status/desktop-image.png", "name": "desktop-image" }, { "url": "/images/status/desktop-network.png", "name": "desktop-network" }, { "url": "/images/status/desktop.png", "name": "desktop" }, { "url": "/images/status/diamond.png", "name": "diamond" }, { "url": "/images/status/direction--arrow.png", "name": "direction--arrow" }, { "url": "/images/status/direction--exclamation.png", "name": "direction--exclamation" }, { "url": "/images/status/direction--minus.png", "name": "direction--minus" }, { "url": "/images/status/direction--pencil.png", "name": "direction--pencil" }, { "url": "/images/status/direction--plus.png", "name": "direction--plus" }, { "url": "/images/status/direction.png", "name": "direction" }, { "url": "/images/status/disc--arrow.png", "name": "disc--arrow" }, { "url": "/images/status/disc--exclamation.png", "name": "disc--exclamation" }, { "url": "/images/status/disc--minus.png", "name": "disc--minus" }, { "url": "/images/status/disc--pencil.png", "name": "disc--pencil" }, { "url": "/images/status/disc--plus.png", "name": "disc--plus" }, { "url": "/images/status/disc-blue.png", "name": "disc-blue" }, { "url": "/images/status/disc-case-label.png", "name": "disc-case-label" }, { "url": "/images/status/disc-case.png", "name": "disc-case" }, { "url": "/images/status/disc-label.png", "name": "disc-label" }, { "url": "/images/status/disc-small.png", "name": "disc-small" }, { "url": "/images/status/disc.png", "name": "disc" }, { "url": "/images/status/discs.png", "name": "discs" }, { "url": "/images/status/disk--arrow.png", "name": "disk--arrow" }, { "url": "/images/status/disk--exclamation.png", "name": "disk--exclamation" }, { "url": "/images/status/disk--minus.png", "name": "disk--minus" }, { "url": "/images/status/disk--pencil.png", "name": "disk--pencil" }, { "url": "/images/status/disk--plus.png", "name": "disk--plus" }, { "url": "/images/status/disk-black.png", "name": "disk-black" }, { "url": "/images/status/disk-return-black.png", "name": "disk-return-black" }, { "url": "/images/status/disk-return.png", "name": "disk-return" }, { "url": "/images/status/disk-small-black.png", "name": "disk-small-black" }, { "url": "/images/status/disk-small.png", "name": "disk-small" }, { "url": "/images/status/disk.png", "name": "disk" }, { "url": "/images/status/disks-black.png", "name": "disks-black" }, { "url": "/images/status/disks.png", "name": "disks" }, { "url": "/images/status/do-not-disturb-sign-cross.png", "name": "do-not-disturb-sign-cross" }, { "url": "/images/status/do-not-disturb-sign.png", "name": "do-not-disturb-sign" }, { "url": "/images/status/document--arrow.png", "name": "document--arrow" }, { "url": "/images/status/document--exclamation.png", "name": "document--exclamation" }, { "url": "/images/status/document--minus.png", "name": "document--minus" }, { "url": "/images/status/document--pencil.png", "name": "document--pencil" }, { "url": "/images/status/document--plus.png", "name": "document--plus" }, { "url": "/images/status/document-access.png", "name": "document-access" }, { "url": "/images/status/document-attribute-b.png", "name": "document-attribute-b" }, { "url": "/images/status/document-attribute-c.png", "name": "document-attribute-c" }, { "url": "/images/status/document-attribute-d.png", "name": "document-attribute-d" }, { "url": "/images/status/document-attribute-e.png", "name": "document-attribute-e" }, { "url": "/images/status/document-attribute-f.png", "name": "document-attribute-f" }, { "url": "/images/status/document-attribute-g.png", "name": "document-attribute-g" }, { "url": "/images/status/document-attribute-h.png", "name": "document-attribute-h" }, { "url": "/images/status/document-attribute-i.png", "name": "document-attribute-i" }, { "url": "/images/status/document-attribute-j.png", "name": "document-attribute-j" }, { "url": "/images/status/document-attribute-k.png", "name": "document-attribute-k" }, { "url": "/images/status/document-attribute-l.png", "name": "document-attribute-l" }, { "url": "/images/status/document-attribute-m.png", "name": "document-attribute-m" }, { "url": "/images/status/document-attribute-n.png", "name": "document-attribute-n" }, { "url": "/images/status/document-attribute-o.png", "name": "document-attribute-o" }, { "url": "/images/status/document-attribute-p.png", "name": "document-attribute-p" }, { "url": "/images/status/document-attribute-q.png", "name": "document-attribute-q" }, { "url": "/images/status/document-attribute-r.png", "name": "document-attribute-r" }, { "url": "/images/status/document-attribute-s.png", "name": "document-attribute-s" }, { "url": "/images/status/document-attribute-t.png", "name": "document-attribute-t" }, { "url": "/images/status/document-attribute-u.png", "name": "document-attribute-u" }, { "url": "/images/status/document-attribute-v.png", "name": "document-attribute-v" }, { "url": "/images/status/document-attribute-w.png", "name": "document-attribute-w" }, { "url": "/images/status/document-attribute-x.png", "name": "document-attribute-x" }, { "url": "/images/status/document-attribute-y.png", "name": "document-attribute-y" }, { "url": "/images/status/document-attribute-z.png", "name": "document-attribute-z" }, { "url": "/images/status/document-attribute.png", "name": "document-attribute" }, { "url": "/images/status/document-binary.png", "name": "document-binary" }, { "url": "/images/status/document-block.png", "name": "document-block" }, { "url": "/images/status/document-bookmark.png", "name": "document-bookmark" }, { "url": "/images/status/document-break.png", "name": "document-break" }, { "url": "/images/status/document-clock.png", "name": "document-clock" }, { "url": "/images/status/document-code.png", "name": "document-code" }, { "url": "/images/status/document-convert.png", "name": "document-convert" }, { "url": "/images/status/document-copy.png", "name": "document-copy" }, { "url": "/images/status/document-excel-csv.png", "name": "document-excel-csv" }, { "url": "/images/status/document-excel-table.png", "name": "document-excel-table" }, { "url": "/images/status/document-excel.png", "name": "document-excel" }, { "url": "/images/status/document-export.png", "name": "document-export" }, { "url": "/images/status/document-film.png", "name": "document-film" }, { "url": "/images/status/document-flash-movie.png", "name": "document-flash-movie" }, { "url": "/images/status/document-flash.png", "name": "document-flash" }, { "url": "/images/status/document-globe.png", "name": "document-globe" }, { "url": "/images/status/document-hf-delete-footer.png", "name": "document-hf-delete-footer" }, { "url": "/images/status/document-hf-delete.png", "name": "document-hf-delete" }, { "url": "/images/status/document-hf-insert-footer.png", "name": "document-hf-insert-footer" }, { "url": "/images/status/document-hf-insert.png", "name": "document-hf-insert" }, { "url": "/images/status/document-hf-select-footer.png", "name": "document-hf-select-footer" }, { "url": "/images/status/document-hf-select.png", "name": "document-hf-select" }, { "url": "/images/status/document-hf.png", "name": "document-hf" }, { "url": "/images/status/document-horizontal-text.png", "name": "document-horizontal-text" }, { "url": "/images/status/document-horizontal.png", "name": "document-horizontal" }, { "url": "/images/status/document-illustrator.png", "name": "document-illustrator" }, { "url": "/images/status/document-image.png", "name": "document-image" }, { "url": "/images/status/document-import.png", "name": "document-import" }, { "url": "/images/status/document-insert.png", "name": "document-insert" }, { "url": "/images/status/document-invoice.png", "name": "document-invoice" }, { "url": "/images/status/document-list.png", "name": "document-list" }, { "url": "/images/status/document-music-playlist.png", "name": "document-music-playlist" }, { "url": "/images/status/document-music.png", "name": "document-music" }, { "url": "/images/status/document-number.png", "name": "document-number" }, { "url": "/images/status/document-office-text.png", "name": "document-office-text" }, { "url": "/images/status/document-office.png", "name": "document-office" }, { "url": "/images/status/document-outlook.png", "name": "document-outlook" }, { "url": "/images/status/document-page-last.png", "name": "document-page-last" }, { "url": "/images/status/document-page-next.png", "name": "document-page-next" }, { "url": "/images/status/document-page-previous.png", "name": "document-page-previous" }, { "url": "/images/status/document-page.png", "name": "document-page" }, { "url": "/images/status/document-pdf-text.png", "name": "document-pdf-text" }, { "url": "/images/status/document-pdf.png", "name": "document-pdf" }, { "url": "/images/status/document-photoshop-image.png", "name": "document-photoshop-image" }, { "url": "/images/status/document-photoshop.png", "name": "document-photoshop" }, { "url": "/images/status/document-php.png", "name": "document-php" }, { "url": "/images/status/document-powerpoint.png", "name": "document-powerpoint" }, { "url": "/images/status/document-rename.png", "name": "document-rename" }, { "url": "/images/status/document-resize-actual.png", "name": "document-resize-actual" }, { "url": "/images/status/document-resize.png", "name": "document-resize" }, { "url": "/images/status/document-search-result.png", "name": "document-search-result" }, { "url": "/images/status/document-share.png", "name": "document-share" }, { "url": "/images/status/document-shred.png", "name": "document-shred" }, { "url": "/images/status/document-small-list.png", "name": "document-small-list" }, { "url": "/images/status/document-small.png", "name": "document-small" }, { "url": "/images/status/document-snippet.png", "name": "document-snippet" }, { "url": "/images/status/document-stamp.png", "name": "document-stamp" }, { "url": "/images/status/document-stand.png", "name": "document-stand" }, { "url": "/images/status/document-sub.png", "name": "document-sub" }, { "url": "/images/status/document-table.png", "name": "document-table" }, { "url": "/images/status/document-tag.png", "name": "document-tag" }, { "url": "/images/status/document-task.png", "name": "document-task" }, { "url": "/images/status/document-template.png", "name": "document-template" }, { "url": "/images/status/document-text-image.png", "name": "document-text-image" }, { "url": "/images/status/document-text.png", "name": "document-text" }, { "url": "/images/status/document-view-book.png", "name": "document-view-book" }, { "url": "/images/status/document-view-thumbnail.png", "name": "document-view-thumbnail" }, { "url": "/images/status/document-view.png", "name": "document-view" }, { "url": "/images/status/document-visual-studio.png", "name": "document-visual-studio" }, { "url": "/images/status/document-word-text.png", "name": "document-word-text" }, { "url": "/images/status/document-word.png", "name": "document-word" }, { "url": "/images/status/document-zipper.png", "name": "document-zipper" }, { "url": "/images/status/document.png", "name": "document" }, { "url": "/images/status/documents-stack.png", "name": "documents-stack" }, { "url": "/images/status/documents-text.png", "name": "documents-text" }, { "url": "/images/status/documents.png", "name": "documents" }, { "url": "/images/status/door--arrow.png", "name": "door--arrow" }, { "url": "/images/status/door--exclamation.png", "name": "door--exclamation" }, { "url": "/images/status/door--minus.png", "name": "door--minus" }, { "url": "/images/status/door--pencil.png", "name": "door--pencil" }, { "url": "/images/status/door--plus.png", "name": "door--plus" }, { "url": "/images/status/door-open-in.png", "name": "door-open-in" }, { "url": "/images/status/door-open-out.png", "name": "door-open-out" }, { "url": "/images/status/door-open.png", "name": "door-open" }, { "url": "/images/status/door.png", "name": "door" }, { "url": "/images/status/drawer--arrow.png", "name": "drawer--arrow" }, { "url": "/images/status/drawer--exclamation.png", "name": "drawer--exclamation" }, { "url": "/images/status/drawer--minus.png", "name": "drawer--minus" }, { "url": "/images/status/drawer--pencil.png", "name": "drawer--pencil" }, { "url": "/images/status/drawer--plus.png", "name": "drawer--plus" }, { "url": "/images/status/drawer-open.png", "name": "drawer-open" }, { "url": "/images/status/drawer.png", "name": "drawer" }, { "url": "/images/status/drill--arrow.png", "name": "drill--arrow" }, { "url": "/images/status/drill--exclamation.png", "name": "drill--exclamation" }, { "url": "/images/status/drill--minus.png", "name": "drill--minus" }, { "url": "/images/status/drill--pencil.png", "name": "drill--pencil" }, { "url": "/images/status/drill--plus.png", "name": "drill--plus" }, { "url": "/images/status/drill.png", "name": "drill" }, { "url": "/images/status/drive--arrow.png", "name": "drive--arrow" }, { "url": "/images/status/drive--exclamation.png", "name": "drive--exclamation" }, { "url": "/images/status/drive--minus.png", "name": "drive--minus" }, { "url": "/images/status/drive--pencil.png", "name": "drive--pencil" }, { "url": "/images/status/drive--plus.png", "name": "drive--plus" }, { "url": "/images/status/drive-download.png", "name": "drive-download" }, { "url": "/images/status/drive-globe.png", "name": "drive-globe" }, { "url": "/images/status/drive-network.png", "name": "drive-network" }, { "url": "/images/status/drive-rename.png", "name": "drive-rename" }, { "url": "/images/status/drive-small.png", "name": "drive-small" }, { "url": "/images/status/drive-upload.png", "name": "drive-upload" }, { "url": "/images/status/drive.png", "name": "drive" }, { "url": "/images/status/dummy.png", "name": "dummy" }, { "url": "/images/status/e-book-reader-white.png", "name": "e-book-reader-white" }, { "url": "/images/status/e-book-reader.png", "name": "e-book-reader" }, { "url": "/images/status/edit-alignment-center.png", "name": "edit-alignment-center" }, { "url": "/images/status/edit-alignment-justify-distribute.png", "name": "edit-alignment-justify-distribute" }, { "url": "/images/status/edit-alignment-justify.png", "name": "edit-alignment-justify" }, { "url": "/images/status/edit-alignment-right.png", "name": "edit-alignment-right" }, { "url": "/images/status/edit-alignment.png", "name": "edit-alignment" }, { "url": "/images/status/edit-all-caps.png", "name": "edit-all-caps" }, { "url": "/images/status/edit-bold.png", "name": "edit-bold" }, { "url": "/images/status/edit-code.png", "name": "edit-code" }, { "url": "/images/status/edit-color.png", "name": "edit-color" }, { "url": "/images/status/edit-column.png", "name": "edit-column" }, { "url": "/images/status/edit-comma.png", "name": "edit-comma" }, { "url": "/images/status/edit-decimal-decrease.png", "name": "edit-decimal-decrease" }, { "url": "/images/status/edit-decimal.png", "name": "edit-decimal" }, { "url": "/images/status/edit-diff.png", "name": "edit-diff" }, { "url": "/images/status/edit-direction-rtl.png", "name": "edit-direction-rtl" }, { "url": "/images/status/edit-direction.png", "name": "edit-direction" }, { "url": "/images/status/edit-drop-cap.png", "name": "edit-drop-cap" }, { "url": "/images/status/edit-heading.png", "name": "edit-heading" }, { "url": "/images/status/edit-hyphenation.png", "name": "edit-hyphenation" }, { "url": "/images/status/edit-image-center.png", "name": "edit-image-center" }, { "url": "/images/status/edit-image-right.png", "name": "edit-image-right" }, { "url": "/images/status/edit-image.png", "name": "edit-image" }, { "url": "/images/status/edit-indent.png", "name": "edit-indent" }, { "url": "/images/status/edit-italic.png", "name": "edit-italic" }, { "url": "/images/status/edit-kerning.png", "name": "edit-kerning" }, { "url": "/images/status/edit-language.png", "name": "edit-language" }, { "url": "/images/status/edit-letter-spacing.png", "name": "edit-letter-spacing" }, { "url": "/images/status/edit-line-spacing.png", "name": "edit-line-spacing" }, { "url": "/images/status/edit-list-order.png", "name": "edit-list-order" }, { "url": "/images/status/edit-list.png", "name": "edit-list" }, { "url": "/images/status/edit-lowercase.png", "name": "edit-lowercase" }, { "url": "/images/status/edit-mathematics.png", "name": "edit-mathematics" }, { "url": "/images/status/edit-number.png", "name": "edit-number" }, { "url": "/images/status/edit-outdent.png", "name": "edit-outdent" }, { "url": "/images/status/edit-outline.png", "name": "edit-outline" }, { "url": "/images/status/edit-overline.png", "name": "edit-overline" }, { "url": "/images/status/edit-padding-left.png", "name": "edit-padding-left" }, { "url": "/images/status/edit-padding-right.png", "name": "edit-padding-right" }, { "url": "/images/status/edit-padding-top.png", "name": "edit-padding-top" }, { "url": "/images/status/edit-padding.png", "name": "edit-padding" }, { "url": "/images/status/edit-percent.png", "name": "edit-percent" }, { "url": "/images/status/edit-pilcrow.png", "name": "edit-pilcrow" }, { "url": "/images/status/edit-quotation.png", "name": "edit-quotation" }, { "url": "/images/status/edit-replace.png", "name": "edit-replace" }, { "url": "/images/status/edit-rotate.png", "name": "edit-rotate" }, { "url": "/images/status/edit-rule.png", "name": "edit-rule" }, { "url": "/images/status/edit-scale-vertical.png", "name": "edit-scale-vertical" }, { "url": "/images/status/edit-scale.png", "name": "edit-scale" }, { "url": "/images/status/edit-shade.png", "name": "edit-shade" }, { "url": "/images/status/edit-shadow.png", "name": "edit-shadow" }, { "url": "/images/status/edit-signiture.png", "name": "edit-signiture" }, { "url": "/images/status/edit-size-down.png", "name": "edit-size-down" }, { "url": "/images/status/edit-size-up.png", "name": "edit-size-up" }, { "url": "/images/status/edit-size.png", "name": "edit-size" }, { "url": "/images/status/edit-small-caps.png", "name": "edit-small-caps" }, { "url": "/images/status/edit-space.png", "name": "edit-space" }, { "url": "/images/status/edit-strike-double.png", "name": "edit-strike-double" }, { "url": "/images/status/edit-strike.png", "name": "edit-strike" }, { "url": "/images/status/edit-subscript.png", "name": "edit-subscript" }, { "url": "/images/status/edit-superscript.png", "name": "edit-superscript" }, { "url": "/images/status/edit-symbol.png", "name": "edit-symbol" }, { "url": "/images/status/edit-underline-double.png", "name": "edit-underline-double" }, { "url": "/images/status/edit-underline.png", "name": "edit-underline" }, { "url": "/images/status/edit-uppercase.png", "name": "edit-uppercase" }, { "url": "/images/status/edit-vertical-alignment-middle.png", "name": "edit-vertical-alignment-middle" }, { "url": "/images/status/edit-vertical-alignment-top.png", "name": "edit-vertical-alignment-top" }, { "url": "/images/status/edit-vertical-alignment.png", "name": "edit-vertical-alignment" }, { "url": "/images/status/edit-writing-mode-tbrl.png", "name": "edit-writing-mode-tbrl" }, { "url": "/images/status/edit-writing-mode.png", "name": "edit-writing-mode" }, { "url": "/images/status/edit.png", "name": "edit" }, { "url": "/images/status/envelope--arrow.png", "name": "envelope--arrow" }, { "url": "/images/status/envelope--exclamation.png", "name": "envelope--exclamation" }, { "url": "/images/status/envelope--minus.png", "name": "envelope--minus" }, { "url": "/images/status/envelope--pencil.png", "name": "envelope--pencil" }, { "url": "/images/status/envelope--plus.png", "name": "envelope--plus" }, { "url": "/images/status/envelope-label.png", "name": "envelope-label" }, { "url": "/images/status/envelope.png", "name": "envelope" }, { "url": "/images/status/equalizer--arrow.png", "name": "equalizer--arrow" }, { "url": "/images/status/equalizer--exclamation.png", "name": "equalizer--exclamation" }, { "url": "/images/status/equalizer--minus.png", "name": "equalizer--minus" }, { "url": "/images/status/equalizer--pencil.png", "name": "equalizer--pencil" }, { "url": "/images/status/equalizer--plus.png", "name": "equalizer--plus" }, { "url": "/images/status/equalizer-flat.png", "name": "equalizer-flat" }, { "url": "/images/status/equalizer-high.png", "name": "equalizer-high" }, { "url": "/images/status/equalizer-low.png", "name": "equalizer-low" }, { "url": "/images/status/equalizer.png", "name": "equalizer" }, { "url": "/images/status/eraser--arrow.png", "name": "eraser--arrow" }, { "url": "/images/status/eraser--exclamation.png", "name": "eraser--exclamation" }, { "url": "/images/status/eraser--minus.png", "name": "eraser--minus" }, { "url": "/images/status/eraser--pencil.png", "name": "eraser--pencil" }, { "url": "/images/status/eraser--plus.png", "name": "eraser--plus" }, { "url": "/images/status/eraser-small.png", "name": "eraser-small" }, { "url": "/images/status/eraser.png", "name": "eraser" }, { "url": "/images/status/exclamation--frame.png", "name": "exclamation--frame" }, { "url": "/images/status/exclamation-button.png", "name": "exclamation-button" }, { "url": "/images/status/exclamation-diamond-frame.png", "name": "exclamation-diamond-frame" }, { "url": "/images/status/exclamation-diamond.png", "name": "exclamation-diamond" }, { "url": "/images/status/exclamation-octagon-frame.png", "name": "exclamation-octagon-frame" }, { "url": "/images/status/exclamation-octagon.png", "name": "exclamation-octagon" }, { "url": "/images/status/exclamation-red-frame.png", "name": "exclamation-red-frame" }, { "url": "/images/status/exclamation-red.png", "name": "exclamation-red" }, { "url": "/images/status/exclamation-shield-frame.png", "name": "exclamation-shield-frame" }, { "url": "/images/status/exclamation-shield.png", "name": "exclamation-shield" }, { "url": "/images/status/exclamation-small-red.png", "name": "exclamation-small-red" }, { "url": "/images/status/exclamation-small-white.png", "name": "exclamation-small-white" }, { "url": "/images/status/exclamation-small.png", "name": "exclamation-small" }, { "url": "/images/status/exclamation-white.png", "name": "exclamation-white" }, { "url": "/images/status/exclamation.png", "name": "exclamation" }, { "url": "/images/status/external-small.png", "name": "external-small" }, { "url": "/images/status/external.png", "name": "external" }, { "url": "/images/status/eye--arrow.png", "name": "eye--arrow" }, { "url": "/images/status/eye--exclamation.png", "name": "eye--exclamation" }, { "url": "/images/status/eye--minus.png", "name": "eye--minus" }, { "url": "/images/status/eye--pencil.png", "name": "eye--pencil" }, { "url": "/images/status/eye--plus.png", "name": "eye--plus" }, { "url": "/images/status/eye-close.png", "name": "eye-close" }, { "url": "/images/status/eye-half.png", "name": "eye-half" }, { "url": "/images/status/eye-red.png", "name": "eye-red" }, { "url": "/images/status/eye.png", "name": "eye" }, { "url": "/images/status/feed--arrow.png", "name": "feed--arrow" }, { "url": "/images/status/feed--exclamation.png", "name": "feed--exclamation" }, { "url": "/images/status/feed--minus.png", "name": "feed--minus" }, { "url": "/images/status/feed--pencil.png", "name": "feed--pencil" }, { "url": "/images/status/feed--plus.png", "name": "feed--plus" }, { "url": "/images/status/feed-balloon.png", "name": "feed-balloon" }, { "url": "/images/status/feed-document.png", "name": "feed-document" }, { "url": "/images/status/feed-small.png", "name": "feed-small" }, { "url": "/images/status/feed.png", "name": "feed" }, { "url": "/images/status/fill-090.png", "name": "fill-090" }, { "url": "/images/status/fill-180.png", "name": "fill-180" }, { "url": "/images/status/fill-270.png", "name": "fill-270" }, { "url": "/images/status/fill.png", "name": "fill" }, { "url": "/images/status/film--arrow.png", "name": "film--arrow" }, { "url": "/images/status/film--exclamation.png", "name": "film--exclamation" }, { "url": "/images/status/film--minus.png", "name": "film--minus" }, { "url": "/images/status/film--pencil.png", "name": "film--pencil" }, { "url": "/images/status/film--plus.png", "name": "film--plus" }, { "url": "/images/status/film-cast.png", "name": "film-cast" }, { "url": "/images/status/film-small.png", "name": "film-small" }, { "url": "/images/status/film.png", "name": "film" }, { "url": "/images/status/films.png", "name": "films" }, { "url": "/images/status/fingerprint-recognition.png", "name": "fingerprint-recognition" }, { "url": "/images/status/fingerprint.png", "name": "fingerprint" }, { "url": "/images/status/fire--arrow.png", "name": "fire--arrow" }, { "url": "/images/status/fire--exclamation.png", "name": "fire--exclamation" }, { "url": "/images/status/fire--minus.png", "name": "fire--minus" }, { "url": "/images/status/fire--pencil.png", "name": "fire--pencil" }, { "url": "/images/status/fire--plus.png", "name": "fire--plus" }, { "url": "/images/status/fire-big.png", "name": "fire-big" }, { "url": "/images/status/fire-small.png", "name": "fire-small" }, { "url": "/images/status/fire.png", "name": "fire" }, { "url": "/images/status/flag--arrow.png", "name": "flag--arrow" }, { "url": "/images/status/flag--exclamation.png", "name": "flag--exclamation" }, { "url": "/images/status/flag--minus.png", "name": "flag--minus" }, { "url": "/images/status/flag--pencil.png", "name": "flag--pencil" }, { "url": "/images/status/flag--plus.png", "name": "flag--plus" }, { "url": "/images/status/flag-small.png", "name": "flag-small" }, { "url": "/images/status/flag.png", "name": "flag" }, { "url": "/images/status/flashlight--arrow.png", "name": "flashlight--arrow" }, { "url": "/images/status/flashlight--exclamation.png", "name": "flashlight--exclamation" }, { "url": "/images/status/flashlight--minus.png", "name": "flashlight--minus" }, { "url": "/images/status/flashlight--pencil.png", "name": "flashlight--pencil" }, { "url": "/images/status/flashlight--plus.png", "name": "flashlight--plus" }, { "url": "/images/status/flashlight-shine.png", "name": "flashlight-shine" }, { "url": "/images/status/flashlight.png", "name": "flashlight" }, { "url": "/images/status/flask--arrow.png", "name": "flask--arrow" }, { "url": "/images/status/flask--exclamation.png", "name": "flask--exclamation" }, { "url": "/images/status/flask--minus.png", "name": "flask--minus" }, { "url": "/images/status/flask--pencil.png", "name": "flask--pencil" }, { "url": "/images/status/flask--plus.png", "name": "flask--plus" }, { "url": "/images/status/flask-empty.png", "name": "flask-empty" }, { "url": "/images/status/flask.png", "name": "flask" }, { "url": "/images/status/foaf.png", "name": "foaf" }, { "url": "/images/status/folder--arrow.png", "name": "folder--arrow" }, { "url": "/images/status/folder--exclamation.png", "name": "folder--exclamation" }, { "url": "/images/status/folder--minus.png", "name": "folder--minus" }, { "url": "/images/status/folder--pencil.png", "name": "folder--pencil" }, { "url": "/images/status/folder--plus.png", "name": "folder--plus" }, { "url": "/images/status/folder-bookmark.png", "name": "folder-bookmark" }, { "url": "/images/status/folder-export.png", "name": "folder-export" }, { "url": "/images/status/folder-horizontal-open.png", "name": "folder-horizontal-open" }, { "url": "/images/status/folder-horizontal.png", "name": "folder-horizontal" }, { "url": "/images/status/folder-import.png", "name": "folder-import" }, { "url": "/images/status/folder-network.png", "name": "folder-network" }, { "url": "/images/status/folder-open-document-music-playlist.png", "name": "folder-open-document-music-playlist" }, { "url": "/images/status/folder-open-document-music.png", "name": "folder-open-document-music" }, { "url": "/images/status/folder-open-document-text.png", "name": "folder-open-document-text" }, { "url": "/images/status/folder-open-document.png", "name": "folder-open-document" }, { "url": "/images/status/folder-open-film.png", "name": "folder-open-film" }, { "url": "/images/status/folder-open-image.png", "name": "folder-open-image" }, { "url": "/images/status/folder-open-slide.png", "name": "folder-open-slide" }, { "url": "/images/status/folder-open-table.png", "name": "folder-open-table" }, { "url": "/images/status/folder-open.png", "name": "folder-open" }, { "url": "/images/status/folder-rename.png", "name": "folder-rename" }, { "url": "/images/status/folder-search-result.png", "name": "folder-search-result" }, { "url": "/images/status/folder-share.png", "name": "folder-share" }, { "url": "/images/status/folder-shred.png", "name": "folder-shred" }, { "url": "/images/status/folder-small-horizontal.png", "name": "folder-small-horizontal" }, { "url": "/images/status/folder-small.png", "name": "folder-small" }, { "url": "/images/status/folder-stamp.png", "name": "folder-stamp" }, { "url": "/images/status/folder-stand.png", "name": "folder-stand" }, { "url": "/images/status/folder-zipper.png", "name": "folder-zipper" }, { "url": "/images/status/folder.png", "name": "folder" }, { "url": "/images/status/folders-stack.png", "name": "folders-stack" }, { "url": "/images/status/folders.png", "name": "folders" }, { "url": "/images/status/fruit-orange.png", "name": "fruit-orange" }, { "url": "/images/status/fruit.png", "name": "fruit" }, { "url": "/images/status/function.png", "name": "function" }, { "url": "/images/status/funnel--arrow.png", "name": "funnel--arrow" }, { "url": "/images/status/funnel--exclamation.png", "name": "funnel--exclamation" }, { "url": "/images/status/funnel--minus.png", "name": "funnel--minus" }, { "url": "/images/status/funnel--pencil.png", "name": "funnel--pencil" }, { "url": "/images/status/funnel--plus.png", "name": "funnel--plus" }, { "url": "/images/status/funnel-small.png", "name": "funnel-small" }, { "url": "/images/status/funnel.png", "name": "funnel" }, { "url": "/images/status/game-monitor.png", "name": "game-monitor" }, { "url": "/images/status/game.png", "name": "game" }, { "url": "/images/status/gear--arrow.png", "name": "gear--arrow" }, { "url": "/images/status/gear--exclamation.png", "name": "gear--exclamation" }, { "url": "/images/status/gear--minus.png", "name": "gear--minus" }, { "url": "/images/status/gear--pencil.png", "name": "gear--pencil" }, { "url": "/images/status/gear--plus.png", "name": "gear--plus" }, { "url": "/images/status/gear-small.png", "name": "gear-small" }, { "url": "/images/status/gear.png", "name": "gear" }, { "url": "/images/status/gender-female.png", "name": "gender-female" }, { "url": "/images/status/gender.png", "name": "gender" }, { "url": "/images/status/geotag-balloon.png", "name": "geotag-balloon" }, { "url": "/images/status/geotag-document.png", "name": "geotag-document" }, { "url": "/images/status/geotag-small.png", "name": "geotag-small" }, { "url": "/images/status/geotag.png", "name": "geotag" }, { "url": "/images/status/ghost-small.png", "name": "ghost-small" }, { "url": "/images/status/ghost.png", "name": "ghost" }, { "url": "/images/status/glass--arrow.png", "name": "glass--arrow" }, { "url": "/images/status/glass--exclamation.png", "name": "glass--exclamation" }, { "url": "/images/status/glass--minus.png", "name": "glass--minus" }, { "url": "/images/status/glass--pencil.png", "name": "glass--pencil" }, { "url": "/images/status/glass--plus.png", "name": "glass--plus" }, { "url": "/images/status/glass-empty.png", "name": "glass-empty" }, { "url": "/images/status/glass.png", "name": "glass" }, { "url": "/images/status/globe--arrow.png", "name": "globe--arrow" }, { "url": "/images/status/globe--exclamation.png", "name": "globe--exclamation" }, { "url": "/images/status/globe--minus.png", "name": "globe--minus" }, { "url": "/images/status/globe--pencil.png", "name": "globe--pencil" }, { "url": "/images/status/globe--plus.png", "name": "globe--plus" }, { "url": "/images/status/globe-green.png", "name": "globe-green" }, { "url": "/images/status/globe-medium-green.png", "name": "globe-medium-green" }, { "url": "/images/status/globe-medium.png", "name": "globe-medium" }, { "url": "/images/status/globe-model.png", "name": "globe-model" }, { "url": "/images/status/globe-network.png", "name": "globe-network" }, { "url": "/images/status/globe-place.png", "name": "globe-place" }, { "url": "/images/status/globe-small-green.png", "name": "globe-small-green" }, { "url": "/images/status/globe-small.png", "name": "globe-small" }, { "url": "/images/status/globe.png", "name": "globe" }, { "url": "/images/status/gradient-small.png", "name": "gradient-small" }, { "url": "/images/status/gradient.png", "name": "gradient" }, { "url": "/images/status/grid-dot.png", "name": "grid-dot" }, { "url": "/images/status/grid-small-dot.png", "name": "grid-small-dot" }, { "url": "/images/status/grid-small.png", "name": "grid-small" }, { "url": "/images/status/grid-snap-dot.png", "name": "grid-snap-dot" }, { "url": "/images/status/grid-snap.png", "name": "grid-snap" }, { "url": "/images/status/grid.png", "name": "grid" }, { "url": "/images/status/guide-snap.png", "name": "guide-snap" }, { "url": "/images/status/guide.png", "name": "guide" }, { "url": "/images/status/guitar--arrow.png", "name": "guitar--arrow" }, { "url": "/images/status/guitar--exclamation.png", "name": "guitar--exclamation" }, { "url": "/images/status/guitar--minus.png", "name": "guitar--minus" }, { "url": "/images/status/guitar--pencil.png", "name": "guitar--pencil" }, { "url": "/images/status/guitar--plus.png", "name": "guitar--plus" }, { "url": "/images/status/guitar.png", "name": "guitar" }, { "url": "/images/status/hammer--arrow.png", "name": "hammer--arrow" }, { "url": "/images/status/hammer--exclamation.png", "name": "hammer--exclamation" }, { "url": "/images/status/hammer--minus.png", "name": "hammer--minus" }, { "url": "/images/status/hammer--pencil.png", "name": "hammer--pencil" }, { "url": "/images/status/hammer--plus.png", "name": "hammer--plus" }, { "url": "/images/status/hammer-left.png", "name": "hammer-left" }, { "url": "/images/status/hammer-screwdriver.png", "name": "hammer-screwdriver" }, { "url": "/images/status/hammer.png", "name": "hammer" }, { "url": "/images/status/hand-point-090.png", "name": "hand-point-090" }, { "url": "/images/status/hand-point-180.png", "name": "hand-point-180" }, { "url": "/images/status/hand-point-270.png", "name": "hand-point-270" }, { "url": "/images/status/hand-point.png", "name": "hand-point" }, { "url": "/images/status/hand-property.png", "name": "hand-property" }, { "url": "/images/status/hand-share.png", "name": "hand-share" }, { "url": "/images/status/hand.png", "name": "hand" }, { "url": "/images/status/hard-hat--arrow.png", "name": "hard-hat--arrow" }, { "url": "/images/status/hard-hat--exclamation.png", "name": "hard-hat--exclamation" }, { "url": "/images/status/hard-hat--minus.png", "name": "hard-hat--minus" }, { "url": "/images/status/hard-hat--pencil.png", "name": "hard-hat--pencil" }, { "url": "/images/status/hard-hat--plus.png", "name": "hard-hat--plus" }, { "url": "/images/status/hard-hat-military.png", "name": "hard-hat-military" }, { "url": "/images/status/hard-hat-mine.png", "name": "hard-hat-mine" }, { "url": "/images/status/hard-hat.png", "name": "hard-hat" }, { "url": "/images/status/headphone--arrow.png", "name": "headphone--arrow" }, { "url": "/images/status/headphone--exclamation.png", "name": "headphone--exclamation" }, { "url": "/images/status/headphone--minus.png", "name": "headphone--minus" }, { "url": "/images/status/headphone--pencil.png", "name": "headphone--pencil" }, { "url": "/images/status/headphone--plus.png", "name": "headphone--plus" }, { "url": "/images/status/headphone-microphone.png", "name": "headphone-microphone" }, { "url": "/images/status/headphone.png", "name": "headphone" }, { "url": "/images/status/heart--arrow.png", "name": "heart--arrow" }, { "url": "/images/status/heart--exclamation.png", "name": "heart--exclamation" }, { "url": "/images/status/heart--minus.png", "name": "heart--minus" }, { "url": "/images/status/heart--pencil.png", "name": "heart--pencil" }, { "url": "/images/status/heart--plus.png", "name": "heart--plus" }, { "url": "/images/status/heart-break.png", "name": "heart-break" }, { "url": "/images/status/heart-empty.png", "name": "heart-empty" }, { "url": "/images/status/heart-half.png", "name": "heart-half" }, { "url": "/images/status/heart-small-empty.png", "name": "heart-small-empty" }, { "url": "/images/status/heart-small-half.png", "name": "heart-small-half" }, { "url": "/images/status/heart-small.png", "name": "heart-small" }, { "url": "/images/status/heart.png", "name": "heart" }, { "url": "/images/status/highlighter--arrow.png", "name": "highlighter--arrow" }, { "url": "/images/status/highlighter--exclamation.png", "name": "highlighter--exclamation" }, { "url": "/images/status/highlighter--minus.png", "name": "highlighter--minus" }, { "url": "/images/status/highlighter--plus.png", "name": "highlighter--plus" }, { "url": "/images/status/highlighter-color.png", "name": "highlighter-color" }, { "url": "/images/status/highlighter-small.png", "name": "highlighter-small" }, { "url": "/images/status/highlighter-text.png", "name": "highlighter-text" }, { "url": "/images/status/highlighter.png", "name": "highlighter" }, { "url": "/images/status/home--arrow.png", "name": "home--arrow" }, { "url": "/images/status/home--exclamation.png", "name": "home--exclamation" }, { "url": "/images/status/home--minus.png", "name": "home--minus" }, { "url": "/images/status/home--pencil.png", "name": "home--pencil" }, { "url": "/images/status/home--plus.png", "name": "home--plus" }, { "url": "/images/status/home-network.png", "name": "home-network" }, { "url": "/images/status/home-small.png", "name": "home-small" }, { "url": "/images/status/home.png", "name": "home" }, { "url": "/images/status/hourglass--arrow.png", "name": "hourglass--arrow" }, { "url": "/images/status/hourglass--exclamation.png", "name": "hourglass--exclamation" }, { "url": "/images/status/hourglass--minus.png", "name": "hourglass--minus" }, { "url": "/images/status/hourglass--pencil.png", "name": "hourglass--pencil" }, { "url": "/images/status/hourglass--plus.png", "name": "hourglass--plus" }, { "url": "/images/status/hourglass-select-remain.png", "name": "hourglass-select-remain" }, { "url": "/images/status/hourglass-select.png", "name": "hourglass-select" }, { "url": "/images/status/hourglass.png", "name": "hourglass" }, { "url": "/images/status/ice--arrow.png", "name": "ice--arrow" }, { "url": "/images/status/ice--exclamation.png", "name": "ice--exclamation" }, { "url": "/images/status/ice--minus.png", "name": "ice--minus" }, { "url": "/images/status/ice--pencil.png", "name": "ice--pencil" }, { "url": "/images/status/ice--plus.png", "name": "ice--plus" }, { "url": "/images/status/ice.png", "name": "ice" }, { "url": "/images/status/image--arrow.png", "name": "image--arrow" }, { "url": "/images/status/image--exclamation.png", "name": "image--exclamation" }, { "url": "/images/status/image--minus.png", "name": "image--minus" }, { "url": "/images/status/image--pencil.png", "name": "image--pencil" }, { "url": "/images/status/image--plus.png", "name": "image--plus" }, { "url": "/images/status/image-balloon.png", "name": "image-balloon" }, { "url": "/images/status/image-blur.png", "name": "image-blur" }, { "url": "/images/status/image-cast.png", "name": "image-cast" }, { "url": "/images/status/image-crop.png", "name": "image-crop" }, { "url": "/images/status/image-empty.png", "name": "image-empty" }, { "url": "/images/status/image-export.png", "name": "image-export" }, { "url": "/images/status/image-import.png", "name": "image-import" }, { "url": "/images/status/image-reflection.png", "name": "image-reflection" }, { "url": "/images/status/image-resize-actual.png", "name": "image-resize-actual" }, { "url": "/images/status/image-resize.png", "name": "image-resize" }, { "url": "/images/status/image-select.png", "name": "image-select" }, { "url": "/images/status/image-sharpen.png", "name": "image-sharpen" }, { "url": "/images/status/image-small-sunset.png", "name": "image-small-sunset" }, { "url": "/images/status/image-small.png", "name": "image-small" }, { "url": "/images/status/image-sunset.png", "name": "image-sunset" }, { "url": "/images/status/image-vertical-sunset.png", "name": "image-vertical-sunset" }, { "url": "/images/status/image-vertical.png", "name": "image-vertical" }, { "url": "/images/status/image.png", "name": "image" }, { "url": "/images/status/images-flickr.png", "name": "images-flickr" }, { "url": "/images/status/images-stack.png", "name": "images-stack" }, { "url": "/images/status/images.png", "name": "images" }, { "url": "/images/status/inbox--arrow.png", "name": "inbox--arrow" }, { "url": "/images/status/inbox--exclamation.png", "name": "inbox--exclamation" }, { "url": "/images/status/inbox--minus.png", "name": "inbox--minus" }, { "url": "/images/status/inbox--pencil.png", "name": "inbox--pencil" }, { "url": "/images/status/inbox--plus.png", "name": "inbox--plus" }, { "url": "/images/status/inbox-document-music-playlist.png", "name": "inbox-document-music-playlist" }, { "url": "/images/status/inbox-document-music.png", "name": "inbox-document-music" }, { "url": "/images/status/inbox-document-text.png", "name": "inbox-document-text" }, { "url": "/images/status/inbox-document.png", "name": "inbox-document" }, { "url": "/images/status/inbox-film.png", "name": "inbox-film" }, { "url": "/images/status/inbox-image.png", "name": "inbox-image" }, { "url": "/images/status/inbox-slide.png", "name": "inbox-slide" }, { "url": "/images/status/inbox-table.png", "name": "inbox-table" }, { "url": "/images/status/inbox.png", "name": "inbox" }, { "url": "/images/status/infocard-small.png", "name": "infocard-small" }, { "url": "/images/status/infocard.png", "name": "infocard" }, { "url": "/images/status/information-balloon.png", "name": "information-balloon" }, { "url": "/images/status/information-button.png", "name": "information-button" }, { "url": "/images/status/information-frame.png", "name": "information-frame" }, { "url": "/images/status/information-octagon-frame.png", "name": "information-octagon-frame" }, { "url": "/images/status/information-octagon.png", "name": "information-octagon" }, { "url": "/images/status/information-shield.png", "name": "information-shield" }, { "url": "/images/status/information-small-white.png", "name": "information-small-white" }, { "url": "/images/status/information-small.png", "name": "information-small" }, { "url": "/images/status/information-white.png", "name": "information-white" }, { "url": "/images/status/information.png", "name": "information" }, { "url": "/images/status/jar--arrow.png", "name": "jar--arrow" }, { "url": "/images/status/jar--exclamation.png", "name": "jar--exclamation" }, { "url": "/images/status/jar--minus.png", "name": "jar--minus" }, { "url": "/images/status/jar--pencil.png", "name": "jar--pencil" }, { "url": "/images/status/jar--plus.png", "name": "jar--plus" }, { "url": "/images/status/jar-empty.png", "name": "jar-empty" }, { "url": "/images/status/jar-label.png", "name": "jar-label" }, { "url": "/images/status/jar-open.png", "name": "jar-open" }, { "url": "/images/status/jar.png", "name": "jar" }, { "url": "/images/status/json.png", "name": "json" }, { "url": "/images/status/key--arrow.png", "name": "key--arrow" }, { "url": "/images/status/key--exclamation.png", "name": "key--exclamation" }, { "url": "/images/status/key--minus.png", "name": "key--minus" }, { "url": "/images/status/key--pencil.png", "name": "key--pencil" }, { "url": "/images/status/key--plus.png", "name": "key--plus" }, { "url": "/images/status/key-solid.png", "name": "key-solid" }, { "url": "/images/status/key.png", "name": "key" }, { "url": "/images/status/keyboard--arrow.png", "name": "keyboard--arrow" }, { "url": "/images/status/keyboard--exclamation.png", "name": "keyboard--exclamation" }, { "url": "/images/status/keyboard--minus.png", "name": "keyboard--minus" }, { "url": "/images/status/keyboard--pencil.png", "name": "keyboard--pencil" }, { "url": "/images/status/keyboard--plus.png", "name": "keyboard--plus" }, { "url": "/images/status/keyboard-space.png", "name": "keyboard-space" }, { "url": "/images/status/keyboard.png", "name": "keyboard" }, { "url": "/images/status/language-balloon.png", "name": "language-balloon" }, { "url": "/images/status/language-document.png", "name": "language-document" }, { "url": "/images/status/language-small.png", "name": "language-small" }, { "url": "/images/status/language.png", "name": "language" }, { "url": "/images/status/layer--arrow.png", "name": "layer--arrow" }, { "url": "/images/status/layer--exclamation.png", "name": "layer--exclamation" }, { "url": "/images/status/layer--minus.png", "name": "layer--minus" }, { "url": "/images/status/layer--pencil.png", "name": "layer--pencil" }, { "url": "/images/status/layer--plus.png", "name": "layer--plus" }, { "url": "/images/status/layer-flip-vertical.png", "name": "layer-flip-vertical" }, { "url": "/images/status/layer-flip.png", "name": "layer-flip" }, { "url": "/images/status/layer-mask.png", "name": "layer-mask" }, { "url": "/images/status/layer-resize-actual.png", "name": "layer-resize-actual" }, { "url": "/images/status/layer-resize-replicate-vertical.png", "name": "layer-resize-replicate-vertical" }, { "url": "/images/status/layer-resize-replicate.png", "name": "layer-resize-replicate" }, { "url": "/images/status/layer-resize.png", "name": "layer-resize" }, { "url": "/images/status/layer-rotate-left.png", "name": "layer-rotate-left" }, { "url": "/images/status/layer-rotate.png", "name": "layer-rotate" }, { "url": "/images/status/layer-select-point.png", "name": "layer-select-point" }, { "url": "/images/status/layer-select.png", "name": "layer-select" }, { "url": "/images/status/layer-shade.png", "name": "layer-shade" }, { "url": "/images/status/layer-shape-curve.png", "name": "layer-shape-curve" }, { "url": "/images/status/layer-shape-ellipse.png", "name": "layer-shape-ellipse" }, { "url": "/images/status/layer-shape-line.png", "name": "layer-shape-line" }, { "url": "/images/status/layer-shape-polygon.png", "name": "layer-shape-polygon" }, { "url": "/images/status/layer-shape-polyline.png", "name": "layer-shape-polyline" }, { "url": "/images/status/layer-shape-round.png", "name": "layer-shape-round" }, { "url": "/images/status/layer-shape-text.png", "name": "layer-shape-text" }, { "url": "/images/status/layer-shape.png", "name": "layer-shape" }, { "url": "/images/status/layer-shred.png", "name": "layer-shred" }, { "url": "/images/status/layer-small.png", "name": "layer-small" }, { "url": "/images/status/layer-transparent.png", "name": "layer-transparent" }, { "url": "/images/status/layer-vector.png", "name": "layer-vector" }, { "url": "/images/status/layer.png", "name": "layer" }, { "url": "/images/status/layers-alignment-bottom.png", "name": "layers-alignment-bottom" }, { "url": "/images/status/layers-alignment-center.png", "name": "layers-alignment-center" }, { "url": "/images/status/layers-alignment-left.png", "name": "layers-alignment-left" }, { "url": "/images/status/layers-alignment-middle.png", "name": "layers-alignment-middle" }, { "url": "/images/status/layers-alignment-right.png", "name": "layers-alignment-right" }, { "url": "/images/status/layers-alignment.png", "name": "layers-alignment" }, { "url": "/images/status/layers-arrange-back.png", "name": "layers-arrange-back" }, { "url": "/images/status/layers-arrange.png", "name": "layers-arrange" }, { "url": "/images/status/layers-group.png", "name": "layers-group" }, { "url": "/images/status/layers-small.png", "name": "layers-small" }, { "url": "/images/status/layers-stack-arrange-back.png", "name": "layers-stack-arrange-back" }, { "url": "/images/status/layers-stack-arrange.png", "name": "layers-stack-arrange" }, { "url": "/images/status/layers-stack.png", "name": "layers-stack" }, { "url": "/images/status/layers-ungroup.png", "name": "layers-ungroup" }, { "url": "/images/status/layers.png", "name": "layers" }, { "url": "/images/status/layout-2-equal.png", "name": "layout-2-equal" }, { "url": "/images/status/layout-2.png", "name": "layout-2" }, { "url": "/images/status/layout-3-mix.png", "name": "layout-3-mix" }, { "url": "/images/status/layout-3.png", "name": "layout-3" }, { "url": "/images/status/layout-design.png", "name": "layout-design" }, { "url": "/images/status/layout-header-2-equal.png", "name": "layout-header-2-equal" }, { "url": "/images/status/layout-header-2.png", "name": "layout-header-2" }, { "url": "/images/status/layout-header-3-mix.png", "name": "layout-header-3-mix" }, { "url": "/images/status/layout-header-3.png", "name": "layout-header-3" }, { "url": "/images/status/layout-header.png", "name": "layout-header" }, { "url": "/images/status/layout-hf-2-equal.png", "name": "layout-hf-2-equal" }, { "url": "/images/status/layout-hf-2.png", "name": "layout-hf-2" }, { "url": "/images/status/layout-hf-3-mix.png", "name": "layout-hf-3-mix" }, { "url": "/images/status/layout-hf-3.png", "name": "layout-hf-3" }, { "url": "/images/status/layout-hf.png", "name": "layout-hf" }, { "url": "/images/status/layout-join-vertical.png", "name": "layout-join-vertical" }, { "url": "/images/status/layout-join.png", "name": "layout-join" }, { "url": "/images/status/layout-select-content.png", "name": "layout-select-content" }, { "url": "/images/status/layout-select-footer.png", "name": "layout-select-footer" }, { "url": "/images/status/layout-select-sidebar.png", "name": "layout-select-sidebar" }, { "url": "/images/status/layout-select.png", "name": "layout-select" }, { "url": "/images/status/layout-split-vertical.png", "name": "layout-split-vertical" }, { "url": "/images/status/layout-split.png", "name": "layout-split" }, { "url": "/images/status/layout.png", "name": "layout" }, { "url": "/images/status/leaf--arrow.png", "name": "leaf--arrow" }, { "url": "/images/status/leaf--exclamation.png", "name": "leaf--exclamation" }, { "url": "/images/status/leaf--minus.png", "name": "leaf--minus" }, { "url": "/images/status/leaf--pencil.png", "name": "leaf--pencil" }, { "url": "/images/status/leaf--plus.png", "name": "leaf--plus" }, { "url": "/images/status/leaf-wormhole.png", "name": "leaf-wormhole" }, { "url": "/images/status/leaf.png", "name": "leaf" }, { "url": "/images/status/license-key.png", "name": "license-key" }, { "url": "/images/status/lifebuoy--arrow.png", "name": "lifebuoy--arrow" }, { "url": "/images/status/lifebuoy--exclamation.png", "name": "lifebuoy--exclamation" }, { "url": "/images/status/lifebuoy--minus.png", "name": "lifebuoy--minus" }, { "url": "/images/status/lifebuoy--pencil.png", "name": "lifebuoy--pencil" }, { "url": "/images/status/lifebuoy--plus.png", "name": "lifebuoy--plus" }, { "url": "/images/status/lifebuoy.png", "name": "lifebuoy" }, { "url": "/images/status/light-bulb--arrow.png", "name": "light-bulb--arrow" }, { "url": "/images/status/light-bulb--exclamation.png", "name": "light-bulb--exclamation" }, { "url": "/images/status/light-bulb--minus.png", "name": "light-bulb--minus" }, { "url": "/images/status/light-bulb--pencil.png", "name": "light-bulb--pencil" }, { "url": "/images/status/light-bulb--plus.png", "name": "light-bulb--plus" }, { "url": "/images/status/light-bulb-code.png", "name": "light-bulb-code" }, { "url": "/images/status/light-bulb-off.png", "name": "light-bulb-off" }, { "url": "/images/status/light-bulb-small-off.png", "name": "light-bulb-small-off" }, { "url": "/images/status/light-bulb-small.png", "name": "light-bulb-small" }, { "url": "/images/status/light-bulb.png", "name": "light-bulb" }, { "url": "/images/status/lightning--arrow.png", "name": "lightning--arrow" }, { "url": "/images/status/lightning--exclamation.png", "name": "lightning--exclamation" }, { "url": "/images/status/lightning--minus.png", "name": "lightning--minus" }, { "url": "/images/status/lightning--pencil.png", "name": "lightning--pencil" }, { "url": "/images/status/lightning--plus.png", "name": "lightning--plus" }, { "url": "/images/status/lightning-small.png", "name": "lightning-small" }, { "url": "/images/status/lightning.png", "name": "lightning" }, { "url": "/images/status/locale.png", "name": "locale" }, { "url": "/images/status/lock--arrow.png", "name": "lock--arrow" }, { "url": "/images/status/lock--exclamation.png", "name": "lock--exclamation" }, { "url": "/images/status/lock--minus.png", "name": "lock--minus" }, { "url": "/images/status/lock--pencil.png", "name": "lock--pencil" }, { "url": "/images/status/lock--plus.png", "name": "lock--plus" }, { "url": "/images/status/lock-small.png", "name": "lock-small" }, { "url": "/images/status/lock-unlock.png", "name": "lock-unlock" }, { "url": "/images/status/lock.png", "name": "lock" }, { "url": "/images/status/luggage--arrow.png", "name": "luggage--arrow" }, { "url": "/images/status/luggage--exclamation.png", "name": "luggage--exclamation" }, { "url": "/images/status/luggage--minus.png", "name": "luggage--minus" }, { "url": "/images/status/luggage--pencil.png", "name": "luggage--pencil" }, { "url": "/images/status/luggage--plus.png", "name": "luggage--plus" }, { "url": "/images/status/luggage-tag.png", "name": "luggage-tag" }, { "url": "/images/status/luggage.png", "name": "luggage" }, { "url": "/images/status/magnet--arrow.png", "name": "magnet--arrow" }, { "url": "/images/status/magnet--exclamation.png", "name": "magnet--exclamation" }, { "url": "/images/status/magnet--minus.png", "name": "magnet--minus" }, { "url": "/images/status/magnet--pencil.png", "name": "magnet--pencil" }, { "url": "/images/status/magnet--plus.png", "name": "magnet--plus" }, { "url": "/images/status/magnet-blue.png", "name": "magnet-blue" }, { "url": "/images/status/magnet-small.png", "name": "magnet-small" }, { "url": "/images/status/magnet.png", "name": "magnet" }, { "url": "/images/status/magnifier--arrow.png", "name": "magnifier--arrow" }, { "url": "/images/status/magnifier--exclamation.png", "name": "magnifier--exclamation" }, { "url": "/images/status/magnifier--minus.png", "name": "magnifier--minus" }, { "url": "/images/status/magnifier--pencil.png", "name": "magnifier--pencil" }, { "url": "/images/status/magnifier--plus.png", "name": "magnifier--plus" }, { "url": "/images/status/magnifier-history-left.png", "name": "magnifier-history-left" }, { "url": "/images/status/magnifier-history.png", "name": "magnifier-history" }, { "url": "/images/status/magnifier-left.png", "name": "magnifier-left" }, { "url": "/images/status/magnifier-medium-left.png", "name": "magnifier-medium-left" }, { "url": "/images/status/magnifier-medium.png", "name": "magnifier-medium" }, { "url": "/images/status/magnifier-small.png", "name": "magnifier-small" }, { "url": "/images/status/magnifier-zoom-actual-equal.png", "name": "magnifier-zoom-actual-equal" }, { "url": "/images/status/magnifier-zoom-actual.png", "name": "magnifier-zoom-actual" }, { "url": "/images/status/magnifier-zoom-fit.png", "name": "magnifier-zoom-fit" }, { "url": "/images/status/magnifier-zoom-in.png", "name": "magnifier-zoom-in" }, { "url": "/images/status/magnifier-zoom-out.png", "name": "magnifier-zoom-out" }, { "url": "/images/status/magnifier-zoom.png", "name": "magnifier-zoom" }, { "url": "/images/status/magnifier.png", "name": "magnifier" }, { "url": "/images/status/mahjong--arrow.png", "name": "mahjong--arrow" }, { "url": "/images/status/mahjong--exclamation.png", "name": "mahjong--exclamation" }, { "url": "/images/status/mahjong--minus.png", "name": "mahjong--minus" }, { "url": "/images/status/mahjong--pencil.png", "name": "mahjong--pencil" }, { "url": "/images/status/mahjong--plus.png", "name": "mahjong--plus" }, { "url": "/images/status/mahjong-white.png", "name": "mahjong-white" }, { "url": "/images/status/mahjong.png", "name": "mahjong" }, { "url": "/images/status/mail--arrow.png", "name": "mail--arrow" }, { "url": "/images/status/mail--exclamation.png", "name": "mail--exclamation" }, { "url": "/images/status/mail--minus.png", "name": "mail--minus" }, { "url": "/images/status/mail--pencil.png", "name": "mail--pencil" }, { "url": "/images/status/mail--plus.png", "name": "mail--plus" }, { "url": "/images/status/mail-open-document-music-playlist.png", "name": "mail-open-document-music-playlist" }, { "url": "/images/status/mail-open-document-music.png", "name": "mail-open-document-music" }, { "url": "/images/status/mail-open-document-text.png", "name": "mail-open-document-text" }, { "url": "/images/status/mail-open-document.png", "name": "mail-open-document" }, { "url": "/images/status/mail-open-film.png", "name": "mail-open-film" }, { "url": "/images/status/mail-open-image.png", "name": "mail-open-image" }, { "url": "/images/status/mail-open-table.png", "name": "mail-open-table" }, { "url": "/images/status/mail-open.png", "name": "mail-open" }, { "url": "/images/status/mail-small.png", "name": "mail-small" }, { "url": "/images/status/mail.png", "name": "mail" }, { "url": "/images/status/mails-stack.png", "name": "mails-stack" }, { "url": "/images/status/mails.png", "name": "mails" }, { "url": "/images/status/map--arrow.png", "name": "map--arrow" }, { "url": "/images/status/map--exclamation.png", "name": "map--exclamation" }, { "url": "/images/status/map--minus.png", "name": "map--minus" }, { "url": "/images/status/map--pencil.png", "name": "map--pencil" }, { "url": "/images/status/map--plus.png", "name": "map--plus" }, { "url": "/images/status/map-pin.png", "name": "map-pin" }, { "url": "/images/status/map.png", "name": "map" }, { "url": "/images/status/maps-stack.png", "name": "maps-stack" }, { "url": "/images/status/maps.png", "name": "maps" }, { "url": "/images/status/marker--arrow.png", "name": "marker--arrow" }, { "url": "/images/status/marker--exclamation.png", "name": "marker--exclamation" }, { "url": "/images/status/marker--minus.png", "name": "marker--minus" }, { "url": "/images/status/marker--pencil.png", "name": "marker--pencil" }, { "url": "/images/status/marker--plus.png", "name": "marker--plus" }, { "url": "/images/status/marker.png", "name": "marker" }, { "url": "/images/status/mask.png", "name": "mask" }, { "url": "/images/status/medal--arrow.png", "name": "medal--arrow" }, { "url": "/images/status/medal--exclamation.png", "name": "medal--exclamation" }, { "url": "/images/status/medal--minus.png", "name": "medal--minus" }, { "url": "/images/status/medal--pencil.png", "name": "medal--pencil" }, { "url": "/images/status/medal--plus.png", "name": "medal--plus" }, { "url": "/images/status/medal-bronze-red.png", "name": "medal-bronze-red" }, { "url": "/images/status/medal-bronze.png", "name": "medal-bronze" }, { "url": "/images/status/medal-red.png", "name": "medal-red" }, { "url": "/images/status/medal-silver-red.png", "name": "medal-silver-red" }, { "url": "/images/status/medal-silver.png", "name": "medal-silver" }, { "url": "/images/status/medal.png", "name": "medal" }, { "url": "/images/status/media-player--arrow.png", "name": "media-player--arrow" }, { "url": "/images/status/media-player--exclamation.png", "name": "media-player--exclamation" }, { "url": "/images/status/media-player--minus.png", "name": "media-player--minus" }, { "url": "/images/status/media-player--pencil.png", "name": "media-player--pencil" }, { "url": "/images/status/media-player--plus.png", "name": "media-player--plus" }, { "url": "/images/status/media-player-black.png", "name": "media-player-black" }, { "url": "/images/status/media-player-cast.png", "name": "media-player-cast" }, { "url": "/images/status/media-player-medium-black.png", "name": "media-player-medium-black" }, { "url": "/images/status/media-player-medium-blue.png", "name": "media-player-medium-blue" }, { "url": "/images/status/media-player-medium-green.png", "name": "media-player-medium-green" }, { "url": "/images/status/media-player-medium-orange.png", "name": "media-player-medium-orange" }, { "url": "/images/status/media-player-medium-pink.png", "name": "media-player-medium-pink" }, { "url": "/images/status/media-player-medium-purple.png", "name": "media-player-medium-purple" }, { "url": "/images/status/media-player-medium-red.png", "name": "media-player-medium-red" }, { "url": "/images/status/media-player-medium-yellow.png", "name": "media-player-medium-yellow" }, { "url": "/images/status/media-player-medium.png", "name": "media-player-medium" }, { "url": "/images/status/media-player-phone-horizontal.png", "name": "media-player-phone-horizontal" }, { "url": "/images/status/media-player-phone.png", "name": "media-player-phone" }, { "url": "/images/status/media-player-small-blue.png", "name": "media-player-small-blue" }, { "url": "/images/status/media-player-small-green.png", "name": "media-player-small-green" }, { "url": "/images/status/media-player-small-pink.png", "name": "media-player-small-pink" }, { "url": "/images/status/media-player-small-red.png", "name": "media-player-small-red" }, { "url": "/images/status/media-player-small.png", "name": "media-player-small" }, { "url": "/images/status/media-player-xsmall-black.png", "name": "media-player-xsmall-black" }, { "url": "/images/status/media-player-xsmall-blue.png", "name": "media-player-xsmall-blue" }, { "url": "/images/status/media-player-xsmall-green.png", "name": "media-player-xsmall-green" }, { "url": "/images/status/media-player-xsmall-pink.png", "name": "media-player-xsmall-pink" }, { "url": "/images/status/media-player-xsmall-polish.png", "name": "media-player-xsmall-polish" }, { "url": "/images/status/media-player-xsmall.png", "name": "media-player-xsmall" }, { "url": "/images/status/media-player.png", "name": "media-player" }, { "url": "/images/status/media-players.png", "name": "media-players" }, { "url": "/images/status/megaphone--arrow.png", "name": "megaphone--arrow" }, { "url": "/images/status/megaphone--exclamation.png", "name": "megaphone--exclamation" }, { "url": "/images/status/megaphone--minus.png", "name": "megaphone--minus" }, { "url": "/images/status/megaphone--pencil.png", "name": "megaphone--pencil" }, { "url": "/images/status/megaphone--plus.png", "name": "megaphone--plus" }, { "url": "/images/status/megaphone.png", "name": "megaphone" }, { "url": "/images/status/memory.png", "name": "memory" }, { "url": "/images/status/metronome--arrow.png", "name": "metronome--arrow" }, { "url": "/images/status/metronome--exclamation.png", "name": "metronome--exclamation" }, { "url": "/images/status/metronome--minus.png", "name": "metronome--minus" }, { "url": "/images/status/metronome--pencil.png", "name": "metronome--pencil" }, { "url": "/images/status/metronome--plus.png", "name": "metronome--plus" }, { "url": "/images/status/metronome.png", "name": "metronome" }, { "url": "/images/status/microformats.png", "name": "microformats" }, { "url": "/images/status/microphone--arrow.png", "name": "microphone--arrow" }, { "url": "/images/status/microphone--exclamation.png", "name": "microphone--exclamation" }, { "url": "/images/status/microphone--minus.png", "name": "microphone--minus" }, { "url": "/images/status/microphone--pencil.png", "name": "microphone--pencil" }, { "url": "/images/status/microphone--plus.png", "name": "microphone--plus" }, { "url": "/images/status/microphone.png", "name": "microphone" }, { "url": "/images/status/minus-button.png", "name": "minus-button" }, { "url": "/images/status/minus-circle-frame.png", "name": "minus-circle-frame" }, { "url": "/images/status/minus-circle.png", "name": "minus-circle" }, { "url": "/images/status/minus-octagon-frame.png", "name": "minus-octagon-frame" }, { "url": "/images/status/minus-octagon.png", "name": "minus-octagon" }, { "url": "/images/status/minus-shield.png", "name": "minus-shield" }, { "url": "/images/status/minus-small-circle.png", "name": "minus-small-circle" }, { "url": "/images/status/minus-small-white.png", "name": "minus-small-white" }, { "url": "/images/status/minus-small.png", "name": "minus-small" }, { "url": "/images/status/minus-white.png", "name": "minus-white" }, { "url": "/images/status/minus.png", "name": "minus" }, { "url": "/images/status/mobile-phone--arrow.png", "name": "mobile-phone--arrow" }, { "url": "/images/status/mobile-phone--exclamation.png", "name": "mobile-phone--exclamation" }, { "url": "/images/status/mobile-phone--minus.png", "name": "mobile-phone--minus" }, { "url": "/images/status/mobile-phone--pencil.png", "name": "mobile-phone--pencil" }, { "url": "/images/status/mobile-phone--plus.png", "name": "mobile-phone--plus" }, { "url": "/images/status/mobile-phone-cast.png", "name": "mobile-phone-cast" }, { "url": "/images/status/mobile-phone-off.png", "name": "mobile-phone-off" }, { "url": "/images/status/mobile-phone.png", "name": "mobile-phone" }, { "url": "/images/status/money--arrow.png", "name": "money--arrow" }, { "url": "/images/status/money--exclamation.png", "name": "money--exclamation" }, { "url": "/images/status/money--minus.png", "name": "money--minus" }, { "url": "/images/status/money--pencil.png", "name": "money--pencil" }, { "url": "/images/status/money--plus.png", "name": "money--plus" }, { "url": "/images/status/money-coin.png", "name": "money-coin" }, { "url": "/images/status/money.png", "name": "money" }, { "url": "/images/status/monitor--arrow.png", "name": "monitor--arrow" }, { "url": "/images/status/monitor--exclamation.png", "name": "monitor--exclamation" }, { "url": "/images/status/monitor--minus.png", "name": "monitor--minus" }, { "url": "/images/status/monitor--pencil.png", "name": "monitor--pencil" }, { "url": "/images/status/monitor--plus.png", "name": "monitor--plus" }, { "url": "/images/status/monitor-cast.png", "name": "monitor-cast" }, { "url": "/images/status/monitor-image.png", "name": "monitor-image" }, { "url": "/images/status/monitor-network.png", "name": "monitor-network" }, { "url": "/images/status/monitor-off.png", "name": "monitor-off" }, { "url": "/images/status/monitor-screensaver.png", "name": "monitor-screensaver" }, { "url": "/images/status/monitor-sidebar.png", "name": "monitor-sidebar" }, { "url": "/images/status/monitor-wallpaper.png", "name": "monitor-wallpaper" }, { "url": "/images/status/monitor-window-3d.png", "name": "monitor-window-3d" }, { "url": "/images/status/monitor-window-flow.png", "name": "monitor-window-flow" }, { "url": "/images/status/monitor-window.png", "name": "monitor-window" }, { "url": "/images/status/monitor.png", "name": "monitor" }, { "url": "/images/status/mouse--arrow.png", "name": "mouse--arrow" }, { "url": "/images/status/mouse--exclamation.png", "name": "mouse--exclamation" }, { "url": "/images/status/mouse--minus.png", "name": "mouse--minus" }, { "url": "/images/status/mouse--pencil.png", "name": "mouse--pencil" }, { "url": "/images/status/mouse--plus.png", "name": "mouse--plus" }, { "url": "/images/status/mouse-select-right.png", "name": "mouse-select-right" }, { "url": "/images/status/mouse-select-wheel.png", "name": "mouse-select-wheel" }, { "url": "/images/status/mouse-select.png", "name": "mouse-select" }, { "url": "/images/status/mouse.png", "name": "mouse" }, { "url": "/images/status/music--arrow.png", "name": "music--arrow" }, { "url": "/images/status/music--exclamation.png", "name": "music--exclamation" }, { "url": "/images/status/music--minus.png", "name": "music--minus" }, { "url": "/images/status/music--pencil.png", "name": "music--pencil" }, { "url": "/images/status/music--plus.png", "name": "music--plus" }, { "url": "/images/status/music-beam-16.png", "name": "music-beam-16" }, { "url": "/images/status/music-beam.png", "name": "music-beam" }, { "url": "/images/status/music-small.png", "name": "music-small" }, { "url": "/images/status/music.png", "name": "music" }, { "url": "/images/status/na.png", "name": "na" }, { "url": "/images/status/navigation-000-button.png", "name": "navigation-000-button" }, { "url": "/images/status/navigation-000-frame.png", "name": "navigation-000-frame" }, { "url": "/images/status/navigation-000-white.png", "name": "navigation-000-white" }, { "url": "/images/status/navigation-090-button.png", "name": "navigation-090-button" }, { "url": "/images/status/navigation-090-frame.png", "name": "navigation-090-frame" }, { "url": "/images/status/navigation-090-white.png", "name": "navigation-090-white" }, { "url": "/images/status/navigation-090.png", "name": "navigation-090" }, { "url": "/images/status/navigation-180-button.png", "name": "navigation-180-button" }, { "url": "/images/status/navigation-180-frame.png", "name": "navigation-180-frame" }, { "url": "/images/status/navigation-180-white.png", "name": "navigation-180-white" }, { "url": "/images/status/navigation-180.png", "name": "navigation-180" }, { "url": "/images/status/navigation-270-button.png", "name": "navigation-270-button" }, { "url": "/images/status/navigation-270-frame.png", "name": "navigation-270-frame" }, { "url": "/images/status/navigation-270-white.png", "name": "navigation-270-white" }, { "url": "/images/status/navigation-270.png", "name": "navigation-270" }, { "url": "/images/status/navigation.png", "name": "navigation" }, { "url": "/images/status/network-cloud.png", "name": "network-cloud" }, { "url": "/images/status/network-clouds.png", "name": "network-clouds" }, { "url": "/images/status/network-ethernet.png", "name": "network-ethernet" }, { "url": "/images/status/network-hub.png", "name": "network-hub" }, { "url": "/images/status/network.png", "name": "network" }, { "url": "/images/status/new.png", "name": "new" }, { "url": "/images/status/newspaper--arrow.png", "name": "newspaper--arrow" }, { "url": "/images/status/newspaper--exclamation.png", "name": "newspaper--exclamation" }, { "url": "/images/status/newspaper--minus.png", "name": "newspaper--minus" }, { "url": "/images/status/newspaper--pencil.png", "name": "newspaper--pencil" }, { "url": "/images/status/newspaper--plus.png", "name": "newspaper--plus" }, { "url": "/images/status/newspaper.png", "name": "newspaper" }, { "url": "/images/status/newspapers.png", "name": "newspapers" }, { "url": "/images/status/node-delete-child.png", "name": "node-delete-child" }, { "url": "/images/status/node-delete-next.png", "name": "node-delete-next" }, { "url": "/images/status/node-delete-previous.png", "name": "node-delete-previous" }, { "url": "/images/status/node-delete.png", "name": "node-delete" }, { "url": "/images/status/node-design.png", "name": "node-design" }, { "url": "/images/status/node-insert-child.png", "name": "node-insert-child" }, { "url": "/images/status/node-insert-next.png", "name": "node-insert-next" }, { "url": "/images/status/node-insert-previous.png", "name": "node-insert-previous" }, { "url": "/images/status/node-insert.png", "name": "node-insert" }, { "url": "/images/status/node-magnifier.png", "name": "node-magnifier" }, { "url": "/images/status/node-select-all.png", "name": "node-select-all" }, { "url": "/images/status/node-select-child.png", "name": "node-select-child" }, { "url": "/images/status/node-select-next.png", "name": "node-select-next" }, { "url": "/images/status/node-select-previous.png", "name": "node-select-previous" }, { "url": "/images/status/node-select.png", "name": "node-select" }, { "url": "/images/status/node.png", "name": "node" }, { "url": "/images/status/notebook--arrow.png", "name": "notebook--arrow" }, { "url": "/images/status/notebook--exclamation.png", "name": "notebook--exclamation" }, { "url": "/images/status/notebook--minus.png", "name": "notebook--minus" }, { "url": "/images/status/notebook--pencil.png", "name": "notebook--pencil" }, { "url": "/images/status/notebook--plus.png", "name": "notebook--plus" }, { "url": "/images/status/notebook.png", "name": "notebook" }, { "url": "/images/status/notebooks.png", "name": "notebooks" }, { "url": "/images/status/open-share-balloon.png", "name": "open-share-balloon" }, { "url": "/images/status/open-share-document.png", "name": "open-share-document" }, { "url": "/images/status/open-share-small.png", "name": "open-share-small" }, { "url": "/images/status/open-share.png", "name": "open-share" }, { "url": "/images/status/open-source.png", "name": "open-source" }, { "url": "/images/status/openid.png", "name": "openid" }, { "url": "/images/status/opml-balloon.png", "name": "opml-balloon" }, { "url": "/images/status/opml-document.png", "name": "opml-document" }, { "url": "/images/status/opml-small.png", "name": "opml-small" }, { "url": "/images/status/opml.png", "name": "opml" }, { "url": "/images/status/paint-brush--arrow.png", "name": "paint-brush--arrow" }, { "url": "/images/status/paint-brush--exclamation.png", "name": "paint-brush--exclamation" }, { "url": "/images/status/paint-brush--minus.png", "name": "paint-brush--minus" }, { "url": "/images/status/paint-brush--pencil.png", "name": "paint-brush--pencil" }, { "url": "/images/status/paint-brush--plus.png", "name": "paint-brush--plus" }, { "url": "/images/status/paint-brush-color.png", "name": "paint-brush-color" }, { "url": "/images/status/paint-brush-small.png", "name": "paint-brush-small" }, { "url": "/images/status/paint-brush.png", "name": "paint-brush" }, { "url": "/images/status/paint-can--arrow.png", "name": "paint-can--arrow" }, { "url": "/images/status/paint-can--exclamation.png", "name": "paint-can--exclamation" }, { "url": "/images/status/paint-can--minus.png", "name": "paint-can--minus" }, { "url": "/images/status/paint-can--pencil.png", "name": "paint-can--pencil" }, { "url": "/images/status/paint-can--plus.png", "name": "paint-can--plus" }, { "url": "/images/status/paint-can-color.png", "name": "paint-can-color" }, { "url": "/images/status/paint-can-paint-brush.png", "name": "paint-can-paint-brush" }, { "url": "/images/status/paint-can.png", "name": "paint-can" }, { "url": "/images/status/paint-tube--arrow.png", "name": "paint-tube--arrow" }, { "url": "/images/status/paint-tube--exclamation.png", "name": "paint-tube--exclamation" }, { "url": "/images/status/paint-tube--minus.png", "name": "paint-tube--minus" }, { "url": "/images/status/paint-tube--pencil.png", "name": "paint-tube--pencil" }, { "url": "/images/status/paint-tube--plus.png", "name": "paint-tube--plus" }, { "url": "/images/status/paint-tube-color.png", "name": "paint-tube-color" }, { "url": "/images/status/paint-tube.png", "name": "paint-tube" }, { "url": "/images/status/palette--arrow.png", "name": "palette--arrow" }, { "url": "/images/status/palette--exclamation.png", "name": "palette--exclamation" }, { "url": "/images/status/palette--minus.png", "name": "palette--minus" }, { "url": "/images/status/palette--pencil.png", "name": "palette--pencil" }, { "url": "/images/status/palette--plus.png", "name": "palette--plus" }, { "url": "/images/status/palette-color.png", "name": "palette-color" }, { "url": "/images/status/palette-paint-brush.png", "name": "palette-paint-brush" }, { "url": "/images/status/palette.png", "name": "palette" }, { "url": "/images/status/paper-bag--arrow.png", "name": "paper-bag--arrow" }, { "url": "/images/status/paper-bag--exclamation.png", "name": "paper-bag--exclamation" }, { "url": "/images/status/paper-bag--minus.png", "name": "paper-bag--minus" }, { "url": "/images/status/paper-bag--pencil.png", "name": "paper-bag--pencil" }, { "url": "/images/status/paper-bag--plus.png", "name": "paper-bag--plus" }, { "url": "/images/status/paper-bag-label.png", "name": "paper-bag-label" }, { "url": "/images/status/paper-bag.png", "name": "paper-bag" }, { "url": "/images/status/paper-clip-small.png", "name": "paper-clip-small" }, { "url": "/images/status/paper-clip.png", "name": "paper-clip" }, { "url": "/images/status/paper-plane--arrow.png", "name": "paper-plane--arrow" }, { "url": "/images/status/paper-plane--exclamation.png", "name": "paper-plane--exclamation" }, { "url": "/images/status/paper-plane--minus.png", "name": "paper-plane--minus" }, { "url": "/images/status/paper-plane--pencil.png", "name": "paper-plane--pencil" }, { "url": "/images/status/paper-plane--plus.png", "name": "paper-plane--plus" }, { "url": "/images/status/paper-plane-return.png", "name": "paper-plane-return" }, { "url": "/images/status/paper-plane.png", "name": "paper-plane" }, { "url": "/images/status/party-hat.png", "name": "party-hat" }, { "url": "/images/status/pda--arrow.png", "name": "pda--arrow" }, { "url": "/images/status/pda--exclamation.png", "name": "pda--exclamation" }, { "url": "/images/status/pda--minus.png", "name": "pda--minus" }, { "url": "/images/status/pda--pencil.png", "name": "pda--pencil" }, { "url": "/images/status/pda--plus.png", "name": "pda--plus" }, { "url": "/images/status/pda-off.png", "name": "pda-off" }, { "url": "/images/status/pda.png", "name": "pda" }, { "url": "/images/status/pencil--arrow.png", "name": "pencil--arrow" }, { "url": "/images/status/pencil--exclamation.png", "name": "pencil--exclamation" }, { "url": "/images/status/pencil--minus.png", "name": "pencil--minus" }, { "url": "/images/status/pencil--plus.png", "name": "pencil--plus" }, { "url": "/images/status/pencil-color.png", "name": "pencil-color" }, { "url": "/images/status/pencil-field.png", "name": "pencil-field" }, { "url": "/images/status/pencil-ruler.png", "name": "pencil-ruler" }, { "url": "/images/status/pencil-small.png", "name": "pencil-small" }, { "url": "/images/status/pencil.png", "name": "pencil" }, { "url": "/images/status/photo-album--arrow.png", "name": "photo-album--arrow" }, { "url": "/images/status/photo-album--exclamation.png", "name": "photo-album--exclamation" }, { "url": "/images/status/photo-album--minus.png", "name": "photo-album--minus" }, { "url": "/images/status/photo-album--pencil.png", "name": "photo-album--pencil" }, { "url": "/images/status/photo-album--plus.png", "name": "photo-album--plus" }, { "url": "/images/status/photo-album-blue.png", "name": "photo-album-blue" }, { "url": "/images/status/photo-album.png", "name": "photo-album" }, { "url": "/images/status/piano--arrow.png", "name": "piano--arrow" }, { "url": "/images/status/piano--exclamation.png", "name": "piano--exclamation" }, { "url": "/images/status/piano--minus.png", "name": "piano--minus" }, { "url": "/images/status/piano--pencil.png", "name": "piano--pencil" }, { "url": "/images/status/piano--plus.png", "name": "piano--plus" }, { "url": "/images/status/piano.png", "name": "piano" }, { "url": "/images/status/picture--arrow.png", "name": "picture--arrow" }, { "url": "/images/status/picture--exclamation.png", "name": "picture--exclamation" }, { "url": "/images/status/picture--minus.png", "name": "picture--minus" }, { "url": "/images/status/picture--pencil.png", "name": "picture--pencil" }, { "url": "/images/status/picture--plus.png", "name": "picture--plus" }, { "url": "/images/status/picture-small-sunset.png", "name": "picture-small-sunset" }, { "url": "/images/status/picture-small.png", "name": "picture-small" }, { "url": "/images/status/picture-sunset.png", "name": "picture-sunset" }, { "url": "/images/status/picture.png", "name": "picture" }, { "url": "/images/status/pictures-stack.png", "name": "pictures-stack" }, { "url": "/images/status/pictures.png", "name": "pictures" }, { "url": "/images/status/pill--arrow.png", "name": "pill--arrow" }, { "url": "/images/status/pill--exclamation.png", "name": "pill--exclamation" }, { "url": "/images/status/pill--minus.png", "name": "pill--minus" }, { "url": "/images/status/pill--pencil.png", "name": "pill--pencil" }, { "url": "/images/status/pill--plus.png", "name": "pill--plus" }, { "url": "/images/status/pill-small.png", "name": "pill-small" }, { "url": "/images/status/pill.png", "name": "pill" }, { "url": "/images/status/pin--arrow.png", "name": "pin--arrow" }, { "url": "/images/status/pin--exclamation.png", "name": "pin--exclamation" }, { "url": "/images/status/pin--minus.png", "name": "pin--minus" }, { "url": "/images/status/pin--pencil.png", "name": "pin--pencil" }, { "url": "/images/status/pin--plus.png", "name": "pin--plus" }, { "url": "/images/status/pin-small.png", "name": "pin-small" }, { "url": "/images/status/pin.png", "name": "pin" }, { "url": "/images/status/pipette--arrow.png", "name": "pipette--arrow" }, { "url": "/images/status/pipette--exclamation.png", "name": "pipette--exclamation" }, { "url": "/images/status/pipette--minus.png", "name": "pipette--minus" }, { "url": "/images/status/pipette--pencil.png", "name": "pipette--pencil" }, { "url": "/images/status/pipette--plus.png", "name": "pipette--plus" }, { "url": "/images/status/pipette-color.png", "name": "pipette-color" }, { "url": "/images/status/pipette.png", "name": "pipette" }, { "url": "/images/status/playing-card--arrow.png", "name": "playing-card--arrow" }, { "url": "/images/status/playing-card--exclamation.png", "name": "playing-card--exclamation" }, { "url": "/images/status/playing-card--minus.png", "name": "playing-card--minus" }, { "url": "/images/status/playing-card--pencil.png", "name": "playing-card--pencil" }, { "url": "/images/status/playing-card--plus.png", "name": "playing-card--plus" }, { "url": "/images/status/playing-card.png", "name": "playing-card" }, { "url": "/images/status/plug--arrow.png", "name": "plug--arrow" }, { "url": "/images/status/plug--exclamation.png", "name": "plug--exclamation" }, { "url": "/images/status/plug--minus.png", "name": "plug--minus" }, { "url": "/images/status/plug--pencil.png", "name": "plug--pencil" }, { "url": "/images/status/plug--plus.png", "name": "plug--plus" }, { "url": "/images/status/plug.png", "name": "plug" }, { "url": "/images/status/plus-button.png", "name": "plus-button" }, { "url": "/images/status/plus-circle-frame.png", "name": "plus-circle-frame" }, { "url": "/images/status/plus-circle.png", "name": "plus-circle" }, { "url": "/images/status/plus-octagon-frame.png", "name": "plus-octagon-frame" }, { "url": "/images/status/plus-octagon.png", "name": "plus-octagon" }, { "url": "/images/status/plus-shield.png", "name": "plus-shield" }, { "url": "/images/status/plus-small-circle.png", "name": "plus-small-circle" }, { "url": "/images/status/plus-small-white.png", "name": "plus-small-white" }, { "url": "/images/status/plus-small.png", "name": "plus-small" }, { "url": "/images/status/plus-white.png", "name": "plus-white" }, { "url": "/images/status/plus.png", "name": "plus" }, { "url": "/images/status/point--arrow.png", "name": "point--arrow" }, { "url": "/images/status/point--exclamation.png", "name": "point--exclamation" }, { "url": "/images/status/point--minus.png", "name": "point--minus" }, { "url": "/images/status/point--pencil.png", "name": "point--pencil" }, { "url": "/images/status/point--plus.png", "name": "point--plus" }, { "url": "/images/status/point-bronze.png", "name": "point-bronze" }, { "url": "/images/status/point-silver.png", "name": "point-silver" }, { "url": "/images/status/point-small.png", "name": "point-small" }, { "url": "/images/status/point.png", "name": "point" }, { "url": "/images/status/points.png", "name": "points" }, { "url": "/images/status/postage-stamp--arrow.png", "name": "postage-stamp--arrow" }, { "url": "/images/status/postage-stamp--exclamation.png", "name": "postage-stamp--exclamation" }, { "url": "/images/status/postage-stamp--minus.png", "name": "postage-stamp--minus" }, { "url": "/images/status/postage-stamp--pencil.png", "name": "postage-stamp--pencil" }, { "url": "/images/status/postage-stamp--plus.png", "name": "postage-stamp--plus" }, { "url": "/images/status/postage-stamp.png", "name": "postage-stamp" }, { "url": "/images/status/present--arrow.png", "name": "present--arrow" }, { "url": "/images/status/present--exclamation.png", "name": "present--exclamation" }, { "url": "/images/status/present--minus.png", "name": "present--minus" }, { "url": "/images/status/present--pencil.png", "name": "present--pencil" }, { "url": "/images/status/present--plus.png", "name": "present--plus" }, { "url": "/images/status/present-label.png", "name": "present-label" }, { "url": "/images/status/present.png", "name": "present" }, { "url": "/images/status/price-tag--arrow.png", "name": "price-tag--arrow" }, { "url": "/images/status/price-tag--exclamation.png", "name": "price-tag--exclamation" }, { "url": "/images/status/price-tag--minus.png", "name": "price-tag--minus" }, { "url": "/images/status/price-tag--pencil.png", "name": "price-tag--pencil" }, { "url": "/images/status/price-tag--plus.png", "name": "price-tag--plus" }, { "url": "/images/status/price-tag-label.png", "name": "price-tag-label" }, { "url": "/images/status/price-tag.png", "name": "price-tag" }, { "url": "/images/status/printer--arrow.png", "name": "printer--arrow" }, { "url": "/images/status/printer--exclamation.png", "name": "printer--exclamation" }, { "url": "/images/status/printer--minus.png", "name": "printer--minus" }, { "url": "/images/status/printer--pencil.png", "name": "printer--pencil" }, { "url": "/images/status/printer--plus.png", "name": "printer--plus" }, { "url": "/images/status/printer-empty.png", "name": "printer-empty" }, { "url": "/images/status/printer-network.png", "name": "printer-network" }, { "url": "/images/status/printer-small.png", "name": "printer-small" }, { "url": "/images/status/printer.png", "name": "printer" }, { "url": "/images/status/processor.png", "name": "processor" }, { "url": "/images/status/projection-screen--arrow.png", "name": "projection-screen--arrow" }, { "url": "/images/status/projection-screen--exclamation.png", "name": "projection-screen--exclamation" }, { "url": "/images/status/projection-screen--minus.png", "name": "projection-screen--minus" }, { "url": "/images/status/projection-screen--pencil.png", "name": "projection-screen--pencil" }, { "url": "/images/status/projection-screen--plus.png", "name": "projection-screen--plus" }, { "url": "/images/status/projection-screen-presentation.png", "name": "projection-screen-presentation" }, { "url": "/images/status/projection-screen.png", "name": "projection-screen" }, { "url": "/images/status/property-blue.png", "name": "property-blue" }, { "url": "/images/status/property-export.png", "name": "property-export" }, { "url": "/images/status/property-import.png", "name": "property-import" }, { "url": "/images/status/property.png", "name": "property" }, { "url": "/images/status/puzzle--arrow.png", "name": "puzzle--arrow" }, { "url": "/images/status/puzzle--exclamation.png", "name": "puzzle--exclamation" }, { "url": "/images/status/puzzle--minus.png", "name": "puzzle--minus" }, { "url": "/images/status/puzzle--pencil.png", "name": "puzzle--pencil" }, { "url": "/images/status/puzzle--plus.png", "name": "puzzle--plus" }, { "url": "/images/status/puzzle.png", "name": "puzzle" }, { "url": "/images/status/question-balloon.png", "name": "question-balloon" }, { "url": "/images/status/question-button.png", "name": "question-button" }, { "url": "/images/status/question-frame.png", "name": "question-frame" }, { "url": "/images/status/question-octagon-frame.png", "name": "question-octagon-frame" }, { "url": "/images/status/question-octagon.png", "name": "question-octagon" }, { "url": "/images/status/question-shield.png", "name": "question-shield" }, { "url": "/images/status/question-small-white.png", "name": "question-small-white" }, { "url": "/images/status/question-small.png", "name": "question-small" }, { "url": "/images/status/question-white.png", "name": "question-white" }, { "url": "/images/status/question.png", "name": "question" }, { "url": "/images/status/quill--arrow.png", "name": "quill--arrow" }, { "url": "/images/status/quill--exclamation.png", "name": "quill--exclamation" }, { "url": "/images/status/quill--minus.png", "name": "quill--minus" }, { "url": "/images/status/quill--plus.png", "name": "quill--plus" }, { "url": "/images/status/quill.png", "name": "quill" }, { "url": "/images/status/rainbow.png", "name": "rainbow" }, { "url": "/images/status/receipt--arrow.png", "name": "receipt--arrow" }, { "url": "/images/status/receipt--exclamation.png", "name": "receipt--exclamation" }, { "url": "/images/status/receipt--minus.png", "name": "receipt--minus" }, { "url": "/images/status/receipt--pencil.png", "name": "receipt--pencil" }, { "url": "/images/status/receipt--plus.png", "name": "receipt--plus" }, { "url": "/images/status/receipt-excel-text.png", "name": "receipt-excel-text" }, { "url": "/images/status/receipt-excel.png", "name": "receipt-excel" }, { "url": "/images/status/receipt-export.png", "name": "receipt-export" }, { "url": "/images/status/receipt-import.png", "name": "receipt-import" }, { "url": "/images/status/receipt-invoice.png", "name": "receipt-invoice" }, { "url": "/images/status/receipt-shred.png", "name": "receipt-shred" }, { "url": "/images/status/receipt-stamp.png", "name": "receipt-stamp" }, { "url": "/images/status/receipt-text.png", "name": "receipt-text" }, { "url": "/images/status/receipt.png", "name": "receipt" }, { "url": "/images/status/receipts-text.png", "name": "receipts-text" }, { "url": "/images/status/receipts.png", "name": "receipts" }, { "url": "/images/status/report--arrow.png", "name": "report--arrow" }, { "url": "/images/status/report--exclamation.png", "name": "report--exclamation" }, { "url": "/images/status/report--minus.png", "name": "report--minus" }, { "url": "/images/status/report--pencil.png", "name": "report--pencil" }, { "url": "/images/status/report--plus.png", "name": "report--plus" }, { "url": "/images/status/report-excel.png", "name": "report-excel" }, { "url": "/images/status/report-paper.png", "name": "report-paper" }, { "url": "/images/status/report-word.png", "name": "report-word" }, { "url": "/images/status/report.png", "name": "report" }, { "url": "/images/status/reports-stack.png", "name": "reports-stack" }, { "url": "/images/status/reports.png", "name": "reports" }, { "url": "/images/status/robot-off.png", "name": "robot-off" }, { "url": "/images/status/robot.png", "name": "robot" }, { "url": "/images/status/rocket--arrow.png", "name": "rocket--arrow" }, { "url": "/images/status/rocket--exclamation.png", "name": "rocket--exclamation" }, { "url": "/images/status/rocket--minus.png", "name": "rocket--minus" }, { "url": "/images/status/rocket--pencil.png", "name": "rocket--pencil" }, { "url": "/images/status/rocket--plus.png", "name": "rocket--plus" }, { "url": "/images/status/rocket-fly.png", "name": "rocket-fly" }, { "url": "/images/status/rocket.png", "name": "rocket" }, { "url": "/images/status/ruby.png", "name": "ruby" }, { "url": "/images/status/ruler--arrow.png", "name": "ruler--arrow" }, { "url": "/images/status/ruler--exclamation.png", "name": "ruler--exclamation" }, { "url": "/images/status/ruler--minus.png", "name": "ruler--minus" }, { "url": "/images/status/ruler--pencil.png", "name": "ruler--pencil" }, { "url": "/images/status/ruler--plus.png", "name": "ruler--plus" }, { "url": "/images/status/ruler-crop.png", "name": "ruler-crop" }, { "url": "/images/status/ruler-triangle.png", "name": "ruler-triangle" }, { "url": "/images/status/ruler.png", "name": "ruler" }, { "url": "/images/status/safe--arrow.png", "name": "safe--arrow" }, { "url": "/images/status/safe--exclamation.png", "name": "safe--exclamation" }, { "url": "/images/status/safe--minus.png", "name": "safe--minus" }, { "url": "/images/status/safe--pencil.png", "name": "safe--pencil" }, { "url": "/images/status/safe--plus.png", "name": "safe--plus" }, { "url": "/images/status/safe.png", "name": "safe" }, { "url": "/images/status/scanner--arrow.png", "name": "scanner--arrow" }, { "url": "/images/status/scanner--exclamation.png", "name": "scanner--exclamation" }, { "url": "/images/status/scanner--minus.png", "name": "scanner--minus" }, { "url": "/images/status/scanner--pencil.png", "name": "scanner--pencil" }, { "url": "/images/status/scanner--plus.png", "name": "scanner--plus" }, { "url": "/images/status/scanner-off.png", "name": "scanner-off" }, { "url": "/images/status/scanner.png", "name": "scanner" }, { "url": "/images/status/scissors--arrow.png", "name": "scissors--arrow" }, { "url": "/images/status/scissors--exclamation.png", "name": "scissors--exclamation" }, { "url": "/images/status/scissors--minus.png", "name": "scissors--minus" }, { "url": "/images/status/scissors--pencil.png", "name": "scissors--pencil" }, { "url": "/images/status/scissors--plus.png", "name": "scissors--plus" }, { "url": "/images/status/scissors-blue.png", "name": "scissors-blue" }, { "url": "/images/status/scissors.png", "name": "scissors" }, { "url": "/images/status/screwdriver--arrow.png", "name": "screwdriver--arrow" }, { "url": "/images/status/screwdriver--exclamation.png", "name": "screwdriver--exclamation" }, { "url": "/images/status/screwdriver--minus.png", "name": "screwdriver--minus" }, { "url": "/images/status/screwdriver--pencil.png", "name": "screwdriver--pencil" }, { "url": "/images/status/screwdriver--plus.png", "name": "screwdriver--plus" }, { "url": "/images/status/screwdriver.png", "name": "screwdriver" }, { "url": "/images/status/script--arrow.png", "name": "script--arrow" }, { "url": "/images/status/script--exclamation.png", "name": "script--exclamation" }, { "url": "/images/status/script--minus.png", "name": "script--minus" }, { "url": "/images/status/script--pencil.png", "name": "script--pencil" }, { "url": "/images/status/script--plus.png", "name": "script--plus" }, { "url": "/images/status/script-attribute-b.png", "name": "script-attribute-b" }, { "url": "/images/status/script-attribute-c.png", "name": "script-attribute-c" }, { "url": "/images/status/script-attribute-d.png", "name": "script-attribute-d" }, { "url": "/images/status/script-attribute-e.png", "name": "script-attribute-e" }, { "url": "/images/status/script-attribute-f.png", "name": "script-attribute-f" }, { "url": "/images/status/script-attribute-g.png", "name": "script-attribute-g" }, { "url": "/images/status/script-attribute-h.png", "name": "script-attribute-h" }, { "url": "/images/status/script-attribute-i.png", "name": "script-attribute-i" }, { "url": "/images/status/script-attribute-j.png", "name": "script-attribute-j" }, { "url": "/images/status/script-attribute-k.png", "name": "script-attribute-k" }, { "url": "/images/status/script-attribute-l.png", "name": "script-attribute-l" }, { "url": "/images/status/script-attribute-m.png", "name": "script-attribute-m" }, { "url": "/images/status/script-attribute-n.png", "name": "script-attribute-n" }, { "url": "/images/status/script-attribute-o.png", "name": "script-attribute-o" }, { "url": "/images/status/script-attribute-p.png", "name": "script-attribute-p" }, { "url": "/images/status/script-attribute-q.png", "name": "script-attribute-q" }, { "url": "/images/status/script-attribute-r.png", "name": "script-attribute-r" }, { "url": "/images/status/script-attribute-s.png", "name": "script-attribute-s" }, { "url": "/images/status/script-attribute-t.png", "name": "script-attribute-t" }, { "url": "/images/status/script-attribute-u.png", "name": "script-attribute-u" }, { "url": "/images/status/script-attribute-v.png", "name": "script-attribute-v" }, { "url": "/images/status/script-attribute-w.png", "name": "script-attribute-w" }, { "url": "/images/status/script-attribute-x.png", "name": "script-attribute-x" }, { "url": "/images/status/script-attribute-y.png", "name": "script-attribute-y" }, { "url": "/images/status/script-attribute-z.png", "name": "script-attribute-z" }, { "url": "/images/status/script-attribute.png", "name": "script-attribute" }, { "url": "/images/status/script-binary.png", "name": "script-binary" }, { "url": "/images/status/script-block.png", "name": "script-block" }, { "url": "/images/status/script-code.png", "name": "script-code" }, { "url": "/images/status/script-excel.png", "name": "script-excel" }, { "url": "/images/status/script-export.png", "name": "script-export" }, { "url": "/images/status/script-flash.png", "name": "script-flash" }, { "url": "/images/status/script-globe.png", "name": "script-globe" }, { "url": "/images/status/script-import.png", "name": "script-import" }, { "url": "/images/status/script-office.png", "name": "script-office" }, { "url": "/images/status/script-php.png", "name": "script-php" }, { "url": "/images/status/script-stamp.png", "name": "script-stamp" }, { "url": "/images/status/script-text.png", "name": "script-text" }, { "url": "/images/status/script-visual-studio.png", "name": "script-visual-studio" }, { "url": "/images/status/script-word.png", "name": "script-word" }, { "url": "/images/status/script.png", "name": "script" }, { "url": "/images/status/scripts-text.png", "name": "scripts-text" }, { "url": "/images/status/scripts.png", "name": "scripts" }, { "url": "/images/status/selection-input.png", "name": "selection-input" }, { "url": "/images/status/selection-select-input.png", "name": "selection-select-input" }, { "url": "/images/status/selection-select.png", "name": "selection-select" }, { "url": "/images/status/selection.png", "name": "selection" }, { "url": "/images/status/server--arrow.png", "name": "server--arrow" }, { "url": "/images/status/server--exclamation.png", "name": "server--exclamation" }, { "url": "/images/status/server--minus.png", "name": "server--minus" }, { "url": "/images/status/server--pencil.png", "name": "server--pencil" }, { "url": "/images/status/server--plus.png", "name": "server--plus" }, { "url": "/images/status/server-cast.png", "name": "server-cast" }, { "url": "/images/status/server-network.png", "name": "server-network" }, { "url": "/images/status/server-property.png", "name": "server-property" }, { "url": "/images/status/server.png", "name": "server" }, { "url": "/images/status/servers-network.png", "name": "servers-network" }, { "url": "/images/status/servers.png", "name": "servers" }, { "url": "/images/status/service-bell--arrow.png", "name": "service-bell--arrow" }, { "url": "/images/status/service-bell--exclamation.png", "name": "service-bell--exclamation" }, { "url": "/images/status/service-bell--minus.png", "name": "service-bell--minus" }, { "url": "/images/status/service-bell--pencil.png", "name": "service-bell--pencil" }, { "url": "/images/status/service-bell--plus.png", "name": "service-bell--plus" }, { "url": "/images/status/service-bell.png", "name": "service-bell" }, { "url": "/images/status/share-balloon.png", "name": "share-balloon" }, { "url": "/images/status/share-document.png", "name": "share-document" }, { "url": "/images/status/share-small.png", "name": "share-small" }, { "url": "/images/status/share.png", "name": "share" }, { "url": "/images/status/shield--arrow.png", "name": "shield--arrow" }, { "url": "/images/status/shield--exclamation.png", "name": "shield--exclamation" }, { "url": "/images/status/shield--minus.png", "name": "shield--minus" }, { "url": "/images/status/shield--pencil.png", "name": "shield--pencil" }, { "url": "/images/status/shield--plus.png", "name": "shield--plus" }, { "url": "/images/status/shield.png", "name": "shield" }, { "url": "/images/status/shopping-basket--arrow.png", "name": "shopping-basket--arrow" }, { "url": "/images/status/shopping-basket--exclamation.png", "name": "shopping-basket--exclamation" }, { "url": "/images/status/shopping-basket--minus.png", "name": "shopping-basket--minus" }, { "url": "/images/status/shopping-basket--pencil.png", "name": "shopping-basket--pencil" }, { "url": "/images/status/shopping-basket--plus.png", "name": "shopping-basket--plus" }, { "url": "/images/status/shopping-basket.png", "name": "shopping-basket" }, { "url": "/images/status/shortcut-small.png", "name": "shortcut-small" }, { "url": "/images/status/shortcut.png", "name": "shortcut" }, { "url": "/images/status/sitemap-application-blue.png", "name": "sitemap-application-blue" }, { "url": "/images/status/sitemap-application.png", "name": "sitemap-application" }, { "url": "/images/status/sitemap-image.png", "name": "sitemap-image" }, { "url": "/images/status/sitemap.png", "name": "sitemap" }, { "url": "/images/status/slash-button.png", "name": "slash-button" }, { "url": "/images/status/slash-small.png", "name": "slash-small" }, { "url": "/images/status/slash.png", "name": "slash" }, { "url": "/images/status/slide--arrow.png", "name": "slide--arrow" }, { "url": "/images/status/slide--exclamation.png", "name": "slide--exclamation" }, { "url": "/images/status/slide--minus.png", "name": "slide--minus" }, { "url": "/images/status/slide--pencil.png", "name": "slide--pencil" }, { "url": "/images/status/slide--plus.png", "name": "slide--plus" }, { "url": "/images/status/slide-powerpoint.png", "name": "slide-powerpoint" }, { "url": "/images/status/slide.png", "name": "slide" }, { "url": "/images/status/slides-stack.png", "name": "slides-stack" }, { "url": "/images/status/slides.png", "name": "slides" }, { "url": "/images/status/smiley-confuse.png", "name": "smiley-confuse" }, { "url": "/images/status/smiley-cool.png", "name": "smiley-cool" }, { "url": "/images/status/smiley-cry.png", "name": "smiley-cry" }, { "url": "/images/status/smiley-draw.png", "name": "smiley-draw" }, { "url": "/images/status/smiley-eek.png", "name": "smiley-eek" }, { "url": "/images/status/smiley-evil.png", "name": "smiley-evil" }, { "url": "/images/status/smiley-fat.png", "name": "smiley-fat" }, { "url": "/images/status/smiley-grin.png", "name": "smiley-grin" }, { "url": "/images/status/smiley-kiss.png", "name": "smiley-kiss" }, { "url": "/images/status/smiley-kitty.png", "name": "smiley-kitty" }, { "url": "/images/status/smiley-lol.png", "name": "smiley-lol" }, { "url": "/images/status/smiley-mad.png", "name": "smiley-mad" }, { "url": "/images/status/smiley-money.png", "name": "smiley-money" }, { "url": "/images/status/smiley-mr-green.png", "name": "smiley-mr-green" }, { "url": "/images/status/smiley-neutral.png", "name": "smiley-neutral" }, { "url": "/images/status/smiley-razz.png", "name": "smiley-razz" }, { "url": "/images/status/smiley-red.png", "name": "smiley-red" }, { "url": "/images/status/smiley-roll-sweat.png", "name": "smiley-roll-sweat" }, { "url": "/images/status/smiley-roll.png", "name": "smiley-roll" }, { "url": "/images/status/smiley-sad.png", "name": "smiley-sad" }, { "url": "/images/status/smiley-sleep.png", "name": "smiley-sleep" }, { "url": "/images/status/smiley-slim.png", "name": "smiley-slim" }, { "url": "/images/status/smiley-small.png", "name": "smiley-small" }, { "url": "/images/status/smiley-surprise.png", "name": "smiley-surprise" }, { "url": "/images/status/smiley-sweat.png", "name": "smiley-sweat" }, { "url": "/images/status/smiley-twist.png", "name": "smiley-twist" }, { "url": "/images/status/smiley-wink.png", "name": "smiley-wink" }, { "url": "/images/status/smiley-yell.png", "name": "smiley-yell" }, { "url": "/images/status/smiley-zipper.png", "name": "smiley-zipper" }, { "url": "/images/status/smiley.png", "name": "smiley" }, { "url": "/images/status/snowman-hat.png", "name": "snowman-hat" }, { "url": "/images/status/snowman.png", "name": "snowman" }, { "url": "/images/status/soap-body.png", "name": "soap-body" }, { "url": "/images/status/soap-header.png", "name": "soap-header" }, { "url": "/images/status/soap.png", "name": "soap" }, { "url": "/images/status/socket--arrow.png", "name": "socket--arrow" }, { "url": "/images/status/socket--exclamation.png", "name": "socket--exclamation" }, { "url": "/images/status/socket--minus.png", "name": "socket--minus" }, { "url": "/images/status/socket--pencil.png", "name": "socket--pencil" }, { "url": "/images/status/socket--plus.png", "name": "socket--plus" }, { "url": "/images/status/socket.png", "name": "socket" }, { "url": "/images/status/sockets.png", "name": "sockets" }, { "url": "/images/status/sofa--arrow.png", "name": "sofa--arrow" }, { "url": "/images/status/sofa--exclamation.png", "name": "sofa--exclamation" }, { "url": "/images/status/sofa--minus.png", "name": "sofa--minus" }, { "url": "/images/status/sofa--pencil.png", "name": "sofa--pencil" }, { "url": "/images/status/sofa--plus.png", "name": "sofa--plus" }, { "url": "/images/status/sofa.png", "name": "sofa" }, { "url": "/images/status/sort--arrow.png", "name": "sort--arrow" }, { "url": "/images/status/sort--exclamation.png", "name": "sort--exclamation" }, { "url": "/images/status/sort--minus.png", "name": "sort--minus" }, { "url": "/images/status/sort--pencil.png", "name": "sort--pencil" }, { "url": "/images/status/sort--plus.png", "name": "sort--plus" }, { "url": "/images/status/sort-alphabet-descending.png", "name": "sort-alphabet-descending" }, { "url": "/images/status/sort-alphabet.png", "name": "sort-alphabet" }, { "url": "/images/status/sort-date-descending.png", "name": "sort-date-descending" }, { "url": "/images/status/sort-date.png", "name": "sort-date" }, { "url": "/images/status/sort-number-descending.png", "name": "sort-number-descending" }, { "url": "/images/status/sort-number.png", "name": "sort-number" }, { "url": "/images/status/sort-price-descending.png", "name": "sort-price-descending" }, { "url": "/images/status/sort-price.png", "name": "sort-price" }, { "url": "/images/status/sort-quantity-descending.png", "name": "sort-quantity-descending" }, { "url": "/images/status/sort-quantity.png", "name": "sort-quantity" }, { "url": "/images/status/sort-rating-descending.png", "name": "sort-rating-descending" }, { "url": "/images/status/sort-rating.png", "name": "sort-rating" }, { "url": "/images/status/sort-small.png", "name": "sort-small" }, { "url": "/images/status/sort.png", "name": "sort" }, { "url": "/images/status/speaker--arrow.png", "name": "speaker--arrow" }, { "url": "/images/status/speaker--exclamation.png", "name": "speaker--exclamation" }, { "url": "/images/status/speaker--minus.png", "name": "speaker--minus" }, { "url": "/images/status/speaker--pencil.png", "name": "speaker--pencil" }, { "url": "/images/status/speaker--plus.png", "name": "speaker--plus" }, { "url": "/images/status/speaker-volume-control-mute.png", "name": "speaker-volume-control-mute" }, { "url": "/images/status/speaker-volume-control-up.png", "name": "speaker-volume-control-up" }, { "url": "/images/status/speaker-volume-control.png", "name": "speaker-volume-control" }, { "url": "/images/status/speaker-volume-low.png", "name": "speaker-volume-low" }, { "url": "/images/status/speaker-volume-none.png", "name": "speaker-volume-none" }, { "url": "/images/status/speaker-volume.png", "name": "speaker-volume" }, { "url": "/images/status/speaker.png", "name": "speaker" }, { "url": "/images/status/spectacle-small.png", "name": "spectacle-small" }, { "url": "/images/status/spectacle-sunglass.png", "name": "spectacle-sunglass" }, { "url": "/images/status/spectacle.png", "name": "spectacle" }, { "url": "/images/status/spell-check-error.png", "name": "spell-check-error" }, { "url": "/images/status/spell-check.png", "name": "spell-check" }, { "url": "/images/status/spray--arrow.png", "name": "spray--arrow" }, { "url": "/images/status/spray--exclamation.png", "name": "spray--exclamation" }, { "url": "/images/status/spray--minus.png", "name": "spray--minus" }, { "url": "/images/status/spray--pencil.png", "name": "spray--pencil" }, { "url": "/images/status/spray--plus.png", "name": "spray--plus" }, { "url": "/images/status/spray-color.png", "name": "spray-color" }, { "url": "/images/status/spray.png", "name": "spray" }, { "url": "/images/status/sql-join-inner.png", "name": "sql-join-inner" }, { "url": "/images/status/sql-join-left-exclude.png", "name": "sql-join-left-exclude" }, { "url": "/images/status/sql-join-left.png", "name": "sql-join-left" }, { "url": "/images/status/sql-join-outer-exclude.png", "name": "sql-join-outer-exclude" }, { "url": "/images/status/sql-join-outer.png", "name": "sql-join-outer" }, { "url": "/images/status/sql-join-right-exclude.png", "name": "sql-join-right-exclude" }, { "url": "/images/status/sql-join-right.png", "name": "sql-join-right" }, { "url": "/images/status/sql-join.png", "name": "sql-join" }, { "url": "/images/status/sql.png", "name": "sql" }, { "url": "/images/status/stamp--arrow.png", "name": "stamp--arrow" }, { "url": "/images/status/stamp--exclamation.png", "name": "stamp--exclamation" }, { "url": "/images/status/stamp--minus.png", "name": "stamp--minus" }, { "url": "/images/status/stamp--pencil.png", "name": "stamp--pencil" }, { "url": "/images/status/stamp--plus.png", "name": "stamp--plus" }, { "url": "/images/status/stamp-pattern.png", "name": "stamp-pattern" }, { "url": "/images/status/stamp.png", "name": "stamp" }, { "url": "/images/status/star--arrow.png", "name": "star--arrow" }, { "url": "/images/status/star--exclamation.png", "name": "star--exclamation" }, { "url": "/images/status/star--minus.png", "name": "star--minus" }, { "url": "/images/status/star--pencil.png", "name": "star--pencil" }, { "url": "/images/status/star--plus.png", "name": "star--plus" }, { "url": "/images/status/star-empty.png", "name": "star-empty" }, { "url": "/images/status/star-half.png", "name": "star-half" }, { "url": "/images/status/star-small-empty.png", "name": "star-small-empty" }, { "url": "/images/status/star-small-half.png", "name": "star-small-half" }, { "url": "/images/status/star-small.png", "name": "star-small" }, { "url": "/images/status/star.png", "name": "star" }, { "url": "/images/status/status-away.png", "name": "status-away" }, { "url": "/images/status/status-busy.png", "name": "status-busy" }, { "url": "/images/status/status-offline.png", "name": "status-offline" }, { "url": "/images/status/status.png", "name": "status" }, { "url": "/images/status/sticky-note--arrow.png", "name": "sticky-note--arrow" }, { "url": "/images/status/sticky-note--exclamation.png", "name": "sticky-note--exclamation" }, { "url": "/images/status/sticky-note--minus.png", "name": "sticky-note--minus" }, { "url": "/images/status/sticky-note--pencil.png", "name": "sticky-note--pencil" }, { "url": "/images/status/sticky-note--plus.png", "name": "sticky-note--plus" }, { "url": "/images/status/sticky-note-pin.png", "name": "sticky-note-pin" }, { "url": "/images/status/sticky-note-shred.png", "name": "sticky-note-shred" }, { "url": "/images/status/sticky-note-small-pin.png", "name": "sticky-note-small-pin" }, { "url": "/images/status/sticky-note-small.png", "name": "sticky-note-small" }, { "url": "/images/status/sticky-note-text.png", "name": "sticky-note-text" }, { "url": "/images/status/sticky-note.png", "name": "sticky-note" }, { "url": "/images/status/sticky-notes-pin.png", "name": "sticky-notes-pin" }, { "url": "/images/status/sticky-notes-stack.png", "name": "sticky-notes-stack" }, { "url": "/images/status/sticky-notes-text.png", "name": "sticky-notes-text" }, { "url": "/images/status/sticky-notes.png", "name": "sticky-notes" }, { "url": "/images/status/store--arrow.png", "name": "store--arrow" }, { "url": "/images/status/store--exclamation.png", "name": "store--exclamation" }, { "url": "/images/status/store--minus.png", "name": "store--minus" }, { "url": "/images/status/store--pencil.png", "name": "store--pencil" }, { "url": "/images/status/store--plus.png", "name": "store--plus" }, { "url": "/images/status/store-label.png", "name": "store-label" }, { "url": "/images/status/store-network.png", "name": "store-network" }, { "url": "/images/status/store-open.png", "name": "store-open" }, { "url": "/images/status/store-small.png", "name": "store-small" }, { "url": "/images/status/store.png", "name": "store" }, { "url": "/images/status/subversion-small.png", "name": "subversion-small" }, { "url": "/images/status/subversion.png", "name": "subversion" }, { "url": "/images/status/sum.png", "name": "sum" }, { "url": "/images/status/switch--arrow.png", "name": "switch--arrow" }, { "url": "/images/status/switch--exclamation.png", "name": "switch--exclamation" }, { "url": "/images/status/switch--minus.png", "name": "switch--minus" }, { "url": "/images/status/switch--pencil.png", "name": "switch--pencil" }, { "url": "/images/status/switch--plus.png", "name": "switch--plus" }, { "url": "/images/status/switch-network.png", "name": "switch-network" }, { "url": "/images/status/switch-small.png", "name": "switch-small" }, { "url": "/images/status/switch.png", "name": "switch" }, { "url": "/images/status/system-monitor--arrow.png", "name": "system-monitor--arrow" }, { "url": "/images/status/system-monitor--exclamation.png", "name": "system-monitor--exclamation" }, { "url": "/images/status/system-monitor--minus.png", "name": "system-monitor--minus" }, { "url": "/images/status/system-monitor--pencil.png", "name": "system-monitor--pencil" }, { "url": "/images/status/system-monitor--plus.png", "name": "system-monitor--plus" }, { "url": "/images/status/system-monitor.png", "name": "system-monitor" }, { "url": "/images/status/t-shirt-gray.png", "name": "t-shirt-gray" }, { "url": "/images/status/t-shirt-print-gray.png", "name": "t-shirt-print-gray" }, { "url": "/images/status/t-shirt-print.png", "name": "t-shirt-print" }, { "url": "/images/status/t-shirt.png", "name": "t-shirt" }, { "url": "/images/status/table--arrow.png", "name": "table--arrow" }, { "url": "/images/status/table--exclamation.png", "name": "table--exclamation" }, { "url": "/images/status/table--minus.png", "name": "table--minus" }, { "url": "/images/status/table--pencil.png", "name": "table--pencil" }, { "url": "/images/status/table--plus.png", "name": "table--plus" }, { "url": "/images/status/table-delete-column.png", "name": "table-delete-column" }, { "url": "/images/status/table-delete-row.png", "name": "table-delete-row" }, { "url": "/images/status/table-delete.png", "name": "table-delete" }, { "url": "/images/status/table-excel.png", "name": "table-excel" }, { "url": "/images/status/table-export.png", "name": "table-export" }, { "url": "/images/status/table-import.png", "name": "table-import" }, { "url": "/images/status/table-insert-column.png", "name": "table-insert-column" }, { "url": "/images/status/table-insert-row.png", "name": "table-insert-row" }, { "url": "/images/status/table-insert.png", "name": "table-insert" }, { "url": "/images/status/table-join.png", "name": "table-join" }, { "url": "/images/status/table-money.png", "name": "table-money" }, { "url": "/images/status/table-paint-can.png", "name": "table-paint-can" }, { "url": "/images/status/table-select-all.png", "name": "table-select-all" }, { "url": "/images/status/table-select-cells.png", "name": "table-select-cells" }, { "url": "/images/status/table-select-column.png", "name": "table-select-column" }, { "url": "/images/status/table-select-row.png", "name": "table-select-row" }, { "url": "/images/status/table-select.png", "name": "table-select" }, { "url": "/images/status/table-sheet.png", "name": "table-sheet" }, { "url": "/images/status/table-small.png", "name": "table-small" }, { "url": "/images/status/table-split.png", "name": "table-split" }, { "url": "/images/status/table-sum.png", "name": "table-sum" }, { "url": "/images/status/table.png", "name": "table" }, { "url": "/images/status/tables-relation.png", "name": "tables-relation" }, { "url": "/images/status/tables-stacks.png", "name": "tables-stacks" }, { "url": "/images/status/tables.png", "name": "tables" }, { "url": "/images/status/tag--arrow.png", "name": "tag--arrow" }, { "url": "/images/status/tag--exclamation.png", "name": "tag--exclamation" }, { "url": "/images/status/tag--minus.png", "name": "tag--minus" }, { "url": "/images/status/tag--pencil.png", "name": "tag--pencil" }, { "url": "/images/status/tag--plus.png", "name": "tag--plus" }, { "url": "/images/status/tag-export.png", "name": "tag-export" }, { "url": "/images/status/tag-import.png", "name": "tag-import" }, { "url": "/images/status/tag-label.png", "name": "tag-label" }, { "url": "/images/status/tag-small.png", "name": "tag-small" }, { "url": "/images/status/tag.png", "name": "tag" }, { "url": "/images/status/tags-label.png", "name": "tags-label" }, { "url": "/images/status/tags.png", "name": "tags" }, { "url": "/images/status/target--arrow.png", "name": "target--arrow" }, { "url": "/images/status/target--exclamation.png", "name": "target--exclamation" }, { "url": "/images/status/target--minus.png", "name": "target--minus" }, { "url": "/images/status/target--pencil.png", "name": "target--pencil" }, { "url": "/images/status/target--plus.png", "name": "target--plus" }, { "url": "/images/status/target.png", "name": "target" }, { "url": "/images/status/task--arrow.png", "name": "task--arrow" }, { "url": "/images/status/task--exclamation.png", "name": "task--exclamation" }, { "url": "/images/status/task--minus.png", "name": "task--minus" }, { "url": "/images/status/task--pencil.png", "name": "task--pencil" }, { "url": "/images/status/task--plus.png", "name": "task--plus" }, { "url": "/images/status/task-select-first.png", "name": "task-select-first" }, { "url": "/images/status/task-select-last.png", "name": "task-select-last" }, { "url": "/images/status/task-select.png", "name": "task-select" }, { "url": "/images/status/task.png", "name": "task" }, { "url": "/images/status/telephone--arrow.png", "name": "telephone--arrow" }, { "url": "/images/status/telephone--exclamation.png", "name": "telephone--exclamation" }, { "url": "/images/status/telephone--minus.png", "name": "telephone--minus" }, { "url": "/images/status/telephone--pencil.png", "name": "telephone--pencil" }, { "url": "/images/status/telephone--plus.png", "name": "telephone--plus" }, { "url": "/images/status/telephone-fax.png", "name": "telephone-fax" }, { "url": "/images/status/telephone-off.png", "name": "telephone-off" }, { "url": "/images/status/telephone.png", "name": "telephone" }, { "url": "/images/status/television--arrow.png", "name": "television--arrow" }, { "url": "/images/status/television--exclamation.png", "name": "television--exclamation" }, { "url": "/images/status/television--minus.png", "name": "television--minus" }, { "url": "/images/status/television--pencil.png", "name": "television--pencil" }, { "url": "/images/status/television--plus.png", "name": "television--plus" }, { "url": "/images/status/television-image.png", "name": "television-image" }, { "url": "/images/status/television-off.png", "name": "television-off" }, { "url": "/images/status/television.png", "name": "television" }, { "url": "/images/status/terminal--arrow.png", "name": "terminal--arrow" }, { "url": "/images/status/terminal--exclamation.png", "name": "terminal--exclamation" }, { "url": "/images/status/terminal--minus.png", "name": "terminal--minus" }, { "url": "/images/status/terminal--pencil.png", "name": "terminal--pencil" }, { "url": "/images/status/terminal--plus.png", "name": "terminal--plus" }, { "url": "/images/status/terminal.png", "name": "terminal" }, { "url": "/images/status/thumb-up.png", "name": "thumb-up" }, { "url": "/images/status/thumb.png", "name": "thumb" }, { "url": "/images/status/tick-button.png", "name": "tick-button" }, { "url": "/images/status/tick-circle-frame.png", "name": "tick-circle-frame" }, { "url": "/images/status/tick-circle.png", "name": "tick-circle" }, { "url": "/images/status/tick-octagon-frame.png", "name": "tick-octagon-frame" }, { "url": "/images/status/tick-octagon.png", "name": "tick-octagon" }, { "url": "/images/status/tick-shield.png", "name": "tick-shield" }, { "url": "/images/status/tick-small-circle.png", "name": "tick-small-circle" }, { "url": "/images/status/tick-small-white.png", "name": "tick-small-white" }, { "url": "/images/status/tick-small.png", "name": "tick-small" }, { "url": "/images/status/tick-white.png", "name": "tick-white" }, { "url": "/images/status/tick.png", "name": "tick" }, { "url": "/images/status/ticket--arrow.png", "name": "ticket--arrow" }, { "url": "/images/status/ticket--exclamation.png", "name": "ticket--exclamation" }, { "url": "/images/status/ticket--minus.png", "name": "ticket--minus" }, { "url": "/images/status/ticket--pencil.png", "name": "ticket--pencil" }, { "url": "/images/status/ticket--plus.png", "name": "ticket--plus" }, { "url": "/images/status/ticket-small.png", "name": "ticket-small" }, { "url": "/images/status/ticket-stub.png", "name": "ticket-stub" }, { "url": "/images/status/ticket.png", "name": "ticket" }, { "url": "/images/status/toggle-expand.png", "name": "toggle-expand" }, { "url": "/images/status/toggle-small-expand.png", "name": "toggle-small-expand" }, { "url": "/images/status/toggle-small.png", "name": "toggle-small" }, { "url": "/images/status/toggle.png", "name": "toggle" }, { "url": "/images/status/toolbox.png", "name": "toolbox" }, { "url": "/images/status/traffic-cone--arrow.png", "name": "traffic-cone--arrow" }, { "url": "/images/status/traffic-cone--exclamation.png", "name": "traffic-cone--exclamation" }, { "url": "/images/status/traffic-cone--minus.png", "name": "traffic-cone--minus" }, { "url": "/images/status/traffic-cone--pencil.png", "name": "traffic-cone--pencil" }, { "url": "/images/status/traffic-cone--plus.png", "name": "traffic-cone--plus" }, { "url": "/images/status/traffic-cone.png", "name": "traffic-cone" }, { "url": "/images/status/traffic-light--arrow.png", "name": "traffic-light--arrow" }, { "url": "/images/status/traffic-light--exclamation.png", "name": "traffic-light--exclamation" }, { "url": "/images/status/traffic-light--minus.png", "name": "traffic-light--minus" }, { "url": "/images/status/traffic-light--pencil.png", "name": "traffic-light--pencil" }, { "url": "/images/status/traffic-light--plus.png", "name": "traffic-light--plus" }, { "url": "/images/status/traffic-light-off.png", "name": "traffic-light-off" }, { "url": "/images/status/traffic-light.png", "name": "traffic-light" }, { "url": "/images/status/trophy--arrow.png", "name": "trophy--arrow" }, { "url": "/images/status/trophy--exclamation.png", "name": "trophy--exclamation" }, { "url": "/images/status/trophy--minus.png", "name": "trophy--minus" }, { "url": "/images/status/trophy--pencil.png", "name": "trophy--pencil" }, { "url": "/images/status/trophy--plus.png", "name": "trophy--plus" }, { "url": "/images/status/trophy-bronze.png", "name": "trophy-bronze" }, { "url": "/images/status/trophy-silver.png", "name": "trophy-silver" }, { "url": "/images/status/trophy.png", "name": "trophy" }, { "url": "/images/status/ui-accordion.png", "name": "ui-accordion" }, { "url": "/images/status/ui-address-bar-green.png", "name": "ui-address-bar-green" }, { "url": "/images/status/ui-address-bar-red.png", "name": "ui-address-bar-red" }, { "url": "/images/status/ui-address-bar-yellow.png", "name": "ui-address-bar-yellow" }, { "url": "/images/status/ui-address-bar.png", "name": "ui-address-bar" }, { "url": "/images/status/ui-breadcrumb.png", "name": "ui-breadcrumb" }, { "url": "/images/status/ui-button-default.png", "name": "ui-button-default" }, { "url": "/images/status/ui-button-navigation-back.png", "name": "ui-button-navigation-back" }, { "url": "/images/status/ui-button-navigation.png", "name": "ui-button-navigation" }, { "url": "/images/status/ui-button-toggle.png", "name": "ui-button-toggle" }, { "url": "/images/status/ui-button.png", "name": "ui-button" }, { "url": "/images/status/ui-buttons.png", "name": "ui-buttons" }, { "url": "/images/status/ui-check-box-mix.png", "name": "ui-check-box-mix" }, { "url": "/images/status/ui-check-box-uncheck.png", "name": "ui-check-box-uncheck" }, { "url": "/images/status/ui-check-box.png", "name": "ui-check-box" }, { "url": "/images/status/ui-check-boxes-series.png", "name": "ui-check-boxes-series" }, { "url": "/images/status/ui-check-boxes.png", "name": "ui-check-boxes" }, { "url": "/images/status/ui-color-picker-default.png", "name": "ui-color-picker-default" }, { "url": "/images/status/ui-color-picker-switch.png", "name": "ui-color-picker-switch" }, { "url": "/images/status/ui-color-picker-transparent.png", "name": "ui-color-picker-transparent" }, { "url": "/images/status/ui-color-picker.png", "name": "ui-color-picker" }, { "url": "/images/status/ui-combo-box-blue.png", "name": "ui-combo-box-blue" }, { "url": "/images/status/ui-combo-box-calendar.png", "name": "ui-combo-box-calendar" }, { "url": "/images/status/ui-combo-box-edit.png", "name": "ui-combo-box-edit" }, { "url": "/images/status/ui-combo-box.png", "name": "ui-combo-box" }, { "url": "/images/status/ui-combo-boxes.png", "name": "ui-combo-boxes" }, { "url": "/images/status/ui-flow.png", "name": "ui-flow" }, { "url": "/images/status/ui-group-box.png", "name": "ui-group-box" }, { "url": "/images/status/ui-label-link.png", "name": "ui-label-link" }, { "url": "/images/status/ui-label.png", "name": "ui-label" }, { "url": "/images/status/ui-labels.png", "name": "ui-labels" }, { "url": "/images/status/ui-layout-panel.png", "name": "ui-layout-panel" }, { "url": "/images/status/ui-list-box-blue.png", "name": "ui-list-box-blue" }, { "url": "/images/status/ui-list-box.png", "name": "ui-list-box" }, { "url": "/images/status/ui-menu-blue.png", "name": "ui-menu-blue" }, { "url": "/images/status/ui-menu.png", "name": "ui-menu" }, { "url": "/images/status/ui-paginator.png", "name": "ui-paginator" }, { "url": "/images/status/ui-progress-bar-indeterminate.png", "name": "ui-progress-bar-indeterminate" }, { "url": "/images/status/ui-progress-bar.png", "name": "ui-progress-bar" }, { "url": "/images/status/ui-radio-button-uncheck.png", "name": "ui-radio-button-uncheck" }, { "url": "/images/status/ui-radio-button.png", "name": "ui-radio-button" }, { "url": "/images/status/ui-radio-buttons.png", "name": "ui-radio-buttons" }, { "url": "/images/status/ui-ruler.png", "name": "ui-ruler" }, { "url": "/images/status/ui-scroll-bar-horizontal.png", "name": "ui-scroll-bar-horizontal" }, { "url": "/images/status/ui-scroll-bar.png", "name": "ui-scroll-bar" }, { "url": "/images/status/ui-scroll-pane-blog.png", "name": "ui-scroll-pane-blog" }, { "url": "/images/status/ui-scroll-pane-both.png", "name": "ui-scroll-pane-both" }, { "url": "/images/status/ui-scroll-pane-detail.png", "name": "ui-scroll-pane-detail" }, { "url": "/images/status/ui-scroll-pane-form.png", "name": "ui-scroll-pane-form" }, { "url": "/images/status/ui-scroll-pane-horizontal.png", "name": "ui-scroll-pane-horizontal" }, { "url": "/images/status/ui-scroll-pane-icon.png", "name": "ui-scroll-pane-icon" }, { "url": "/images/status/ui-scroll-pane-image.png", "name": "ui-scroll-pane-image" }, { "url": "/images/status/ui-scroll-pane-list.png", "name": "ui-scroll-pane-list" }, { "url": "/images/status/ui-scroll-pane-table.png", "name": "ui-scroll-pane-table" }, { "url": "/images/status/ui-scroll-pane-text-image.png", "name": "ui-scroll-pane-text-image" }, { "url": "/images/status/ui-scroll-pane-text.png", "name": "ui-scroll-pane-text" }, { "url": "/images/status/ui-scroll-pane-tree.png", "name": "ui-scroll-pane-tree" }, { "url": "/images/status/ui-scroll-pane.png", "name": "ui-scroll-pane" }, { "url": "/images/status/ui-search-field.png", "name": "ui-search-field" }, { "url": "/images/status/ui-slider-050.png", "name": "ui-slider-050" }, { "url": "/images/status/ui-slider-100.png", "name": "ui-slider-100" }, { "url": "/images/status/ui-slider-vertical-050.png", "name": "ui-slider-vertical-050" }, { "url": "/images/status/ui-slider-vertical-100.png", "name": "ui-slider-vertical-100" }, { "url": "/images/status/ui-slider-vertical.png", "name": "ui-slider-vertical" }, { "url": "/images/status/ui-slider.png", "name": "ui-slider" }, { "url": "/images/status/ui-spin.png", "name": "ui-spin" }, { "url": "/images/status/ui-splitter-horizontal.png", "name": "ui-splitter-horizontal" }, { "url": "/images/status/ui-splitter.png", "name": "ui-splitter" }, { "url": "/images/status/ui-status-bar-blue.png", "name": "ui-status-bar-blue" }, { "url": "/images/status/ui-status-bar.png", "name": "ui-status-bar" }, { "url": "/images/status/ui-tab--arrow.png", "name": "ui-tab--arrow" }, { "url": "/images/status/ui-tab--exclamation.png", "name": "ui-tab--exclamation" }, { "url": "/images/status/ui-tab--minus.png", "name": "ui-tab--minus" }, { "url": "/images/status/ui-tab--pencil.png", "name": "ui-tab--pencil" }, { "url": "/images/status/ui-tab--plus.png", "name": "ui-tab--plus" }, { "url": "/images/status/ui-tab-bottom.png", "name": "ui-tab-bottom" }, { "url": "/images/status/ui-tab-content.png", "name": "ui-tab-content" }, { "url": "/images/status/ui-tab-side.png", "name": "ui-tab-side" }, { "url": "/images/status/ui-tab.png", "name": "ui-tab" }, { "url": "/images/status/ui-text-field-hidden.png", "name": "ui-text-field-hidden" }, { "url": "/images/status/ui-text-field-password.png", "name": "ui-text-field-password" }, { "url": "/images/status/ui-text-field-select.png", "name": "ui-text-field-select" }, { "url": "/images/status/ui-text-field-suggestion.png", "name": "ui-text-field-suggestion" }, { "url": "/images/status/ui-text-field.png", "name": "ui-text-field" }, { "url": "/images/status/ui-toolbar--arrow.png", "name": "ui-toolbar--arrow" }, { "url": "/images/status/ui-toolbar--exclamation.png", "name": "ui-toolbar--exclamation" }, { "url": "/images/status/ui-toolbar--minus.png", "name": "ui-toolbar--minus" }, { "url": "/images/status/ui-toolbar--pencil.png", "name": "ui-toolbar--pencil" }, { "url": "/images/status/ui-toolbar--plus.png", "name": "ui-toolbar--plus" }, { "url": "/images/status/ui-toolbar-bookmark.png", "name": "ui-toolbar-bookmark" }, { "url": "/images/status/ui-toolbar.png", "name": "ui-toolbar" }, { "url": "/images/status/ui-tooltip-balloon.png", "name": "ui-tooltip-balloon" }, { "url": "/images/status/ui-tooltip.png", "name": "ui-tooltip" }, { "url": "/images/status/umbrella--arrow.png", "name": "umbrella--arrow" }, { "url": "/images/status/umbrella--exclamation.png", "name": "umbrella--exclamation" }, { "url": "/images/status/umbrella--minus.png", "name": "umbrella--minus" }, { "url": "/images/status/umbrella--pencil.png", "name": "umbrella--pencil" }, { "url": "/images/status/umbrella--plus.png", "name": "umbrella--plus" }, { "url": "/images/status/umbrella.png", "name": "umbrella" }, { "url": "/images/status/universal.png", "name": "universal" }, { "url": "/images/status/usb-flash-drive--arrow.png", "name": "usb-flash-drive--arrow" }, { "url": "/images/status/usb-flash-drive--exclamation.png", "name": "usb-flash-drive--exclamation" }, { "url": "/images/status/usb-flash-drive--minus.png", "name": "usb-flash-drive--minus" }, { "url": "/images/status/usb-flash-drive--pencil.png", "name": "usb-flash-drive--pencil" }, { "url": "/images/status/usb-flash-drive--plus.png", "name": "usb-flash-drive--plus" }, { "url": "/images/status/usb-flash-drive.png", "name": "usb-flash-drive" }, { "url": "/images/status/user--arrow.png", "name": "user--arrow" }, { "url": "/images/status/user--exclamation.png", "name": "user--exclamation" }, { "url": "/images/status/user--minus.png", "name": "user--minus" }, { "url": "/images/status/user--pencil.png", "name": "user--pencil" }, { "url": "/images/status/user--plus.png", "name": "user--plus" }, { "url": "/images/status/user-black-female.png", "name": "user-black-female" }, { "url": "/images/status/user-black.png", "name": "user-black" }, { "url": "/images/status/user-business-boss.png", "name": "user-business-boss" }, { "url": "/images/status/user-business-gray-boss.png", "name": "user-business-gray-boss" }, { "url": "/images/status/user-business-gray.png", "name": "user-business-gray" }, { "url": "/images/status/user-business.png", "name": "user-business" }, { "url": "/images/status/user-detective-gray.png", "name": "user-detective-gray" }, { "url": "/images/status/user-detective.png", "name": "user-detective" }, { "url": "/images/status/user-female.png", "name": "user-female" }, { "url": "/images/status/user-gray-female.png", "name": "user-gray-female" }, { "url": "/images/status/user-gray.png", "name": "user-gray" }, { "url": "/images/status/user-green-female.png", "name": "user-green-female" }, { "url": "/images/status/user-green.png", "name": "user-green" }, { "url": "/images/status/user-medium-female.png", "name": "user-medium-female" }, { "url": "/images/status/user-medium.png", "name": "user-medium" }, { "url": "/images/status/user-nude-female.png", "name": "user-nude-female" }, { "url": "/images/status/user-nude.png", "name": "user-nude" }, { "url": "/images/status/user-red-female.png", "name": "user-red-female" }, { "url": "/images/status/user-red.png", "name": "user-red" }, { "url": "/images/status/user-silhouette-question.png", "name": "user-silhouette-question" }, { "url": "/images/status/user-silhouette.png", "name": "user-silhouette" }, { "url": "/images/status/user-small-female.png", "name": "user-small-female" }, { "url": "/images/status/user-small.png", "name": "user-small" }, { "url": "/images/status/user-thief-baldie.png", "name": "user-thief-baldie" }, { "url": "/images/status/user-thief-female.png", "name": "user-thief-female" }, { "url": "/images/status/user-thief.png", "name": "user-thief" }, { "url": "/images/status/user-white-female.png", "name": "user-white-female" }, { "url": "/images/status/user-white.png", "name": "user-white" }, { "url": "/images/status/user-worker-boss.png", "name": "user-worker-boss" }, { "url": "/images/status/user-worker.png", "name": "user-worker" }, { "url": "/images/status/user-yellow-female.png", "name": "user-yellow-female" }, { "url": "/images/status/user-yellow.png", "name": "user-yellow" }, { "url": "/images/status/user.png", "name": "user" }, { "url": "/images/status/users.png", "name": "users" }, { "url": "/images/status/validation-document.png", "name": "validation-document" }, { "url": "/images/status/validation-invalid-document.png", "name": "validation-invalid-document" }, { "url": "/images/status/validation-invalid.png", "name": "validation-invalid" }, { "url": "/images/status/validation-label-html.png", "name": "validation-label-html" }, { "url": "/images/status/validation-label.png", "name": "validation-label" }, { "url": "/images/status/validation-valid-document.png", "name": "validation-valid-document" }, { "url": "/images/status/validation-valid.png", "name": "validation-valid" }, { "url": "/images/status/validation.png", "name": "validation" }, { "url": "/images/status/vise-drawer.png", "name": "vise-drawer" }, { "url": "/images/status/vise.png", "name": "vise" }, { "url": "/images/status/wall--arrow.png", "name": "wall--arrow" }, { "url": "/images/status/wall--exclamation.png", "name": "wall--exclamation" }, { "url": "/images/status/wall--minus.png", "name": "wall--minus" }, { "url": "/images/status/wall--pencil.png", "name": "wall--pencil" }, { "url": "/images/status/wall--plus.png", "name": "wall--plus" }, { "url": "/images/status/wall-break.png", "name": "wall-break" }, { "url": "/images/status/wall-brick.png", "name": "wall-brick" }, { "url": "/images/status/wall-small-brick.png", "name": "wall-small-brick" }, { "url": "/images/status/wall-small.png", "name": "wall-small" }, { "url": "/images/status/wall.png", "name": "wall" }, { "url": "/images/status/wallet--arrow.png", "name": "wallet--arrow" }, { "url": "/images/status/wallet--exclamation.png", "name": "wallet--exclamation" }, { "url": "/images/status/wallet--minus.png", "name": "wallet--minus" }, { "url": "/images/status/wallet--pencil.png", "name": "wallet--pencil" }, { "url": "/images/status/wallet--plus.png", "name": "wallet--plus" }, { "url": "/images/status/wallet.png", "name": "wallet" }, { "url": "/images/status/wand--arrow.png", "name": "wand--arrow" }, { "url": "/images/status/wand--exclamation.png", "name": "wand--exclamation" }, { "url": "/images/status/wand--minus.png", "name": "wand--minus" }, { "url": "/images/status/wand--pencil.png", "name": "wand--pencil" }, { "url": "/images/status/wand--plus.png", "name": "wand--plus" }, { "url": "/images/status/wand-hat.png", "name": "wand-hat" }, { "url": "/images/status/wand-small.png", "name": "wand-small" }, { "url": "/images/status/wand.png", "name": "wand" }, { "url": "/images/status/water--arrow.png", "name": "water--arrow" }, { "url": "/images/status/water--exclamation.png", "name": "water--exclamation" }, { "url": "/images/status/water--minus.png", "name": "water--minus" }, { "url": "/images/status/water--pencil.png", "name": "water--pencil" }, { "url": "/images/status/water--plus.png", "name": "water--plus" }, { "url": "/images/status/water.png", "name": "water" }, { "url": "/images/status/weather-cloud.png", "name": "weather-cloud" }, { "url": "/images/status/weather-clouds.png", "name": "weather-clouds" }, { "url": "/images/status/weather-cloudy.png", "name": "weather-cloudy" }, { "url": "/images/status/weather-fog.png", "name": "weather-fog" }, { "url": "/images/status/weather-lightning.png", "name": "weather-lightning" }, { "url": "/images/status/weather-moon-clouds.png", "name": "weather-moon-clouds" }, { "url": "/images/status/weather-moon-fog.png", "name": "weather-moon-fog" }, { "url": "/images/status/weather-moon.png", "name": "weather-moon" }, { "url": "/images/status/weather-rain.png", "name": "weather-rain" }, { "url": "/images/status/weather-snow.png", "name": "weather-snow" }, { "url": "/images/status/weather.png", "name": "weather" }, { "url": "/images/status/webcam--arrow.png", "name": "webcam--arrow" }, { "url": "/images/status/webcam--exclamation.png", "name": "webcam--exclamation" }, { "url": "/images/status/webcam--minus.png", "name": "webcam--minus" }, { "url": "/images/status/webcam--pencil.png", "name": "webcam--pencil" }, { "url": "/images/status/webcam--plus.png", "name": "webcam--plus" }, { "url": "/images/status/webcam-network.png", "name": "webcam-network" }, { "url": "/images/status/webcam.png", "name": "webcam" }, { "url": "/images/status/wheel.png", "name": "wheel" }, { "url": "/images/status/wooden-box--arrow.png", "name": "wooden-box--arrow" }, { "url": "/images/status/wooden-box--exclamation.png", "name": "wooden-box--exclamation" }, { "url": "/images/status/wooden-box--minus.png", "name": "wooden-box--minus" }, { "url": "/images/status/wooden-box--pencil.png", "name": "wooden-box--pencil" }, { "url": "/images/status/wooden-box--plus.png", "name": "wooden-box--plus" }, { "url": "/images/status/wooden-box-label.png", "name": "wooden-box-label" }, { "url": "/images/status/wooden-box.png", "name": "wooden-box" }, { "url": "/images/status/wrench--arrow.png", "name": "wrench--arrow" }, { "url": "/images/status/wrench--exclamation.png", "name": "wrench--exclamation" }, { "url": "/images/status/wrench--minus.png", "name": "wrench--minus" }, { "url": "/images/status/wrench--pencil.png", "name": "wrench--pencil" }, { "url": "/images/status/wrench--plus.png", "name": "wrench--plus" }, { "url": "/images/status/wrench-screwdriver.png", "name": "wrench-screwdriver" }, { "url": "/images/status/wrench.png", "name": "wrench" }, { "url": "/images/status/xfn-colleague-met.png", "name": "xfn-colleague-met" }, { "url": "/images/status/xfn-colleague.png", "name": "xfn-colleague" }, { "url": "/images/status/xfn-friend-met.png", "name": "xfn-friend-met" }, { "url": "/images/status/xfn-friend.png", "name": "xfn-friend" }, { "url": "/images/status/xfn-sweetheart-met.png", "name": "xfn-sweetheart-met" }, { "url": "/images/status/xfn-sweetheart.png", "name": "xfn-sweetheart" }, { "url": "/images/status/xfn.png", "name": "xfn" }, { "url": "/images/status/yin-yang.png", "name": "yin-yang" }, { "url": "/images/status/zone--arrow.png", "name": "zone--arrow" }, { "url": "/images/status/zone--exclamation.png", "name": "zone--exclamation" }, { "url": "/images/status/zone--minus.png", "name": "zone--minus" }, { "url": "/images/status/zone--pencil.png", "name": "zone--pencil" }, { "url": "/images/status/zone--plus.png", "name": "zone--plus" }, { "url": "/images/status/zone-money.png", "name": "zone-money" }, { "url": "/images/status/zone-select.png", "name": "zone-select" }, { "url": "/images/status/zone.png", "name": "zone" }, { "url": "/images/status/zones-stack.png", "name": "zones-stack" }, { "url": "/images/status/zones.png", "name": "zones" } ]
25.193545
79
0.472439
0
0
0
0
0
0
0
0
165,519
0.623626
6613dec8d628000fe7b472846f82eac73bd8f3ea
49,047
py
Python
autojail/config/memory.py
ekut-es/autojail
bc16e40e6df55c0a28a3059715851ffa59b14ba8
[ "MIT" ]
6
2020-08-12T08:16:15.000Z
2022-03-05T02:25:53.000Z
autojail/config/memory.py
ekut-es/autojail
bc16e40e6df55c0a28a3059715851ffa59b14ba8
[ "MIT" ]
1
2021-03-30T10:34:51.000Z
2021-06-09T11:24:00.000Z
autojail/config/memory.py
ekut-es/autojail
bc16e40e6df55c0a28a3059715851ffa59b14ba8
[ "MIT" ]
1
2021-11-21T09:30:58.000Z
2021-11-21T09:30:58.000Z
import copy import logging import math import sys from collections import defaultdict from functools import reduce from typing import ( Any, Callable, Dict, Iterable, List, Optional, Sequence, Tuple, Union, ) import tabulate from ortools.sat.python import cp_model from ..model import ( Board, CellConfig, DeviceMemoryRegion, HypervisorMemoryRegion, JailhouseConfig, MemoryRegion, MemoryRegionData, ShMemNetRegion, ) from ..model.datatypes import HexInt from ..model.parameters import GenerateConfig, GenerateParameters, ScalarChoice from ..utils import get_overlap from .passes import BasePass class MemoryAllocationInfeasibleException(Exception): pass class AllocatorSegment: def __init__( self, name: str = "unnamed", alignment: int = 2 ** 12, shared_regions: Optional[ Dict[ str, List[ Union[ MemoryRegion, DeviceMemoryRegion, HypervisorMemoryRegion ] ], ] ] = None, ) -> None: self.name = name self.shared_regions: Optional[ Dict[ str, List[ Union[ MemoryRegion, DeviceMemoryRegion, HypervisorMemoryRegion ] ], ] ] = defaultdict(list) if shared_regions: self.shared_regions.update(shared_regions) self.alignment = alignment self.constraint: Optional[MemoryConstraint] = None @property def physical_start_addr(self): key = self.shared_regions.keys()[0] return self.shared_regions[key][0].physical_start_addr @property def size(self): key = list(self.shared_regions)[0] return sum(map(lambda r: r.size, self.shared_regions[key])) class MemoryConstraint(object): """Implements a generic constraint for AllocatorSegments""" def __init__( self, size: int, virtual: bool, start_addr: int = None ) -> None: self.size = size self.virtual = virtual self.start_addr: Optional[int] = start_addr self.address_range: Optional[Tuple[int, int]] = None # Addresses must be aligned such that # addr % self.alignment == 0 self.alignment: Optional[int] = None # Constraint for Memory regions where physical == virtual address # E.g. mem loadable in root cell self.equal_constraint: Optional["MemoryConstraint"] = None # Solver Interval Variable self.bound_vars: Optional[Tuple[Any, Any]] = None # Values for the allocated range after constraint solving self.allocated_range: Optional[Tuple[int, int]] = None # allow arbitrary actions upon resolving a constraint # this method is called iff, the solver found a valid # solution and assigned start_addr # Parameters: # - self: MemoryConstraint self.resolved: Optional[Callable[[MemoryConstraint], None]] = None def __str__(self): ret = "" if self.start_addr is not None: ret += f"addr: {hex(self.start_addr)} " if self.address_range: ret += f"range: {hex(self.address_range[0])}-{hex(self.address_range[1])} " if self.alignment: ret += f"alignment: {self.alignment} " if self.address_range: ret += f"allocated: {hex(self.address_range[0])}-{hex(self.adress_range[1])} " ret += f"size: {self.size} virtual: {self.virtual}" return ret # Returns a constraint that satisfies both # <self> and <other>, if possible # Fails otherwise def merge(self, other): assert ( self.virtual == other.virtual and "Unable to merge constraints for physical and virtual addresses" ) assert ( self.size == other.size and "Unable to merge constraints with different size" ) assert ( self.start_addr == other.start_addr and "Unbable to merge constraints with different start addresses" ) alignment = self.alignment if other.alignment: if alignment: alignment = (self.alignment * other.alignment) / math.gcd( self.alignment, other.alignment ) else: alignment = other.alignment resolved = self.resolved if other.resolved: if resolved: def callback(mc: MemoryConstraint): assert self.resolved assert other.resolved self.resolved(mc) other.resolved(mc) resolved = callback else: resolved = other.resolved mc = MemoryConstraint(self.size, self.virtual) mc.virtual = self.virtual mc.start_addr = self.start_addr mc.alignment = alignment mc.resolved = resolved class NoOverlapConstraint(object): """Implements a generic no-overlap constraint""" def __init__(self) -> None: self.constraints: List[MemoryConstraint] = [] def add_memory_constraint(self, mc: MemoryConstraint) -> None: self.constraints.append(mc) def __str__(self): return str(self.__dict__) class CPMemorySolver(object): def __init__( self, constraints: List[NoOverlapConstraint], physical_domain: cp_model.Domain, virtual_domain: cp_model.Domain, ): self.constraints = constraints self.model = cp_model.CpModel() self.physical_domain = physical_domain self.virtual_domain = virtual_domain self.ivars: Dict[cp_model.IntervalVar, MemoryConstraint] = dict() self.vars: Dict[ cp_model.IntervalVar, Tuple[cp_model.IntVar, cp_model.IntVar] ] = dict() self._build_cp_constraints() def solve(self): solver = cp_model.CpSolver() solver.parameters.log_search_progress = True status = solver.Solve(self.model) if status == cp_model.FEASIBLE or status == cp_model.OPTIMAL: for ivar, mc in self.ivars.items(): lower, upper = self.vars[ivar] mc.allocated_range = solver.Value(lower), solver.Value(upper) else: print("Memory allocation infeasible") raise MemoryAllocationInfeasibleException() def _build_cp_constraints(self): equal_pairs = [] for overlap_index, no_overlap in enumerate(self.constraints): cp_no_overlap = [] for constr_index, constr in enumerate(no_overlap.constraints): lower = None upper = None constr_name = f"constr_{overlap_index}_{constr_index}" if constr.start_addr is not None: lower = self.model.NewConstant(constr.start_addr) upper = self.model.NewConstant( constr.start_addr + constr.size ) else: if constr.address_range: l_addr, u_addr = constr.address_range lower = self.model.NewIntVar( l_addr, u_addr, f"{constr_name}_lower" ) else: domain = self.physical_domain if constr.virtual: domain = self.virtual_domain lower = self.model.NewIntVarFromDomain( domain, f"{constr_name}_lower" ) if constr.address_range: l_addr, u_addr = constr.address_range upper = self.model.NewIntVar( l_addr, u_addr, f"{constr_name}_upper" ) else: domain = self.physical_domain if constr.virtual: domain = self.virtual_domain upper = self.model.NewIntVarFromDomain( domain, f"{constr_name}_upper" ) ivar = self.model.NewIntervalVar( lower, constr.size, upper, f"{constr_name}_ivar" ) print(lower, constr.size, upper) constr.bound_vars = (lower, upper) if constr.alignment: self.model.AddModuloEquality(0, lower, constr.alignment) if constr.equal_constraint: equal_pairs.append((constr, constr.equal_constraint)) cp_no_overlap.append(ivar) self.ivars[ivar] = constr self.vars[ivar] = (lower, upper) self.model.AddNoOverlap(cp_no_overlap) for first, second in equal_pairs: self.model.Add(first.bound_vars[0] == second.bound_vars[0]) self.model.Add(first.bound_vars[1] == second.bound_vars[1]) class AllocateMemoryPass(BasePass): """Implements a simple MemoryAllocator for AutoJail""" def __init__(self) -> None: self.logger = logging.getLogger("autojail") self.config: Optional[JailhouseConfig] = None self.board: Optional[Board] = None self.root_cell: Optional[CellConfig] = None self.root_cell_id: Optional[str] = None self.unallocated_segments: List[AllocatorSegment] = [] self.allocated_regions: List[MemoryRegionData] = [] self.per_region_constraints: Dict[str, MemoryConstraint] = dict() # data structure for creating and handling generic # constraints self.physical_domain: cp_model.Domain = None self.virtual_domain: cp_model.Domain = None self.global_no_overlap = NoOverlapConstraint() self.no_overlap_constraints: Dict[ str, NoOverlapConstraint ] = defaultdict(NoOverlapConstraint) self.memory_constraints: Dict[ MemoryConstraint, AllocatorSegment ] = dict() def _iter_constraints(self, f_no_overlap, f_mc): for cell_name, no_overlap in self.no_overlap_constraints.items(): if not f_no_overlap(cell_name, no_overlap): continue for mc in no_overlap.constraints: f_mc(cell_name, mc) def _dump_constraints(self): constraint_tables = {} def f_no_overlap( cell_name: str, no_overlap: NoOverlapConstraint ) -> bool: constraint_tables[cell_name] = [] return True def f_mc(cell_name: str, mc: MemoryConstraint) -> None: constraint_tables[cell_name].append( [ hex(mc.start_addr) if mc.start_addr is not None else "-", hex(mc.address_range[0]) + "-" + hex(mc.address_range[1]) if mc.address_range else "-", str(mc.size) if mc.size is not None else "-", str(mc.alignment) if mc.alignment else "-", str(mc.virtual), "yes" if mc.equal_constraint else "-", str(mc.resolved) if mc.resolved else "-", ] ) self._iter_constraints(f_no_overlap, f_mc) self.logger.info("") self.logger.info("Memory Constraints:") for cell_name, constraints in constraint_tables.items(): self.logger.info("Cell: %s", cell_name) formatted = tabulate.tabulate( constraints, headers=[ "Start Address", "Start Address Range", "Size", "Alignment", "Virtual?", "Equal?", "Resolved callback", ], ) self.logger.info(formatted) self.logger.info("") def _check_constraints(self): def f_no_overlap(cell_name, no_overlap): full_regions = [] def insert_region(region): o_start, o_end = region for (start, end) in full_regions: if ( (o_start <= start and start <= o_end) or (o_start <= end and end <= o_end) or (start <= o_start and o_start <= end) or (start <= o_end and o_end <= end) ): print( f"Regions overlap for {cell_name}: (0x{start:x}, 0x{end:x}) and (0x{o_start:x}, 0x{o_end:x})" ) if mc not in self.memory_constraints: continue seg = self.memory_constraints[mc] print("Affected memory cells:") for sharer in seg.shared_regions.keys(): print(f"\t{sharer}") full_regions.append(region) for mc in no_overlap.constraints: if mc.start_addr is not None: region = (mc.start_addr, mc.start_addr + mc.size - 1) insert_region(region) return False def f_mc(cell_name, mc): pass self._iter_constraints(f_no_overlap, f_mc) def __call__( self, board: Board, config: JailhouseConfig ) -> Tuple[Board, JailhouseConfig]: self.logger.info("Memory Allocator") self.board = board self.config = config self.root_cell = None for id, cell in self.config.cells.items(): if cell.type == "root": self.root_cell = cell self.root_cell_id = id break vmem_size = 2 ** 32 if self.board.virtual_address_bits > 32: vmem_size = 2 ** (self.board.virtual_address_bits - 1) self.virtual_domain = cp_model.Domain(0, vmem_size) self._build_allocation_domain() self.logger.info( "Physical Memory Domain: %s", str(self.physical_domain.FlattenedIntervals()), ) self.logger.info( "Virtual Memory domain: %s", str(self.virtual_domain.FlattenedIntervals()), ) self.no_overlap_constraints["__global"] = self.global_no_overlap self.unallocated_segments = self._build_unallocated_segments() self._lift_loadable() self._preallocate_vpci() self.logger.info("") self.logger.info("Unallocated physical segments: ") table = [ [ s.name, s.size, len(s.shared_regions if s.shared_regions else []), ",".join(s.shared_regions.keys() if s.shared_regions else []), ] for s in self.unallocated_segments ] self.logger.info( tabulate.tabulate( table, headers=["Name", "Size (Byte)", "# Subregions", "Sharers"], ) ) for seg in self.unallocated_segments: assert seg.size > 0 assert seg.shared_regions mc_global = None for sharer, regions in seg.shared_regions.items(): mc_seg = seg.constraint mc_local = MemoryConstraint(seg.size, True) if mc_seg and mc_seg.alignment: mc_local.alignment = mc_seg.alignment else: if regions[0].virtual_start_addr is None: mc_local.alignment = seg.alignment fst_region = regions[0] if fst_region.virtual_start_addr is not None: if mc_seg and mc_seg.start_addr and mc_seg.virtual: assert ( mc_seg.start_addr == fst_region.virtual_start_addr and "Invalid state detected: start addresses must be equal" ) mc_local.start_addr = fst_region.virtual_start_addr elif mc_seg and mc_seg.start_addr and mc_seg.virtual: mc_local.start_addr = mc_seg.start_addr if mc_seg and mc_seg.virtual: mc_local.resolved = mc_seg.resolved if not mc_global: mc_global = copy.deepcopy(mc_local) mc_global.virtual = False mc_global.start_addr = None if fst_region.physical_start_addr is not None: if mc_seg and mc_seg.start_addr and not mc_seg.virtual: assert ( mc_seg.start_addr == fst_region.virtual_start_addr and "Invalid state detected: start addresses must be equal" ) mc_global.start_addr = fst_region.physical_start_addr elif mc_seg and mc_seg.start_addr and not mc_seg.virtual: mc_global.start_addr = mc_seg.start_addr if mc_seg and not mc_seg.virtual: mc_global.resolved = mc_seg.resolved if mc_global.start_addr and mc_global.size: print( f"Adding global no-overlapp (shared): [0x{mc_global.start_addr:x}, 0x{mc_global.start_addr + mc_global.size:x}]" ) self.global_no_overlap.add_memory_constraint(mc_global) self.memory_constraints[mc_global] = seg # Add physical == virtual constraint for MEM_LOADABLEs in root cell if sharer == self.root_cell_id: is_loadable = False for shared_regions in seg.shared_regions.values(): for shared_region in shared_regions: if isinstance(shared_region, MemoryRegionData): for flag in shared_region.flags: if flag == "MEM_LOADABLE": is_loadable = True if is_loadable: mc_local.equal_constraint = mc_global self.no_overlap_constraints[sharer].add_memory_constraint( mc_local ) self.memory_constraints[mc_local] = seg # Add virtually reserved segments for cell_name, cell in self.config.cells.items(): assert cell.memory_regions is not None for memory_region in cell.memory_regions.values(): assert memory_region is not None if isinstance(memory_region, HypervisorMemoryRegion): continue if isinstance(memory_region, ShMemNetRegion): continue assert isinstance(memory_region, MemoryRegionData) if ( memory_region.virtual_start_addr is not None and memory_region.physical_start_addr is not None ): if memory_region.allocatable: continue assert memory_region.size is not None memory_constraint = MemoryConstraint( size=int(memory_region.size), virtual=True, start_addr=memory_region.virtual_start_addr, ) self.no_overlap_constraints[ cell_name ].add_memory_constraint(memory_constraint) self._add_gic_constraints() self._dump_constraints() solver = CPMemorySolver( list(self.no_overlap_constraints.values()), self.physical_domain, self.virtual_domain, ) try: solver.solve() except MemoryAllocationInfeasibleException: self._check_constraints() sys.exit(-1) for cell_name, no_overlap_constr in self.no_overlap_constraints.items(): for constr in no_overlap_constr.constraints: if not constr.allocated_range: print(constr, "has not been allocated") continue (start, _) = constr.allocated_range if constr.resolved: constr.resolved(constr) if constr not in self.memory_constraints: continue seg = self.memory_constraints[constr] if cell_name == "__global": assert seg.shared_regions for _, regions in seg.shared_regions.items(): for region in regions: if region.physical_start_addr is None: region.physical_start_addr = HexInt(start) else: assert seg.shared_regions assert constr.virtual for region in seg.shared_regions[cell_name]: if region.virtual_start_addr is None: region.virtual_start_addr = HexInt(start) self._remove_allocatable() return self.board, self.config def _add_gic_constraints(self): interrupt_ranges: List[Tuple[int, int]] = [] for interrupt_controller in self.board.interrupt_controllers: if interrupt_controller.gic_version == 2: interrupt_ranges.append( (interrupt_controller.gicd_base, 0x1000) ) interrupt_ranges.append( (interrupt_controller.gicc_base, 0x2000) ) interrupt_ranges.append( (interrupt_controller.gich_base, 0x2000) ) interrupt_ranges.append( (interrupt_controller.gicv_base, 0x2000) ) elif interrupt_controller.gic_version == 3: interrupt_ranges.append( (interrupt_controller.gicd_base, 0x10000) ) interrupt_ranges.append( (interrupt_controller.gicr_base, 0x20000) ) for name, constraint in self.no_overlap_constraints.items(): for interrupt_range in interrupt_ranges: mc = MemoryConstraint( size=interrupt_range[1], start_addr=interrupt_range[0], virtual=False if name == "__global" else True, ) constraint.add_memory_constraint(mc) def _lift_loadable(self): root_cell = self.root_cell for cell_name, cell in self.config.cells.items(): if cell.type == "root": continue for name, region in cell.memory_regions.items(): if region.flags and "MEM_LOADABLE" in region.flags: root_region_name = f"{name}@{cell_name}" print("Adding region:", root_region_name, "to root cell") copy_region = copy.deepcopy(region) copy_region.flags.remove("MEM_LOADABLE") if "MEM_EXECUTE" in copy_region.flags: copy_region.flags.remove("MEM_EXECUTE") if "MEM_DMA" in copy_region.flags: copy_region.flags.remove("MEM_DMA") # FIXME: is it really true, that that MEM_LOADABLE must be the same at their respective memory region copy_region.virtual_start_addr = ( copy_region.physical_start_addr ) root_cell.memory_regions[root_region_name] = copy_region for seg in self.unallocated_segments: if cell_name not in seg.shared_regions: continue if region not in seg.shared_regions[cell_name]: continue seg.shared_regions["root"].append(copy_region) def _build_allocation_domain(self) -> None: assert self.root_cell is not None assert self.root_cell.memory_regions is not None assert self.board is not None start = None end = 0 allocatable_regions = [] for region in self.board.memory_regions.values(): assert region is not None if isinstance(region, MemoryRegionData) and region.allocatable: assert region.physical_start_addr is not None assert region.size is not None allocatable_regions.append(region) tmp_start = region.physical_start_addr tmp_end = region.physical_start_addr + region.size if start is None: start = tmp_start if tmp_start < start: start = tmp_start if tmp_end > end: end = tmp_end allocatable_regions.sort( key=lambda r: r.physical_start_addr if r.physical_start_addr is not None else 0 ) holes: List[List[int]] = [] for i in range(0, len(allocatable_regions) - 1): r0 = allocatable_regions[i] r1 = allocatable_regions[i + 1] assert r0.physical_start_addr is not None and r0.size is not None assert r1.physical_start_addr is not None r0_end = r0.physical_start_addr + r0.size r1_start = r1.physical_start_addr if r0_end != r1_start: holes.append([r0_end, r1_start]) # Physical domain spans the entire range from the first allocatable memory region # to the end of the last one. Any holes in that range are accomodated for using # constant interval constraints def remove_hole(start, end): try: holes.remove([start, end]) except ValueError: pass self.physical_domain = cp_model.Domain.FromIntervals([[start, end]]) # Make sure all pre-allocated regions part of a cell have a corresponding # constraint (technically, we only need constraints for those regions that # overlapp with the allocatable range/physical domain) non_alloc_ranges: List[List[int]] = [] assert self.config for cell in self.config.cells.values(): assert cell.memory_regions for r in cell.memory_regions.values(): if not isinstance(r, ShMemNetRegion) and not isinstance( r, MemoryRegion ): continue if r.physical_start_addr is not None: assert r.size is not None end = r.physical_start_addr + r.size non_alloc_range = [r.physical_start_addr, end] if non_alloc_range in non_alloc_ranges: continue if not self.physical_domain.Contains( non_alloc_range[0] ) and not self.physical_domain.Contains(non_alloc_range[1]): continue non_alloc_ranges.append(non_alloc_range) remove_hole(r.physical_start_addr, end) mc = MemoryConstraint(r.size, False, r.physical_start_addr) self.global_no_overlap.add_memory_constraint(mc) # fill remaining holes in between allocatable regions for hole in holes: s, e = hole size = e - s mc = MemoryConstraint(size, False, s) self.global_no_overlap.add_memory_constraint(mc) def _remove_allocatable(self): """Finally remove allocatable memory regions from cells""" assert self.config is not None for cell in self.config.cells.values(): delete_list = [] for name, region in cell.memory_regions.items(): if isinstance(region, MemoryRegionData): if region.allocatable: delete_list.append(name) for name in delete_list: del cell.memory_regions[name] def _build_unallocated_segments( self, key: Callable = lambda x: x.physical_start_addr ) -> List[AllocatorSegment]: assert self.config assert self.config.cells ana = UnallocatedOrSharedSegmentsAnalysis( self.root_cell, self.config.cells, self.logger, self.per_region_constraints, self.physical_domain, key, ) ana.run() unallocated = ana.unallocated assert unallocated return unallocated def _preallocate_vpci(self): """Preallocate a virtual page on all devices""" assert self.config is not None if self.root_cell and self.root_cell.platform_info: # see hypvervisor/pci.c:850 end_bus = self.root_cell.platform_info.pci_mmconfig_end_bus vpci_size = (end_bus + 2) * 256 * 4096 if self.root_cell.platform_info.pci_mmconfig_base: for constraints in self.no_overlap_constraints.values(): mc = MemoryConstraint( vpci_size, True, self.root_cell.platform_info.pci_mmconfig_base, ) constraints.add_memory_constraint(mc) else: def callback(mc: MemoryConstraint): assert mc.allocated_range assert self.root_cell assert self.root_cell.platform_info assert self.root_cell.memory_regions physical_start_addr, _ = mc.allocated_range self.root_cell.platform_info.pci_mmconfig_base = HexInt( physical_start_addr ) self.logger.info( "Print resolved pci_mmconfig %s", hex(physical_start_addr), ) # Allocate vpci physically last_mc = MemoryConstraint( vpci_size, True ) # This is a physical constraint, but it does not need to be backed by allocatable memory last_mc.resolved = callback last_mc.alignment = self.board.pagesize last_mc.address_range = (0x0, 2 ** 32 - 1) self.no_overlap_constraints["__global"].add_memory_constraint( last_mc ) for cell_name in self.config.cells.keys(): mc = MemoryConstraint(vpci_size, True) mc.equal_constraint = last_mc self.no_overlap_constraints[ cell_name ].add_memory_constraint(mc) mc.alignment = self.board.pagesize last_mc = mc class UnallocatedOrSharedSegmentsAnalysis(object): """ Group unallocated memory regions into segments that are allocated continuously. Detect (un-)allocated regions that are shared between cells """ def __init__( self, root_cell, cells, logger, per_region_constraints, physical_domain, key=lambda x: x.physical_start_addr, ) -> None: self.root_cell: CellConfig = root_cell self.cells: Dict[str, CellConfig] = cells self.logger = logger self.key = key self.per_region_constraints = per_region_constraints self.physical_domain: Optional[cp_model.Domain] = physical_domain # result store self.unallocated: List[AllocatorSegment] = [] self.shared: Dict[str, AllocatorSegment] = {} def _detect_shared_memio(self): shared: Dict[ Tuple[int, int], Tuple[int, List[MemoryRegionData]] ] = defaultdict(lambda: (0, [])) for cell in self.cells.values(): for region in cell.memory_regions.values(): if not isinstance(region, MemoryRegionData): continue if not self.key(region) or "MEM_IO" not in region.flags: continue start = region.physical_start_addr key = (start, region.size) count, regions = shared[key] regions.append(region) shared[key] = (count + 1, regions) for count, regions in shared.values(): if count > 1: for region in regions: region.shared = True def _log_shared_segments(self): self.logger.info("Shared segments:") for name, seg in self.shared.items(): self.logger.info(f"Region: '{name}' shared by") for cell_name in seg.shared_regions: self.logger.info(f"\t{cell_name}") self.logger.info("\n") def run(self) -> None: assert self.root_cell is not None assert self.cells is not None self._detect_shared_memio() # Add cell memories self.logger.debug("building allocatable regions") for cell_name, cell in self.cells.items(): assert cell is not None assert cell.memory_regions is not None for region_name, region in cell.memory_regions.items(): if not isinstance(region, MemoryRegionData): continue if region.allocatable: continue assert self.shared is not None if region.shared and region_name in self.shared: current_segment = self.shared[region_name] assert current_segment.shared_regions current_segment.shared_regions[cell_name].append(region) if region_name in self.per_region_constraints: constraint = self.per_region_constraints[region_name] if current_segment.constraint: constraint = constraint.merge( current_segment.constraint ) current_segment.constraint = constraint else: current_segment = AllocatorSegment( region_name, shared_regions={cell_name: [region]}, ) if region_name in self.per_region_constraints: current_segment.constraint = self.per_region_constraints[ region_name ] if region.physical_start_addr is None: self.unallocated.append(current_segment) # TODO are shared regions required to have # the same name accross cells? if region.shared: self.shared[region_name] = current_segment # Add hypervisor memories hypervisor_memory = self.root_cell.hypervisor_memory assert isinstance(hypervisor_memory, HypervisorMemoryRegion) if hypervisor_memory.physical_start_addr is None: self.unallocated.append( AllocatorSegment( "hypervisor_memory", alignment=hypervisor_memory.size, # FIXME: this is too much alignment shared_regions={"hypervisor": [hypervisor_memory]}, ) ) self._log_shared_segments() class MergeIoRegionsPass(BasePass): """ Merge IO regions in root cell that are at most n kB apart. n defaults to 64 kb """ def __init__( self, set_params: Optional[GenerateConfig], gen_params: Optional[GenerateParameters], ) -> None: self.config: Optional[JailhouseConfig] = None self.board: Optional[Board] = None self.root_cell: Optional[CellConfig] = None self.logger = logging.getLogger("autojail") self.max_dist = 64 * 1024 if set_params: self.max_dist = set_params.mem_io_merge_threshold if gen_params: threshold_choice = ScalarChoice() threshold_choice.lower = 1024 threshold_choice.upper = 64 * 1024 * 1024 threshold_choice.step = 1024 threshold_choice.integer = True threshold_choice.log = True gen_params.mem_io_merge_threshold = threshold_choice def __call__( self, board: Board, config: JailhouseConfig ) -> Tuple[Board, JailhouseConfig]: self.logger.info("Merge IO Regions") self.board = board self.config = config for cell in self.config.cells.values(): if cell.type == "root": self.root_cell = cell assert self.root_cell assert self.root_cell.memory_regions shared_regions_ana = UnallocatedOrSharedSegmentsAnalysis( self.root_cell, self.config.cells, self.logger, dict(), None, key=lambda region: region.physical_start_addr, ) shared_regions_ana.run() def get_io_regions( regions: Dict[ str, Union[str, ShMemNetRegion, MemoryRegion, DeviceMemoryRegion], ] ) -> List[Tuple[str, Union[DeviceMemoryRegion, MemoryRegion]]]: return list( [ (name, r) for name, r in regions.items() if isinstance(r, MemoryRegionData) and "MEM_IO" in r.flags ] ) regions: Sequence[Tuple[str, MemoryRegionData]] = get_io_regions( self.root_cell.memory_regions ) regions = sorted( regions, key=lambda t: t[1].physical_start_addr if t[1].physical_start_addr is not None else 0, ) grouped_regions: List[List[Tuple[str, MemoryRegionData]]] = [] current_group: List[Tuple[str, MemoryRegionData]] = [] max_dist = self.max_dist vpci_start_addr = None vpci_end_addr = None if ( self.root_cell.platform_info is not None and self.root_cell.platform_info.pci_mmconfig_base is not None and self.root_cell.platform_info.pci_mmconfig_base > 0 ): vpci_start_addr = self.root_cell.platform_info.pci_mmconfig_base vpci_end_addr = ( vpci_start_addr + (self.root_cell.platform_info.pci_mmconfig_end_bus + 1) * 256 * 4096 ) for name, r in regions: assert r.physical_start_addr is not None assert r.size is not None if current_group: r1_end = r.physical_start_addr + r.size r1_start = r.physical_start_addr assert current_group[-1][1].physical_start_addr is not None assert current_group[-1][1].size is not None assert current_group[0][1].physical_start_addr is not None last_region_end = ( current_group[-1][1].physical_start_addr + current_group[-1][1].size ) # Do not merge regions if merged regions would # overlap with gic gic_overlap = False interrupt_ranges = [] for interrupt_controller in board.interrupt_controllers: if interrupt_controller.gic_version == 2: interrupt_ranges.append( (interrupt_controller.gicd_base, 0x1000) ) interrupt_ranges.append( (interrupt_controller.gicc_base, 0x2000) ) interrupt_ranges.append( (interrupt_controller.gich_base, 0x2000) ) interrupt_ranges.append( (interrupt_controller.gicv_base, 0x2000) ) elif interrupt_controller.gic_version == 3: interrupt_ranges.append( (interrupt_controller.gicd_base, 0x10000) ) interrupt_ranges.append( (interrupt_controller.gicr_base, 0x20000) ) for interrupt_range in interrupt_ranges: if ( current_group[0][1].physical_start_addr < interrupt_range[0] + interrupt_range[1] ): if r1_end > interrupt_range[0]: gic_overlap = True break vpci_overlap = False if vpci_start_addr is not None and vpci_end_addr is not None: if ( get_overlap( (r1_start, r1_end), (vpci_start_addr, vpci_end_addr) ) > 0 ): vpci_overlap = True if ( r1_start - last_region_end > max_dist or gic_overlap or vpci_overlap ): grouped_regions.append(current_group) if not gic_overlap and not vpci_overlap: current_group = [(name, r)] else: current_group = [] else: current_group.append((name, r)) else: current_group.append((name, r)) if current_group: grouped_regions.append(current_group) self.logger.info(f"Got {len(grouped_regions)} grouped region(s):") for group in grouped_regions: assert group[0][1].physical_start_addr is not None assert group[-1][1].physical_start_addr is not None assert group[-1][1].size is not None group_begin = group[0][1].physical_start_addr group_end = group[-1][1].physical_start_addr + group[-1][1].size self.logger.info( f"Group-Begin: (0x{group_begin:x} - 0x{group_end:x})" ) for region in group: self.logger.info(f"\t{region}") self.logger.info("Group-End\n") for index, regions in enumerate(grouped_regions): r_start = regions[0][1] r_end = regions[-1][1] assert r_start.physical_start_addr is not None assert r_end.size is not None assert r_end.physical_start_addr is not None new_size = ( r_end.physical_start_addr + r_end.size ) - r_start.physical_start_addr def aux( acc: Iterable[str], t: Tuple[str, MemoryRegionData] ) -> Iterable[str]: _, r = t return set(acc) | set(r.flags) init: Iterable[str] = set() flags: List[str] = sorted(list(reduce(aux, regions, init))) physical_start_addr = r_start.physical_start_addr virtual_start_addr = r_start.virtual_start_addr new_region = MemoryRegion( size=new_size, physical_start_addr=physical_start_addr, virtual_start_addr=virtual_start_addr, flags=flags, allocatable=False, shared=False, ) assert self.root_cell.memory_regions for name, _ in regions: del self.root_cell.memory_regions[name] self.root_cell.memory_regions[f"mmio_{index}"] = new_region return (self.board, self.config) class PrepareMemoryRegionsPass(BasePass): """ Prepare memory regions by merging regions from Extracted Board Info and Cell Configuration""" def __init__(self) -> None: self.config: Optional[JailhouseConfig] = None self.board: Optional[Board] = None def __call__( self, board: Board, config: JailhouseConfig ) -> Tuple[Board, JailhouseConfig]: self.board = board self.config = config assert self.board is not None assert self.config is not None for cell in self.config.cells.values(): assert cell.memory_regions is not None for region in cell.memory_regions.values(): if isinstance(region, MemoryRegionData) and region.size is None: region.size = self.board.pagesize if cell.type == "root": self._prepare_memory_regions_root(cell) return self.board, self.config def _prepare_memory_regions_root(self, cell: CellConfig) -> None: assert self.board is not None assert self.board.memory_regions is not None assert cell.memory_regions is not None allocatable_ranges = [] for region in self.board.memory_regions.values(): if region.allocatable: assert region.size is not None assert region.physical_start_addr is not None start = region.physical_start_addr end = start + region.size allocatable_ranges.append([start, end]) allocatable_ranges.sort(key=lambda r: r[0]) def overlaps_allocatable_region(start, end): for r in allocatable_ranges: if ( r[0] <= start and start <= r[1] or r[0] <= end and end <= r[1] ): return True return False for name, memory_region in self.board.memory_regions.items(): if memory_region.physical_start_addr is None: continue if memory_region.virtual_start_addr is None: continue if memory_region.size is None: continue p_start = memory_region.physical_start_addr v_start = memory_region.virtual_start_addr p_end = memory_region.physical_start_addr + memory_region.size v_end = memory_region.virtual_start_addr + memory_region.size assert p_start is not None assert v_start is not None assert p_end is not None assert v_end is not None if overlaps_allocatable_region(p_start, p_end): continue skip = False for cell_region in cell.memory_regions.values(): if not isinstance(cell_region, MemoryRegionData): continue assert cell_region.size is not None if cell_region.physical_start_addr is not None: if ( p_start >= cell_region.physical_start_addr and p_start < cell_region.physical_start_addr + cell_region.size ): skip = True if ( p_end >= cell_region.physical_start_addr and p_end < cell_region.physical_start_addr + cell_region.size ): skip = True if cell_region.virtual_start_addr is not None: if ( v_start >= cell_region.virtual_start_addr and v_start < cell_region.virtual_start_addr + cell_region.size ): skip = True if ( v_end >= cell_region.virtual_start_addr and v_end < cell_region.virtual_start_addr + cell_region.size ): skip = True if skip is True: continue cell.memory_regions[name] = memory_region
35.438584
140
0.538728
48,355
0.985891
0
0
291
0.005933
0
0
4,099
0.083573
661499e1d6e03e831ef662b0f10bed15a0e0160c
806
py
Python
tests/test_util.py
tsufeki/python-restclientaio
2af2ded9e22ba5552ace193691ed3a4b520cadf8
[ "BSD-2-Clause" ]
null
null
null
tests/test_util.py
tsufeki/python-restclientaio
2af2ded9e22ba5552ace193691ed3a4b520cadf8
[ "BSD-2-Clause" ]
null
null
null
tests/test_util.py
tsufeki/python-restclientaio
2af2ded9e22ba5552ace193691ed3a4b520cadf8
[ "BSD-2-Clause" ]
null
null
null
import pytest from restclientaio._util import * class TestFullName: @pytest.mark.parametrize('args,expected', [ ((str,), 'builtins.str'), ((str, 'lower'), 'builtins.str.lower'), ]) def test_full_name(self, args, expected): assert full_name(*args) == expected class TestFormatRecur: @pytest.mark.parametrize('args,kwargs,expected', [ (('{}', 42), {}, '42'), (({'{0}': '{foo}foo'}, 'bar'), {'foo': 'FOO'}, {'bar': 'FOOfoo'}), ((['{0.real:02d}'], 1), {}, ['01']), ]) def test_format_recur(self, args, kwargs, expected): assert format_recur(*args, **kwargs) == expected def test_throws_on_self_referencing(self): d = {} d['foo'] = d with pytest.raises(ValueError): format_recur(d)
25.1875
74
0.555831
750
0.930521
0
0
545
0.676179
0
0
152
0.188586
6615213f91d714c671d2fcc45dfcb7ea7995394c
1,112
py
Python
experiments/test_experiments.py
srikarym/torchrl
fee98e78ac1657a2c9a4063dd8d63ba207a121e2
[ "Apache-2.0" ]
3
2019-02-27T19:00:32.000Z
2020-07-19T03:18:28.000Z
experiments/test_experiments.py
srikarym/torchrl
fee98e78ac1657a2c9a4063dd8d63ba207a121e2
[ "Apache-2.0" ]
null
null
null
experiments/test_experiments.py
srikarym/torchrl
fee98e78ac1657a2c9a4063dd8d63ba207a121e2
[ "Apache-2.0" ]
null
null
null
# pylint: disable=redefined-outer-name """Test Experiments. This test runs all problems and hyperparameter pairs for 100 time steps. It only guarantees correct API compatiblity and not the problem performance metrics. """ import pytest from torchrl import registry from torchrl.cli.commands.run import do_run problem_hparams_tuples = [] for problem_id, hparams_list in registry.list_problem_hparams().items(): for hparam_set_id in hparams_list: problem_hparams_tuples.append((problem_id, hparam_set_id)) @pytest.fixture(scope='function') def problem_argv(request): problem_id, hparam_set_id = request.param args_dict = { 'problem': problem_id, 'hparam_set': hparam_set_id, 'seed': None, 'extra_hparams': { 'num_total_steps': 100, }, 'log_interval': 50, 'eval_interval': 50, 'num_eval': 1, } yield args_dict @pytest.mark.parametrize('problem_argv', problem_hparams_tuples, indirect=['problem_argv']) def test_problem(problem_argv): problem = problem_argv.pop('problem') do_run(problem, **problem_argv)
24.711111
72
0.714029
0
0
335
0.301259
591
0.531475
0
0
366
0.329137
661546474c795c91d1a7e8fb806431b8b074972c
3,289
py
Python
gw2_price_get.py
rpatricktaylor/gw2_pricepull
ede658cd7cb567d8ab7e6c7698acee83eacc78a3
[ "MIT" ]
null
null
null
gw2_price_get.py
rpatricktaylor/gw2_pricepull
ede658cd7cb567d8ab7e6c7698acee83eacc78a3
[ "MIT" ]
null
null
null
gw2_price_get.py
rpatricktaylor/gw2_pricepull
ede658cd7cb567d8ab7e6c7698acee83eacc78a3
[ "MIT" ]
null
null
null
import json import time import bs4 import numpy as np import pandas as pd import requests as rqs url_apiV2 = r'https://api.guildwars2.com/v2' working_dir = r'/home/ubuntu/' def gw2_request(request_type, item_nums, retries = 25): item_num_str = ','.join([str(num) for num in item_nums]) request_url = '{}/{}?ids={}'.format(url_apiV2, request_type, item_num_str) retry = 0 success = False while True: try: r = rqs.get(request_url) except: retry += 1 else: success = True break finally: if retry == retries: break if not success: return None j = r.json() return j def item_request(item_nums): return gw2_request('items', item_nums) def price_request(item_nums): return gw2_request('commerce/prices', item_nums) def listings_request(item_nums): return gw2_request('commerce/listings', item_nums) def avg_prices(item_nums, min_quantity=1000, max_quantity=50000, max_price=500000): def listing_avg_price(listings): quantity_total = 0 quantity = 0 cost = 0 for listing in listings: q = listing['quantity'] p = listing['unit_price'] quantity_total += q if (quantity < max_quantity) and (cost < max_price): quantity += q cost += p * q return cost, quantity, quantity_total listings = listings_request(item_nums) out = [] request_time = time.strftime('%Y-%m-%d %H:00') if listings: for listing in listings: if 'buys' not in listing or 'sells' not in listing or 'id' not in listing: continue bid_listings = listing['buys'] ask_listings = listing['sells'] item_id = listing['id'] bid_cost, bid_quantity, bid_quantity_total = listing_avg_price(bid_listings) ask_cost, ask_quantity, ask_quantity_total = listing_avg_price(ask_listings) if bid_quantity_total < min_quantity or ask_quantity_total < min_quantity: continue out.append((str(item_id), request_time, bid_cost / bid_quantity, bid_quantity_total, ask_cost / ask_quantity, ask_quantity_total)) return out with open(working_dir + 'item_nums', 'r') as f: item_nums = [int(line[:-1]) for line in f] price_data_fetch = [] k = 0 while k < len(item_nums): price_data_fetch += avg_prices(item_nums[k:(k+200)]) k += 200 price_hist = pd.DataFrame(price_data_fetch, columns=['item_id', 'time', 'bid_price', 'bid_quantity', 'ask_price', 'ask_quantity']) price_hist['liquidity_score'] = price_hist['ask_price'] / price_hist['bid_price'] - 1.1 out_path = '{}price_hist_{}.csv'.format(working_dir, time.strftime('%Y-%m-%d_%H00')) price_hist.to_csv(out_path)
29.366071
89
0.549407
0
0
0
0
0
0
0
0
334
0.101551
66160d3954e8f1108b126460356e2b0740e00e9e
2,055
py
Python
create_db.py
vladstorm98/TaskBoard
ebe4244cc5cbdfda2fdaac84c0158692f440517c
[ "MIT" ]
null
null
null
create_db.py
vladstorm98/TaskBoard
ebe4244cc5cbdfda2fdaac84c0158692f440517c
[ "MIT" ]
null
null
null
create_db.py
vladstorm98/TaskBoard
ebe4244cc5cbdfda2fdaac84c0158692f440517c
[ "MIT" ]
null
null
null
from flask import Flask from flask_sqlalchemy import SQLAlchemy from config import Config app = Flask(__name__) app.config.from_object(Config) db = SQLAlchemy(app) class User(db.Model): __tablename__ = 'user' id = db.Column(db.Integer, primary_key=True) email = db.Column(db.String(128), index=True, unique=True) password_hash = db.Column(db.String(128)) last_seen = db.Column(db.DateTime) profile = db.relationship('Profile', backref='user', lazy='dynamic') class Profile(db.Model): __tablename__ = 'profile' id = db.Column(db.Integer, primary_key=True) first_name = db.Column(db.String(64), index=True) last_name = db.Column(db.String(64), index=True) number = db.Column(db.Integer) price = db.Column(db.String(32)) address = db.Column(db.String(128), index=True) about_client = db.Column(db.String(256)) last_order = db.Column(db.String(32)) user_id = db.Column(db.Integer, db.ForeignKey('user.id')) tasks = db.relationship('Task', backref='client', lazy='dynamic') class Task(db.Model): __tablename__ = 'task' __searchable__ = ['title', 'address', 'note', 'price'] id = db.Column(db.Integer, primary_key=True) title = db.Column(db.String(32)) name = db.Column(db.String(128)) address = db.Column(db.String(128)) note = db.Column(db.String(512)) price = db.Column(db.String(32)) date = db.Column(db.String(32)) in_progress = db.Column(db.Boolean) client_id = db.Column(db.Integer, db.ForeignKey('profile.id')) db.create_all() db.session.commit() # from flask import Flask # from flask_babel import Babel # from flask_babel import format_datetime # from datetime import datetime # from flask import render_template # # ap = Flask(__name__) # babel = Babel(ap) # # @ap.route('/', methods=['GET']) # def index(): # f = format_datetime(datetime(1987, 3, 5, 17, 12), 'EEEE, d. MMMM yyyy H:mm') # # print(f) # return render_template('1') # # # ap.run()
29.357143
83
0.654988
1,392
0.677372
0
0
0
0
0
0
531
0.258394
661759e4ea700063225bc588e580457ea479d76a
1,954
py
Python
02_assignment/toolbox/Toolbox_Python02450/Scripts/ex3_1_2.py
LukaAvbreht/ML_projects
8b36acdeb017ce8a57959c609b96111968852d5f
[ "MIT" ]
null
null
null
02_assignment/toolbox/Toolbox_Python02450/Scripts/ex3_1_2.py
LukaAvbreht/ML_projects
8b36acdeb017ce8a57959c609b96111968852d5f
[ "MIT" ]
null
null
null
02_assignment/toolbox/Toolbox_Python02450/Scripts/ex3_1_2.py
LukaAvbreht/ML_projects
8b36acdeb017ce8a57959c609b96111968852d5f
[ "MIT" ]
null
null
null
# exercise 3.1.4 import numpy as np from sklearn.feature_extraction.text import CountVectorizer # Load the textDocs.txt as a long string into raw_file: with open('../Data/textDocs.txt', 'r') as f: raw_file = f.read() # raw_file contains sentences seperated by newline characters, # so we split by '\n': corpus = raw_file.split('\n') # corpus is now list of "documents" (sentences), but some of them are empty, # because textDocs.txt has a lot of empty lines, we filter/remove them: corpus = list(filter(None, corpus)) # Display the result print('Document-term matrix analysis') print() print('Corpus (5 documents/sentences):') print(np.asmatrix(corpus)) print() # To automatically obtain the bag of words representation, we use sklearn's # feature_extraction.text module, which has a function CountVectorizer. # We make a CounterVectorizer: vectorizer = CountVectorizer(token_pattern=r'\b[^\d\W]+\b') # The token pattern is a regular expression (marked by the r), which ensures # that the vectorizer ignores digit/non-word tokens - in this case, it ensures # the 10 in the last document is not recognized as a token. It's not important # that you should understand it the regexp. # The object vectorizer can now be used to first 'fit' the vectorizer to the # corpus, and the subsequently transform the data. We start by fitting: vectorizer.fit(corpus) # The vectorizer has now determined the unique terms (or tokens) in the corpus # and we can extract them using: attributeNames = vectorizer.get_feature_names() print('Found terms:') print(attributeNames) print() # The next step is to count how many times each term is found in each document, # which we do using the transform function: X = vectorizer.transform(corpus) N,M = X.shape print('Number of documents (data objects, N):\t %i' % N) print('Number of terms (attributes, M):\t %i' % M ) print() print('Document-term matrix:') print(X.toarray()) print() print('Ran Exercise 3.1.2')
37.576923
79
0.746162
0
0
0
0
0
0
0
0
1,405
0.719038
661950464dde57e4e6f43aa2be8e46d0304ef9f0
797
py
Python
vid 18 dream logo.py
agneay/turtle-projects
88f7de0c8eb1bb0f37255746c3d11b9c272d1c10
[ "MIT" ]
null
null
null
vid 18 dream logo.py
agneay/turtle-projects
88f7de0c8eb1bb0f37255746c3d11b9c272d1c10
[ "MIT" ]
null
null
null
vid 18 dream logo.py
agneay/turtle-projects
88f7de0c8eb1bb0f37255746c3d11b9c272d1c10
[ "MIT" ]
null
null
null
from turtle import * def l(y,x): lt(y) fd(x) def r(y,x): rt(y) fd(x) def gt(x,y): pu() goto(x,y) pd() bgcolor("lime") color("black","white") shape("circle") ht() speed(1) width(15) gt(-365,-380) begin_fill() seth(90) fd(20) r(5,20) r(4,60) r(5,100) r(5,120) l(85,50) r(10,25) r(15,10) r(15,40) r(15,50) r(10,90) r(20,50) r(20,25) r(10,75) r(30,20) r(10,10) l(30,50) r(15,10) r(10,20) r(10,80) r(10,40) for _ in range(7): r(10,30) r(10,80) r(20,35) l(30,150) for _ in range(3): r(5,150) end_fill() gt(-290,-70) l(90,30) l(10,120) l(15,60) l(10,30) l(5,40) l(10,40) gt(-320,50) r(70,30) l(10,30) l(15,30) l(5,60) l(5,60) l(15,40) r(10,20) l(20,35) color("black") gt(-50,170) stamp() gt(-340,135) stamp() gt(40,-115) write("dream", font = ('Arial', 85, 'italic','bold')) done()
9.16092
53
0.567127
0
0
0
0
0
0
0
0
63
0.079046
661ea642755905b0144b877774494043f351d6cb
1,316
py
Python
magicauth/otp_forms.py
glibersat/django-magicauth
545cb0df2b2368b27089e253fafa666ca8a870f1
[ "MIT" ]
null
null
null
magicauth/otp_forms.py
glibersat/django-magicauth
545cb0df2b2368b27089e253fafa666ca8a870f1
[ "MIT" ]
null
null
null
magicauth/otp_forms.py
glibersat/django-magicauth
545cb0df2b2368b27089e253fafa666ca8a870f1
[ "MIT" ]
null
null
null
from django import forms from django.core.validators import RegexValidator from django.core.exceptions import ValidationError from django_otp import user_has_device, devices_for_user from magicauth import settings as magicauth_settings class OTPForm(forms.Form): OTP_NUM_DIGITS = magicauth_settings.OTP_NUM_DIGITS otp_token = forms.CharField( max_length=OTP_NUM_DIGITS, min_length=OTP_NUM_DIGITS, validators=[RegexValidator(r"^\d{6}$")], label=f"Entrez le code à {OTP_NUM_DIGITS} chiffres généré par votre téléphone ou votre carte OTP", widget=forms.TextInput(attrs={"autocomplete": "off"}), ) def __init__(self, user, *args, **kwargs): super(OTPForm, self).__init__(*args, **kwargs) self.user = user def clean_otp_token(self): otp_token = self.cleaned_data["otp_token"] user = self.user if not user_has_device(user): raise ValidationError("Le système n'a pas trouvé d'appareil (carte OTP ou générateur sur téléphone) pour votre compte. Contactez le support pour en ajouter un.") for device in devices_for_user(user): if device.verify_is_allowed() and device.verify_token(otp_token): return otp_token raise ValidationError("Ce code n'est pas valide.")
37.6
173
0.705167
1,087
0.818524
0
0
0
0
0
0
308
0.231928
6620a1da84d2b9ed5781d255a6553d73c0a0fa9e
186
py
Python
backend/users/schema.py
DDoS000/Event_Registers
84a77d0914333ee830a72e2d31fa5374f70dea35
[ "MIT" ]
null
null
null
backend/users/schema.py
DDoS000/Event_Registers
84a77d0914333ee830a72e2d31fa5374f70dea35
[ "MIT" ]
null
null
null
backend/users/schema.py
DDoS000/Event_Registers
84a77d0914333ee830a72e2d31fa5374f70dea35
[ "MIT" ]
null
null
null
from pydantic import BaseModel class UserUpdate(BaseModel): fullname: str class ChangePassword(BaseModel): current_password: str new_password: str confirm_password: str
20.666667
32
0.768817
152
0.817204
0
0
0
0
0
0
0
0
662106942718d48504f32ad0e27db934931029d3
19,428
py
Python
tests/adapters/test_s3_adapter.py
MonolithAILtd/monolith-filemanager
2369e244e4d8a48890f55d00419a83001a5c6c40
[ "Apache-2.0" ]
3
2021-06-02T09:45:00.000Z
2022-02-01T14:30:01.000Z
tests/adapters/test_s3_adapter.py
MonolithAILtd/monolith-filemanager
2369e244e4d8a48890f55d00419a83001a5c6c40
[ "Apache-2.0" ]
3
2021-05-26T11:46:28.000Z
2021-11-04T10:14:42.000Z
tests/adapters/test_s3_adapter.py
MonolithAILtd/monolith-filemanager
2369e244e4d8a48890f55d00419a83001a5c6c40
[ "Apache-2.0" ]
2
2021-06-04T15:02:14.000Z
2021-09-03T09:26:45.000Z
from unittest import TestCase, main from unittest.mock import patch, MagicMock, call from monolith_filemanager.adapters.s3_processes import S3ProcessesAdapter, S3ProcessesAdapterError class TestS3ProcessesAdapter(TestCase): @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.__init__") def setUp(self, mock_init) -> None: mock_init.return_value = None self.test_file = S3ProcessesAdapter(file_path="mock/folder/test.xlsx") self.test_file.path = "mock/folder/test.xlsx" self.test_folder = S3ProcessesAdapter(file_path="mock/folder/path") self.test_folder.path = "mock/folder/path" @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter._strip_path_slash") @patch("monolith_filemanager.adapters.s3_processes.V1Engine") @patch("monolith_filemanager.adapters.s3_processes.Base.__init__") def test___init__(self, mock_init, mock_engine, mock_strip_path_slash): mock_init.return_value = None mock_strip_path_slash.return_value = None test = S3ProcessesAdapter(file_path="test") mock_init.assert_called_once_with(file_path="test") mock_engine.assert_called_once_with() self.assertEqual(mock_engine.return_value, test._engine) mock_strip_path_slash.assert_called_once_with() @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.__init__") def test_local_file_object(self, mock_init): mock_init.return_value = None test = S3ProcessesAdapter(file_path="test path") test.file_types = MagicMock() test.path = MagicMock() out_come = test.local_file_object() test.file_types.get_file.assert_called_once_with(file_path=test.path) test.file_types.get_file.return_value.assert_called_once_with(path=test.path) self.assertEqual(test.file_types.get_file.return_value.return_value, out_come) @patch("monolith_filemanager.adapters.s3_processes.FilePath") @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.local_file_object") @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.__init__") def test_read_file(self, mock_init, mock_local_file_object, mock_file_path): mock_init.return_value = None test = S3ProcessesAdapter(file_path=MagicMock()) test.path = MagicMock() test._cache = MagicMock() test._pickle_factory = MagicMock() test._engine = MagicMock() test.file_types = MagicMock() test.path.file_type = "pickle" with self.assertRaises(S3ProcessesAdapterError): test.read_file() test.path.file_type = "not pickle" second_cached_path = test.path.to_string.return_value second_out_come = test.read_file() test._cache.create_cache.assert_called_once_with() test._engine.download_data_file.assert_called_once_with(storage_path=second_cached_path, file_path=test._cache.cache_path) mock_local_file_object.return_value.read.assert_called_once_with() mock_file_path.assert_called_once_with(test._engine.download_data_file.return_value) self.assertEqual(mock_file_path.return_value, test.path) self.assertEqual(mock_local_file_object.return_value.read.return_value, second_out_come) @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.__init__") def test_read_raw_file(self, mock_init): mock_init.return_value = None test = S3ProcessesAdapter(file_path=MagicMock()) test.path = MagicMock() test._engine = MagicMock() out_come = test.read_raw_file() test._engine.download_raw_data_file.assert_called_once_with(storage_path=test.path.to_string.return_value) self.assertEqual(out_come, test._engine.download_raw_data_file.return_value) @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.__init__") def test_custom_read_file(self, mock_init): mock_init.return_value = None test = S3ProcessesAdapter(file_path="test path") test.path = MagicMock() test._cache = MagicMock() test._engine = MagicMock() test.file_types = MagicMock() test.path.file_type = "any" source_path = test.path custom_read_function = MagicMock(name='read function') data_output = MagicMock(name='data') custom_read_function.return_value = data_output out_come = test.custom_read_file(custom_read_function) test._cache.create_cache.assert_called_once_with() test._engine.download_data_file.assert_called_once_with(storage_path=source_path, file_path=test._cache.cache_path) self.assertEqual(test._engine.download_data_file.return_value, test.path) custom_read_function.assert_called_once_with(test.path) self.assertEqual(out_come, data_output) @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.local_file_object") @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.__init__") def test_write_file_supports_s3(self, mock_init, mock_local_file_object): mock_init.return_value = None test = S3ProcessesAdapter(file_path=MagicMock()) test._engine = MagicMock() test.path = MagicMock() mock_local_file_object.return_value.supports_s3.return_value = True mock_data = MagicMock() test.write_file(data=mock_data) mock_local_file_object.return_value.write.assert_called_once_with(mock_data) @patch("monolith_filemanager.adapters.s3_processes.FilePath") @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.local_file_object") @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.__init__") def test_write_file_not_supports_s3(self, mock_init, mock_local_file_object, mock_file_path): mock_init.return_value = None test = S3ProcessesAdapter(file_path=MagicMock()) test._engine = MagicMock() test.path = MagicMock() test._cache = MagicMock() mock_local_file_object.return_value.supports_s3.return_value = False mock_local_file_object.return_value.path = test.path mock_data = MagicMock() test.write_file(data=mock_data) test._engine.upload_data_from_file.assert_called_once_with(file_path=mock_file_path.return_value.to_string.return_value, storage_path=test.path.to_string.return_value) @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.__init__") def test_write_raw_file(self, mock_init): mock_init.return_value = None test = S3ProcessesAdapter(file_path=MagicMock()) test._engine = MagicMock() test.path = MagicMock() mock_data = MagicMock() test.write_raw_file(data=mock_data) test._engine.upload_data.assert_called_once_with(storage_path=test.path.to_string.return_value, data=mock_data) @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.__init__") def test_delete_file(self, mock_init): mock_init.return_value = None test = S3ProcessesAdapter(file_path="test path") test._engine = MagicMock() test.path = MagicMock() test.delete_file() test._engine.delete.assert_called_once_with(storage_path=test.path) @patch("monolith_filemanager.adapters.s3_processes.V1Engine._split_s3_path") def test_delete_folder(self, mock_split_path): mock_engine = MagicMock() mock_engine.delete_file.return_value = None self.test_folder._engine = mock_engine mock_split_path.return_value = ("mock-bucket", "mock/folder", "folder") self.test_folder.delete_folder() mock_engine.delete_file.assert_called_once_with(bucket_name="mock-bucket", file_name="mock/folder/") @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.increment_files") @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.exists") @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.check_name_taken") @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.ls") @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.__init__") def test_write_stream(self, mock_init, mock_ls, mock_name_taken, mock_exists, mock_increment_files): mock_init.return_value = None test = S3ProcessesAdapter(file_path=MagicMock()) test._engine = MagicMock() test.path = "mock/folder/file.txt" test._cache = MagicMock() mock_ls.return_value = ([], []) mock_stream = MagicMock() # test name already taken mock_name_taken.return_value = True with self.assertRaises(S3ProcessesAdapterError): test.write_stream(mock_stream) mock_stream.save.assert_called_once() # test already exists mock_stream.reset_mock() mock_name_taken.return_value = False mock_exists.return_value = True mock_increment_files.return_value = None self.assertEqual("file.txt", test.write_stream(mock_stream)) cache_path = mock_stream.save.call_args_list[0][0][0] test._engine.upload_data_from_file.assert_called_once_with(storage_path=test.path, file_path=cache_path) mock_increment_files.assert_called_once_with() mock_stream.save.assert_called_once() # test doesn't already exist mock_stream.reset_mock() test._engine.reset_mock() mock_increment_files.reset_mock() mock_exists.return_value = False self.assertEqual("file.txt", test.write_stream(mock_stream)) mock_stream.save.assert_called_once() cache_path = mock_stream.save.call_args_list[0][0][0] test._engine.upload_data_from_file.assert_called_once_with(storage_path=test.path, file_path=cache_path) mock_increment_files.assert_has_calls = [] @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.exists") @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.__init__") def test_increment_files(self, mock_init, mock_exists): mock_init.return_value = None test = S3ProcessesAdapter(file_path=MagicMock()) test.path = "mock/path/folder/file.txt" mock_exists.return_value = False test.increment_files() self.assertEqual("mock/path/folder/file 2.txt", test.path) test.path = "mock/path/folder/file.txt" mock_exists.side_effect = [True, False] test.increment_files() self.assertEqual("mock/path/folder/file 3.txt", test.path) @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.__init__") def test_create_directory_if_not_exists(self, mock_init): mock_init.return_value = None mock_path = MagicMock() test = S3ProcessesAdapter(file_path=mock_path) test._engine = MagicMock() test.path = mock_path test.create_directory_if_not_exists() test._engine.create_folder.assert_called_once_with(storage_path=mock_path) @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.__init__") def test_exists(self, mock_init): mock_init.return_value = None test = S3ProcessesAdapter(file_path="test path") test._engine = MagicMock() test.path = MagicMock() test.exists() test._engine.exists.assert_called_once_with(storage_path=test.path) @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.__init__") def test_ls(self, mock_init): mock_init.return_value = None test = S3ProcessesAdapter(file_path="test path") test._engine = MagicMock() test.path = MagicMock() test.ls() test._engine.ls.assert_called_once_with(storage_path=test.path.to_string.return_value) @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.delete_file") @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.__init__") def test_batch_delete(self, mock_init, mock_delete_file): mock_init.return_value = None test = S3ProcessesAdapter(file_path="test/path") test.path = "test/path" test.path = "mock/folder/path" mock_paths = ["mock_folder", "mock_file"] mock_delete_file.side_effect = [None, None] test.batch_delete(paths=mock_paths) mock_delete_file.assert_has_calls = [call(path=test.path + mock_paths[0]), call(path=test.path + mock_paths[1])] def test_copy_file(self): mock_new_path = "mock/new/path" mock_engine = MagicMock() mock_engine._split_s3_path.side_effect = [("mock-bucket", "old/file.txt", None), ("mock-bucket", "new/file.txt", None)] mockObject = MagicMock() mockObject.copy_from.return_value = None mock_engine.resource.Object.return_value = mockObject self.test_file._engine = mock_engine self.test_file.copy_file(mock_new_path) mock_engine._split_s3_path.assert_has_calls = [call(self.test_file.path), call(mock_new_path)] mockObject.copy_from.assert_called_once_with(CopySource="mock-bucket/old/file.txt") @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.delete_file") @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.copy_file") @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.check_name_taken") @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.exists") @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.ls") @patch("monolith_filemanager.adapters.s3_processes.FilePath") def test_rename_file(self, mock_filepath, mock_ls, mock_exists, mock_check_name_taken, mock_copy_file, mock_delete_file): new_name = "new_name" mock_ext = ".xlsx" mock_filepath.side_effect = ["/".join(self.test_file.path.split("/")[:-1]) + f"/{new_name}" + mock_ext, "/".join(self.test_file.path.split("/")[:-1]) + "/"] mock_ls.return_value = ({}, []) mock_exists.return_value = True mock_check_name_taken.return_value = False mock_copy_file.return_value = None mock_delete_file.return_value = None self.test_file.rename_file(new_name=new_name) mock_ls.assert_called_once_with(path="mock/folder/") mock_copy_file.assert_called_once_with(new_path='mock/folder/new_name.xlsx') mock_delete_file.assert_called_once_with() @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.delete_folder") @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.copy_folder") @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.exists") @patch("monolith_filemanager.adapters.s3_processes.FilePath") def test_rename_folder(self, mock_filepath, mock_exists, mock_copy_folder, mock_delete_folder): new_name = "new_folder" mock_filepath.return_value = "/".join(self.test_folder.path.split("/")[:-1]) + f"/{new_name}" mock_exists.return_value = False mock_copy_folder.return_value = None mock_delete_folder.return_value = None self.test_folder.rename_folder(new_name=new_name) mock_copy_folder.assert_called_once_with(new_folder=f"mock/folder/{new_name}") mock_delete_folder.assert_called_once_with() @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.delete_file") @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.copy_file") @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.exists") @patch("monolith_filemanager.adapters.s3_processes.FilePath") def test_move_file(self, mock_filepath, mock_exists, mock_copy_file, mock_delete_file): mock_destination_folder = "mock/new/path" mock_filepath.return_value = "mock/new/path/file.txt" mock_exists.return_value = False self.test_file.move_file(destination_folder=mock_destination_folder) mock_copy_file.assert_called_once_with(new_path=mock_filepath.return_value) mock_delete_file.assert_called_once_with() @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.delete_folder") @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.copy_folder") @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.exists") @patch("monolith_filemanager.adapters.s3_processes.FilePath") def test_move_folder(self, mock_filepath, mock_exists, mock_copy_folder, mock_delete_folder): mock_destination_folder = "mock/new/path" mock_filepath.return_value = "mock/new/path/folder" mock_exists.return_value = False self.test_folder.move_folder(destination_folder=mock_destination_folder) mock_copy_folder.assert_called_once_with(new_folder=mock_filepath.return_value) mock_delete_folder.assert_called_once_with() @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.move_folder") @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.move_file") @patch("monolith_filemanager.adapters.s3_processes.FilePath") def test_batch_move(self, mock_filepath, mock_move_file, mock_move_folder): mock_paths = ["test.xlsx", "test_folder"] mock_destination_folder = "mock/destination/folder" mock_filepath1 = MagicMock() mock_filepath1.to_string.return_value = f"{mock_destination_folder}/{mock_paths[0]}" mock_filepath1.get_file_type.return_value = "xlsx" mock_filepath2 = MagicMock() mock_filepath2.to_string.return_value = f"{mock_destination_folder}/{mock_paths[1]}" mock_filepath2.get_file_type.return_value = None mock_filepath.side_effect = [mock_filepath1, None, mock_filepath2, None] mock_move_file.return_value = None mock_move_folder.return_value = None self.test_folder.batch_move(paths=mock_paths, destination_folder=mock_destination_folder) mock_filepath.assert_has_calls([call(f"{mock_destination_folder}/{mock_paths[0]}"), call(f"{self.test_folder.path}/{mock_paths[0]}"), call(f"{mock_destination_folder}/{mock_paths[1]}"), call(f"{self.test_folder.path}/{mock_paths[1]}")]) mock_move_file.assert_called_once_with(destination_folder=mock_destination_folder) mock_move_folder.assert_called_once_with(destination_folder=mock_destination_folder) @patch("monolith_filemanager.adapters.s3_processes.S3ProcessesAdapter.__init__") def test__strip_path_slash(self, mock_init): mock_init.return_value = None mock_path = "mock/folder/path/" test_folder = S3ProcessesAdapter(file_path=mock_path) test_folder.path = mock_path test_folder._strip_path_slash() self.assertEqual(mock_path.rstrip("/"), test_folder.path) if __name__ == "__main__": main()
51.261214
175
0.726992
19,201
0.988316
0
0
18,308
0.942351
0
0
4,850
0.24964
6621f5308d9319ae5e2c09eb61c97a4f6a12ea20
459
py
Python
maleorfemale.py
harshals13/Jigglypuffpuff
469ea64c71a123cafadc4ae40a1da5171182647b
[ "MIT" ]
null
null
null
maleorfemale.py
harshals13/Jigglypuffpuff
469ea64c71a123cafadc4ae40a1da5171182647b
[ "MIT" ]
null
null
null
maleorfemale.py
harshals13/Jigglypuffpuff
469ea64c71a123cafadc4ae40a1da5171182647b
[ "MIT" ]
null
null
null
from sklearn import tree #[height, weight, shoe size] X = [[181,80,44], [177,70, 43],[160, 60,38],[154, 54, 37], [166,65,40], [190, 90, 47], [175, 64, 39], [177, 70, 40],[159, 55, 45],[171, 75, 42], [181, 85, 43] ] Y = ['male', 'female', 'female', 'female', 'male','male', 'male', 'female', 'male', 'female', 'male'] clf = tree.DecisionTreeClassifier() clf = clf.fit(X, Y) prediction = clf.predict([[ 180, 80, 33 ]]) print(prediction) #This code works
27
160
0.586057
0
0
0
0
0
0
0
0
120
0.261438
6622d00606e15445d1e62f002d0259e183e527a7
1,921
py
Python
Asap-3.8.4/doc/manual/Dislocation.py
auag92/n2dm
03403ef8da303b79478580ae76466e374ec9da60
[ "MIT" ]
1
2021-10-19T11:35:34.000Z
2021-10-19T11:35:34.000Z
Asap-3.8.4/doc/manual/Dislocation.py
auag92/n2dm
03403ef8da303b79478580ae76466e374ec9da60
[ "MIT" ]
null
null
null
Asap-3.8.4/doc/manual/Dislocation.py
auag92/n2dm
03403ef8da303b79478580ae76466e374ec9da60
[ "MIT" ]
3
2016-07-18T19:22:48.000Z
2021-07-06T03:06:42.000Z
#!/usr/bin/env python from Asap.Setup.Lattice.FCCOrtho import * from Asap.Setup.Dislocation import Dislocation from ASE.ChemicalElements import Element from Asap import * from Asap.Trajectories import NetCDFTrajectory from ASE.Visualization.PrimiPlotter import * from Numeric import * splitting = 5 size = (25, 35, 10) # Create a slab of Gold Gold = Element("Au") atoms = FCCOrtho(((1,1,-2), (-1,1,0), (1,1,1)), size, Gold) basis = atoms.GetUnitCell() print "Number of atoms:", len(atoms) # Create the dislocation center = 0.5 * array([basis[0,0], basis[1,1], basis[2,2]]) + array([0.1, 0.1, 0.1]) offset = 0.5 * splitting * atoms.MillerToDirection((-1,0,1)) d1 = Dislocation(center - offset, atoms.MillerToDirection((-1,-1,0)), atoms.MillerToDirection((-2,-1,1))/6.0) d2 = Dislocation(center + offset, atoms.MillerToDirection((1,1,0)), atoms.MillerToDirection((1,2,1))/6.0) # Insert the dislocation in the slab (d1+d2).ApplyTo(atoms) # Write the configuration to a file traj = NetCDFTrajectory("initial.nc", atoms) traj.Update() traj.Close() # Analyse the local crystal structure prior to plotting. print "Now running Common Neighbor Analysis" atoms.SetCalculator(EMT()) CNA(atoms) # Now make two plots of the system. The surfaces at the back and # front are removed, and all atoms in perfect FCC order are removed # from the plot. c = atoms.GetTags() y = array(atoms.GetCartesianPositions()[:,1]) z = array(atoms.GetCartesianPositions()[:,2]) invis1 = equal(c, 0) + less(y, 5) + greater(y, basis[1,1] - 5) invis2 = equal(c, 0) + less(z, 5) + greater(z, basis[2,2] - 5) p1 = PrimiPlotter(atoms) p1.SetRotation([-88,0,0]) p1.SetInvisible(invis1) p1.SetOutput(GifFile("sideview")) p2 = PrimiPlotter(atoms) p2.SetInvisible(invis2) p2.SetOutput(GifFile("topview")) for p in (p1,p2): p.SetColors({0:"red", 1:"yellow", 2:"blue"}) p.SetOutput(X11Window()) p.Plot()
28.671642
83
0.692868
0
0
0
0
0
0
0
0
453
0.235815
662336d44c462304b2b5f94e8721da8b5b0d3e73
7,450
py
Python
supercache/engine/memory.py
Peter92/supercache
e85ae87e4c2fead6e2a6aa55c0983d249512f34d
[ "MIT" ]
2
2020-03-02T01:22:25.000Z
2020-05-18T16:52:11.000Z
supercache/engine/memory.py
huntfx/supercache
e85ae87e4c2fead6e2a6aa55c0983d249512f34d
[ "MIT" ]
null
null
null
supercache/engine/memory.py
huntfx/supercache
e85ae87e4c2fead6e2a6aa55c0983d249512f34d
[ "MIT" ]
null
null
null
import time from collections import defaultdict from .. import exceptions, utils class Memory(object): """Cache directly in memory. This is by far the fastest solution, but the cache cannot be shared outside the current process. This is not completely thread safe, but care has been taken to avoid any errors from stopping the code working. """ FIFO = FirstInFirstOut = 0 FILO = FirstInLastOut = 1 LRU = LeastRecentlyUsed = 2 MRU = MostRecentlyUsed = 3 LFU = LeastFrequentlyUsed = 4 def __init__(self, ttl=None, mode=LRU, count=None, size=None): """Create a new engine. Parameters: mode (int): How to purge the old keys. ttl (int): Time the cache is valid for. Set to None for infinite. count (int): Maximum cache results to store. Set to None or 0 for infinite. size (int): Maximum size of cache in bytes. This is a soft limit, where the memory will be allocated first, and any extra cache purged later. The latest cache item will always be stored. Set to None for infinite. """ self.data = dict( result={}, hits=defaultdict(int), misses=defaultdict(int), size={None: 0}, ttl={}, insert={}, access={} ) self.mode = mode self.ttl = ttl self.count = count self.size = size self._next_ttl = float('inf') def keys(self): """Get the current stored cache keys.""" return list(iter(self)) def __iter__(self): """Iterate through all the keys.""" self._purge() return iter(self.data['result']) def exists(self, key): """Find if cache currently exists for a given key. Any key past its ttl will be removed. """ if key in self.data['result']: if self.expired(key): self.delete(key) return False return True return False def expired(self, key, _current_time=None): """Determine is a key has expired.""" if key not in self.data['ttl']: return False if _current_time is None: _current_time = time.time() try: return self.data['ttl'][key] <= _current_time except KeyError: return True def get(self, key, purge=False): """Get the value belonging to a key. An error will be raised if the cache is expired or doesn't exist. """ if purge: self._purge() if not self.exists(key): raise exceptions.CacheNotFound(key) # If a purge was done, then skip the expiry check if not purge and self.expired(key): raise exceptions.CacheExpired(key) try: self.data['hits'][key] += 1 self.data['access'][key] = time.time() return self.data['result'][key] except KeyError: raise exceptions.CacheExpired(key) def put(self, key, value, ttl=None, purge=True): """Add a new value to cache. This will overwrite any old cache with the same key. """ if ttl is None: ttl = self.ttl self.data['result'][key] = value try: self.data['misses'][key] += 1 except KeyError: self.data['misses'][key] = 1 # Calculate size if self.size is not None: size = utils.getsize(value) self.data['size'][None] += size - self.data['size'].get(key, 0) self.data['size'][key] = size # Set insert/access time current_time = time.time() self.data['insert'][key] = self.data['access'][key] = current_time # Set timeout if ttl is None or ttl <= 0: try: del self.data['ttl'][key] except KeyError: pass else: self.data['ttl'][key] = current_time + ttl self._next_ttl = min(self._next_ttl, self.data['ttl'][key]) # Clean old keys if purge: self._purge(ignore=key) def delete(self, key): """Delete an item of cache. This will not remove the hits or misses. """ if key in self.data['result']: try: del self.data['result'][key] del self.data['insert'][key] del self.data['access'][key] if key in self.data['ttl']: del self.data['ttl'][key] if self.size is not None: self.data['size'][None] -= self.data['size'].pop(key) except KeyError: pass return True return False def hits(self, key): """Return the number of hits on an item of cache.""" return self.data['hits'].get(key, 0) def misses(self, key): """Return the number of misses on an item of cache.""" return self.data['misses'].get(key, 0) def _purge(self, ignore=None): """Remove old cache.""" count = self.count size = self.size purged = 0 # Delete expired if self.data['ttl']: current_time = time.time() if current_time > self._next_ttl: self._next_ttl = float('inf') for key in tuple(self.data['result']): if self.expired(key, _current_time=current_time): self.delete(key) elif key in self.data['ttl']: try: self._next_ttl = min(self._next_ttl, self.data['ttl'][key]) except KeyError: pass # Determine if we can skip if count is not None and len(self.data['result']) < count: count = None if size is not None and self.data['size'][None] < size: size = None if count is None and size is None: return purged # Order the keys if self.mode == self.FirstInFirstOut: order_by = lambda k: self.data['insert'][k] elif self.mode == self.FirstInLastOut: order_by = lambda k: -self.data['insert'][k] elif self.mode == self.LeastRecentlyUsed: order_by = lambda k: self.data['access'][k] elif self.mode == self.MostRecentlyUsed: order_by = lambda k: -self.data['access'][k] elif self.mode == self.LeastFrequentlyUsed: order_by = lambda k: self.data['hits'][k] else: raise NotImplementedError(self.mode) ordered_keys = sorted(self.data['result'], key=order_by, reverse=True) # Remove the cache data if count is not None: for key in ordered_keys[count:]: if key == ignore: continue self.delete(key) purged += 1 if size is not None: total_size = 0 for key in ordered_keys: if key == ignore: continue total_size += self.data['size'][key] if total_size > size: self.delete(key) purged += 1 return purged
32.251082
87
0.52094
7,365
0.988591
0
0
0
0
0
0
2,010
0.269799
6623eb16f8643fe3f8e712cd421dfd5fbd6d80c3
2,541
py
Python
problem_1_falling/test_agent.py
victor-armegioiu/ai-mas-challenges
c449f4bb3fd7e7a5c1c9b00d22209532c92f39aa
[ "MIT" ]
null
null
null
problem_1_falling/test_agent.py
victor-armegioiu/ai-mas-challenges
c449f4bb3fd7e7a5c1c9b00d22209532c92f39aa
[ "MIT" ]
null
null
null
problem_1_falling/test_agent.py
victor-armegioiu/ai-mas-challenges
c449f4bb3fd7e7a5c1c9b00d22209532c92f39aa
[ "MIT" ]
null
null
null
from utils import read_cfg from falling_objects_env import FallingObjects, PLAYER_KEYS, ACTIONS from argparse import ArgumentParser from demo_agent import DemoAgent from dqn_agent import DDQNAgent import importlib import numpy as np import cv2 as cv2 BATCH_SIZE = 32 if __name__ == "__main__": arg_parser = ArgumentParser() arg_parser.add_argument( '-c', '--config-file', default='configs/default.yaml', type=str, dest='config_file', help='Default configuration file' ) arg_parser.add_argument( '-a', '--agent', default='demo_agent+DemoAgent', type=str, dest='agent', help='The agent to test in format <module_name>+<class_name>' ) args = arg_parser.parse_args() config_file = args.config_file cfg = read_cfg(config_file) test_agent_name = args.agent.split("+") test_steps = cfg.test_steps test_agent = getattr(importlib.import_module(test_agent_name[0]), test_agent_name[1]) print(f"Testing agent {test_agent_name[1]}") env = FallingObjects(cfg) #agent = test_agent(max(ACTIONS.keys())) # Dueling Deep Q-Learning Agent agent = DDQNAgent() all_r = 0 obs = env.reset() # In lieu of having a state comprised of a single observation, we stack the last 3 images # at any given time in order to create a state, as suggested in DeepMind's DQN paper; # we do this in order to preserve the movement of the falling objects. s1, _, r1, _ = env.step(0) s2, _, r2, _ = env.step(0) s3, _, r3, _ = env.step(0) all_r += (r1 + r2 + r3) curr_obs = [s1, s2, s3] # Lambda function to reshape, convert to grayscale and stack the images in our observation list. make_obs = lambda obs_list : np.stack((cv2.cvtColor(obs, cv2.COLOR_BGR2GRAY).reshape((1, 86, 86)) for obs in obs_list), axis=3) for i in range(test_steps): # curr_obs is a list of the last 3 frames action = agent.act(make_obs(curr_obs)) next_frame, r, done, _ = env.step(action) all_r += r print('STEP', i, ':', action, '->', all_r) # next_obs takes the last 2 entries in our initial observation and adds the current frame next_obs = curr_obs[1:] + [next_frame] # We cache the experiences in our replay buffer for further usage in our training steps. agent.remember(make_obs(curr_obs), action, r, make_obs(next_obs), done) curr_obs = next_obs agent.replay(min(len(agent.memory), BATCH_SIZE)) print(f"Reward for {test_steps} steps: {all_r} ")
33.88
131
0.67375
0
0
0
0
0
0
0
0
914
0.359701
66240c3ee8769bc3f49297e677406217e8beaf2e
1,505
py
Python
TSTP_20210522_CH4_Functions.py
adjectiveJ/tstp_challenges
e0fcc174594387e0c6142980bf2706d7f5cbc5bd
[ "CC0-1.0" ]
null
null
null
TSTP_20210522_CH4_Functions.py
adjectiveJ/tstp_challenges
e0fcc174594387e0c6142980bf2706d7f5cbc5bd
[ "CC0-1.0" ]
null
null
null
TSTP_20210522_CH4_Functions.py
adjectiveJ/tstp_challenges
e0fcc174594387e0c6142980bf2706d7f5cbc5bd
[ "CC0-1.0" ]
null
null
null
""" The Self-Taught Programmer - Chapter 4 Challenges Author: Dante Valentine Date: 22 May, 2021 """ """ CHALLENGE 1 """ to_square = 12 def square_func(x): # Returns the square of x. return x*x resp = square_func(to_square) #print("The square of", to_square, "is", str(resp) + ".") """ CHALLENGE 2 """ to_print = 1.0056 def print_string(x): # Prints a string. print(str(x)) #print("Next I will print a string...") #string_var = print_string(to_print) """ CHALLENGE 3 """ param1 = "horse" param2 = "owl" param3 = "pig" def mixed_params(x, y, z, a="cat", b="dog"): # Prints 3 required parameters and two optional parameters. print(x ,y, z, a, b) #mixed_params(param1, param2, param3) #mixed_params(param1, param2, param3, "mouse", "frog") """ CHALLENGE 4 """ int_var = 3 def int_div_two(x): # Returns the input value divided by 2. return x/2 def int_mult_four(y): # Returns the input value multiplied by 4. return y*4 var1 = int_div_two(int_var) var2 = int_mult_four(var1) #print("Input: " + str(int_var) + " | Div2: " + str(var1) + " | Mult4: " + str(var2)) """ CHALLENGE 5""" string_var = "ghost" #string_var = "7.5" def stringToFloat(x): # Tries to return the input value as a float, else returns error message. try: return float(x) except ValueError: print("Error: Value must be a number.") print_var = stringToFloat(string_var) print(print_var)
21.5
87
0.621927
0
0
0
0
0
0
0
0
862
0.572757
6629f9d2ad476bdf575b8d97233a3d2d8781d35e
2,874
py
Python
src/unpurple.py
rnbdev/purple-fringe
b372c13f0e4d7d7ba9da53d7e6a4326c0e6c453a
[ "BSD-3-Clause" ]
2
2021-03-16T03:29:41.000Z
2021-05-21T03:32:57.000Z
src/unpurple.py
rnbdev/purple-fringe
b372c13f0e4d7d7ba9da53d7e6a4326c0e6c453a
[ "BSD-3-Clause" ]
null
null
null
src/unpurple.py
rnbdev/purple-fringe
b372c13f0e4d7d7ba9da53d7e6a4326c0e6c453a
[ "BSD-3-Clause" ]
null
null
null
import cv2 import numpy as np import argparse def unpurple(params): img = cv2.imread(params.input).astype(np.float64) img_b = img[..., 0] img_b = np.maximum(0, img_b - params.m * 255) img_b *= params.i / (1 - params.m) width = (params.r << 1) + 1 bl = cv2.blur(img_b, (width, width)) if params.mode == "blur": cv2.imwrite(params.output, bl) else: db = np.maximum(img[..., 0] - img[..., 1], 0) dr = np.maximum(img[..., 2] - img[..., 1], 0) mb = np.minimum(bl, db) r_diff = np.minimum(dr, mb * params.maxred) if params.minred > 0: b_diff = np.minimum(mb, r_diff / params.minred) else: b_diff = mb if params.mode == "diff": img_diff = np.dstack( [b_diff, np.zeros_like(b_diff), r_diff] ) img_diff = img_diff.astype(np.uint8) cv2.imwrite(params.output, img_diff) else: assert(params.mode == "normal") img_fix = img.copy() img_fix[..., 0] -= b_diff img_fix[..., 2] -= r_diff img_fix = img_fix.astype(np.uint8) cv2.imwrite(params.output, img_fix) if __name__ == "__main__": ap = argparse.ArgumentParser() ap.add_argument("-i", help="Intensity (scalar more or less around 1.0)", type=float, default=1.) ap.add_argument("-m", help="Minimum brightness (positive scalar smaller 1.0)", type=float, default=0.) ap.add_argument("-r", help="Blur radius (pixel)", type=int, default=5) ap.add_argument("-minred", help="Minimum red:blue ratio in the fringe", type=float, default=0.) ap.add_argument("-maxred", help="Maximum red:blue ratio in the fringe", type=float, default=.33) ap.add_argument("-gentle", help="Gentle (Same as -m 0.8 -minred 0.15)", action="store_true") ap.add_argument("-diff", action="store_const", dest="mode", const="diff", default="normal", help="Output image type") ap.add_argument("-blur", action="store_const", dest="mode", const="blur", help="Output image type") ap.add_argument(help="input image", dest="input") ap.add_argument(help="output image", dest="output") args = ap.parse_args() if args.gentle: args.m = 0.8 args.minred = 0.15 img = unpurple(args)
29.9375
76
0.4746
0
0
0
0
0
0
0
0
462
0.160752
662b2a0d020eee523039d18045fe01c4d90be8ba
61
py
Python
psi/serialize/__init__.py
delta-mpc/python-psi
1665de12a713b37abd889268c66de84cddb1bf84
[ "Apache-2.0" ]
35
2021-05-28T10:03:09.000Z
2022-03-24T12:08:19.000Z
psi/serialize/__init__.py
delta-mpc/python-psi
1665de12a713b37abd889268c66de84cddb1bf84
[ "Apache-2.0" ]
9
2021-07-15T09:16:34.000Z
2022-03-31T03:59:16.000Z
psi/serialize/__init__.py
delta-mpc/python-psi
1665de12a713b37abd889268c66de84cddb1bf84
[ "Apache-2.0" ]
16
2021-06-18T02:18:56.000Z
2022-03-25T02:43:48.000Z
from .bit_arr import * from .ecc import * from .int import *
15.25
22
0.704918
0
0
0
0
0
0
0
0
0
0
662b8a1aba28c4cad375998a888ed93da1fcc650
1,588
py
Python
scripts/run_episodes.py
takuma-ynd/rrc_example_package
f53cf3191f4c38f4d1f394ccd55b1d935a6a70ba
[ "BSD-3-Clause" ]
null
null
null
scripts/run_episodes.py
takuma-ynd/rrc_example_package
f53cf3191f4c38f4d1f394ccd55b1d935a6a70ba
[ "BSD-3-Clause" ]
null
null
null
scripts/run_episodes.py
takuma-ynd/rrc_example_package
f53cf3191f4c38f4d1f394ccd55b1d935a6a70ba
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/env python3 import numpy as np # from rrc_example_package.code.training_env import make_training_env from rrc_example_package.code.training_env.env import ActionType import rrc_example_package.move_cube import rrc_example_package.cube_env # env = make_training_env(visualization=False, **eval_config) # env.unwrapped.initializer = initializer # eval_config = { # 'action_space': 'torque_and_position', # 'frameskip': 3, # 'residual': True, # 'reward_fn': f'task{difficulty}_competition_reward', # 'termination_fn': 'no_termination', # 'initializer': f'task{difficulty}_init', # 'monitor': False, # 'rank': 0 # } goal = move_cube.sample_goal(3) goal_dict = { 'position': move_cube.position, 'orientation': move_cube.orientation } env = cube_env.RealRobotCubeEnv(goal_dict, 3) obs = env.reset() done = False accumulated_reward = 0 if env.action_type == ActionType.TORQUE_AND_POSITION: zero_action = { 'torque': (env.action_space['torque'].sample() * 0).astype(np.float64), 'position': (env.action_space['position'].sample() * 0).astype(np.float64) } assert zero_action['torque'].dtype == np.float64 assert zero_action['position'].dtype == np.float64 else: zero_action = np.array(env.action_space.sample() * 0).astype(np.float64) assert zero_action.dtype == np.float64 while not done: obs, reward, done, info = env.step(zero_action) accumulated_reward += reward print("Accumulated reward: {}".format(accumulated_reward))
32.408163
82
0.687028
0
0
0
0
0
0
0
0
617
0.388539
662cd92db90d9d0b17d2a45ad47818909732dc56
1,253
py
Python
src/algorithms/utils.py
MSwenne/QSB-Suite
7860e4634bdce10fa79d7f850b6bc2099357d7b0
[ "MIT" ]
null
null
null
src/algorithms/utils.py
MSwenne/QSB-Suite
7860e4634bdce10fa79d7f850b6bc2099357d7b0
[ "MIT" ]
null
null
null
src/algorithms/utils.py
MSwenne/QSB-Suite
7860e4634bdce10fa79d7f850b6bc2099357d7b0
[ "MIT" ]
null
null
null
import random def QFT(first: int, last: int) -> str: res = "// Begin QFT\n" for a in range(first, last+1): res += f"h q[{a}];\n" for b in range(a+1,last+1): res += f"crz({1/(2**(b-a+1))}) q[{a}], q[{b}];\n" return res def QFT_inv(first: int, last: int) -> str: res = "// Begin QFT inverse\n" for a in range(last, first-1, -1): for b in range(last,a,-1): res += f"crz({-1/(2**(b-a+1))}) q[{a}], q[{b}];\n" res += f"h q[{a}];\n" return res def QASM_prefix(qubits: int, bits: int) -> str: # Initial QASM setup res = "OPENQASM 2.0;\n" res += "include \"qelib1.inc\";\n\n" res += f"qreg q[{qubits}];\n" res += f"creg c[{bits}];\n\n" return res def random_pauli() -> str: return random.choice(["x", "y", "z"]) def random_cliff3() -> str: return random.choice(["x", "h", "s"]) def random_cliff7() -> str: return random.choice(["x", "y", "z", "h", "sx", "sy", "s"]) def random_univeral() -> str: return random.choice(["x", "y", "z", "h", "t"]) def random_cgate(qubits): c = random.randint(0,qubits-1) t = random.randint(0,qubits-1) while c == t: t = random.randint(0,qubits-1) return f"cz q[{c}], q[{t}];\n"
27.23913
63
0.51237
0
0
0
0
0
0
0
0
342
0.272945
662db785b141a51d5e5c2d7a6ae200c6d7fc2fa6
1,458
py
Python
src/sprite.py
GreenXenith/zoria
30a16baab3643c820613a8c8669ee6235a2cd47c
[ "MIT" ]
null
null
null
src/sprite.py
GreenXenith/zoria
30a16baab3643c820613a8c8669ee6235a2cd47c
[ "MIT" ]
null
null
null
src/sprite.py
GreenXenith/zoria
30a16baab3643c820613a8c8669ee6235a2cd47c
[ "MIT" ]
null
null
null
import pygame from . import assets from .vector import * global registered_sprites registered_sprites = {} def register_sprite(name, definition): registered_sprites[name] = definition class Sprite: texture = "none.png" rect = pygame.Rect(0, 0, 0, 0) def __init__(self, name, pos, z): self.name = name self.pos = pos self.rot = 0 self.z = z self.vel = Vector(0, 0) for key in registered_sprites[name]: value = registered_sprites[name][key] if not callable(value): setattr(self, key, value) def set_pos(self, vec_or_x, y = None): self.pos = vec_or_num(vec_or_x, y) def set_texture(self, filename): self.texture = assets.get(filename) def set_rect(self, x, y, w, h): self.rect = pygame.Rect(x, y, w, h) def get_rect(self): return self.rect def on_step(self, dtime, map, player): oldx = self.pos.x self.set_pos(self.pos.x + self.vel.x * dtime, self.pos.y) if map.collides(self.pos, self.z, self.rect): self.set_pos(oldx, self.pos.y) oldy = self.pos.y self.set_pos(self.pos.x, self.pos.y + self.vel.y * dtime) if map.collides(self.pos, self.z, self.rect): self.set_pos(self.pos.x, oldy) if "on_step" in registered_sprites[self.name]: registered_sprites[self.name]["on_step"](self, dtime, map, player)
27
78
0.598765
1,265
0.867627
0
0
0
0
0
0
28
0.019204
662f6bd952e2e4b17cde090c9644c4ad6ec3e3d7
5,873
py
Python
pset1 /ps1.py
vnb/Data-Science
af2936b621d51a6839111b6c793f9a270cded16c
[ "MIT" ]
null
null
null
pset1 /ps1.py
vnb/Data-Science
af2936b621d51a6839111b6c793f9a270cded16c
[ "MIT" ]
null
null
null
pset1 /ps1.py
vnb/Data-Science
af2936b621d51a6839111b6c793f9a270cded16c
[ "MIT" ]
null
null
null
########################### # 6.00.2x Problem Set 1: Space Cows from ps1_partition import get_partitions import time #================================ # Part A: Transporting Space Cows #================================ def load_cows(filename): """ Read the contents of the given file. Assumes the file contents contain data in the form of comma-separated cow name, weight pairs, and return a dictionary containing cow names as keys and corresponding weights as values. Parameters: filename - the name of the data file as a string Returns: a dictionary of cow name (string), weight (int) pairs """ cow_dict = dict() f = open(filename, 'r') for line in f: line_data = line.split(',') cow_dict[line_data[0]] = int(line_data[1]) return cow_dict # Problem 1 def greedy_cow_transport(cows,limit=10): """ Uses a greedy heuristic to determine an allocation of cows that attempts to minimize the number of spaceship trips needed to transport all the cows. The returned allocation of cows may or may not be optimal. The greedy heuristic should follow the following method: 1. As long as the current trip can fit another cow, add the largest cow that will fit to the trip 2. Once the trip is full, begin a new trip to transport the remaining cows Does not mutate the given dictionary of cows. Parameters: cows - a dictionary of name (string), weight (int) pairs limit - weight limit of the spaceship (an int) Returns: A list of lists, with each inner list containing the names of cows transported on a particular trip and the overall list containing all the trips """ # # TODO: Your code here # pass #initialize trip list #helper function sub_set selected_cows = [] cow_names = [x for x in cows] available_cows = [cows[x] for x in cows] cows_remaining = [cows[x] for x in cows] set_limit = limit trip_list = [] cow_list = [] cow_trip_list = [] while len(available_cows) > 0: limit = set_limit cows_remaining = available_cows[:] selected_cows = [] sub_list = [] while limit > 0: if len(cows_remaining) == 0: break a = max(cows_remaining) cows_remaining.remove(a) if a <= limit: limit -= a selected_cows.append(a) available_cows.remove(a) trip_list.append(selected_cows) for i in selected_cows: for name in cows: if cows[name] == i: if name in cow_names: cow_list.append(name) cow_names.remove(name) break cow_trip_list.append(cow_list) cow_list = [] return cow_trip_list # Problem 2 def brute_force_cow_transport(cows,limit=10): """ Finds the allocation of cows that minimizes the number of spaceship trips via brute forc e. The brute force algorithm should follow the following method: 1. Enumerate all possible ways that the cows can be divided into separate trips 2. Select the allocation that minimizes the number of trips without making any trip that does not obey the weight limitation Does not mutate the given dictionary of cows. Parameters: cows - a dictionary of name (string), weight (int) pairs limit - weight limit of the spaceship (an int) Returns: A list of lists, with each inner list containing the names of cows transported on a particular trip and the overall list containing all the trips """ def count_sum(listofcows, cows): weight = 0 for i in listofcows: weight += cows[i] if weight > limit: return False break return True cow_list = list(cows.keys()) flight_list = [] all_partitions = get_partitions(cow_list) for i in all_partitions: switch = 'green' for j in i: if count_sum(j, cows) == False: switch = 'red' break if switch == 'green': flight_list.append(i) trip_len_list = [len(i) for i in flight_list] for i in flight_list: if len(i) == min(trip_len_list): ideal_trip = i break return ideal_trip # Problem 3 def compare_cow_transport_algorithms(): """ Using the data from ps1_cow_data.txt and the specified weight limit, run your greedy_cow_transport and brute_force_cow_transport functions here. Use the default weight limits of 10 for both greedy_cow_transport and brute_force_cow_transport. Print out the number of trips returned by each method, and how long each method takes to run in seconds. Returns: Does not return anything. """ cows = load_cows("ps1_cow_data.txt") limit=10 start = time.time() ans_a = greedy_cow_transport(cows, limit) end = time.time() print(end-start) start = time.time() ans_b = brute_force_cow_transport(cows, limit) end = time.time() print(end-start) return """ Here is some test data for you to see the results of your algorithms with. Do not submit this along with any of your answers. Uncomment the last two lines to print the result of your problem. """ cows = load_cows("ps1_cow_data.txt") limit=10 #print(cows) # #print(greedy_cow_transport(cows, limit)) #print(brute_force_cow_transport(cows, limit)) print(compare_cow_transport_algorithms())
30.910526
90
0.604461
0
0
0
0
0
0
0
0
3,141
0.53482
6630cfae3164736554237dd2d66a2111da1f1715
6,080
py
Python
blackboxopt/optimization_loops/dask_distributed.py
boschresearch/blackboxopt
85abea86f01a4a9d50f05d15e7d850e3288baafd
[ "ECL-2.0", "Apache-2.0" ]
8
2021-07-05T13:37:22.000Z
2022-03-11T12:23:27.000Z
blackboxopt/optimization_loops/dask_distributed.py
boschresearch/blackboxopt
85abea86f01a4a9d50f05d15e7d850e3288baafd
[ "ECL-2.0", "Apache-2.0" ]
14
2021-07-07T13:55:23.000Z
2022-02-07T13:09:01.000Z
blackboxopt/optimization_loops/dask_distributed.py
boschresearch/blackboxopt
85abea86f01a4a9d50f05d15e7d850e3288baafd
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
# Copyright (c) 2020 - for information on the respective copyright owner # see the NOTICE file and/or the repository https://github.com/boschresearch/blackboxopt # # SPDX-License-Identifier: Apache-2.0 import logging import time from typing import Callable, List, Set, Union try: import dask.distributed as dd except ImportError as e: raise ImportError( "Unable to import Dask Distributed specific dependencies. " + "Make sure to install blackboxopt[dask]" ) from e from blackboxopt import ( Evaluation, EvaluationSpecification, OptimizationComplete, OptimizerNotReady, ) from blackboxopt.base import ( MultiObjectiveOptimizer, Objective, SingleObjectiveOptimizer, ) from blackboxopt.optimization_loops.utils import ( evaluation_function_wrapper, init_max_evaluations_with_limit_logging, ) class MinimalDaskScheduler: def __init__( self, dask_client: dd.Client, objectives: List[Objective], logger: logging.Logger, ): self.client = dask_client self.objectives = objectives self.logger = logger self._not_done_futures: Set = set() def shutdown(self): return self.client.shutdown() def has_capacity(self): idle = [len(task_id) == 0 for task_id in self.client.processing().values()] return sum(idle) def has_running_jobs(self): return len(self._not_done_futures) > 0 def submit( self, eval_function: Callable[[EvaluationSpecification], Evaluation], eval_spec: EvaluationSpecification, ): f = self.client.submit( evaluation_function_wrapper, evaluation_function=eval_function, evaluation_specification=eval_spec, objectives=self.objectives, catch_exceptions_from_evaluation_function=True, logger=self.logger, ) f.bbo_eval_spec = eval_spec self._not_done_futures.add(f) def check_for_results(self, timeout_s: float = 5.0) -> List[Evaluation]: try: all_futures = dd.wait( self._not_done_futures, timeout=timeout_s, return_when="FIRST_COMPLETED" ) return_values: List[Evaluation] = [] for f in all_futures.done: if f.status == "error": return_values.append( Evaluation( objectives={o.name: None for o in self.objectives}, stacktrace=str(f.traceback()), **f.bbo_eval_spec ) ) else: return_values.append(f.result()) self._not_done_futures = all_futures.not_done except dd.TimeoutError: return_values = [] return return_values def run_optimization_loop( optimizer: Union[SingleObjectiveOptimizer, MultiObjectiveOptimizer], evaluation_function: Callable[[EvaluationSpecification], Evaluation], dask_client: dd.Client, timeout_s: float = float("inf"), max_evaluations: int = None, logger: logging.Logger = None, ) -> List[Evaluation]: """Convenience wrapper for an optimization loop that uses Dask to parallelize optimization until a given timeout or maximum number of evaluations is reached. This already handles signals from the optimizer in case there is no evaluation specification available yet. Args: optimizer: The blackboxopt optimizer to run. dask_client: A Dask Distributed client that is configured with workers. evaluation_function: The function that is called with configuration, settings and optimizer info dictionaries as arguments like provided by an evaluation specification. This is the function that encapsulates the actual execution of a parametrized experiment (e.g. ML model training) and should return a `blackboxopt.Evaluation` as a result. timeout_s: If given, the optimization loop will terminate after the first optimization step that exceeded the timeout (in seconds). Defaults to inf. max_evaluations: If given, the optimization loop will terminate after the given number of steps. Defaults to None. logger: The logger to use for logging progress. Defaults to None. Returns: List of evluation specification and result for all evaluations. """ logger = logging.getLogger("blackboxopt") if logger is None else logger objectives = ( optimizer.objectives if isinstance(optimizer, MultiObjectiveOptimizer) else [optimizer.objective] ) evaluations: List[Evaluation] = [] dask_scheduler = MinimalDaskScheduler( dask_client=dask_client, objectives=objectives, logger=logger ) _max_evaluations = init_max_evaluations_with_limit_logging( max_evaluations=max_evaluations, timeout_s=timeout_s, logger=logger ) n_eval_specs = 0 start = time.time() while time.time() - start < timeout_s and n_eval_specs < _max_evaluations: if dask_scheduler.has_capacity(): try: eval_spec = optimizer.generate_evaluation_specification() dask_scheduler.submit(evaluation_function, eval_spec) n_eval_specs += 1 continue except OptimizerNotReady: logger.info("Optimizer is not ready yet; will retry after short pause.") except OptimizationComplete: logger.info("Optimization is complete") break new_evaluations = dask_scheduler.check_for_results(timeout_s=20) optimizer.report(new_evaluations) evaluations.extend(new_evaluations) while dask_scheduler.has_running_jobs(): new_evaluations = dask_scheduler.check_for_results(timeout_s=20) optimizer.report(new_evaluations) evaluations.extend(new_evaluations) return evaluations
34.742857
88
0.659539
2,026
0.333224
0
0
0
0
0
0
1,727
0.284046
66338488816d4107164bc58a2e6c72cf6c5eff02
2,997
py
Python
admit/at/test/test_ingest.py
astroumd/admit
bbf3d79bb6e1a6f7523553ed8ede0d358d106f2c
[ "MIT" ]
4
2017-03-01T17:26:28.000Z
2022-03-03T19:23:06.000Z
admit/at/test/test_ingest.py
teuben/admit
1cae54d1937c9af3f719102838df716e7e6d655c
[ "MIT" ]
48
2016-10-04T01:25:33.000Z
2021-09-08T14:51:10.000Z
admit/at/test/test_ingest.py
teuben/admit
1cae54d1937c9af3f719102838df716e7e6d655c
[ "MIT" ]
2
2016-11-10T14:10:22.000Z
2017-03-30T18:58:05.000Z
#! /usr/bin/env casarun # # # you can either use the "import" method from within casapy # or use the casarun shortcut to run this from a unix shell # with the argument being the casa image file to be processed # # Typical test usage: # ./test_ingest.py test123.fits [dummy] # This will produce admit.xml and # cim (the casa converted fits) with matching cim.bdp # # mkcd new # ln -s ../../../../data/foobar.fits # ../test_ingest.py foobar.fits both # $ADMIT/admit/at/test/test_ingest.py foobar.fits both import admit.Admit as ad from admit.at.Ingest_AT import Ingest_AT def run(fileName, method): """ Ingest using ADMIT, and return the ADMIT instance for any further analysis method: if blank, only ingest, otherwise use spectrum or stats or both """ # instantiate ADMIT, we can only handle .fits files here loc = fileName.rfind('.') adir = fileName[:loc] + '.admit' a = ad.Admit(adir) a.plotmode(0) # just set an ADMIT variable a.set(foobar=1) print 'admit::foobar =',a.get('foobar') # Instantiate the AT, add it to ADMIT, and set some Ingest parameters a0 = Ingest_AT(file=fileName) i0 = a.addtask(a0) # run and save a.run() a.write() # inspect BDP? This will be a SpwCube_BDP b0 = a0[0] print 'BDP_0 has the following images:',b0.image.images if True: # enable if you want to check if indeed nothing happens here print "BEGIN running again" a.run() print "END running again" if method == "moment": from admit.at.Moment_AT import Moment_AT a1 = Moment_AT() i1 = a.addtask(a1, [(i0,0)]) a1.setkey('moments',[0,1,2]) elif method == "stats": from admit.at.CubeStats_AT import CubeStats_AT a1 = CubeStats_AT() i1 = a.addtask(a1, [(i0,0)]) elif method == "spectrum": from admit.at.CubeSpectrum_AT import CubeSpectrum_AT a1 = CubeSpectrum_AT() a1.setkey('pos',[70,70]) i1 = a.addtask(a1, [(i0,0)]) elif method == "both": # cubestats will pass its maxpos= to cubespectrum from admit.at.CubeStats_AT import CubeStats_AT from admit.at.CubeSpectrum_AT import CubeSpectrum_AT a1 = CubeStats_AT() i1 = a.addtask(a1, [(i0,0)]) a2 = CubeSpectrum_AT() i2 = a.addtask(a2, [(i0,0),(i1,0)]) else: print "No method ",method print "Final run" a.run() a.write() print "All done. admit.xml written" return a if __name__ == "__main__": import sys argv = ad.casa_argv(sys.argv) if len(argv) > 1: if len(argv) == 2: # only one argument: just ingest print "Ingesting ",argv[1] a = run(argv[1],False) else: print "Ingesting and running a sample %s on %s" % (argv[2],argv[1]) a = run(argv[1],argv[2]) print "One more run, of nothing we hope." a.run()
29.382353
79
0.602936
0
0
0
0
0
0
0
0
1,344
0.448448
66349dcef473158c517a2f6336f11fae97c3b0b4
2,156
py
Python
app/Duration.py
joshuaMarple/phase-vocoder
d652a594da2b526eae758c4d0ca6e87e0497b89d
[ "Apache-2.0" ]
null
null
null
app/Duration.py
joshuaMarple/phase-vocoder
d652a594da2b526eae758c4d0ca6e87e0497b89d
[ "Apache-2.0" ]
null
null
null
app/Duration.py
joshuaMarple/phase-vocoder
d652a594da2b526eae758c4d0ca6e87e0497b89d
[ "Apache-2.0" ]
null
null
null
""" Authors: Fernando (UPDATE HIS INFO) License: GPL 3.0 Description: This file contains functions that allows the user to change the pitch of a .wav Comments: None. """ import subprocess import os from sys import platform as _platform from lib import pydub def changeDuration(filename,percent): """ Input: filename , tones filename (string): the path to the soundfile tones (integer): the number of semitones to change(from negative number to positive number) Outputs: pitchoutput.wav Description: This function will change the pitch of a soundfile """ tempochange = "-tempo="+str(percent) if _platform == "linux" or _platform == "linux2": fn = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'soundpitch') elif _platform == "darwin": fn = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'soundpitchmac') elif _platform == "win32": fn = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'soundpitchwin32.exe') subprocess.call([fn,filename, "duroutput.wav","-speech", tempochange]) return "duroutput.wav" def changeGapDuration(filename,gaptime,gapduration,percentage): """ Input: filename , gaptime, gapduration , tones filename (string): the path to the soundfile gaptime (float): the time to begin changing the pitch gapduration (float): the amount of sound to be changed(from the gaptime start to the end of this length) tones (integer): the number of semitones to change(from negative number to positive number) Outputs: processefile.wav Description: This function will change the pitch of a soundfile """ file = pydub.AudioSegment.from_wav(filename) newdurationpart = file[int((gaptime* 1000)) : int(((gaptime+gapduration) * 1000))] first = file[:int(gaptime * 1000)] last = file[int((gaptime+gapduration) * 1000):] newdurationpart.export("durinput.wav", format="wav") changeDuration("durinput.wav",percentage) newdurationpart = pydub.AudioSegment.from_wav("duroutput.wav") newfile = first + newdurationpart + last newfile.export(filename, format="wav") os.remove("durinput.wav") os.remove("duroutput.wav") return newfile
34.222222
106
0.729128
0
0
0
0
0
0
0
0
1,106
0.512987
6634c188bd630f307a7ad6ecabe91c09bac5af47
12,711
py
Python
network-manager/varanuspy/utils.py
netx-ulx/varanus
7df5ec70563253d72a4287566b1fbb6bdf804a4c
[ "Apache-2.0" ]
null
null
null
network-manager/varanuspy/utils.py
netx-ulx/varanus
7df5ec70563253d72a4287566b1fbb6bdf804a4c
[ "Apache-2.0" ]
null
null
null
network-manager/varanuspy/utils.py
netx-ulx/varanus
7df5ec70563253d72a4287566b1fbb6bdf804a4c
[ "Apache-2.0" ]
null
null
null
from Queue import Empty, Queue import collections import ipaddress import netifaces import pwd import signal import socket from subprocess import Popen from threading import Thread ################################################################################ #### String utils def newline( *args ): class SingleLine( object ): def __init__( self, words ): self.words = words def __iter__( self ): return SingleLineIterator( self.words ) def __str__( self ): return ' '.join( self ) if len( args ) == 1 and isinstance( args[0], list ): args_list = args[0] else: args_list = list( args ) return SingleLine( args_list ) class SingleLineIterator( object ): def __init__( self, words ): self.words = words self.final_idx = len( words ) - 1 self.curr_idx = 0 def __iter__( self ): return self def __next__( self ): i = self.curr_idx if i < self.final_idx: self.curr_idx = i + 1 return str( self.words[i] ) elif i == self.final_idx: self.curr_idx = i + 1 return '{}\n'.format( self.words[i] ) else: raise StopIteration next = __next__ def multiline( *args ): class MultiLine( object ): def __init__( self, lines ): self.lines = lines def __iter__( self ): return self.lines def __str__( self ): return '\n'.join( self.lines ) if len( args ) == 1 and isinstance( args[0], list ): args_list = args[0] else: args_list = list( args ) return MultiLine( args_list ) ################################################################################ #### Function utils def call_until( func, stop_condition ): """ Calls the provided function (if defined) until the provided stop condition function returns True. - func : a callable to be called repeatedly - stop_condition: a callable that returns True when no more calls to func should be made """ stop_condition = as_callable( stop_condition, name='stop_condition' ) if is_some( func ): func = as_callable( func, name='func' ) while stop_condition() is not True: func() ################################################################################ #### OS utils def user_exists( username ): try: pwd.getpwnam( username ) return True except KeyError: return False def get_user_home( username ): try: return pwd.getpwnam( username ).pw_dir except KeyError: raise ValueError( 'unknown user' ) class AsyncProcess( object ): """ A wrapper for a Popen object that allows for asynchronous access to its output one line at a time. """ def __init__( self, popen, cmd=None ): """ Creates a new AsyncProcess object that wraps the provided Popen object and consumes its output in a separate thread. """ self.popen = as_a( popen, instance_of=Popen ) self.queue = Queue() if is_some( cmd ): if isinstance( cmd, list ): cmd = ' '.join( cmd ) self.cmd = cmd else: self.cmd = None t = Thread( target=self.__consume_output ) t.daemon = True t.start() def readline( self, block=True, timeout=None ): block = as_bool( block, name='block' ) try: return self.queue.get( block=block, timeout=timeout ) except Empty: return None def readline_nowait( self ): return self.readline( block=False ) def read_available_lines( self ): return list( iter( self.readline_nowait, None ) ) def interrupt( self ): self.popen.send_signal( signal.SIGINT ) def terminate( self ): self.popen.terminate() def kill( self ): self.popen.kill() def wait_to_finish( self ): return self.popen.wait() def is_finished( self ): return is_some( self.get_return_code() ) def get_return_code( self ): return self.popen.poll() def __consume_output( self ): with self.popen.stdout as output: for line in iter( output.readline, b'' ): line = line.rstrip( '\n\r' ) self.queue.put( line ) ################################################################################ #### Network utils def resolve( hostname ): hostname = some( hostname, name='hostname' ) try: return str( ipaddress.ip_address( hostname ) ) except ValueError: return socket.gethostbyname( hostname ) def ipv4address_of( intf, index=0 ): index = as_int( index, minim=0 ) ipv4addrs = ipv4addresses_of( intf ) naddrs = len( ipv4addrs ) if naddrs == 0: raise ValueError( 'interface {} has 0 assigned IPv4 addresses'.format( intf ) ) elif index >= naddrs: if naddrs == 1: raise ValueError( 'address index {} is too high; only one address is available'.format( index ) ) else: raise ValueError( 'address index {} is too high; only {} addresses are available'.format( index, naddrs ) ) else: return ipv4addrs[index]['addr'] def ipv4addresses_of( intf ): intf = as_str( some( intf, name='interface' ) ) if not intf in netifaces.interfaces(): raise ValueError( 'unknown interface "{}"'.format( intf ) ) else: addrs = netifaces.ifaddresses( intf ) if not netifaces.AF_INET in addrs: raise ValueError( 'interface {} does not have any assigned IPv4 addresses'.format( intf ) ) else: return addrs[netifaces.AF_INET] def send_bytes( sock, buf, exit_check=None, exit_on_timeout=False ): """ Sends some bytes to the provided socket. Returns 'True' on success. - sock : a socket object - buf : a buffer containing bytes to send - exit_check : an optional callable indicating if the send operation should be aborted; if the callable is defined and returns 'True', and this function detects it, then the send operation is aborted and 'False' is returned (defaults to 'None') - exit_on_timeout: if 'True' then raised socket.timeout exceptions are propagated to the caller, otherwise they are ignored (defaults to 'False') """ sock = some( sock, name='sock' ) buf = some( buf, name='buf' ) exit_check = as_callable( exit_check, name='exit_check' ) if is_some( exit_check ) else lambda : False exit_on_timeout = as_bool( exit_on_timeout, name='exit_on_timeout' ) while not exit_check(): try: sock.sendall( buf ) return True except socket.timeout: # no bytes were sent if exit_on_timeout: raise # abort else: pass # try again else: return False def recv_bytes( sock, nbytes, exit_check=None, exit_on_timeout=False ): """ Returns a received number of bytes from the provided socket. - sock : a socket object - nbytes : the number of bytes to receive - exit_check : an optional callable indicating if the receive operation should be aborted; if the callable is defined and returns 'True', and this function detects it, then the receive operation is aborted and 'None' is returned (defaults to 'None') - exit_on_timeout: if 'True' then raised socket.timeout exceptions are propagated to the caller, otherwise they are ignored (defaults to 'False') An IOError is raised if the socket receives an EOF. """ sock = some( sock, name='sock' ) nbytes = as_int( nbytes, minim=0, name='nbytes' ) exit_check = as_callable( exit_check, name='exit_check' ) if is_some( exit_check ) else lambda : False exit_on_timeout = as_bool( exit_on_timeout, name='exit_on_timeout' ) buf = bytearray( nbytes ) if nbytes == 0: return buf bufview = memoryview( buf ) while not exit_check(): try: nread = sock.recv_into( bufview ) if nread == 0: # EOF raise IOError( 'remote side terminated the connection' ) else: bufview = bufview[nread:] if len( bufview ) == 0: return buf except socket.timeout: # no bytes were received if exit_on_timeout: raise # abort else: pass # try again else: return None ################################################################################ #### Value testing utils def is_some( value ): return False if value is None else True def is_somestr( value, allow_empty=False ): if value is None: return False else: svalue = str( value ) if svalue is None: return False elif allow_empty == False and len( svalue ) == 0: return False else: return True def is_iterable( value ): if not isinstance( value, collections.Iterable ): try: iter( value ) except TypeError: return False return True def is_mapping( value ): return isinstance( value, collections.Mapping ) ################################################################################ #### Value checking utils def some( value, name='value' ): if value is None: raise ValueError( 'expected {} to be defined (not None)'.format( name ) ) else: return value def as_oneof( value, container, valname='value', containername='container' ): if value not in container: raise ValueError( 'expected {} to be in {}'.format( valname, containername ) ) else: return value def as_bool( value, name='value' ): if value is not True and value is not False: raise ValueError( 'expected {} to be a boolean'.format( name ) ) else: return value def as_int( value, minim=None, maxim=None, name='value' ): try: ivalue = int( value ) except ValueError: raise ValueError( 'expected {} to be an integer'.format( name ) ) if minim is not None and ivalue < minim: raise ValueError( 'expected {} to be at least {}'.format( name, minim ) ) elif maxim is not None and ivalue > maxim: raise ValueError( 'expected {} to be at most {}'.format( name, maxim ) ) else: return ivalue def as_str( value, allow_empty=False, name='value' ): if not is_somestr( value, allow_empty ): raise ValueError( 'expected {} to be a valid string'.format( name ) ) else: return str( value ) def as_the( value, other, valname='value', othername='other' ): if value is not other: raise ValueError( 'expected {} to be the same as {}'.format( valname, othername ) ) else: return value def as_a( value, instance_of=None, subclass_of=None, name='value' ): if instance_of is not None and not isinstance( value, instance_of ): raise ValueError( 'expected {} to be an instance of {}'.format( name, instance_of ) ) elif subclass_of is not None and not issubclass( value, subclass_of ): raise ValueError( 'expected {} to be a subclass of {}'.format( name, subclass_of ) ) else: return value def as_callable( value, name='value' ): if not callable( value ): raise ValueError( 'expected {} to be a callable'.format( name ) ) else: return value ################################################################################ #### Misc. utils def fallback( value, default ): if value is None: return default else: return value def optional( value, mapper ): if is_some( value ): value = mapper( value ) return value def optional_bool( value ): return optional( value, as_bool ) def optional_int( value, minim=None, maxim=None ): return optional( value, lambda x : as_int( x, minim=minim, maxim=maxim ) ) def optional_str( value, allow_empty=False ): return optional( value, lambda x : as_str( x, allow_empty=allow_empty ) ) def check_duplicate( container, value, containername='container', valname='value' ): if value in container: raise ValueError( 'found duplicate {} in {}'.format( valname, containername ) )
29.908235
119
0.571001
2,745
0.215955
0
0
0
0
0
0
3,737
0.293997
66373663ff85fccb4333f1b45aed30d0b9af2c3c
8,824
py
Python
load/DBPLoadController.py
faithcomesbyhearing/dbp-etl
ffd849111e8e2d40e9b07663408d31b5a2d15ce7
[ "MIT" ]
null
null
null
load/DBPLoadController.py
faithcomesbyhearing/dbp-etl
ffd849111e8e2d40e9b07663408d31b5a2d15ce7
[ "MIT" ]
4
2021-03-10T22:20:29.000Z
2022-03-23T22:18:00.000Z
load/DBPLoadController.py
faithcomesbyhearing/dbp-etl
ffd849111e8e2d40e9b07663408d31b5a2d15ce7
[ "MIT" ]
1
2021-03-10T20:49:43.000Z
2021-03-10T20:49:43.000Z
# DBPLoadController.py # 1) Run Validate on the files to process # 2) Move any Fileset that is accepted to uploading # 3) Perform upload # 4) Move any fully uploaded fileset to database # 5) Update fileset related tables # 6) Move updated fileset to complete import os from Config import * from RunStatus import * from LPTSExtractReader import * from Log import * from InputFileset import * from Validate import * from S3Utility import * from SQLBatchExec import * from UpdateDBPFilesetTables import * from UpdateDBPBiblesTable import * from UpdateDBPLPTSTable import * from UpdateDBPVideoTables import * from UpdateDBPBibleFilesSecondary import * class DBPLoadController: def __init__(self, config, db, lptsReader): self.config = config self.db = db self.lptsReader = lptsReader self.s3Utility = S3Utility(config) self.stockNumRegex = re.compile("__[A-Z0-9]{8}") ## This corrects filesets that have stock number instead of damId in the filename. def repairAudioFileNames(self, inputFilesets): for inp in inputFilesets: for index in range(len(inp.files)): file = inp.files[index] if file.name.endswith(".mp3"): namePart = file.name.split(".")[0] damId = namePart[-10:] if self.stockNumRegex.match(damId): inp.files[index].name = namePart[:-10] + inp.filesetId[:10] + ".mp3" def validate(self, inputFilesets): validate = Validate(self.config, self.db) validate.process(inputFilesets) for inp in inputFilesets: if os.path.isfile(inp.csvFilename): InputFileset.upload.append(inp) else: RunStatus.set(inp.filesetId, False) def updateBibles(self): dbOut = SQLBatchExec(self.config) bibles = UpdateDBPBiblesTable(self.config, self.db, dbOut, self.lptsReader) bibles.process() #dbOut.displayStatements() dbOut.displayCounts() success = dbOut.execute("bibles") RunStatus.set(RunStatus.BIBLE, success) return success def upload(self, inputFilesets): self.s3Utility.uploadAllFilesets(inputFilesets) secondary = UpdateDBPBibleFilesSecondary(self.config, None, None) secondary.createAllZipFiles(inputFilesets) Log.writeLog(self.config) def updateFilesetTables(self, inputFilesets): inp = inputFilesets dbOut = SQLBatchExec(self.config) update = UpdateDBPFilesetTables(self.config, self.db, dbOut) video = UpdateDBPVideoTables(self.config, self.db, dbOut) for inp in inputFilesets: hashId = update.processFileset(inp) if inp.typeCode == "video": video.processFileset(inp.filesetPrefix, inp.filenames(), hashId) dbOut.displayCounts() success = dbOut.execute(inp.batchName()) RunStatus.set(inp.filesetId, success) if success: InputFileset.complete.append(inp) else: print("********** Fileset Table %s Update Failed **********" % (inp.filesetId)) def updateLPTSTables(self): dbOut = SQLBatchExec(self.config) lptsDBP = UpdateDBPLPTSTable(self.config, dbOut, self.lptsReader) lptsDBP.process() #dbOut.displayStatements() dbOut.displayCounts() success = dbOut.execute("lpts") RunStatus.set(RunStatus.LPTS, success) return success if (__name__ == '__main__'): config = Config() AWSSession.shared() # ensure AWSSession init db = SQLUtility(config) lptsReader = LPTSExtractReader(config.filename_lpts_xml) ctrl = DBPLoadController(config, db, lptsReader) if len(sys.argv) != 2: InputFileset.validate = InputFileset.filesetCommandLineParser(config, AWSSession.shared().s3Client, lptsReader) ctrl.repairAudioFileNames(InputFileset.validate) ctrl.validate(InputFileset.validate) if ctrl.updateBibles(): ctrl.upload(InputFileset.upload) ctrl.updateFilesetTables(InputFileset.database) ctrl.updateLPTSTables() for inputFileset in InputFileset.complete: print("Completed: ", inputFileset.filesetId) else: ctrl.updateBibles() ctrl.updateLPTSTables() RunStatus.exit() # Get currrent lpts-dbp.xml # aws --profile DBP_DEV s3 cp s3://dbp-etl-upload-newdata-fiu49s0cnup1yr0q/lpts-dbp.xml /Volumes/FCBH/bucket_data/lpts-dbp.xml # Clean up filesets in dbp-stating and dbp-vid-staging # Prepare by getting some local data into a test bucket # aws s3 --profile dbp-etl-dev sync --acl bucket-owner-full-control /Volumes/FCBH/all-dbp-etl-test/audio/UNRWFW/UNRWFWP1DA s3://dbp-etl-upload-dev-zrg0q2rhv7shv7hr/UNRWFWP1DA # aws s3 --profile dbp-etl-dev sync --acl bucket-owner-full-control /Volumes/FCBH/all-dbp-etl-test/HYWWAVN2ET s3://dbp-etl-upload-dev-zrg0q2rhv7shv7hr/HYWWAVN2ET # aws s3 --profile dbp-etl-dev sync --acl bucket-owner-full-control /Volumes/FCBH/all-dbp-etl-test/ENGESVP2DV s3://dbp-etl-upload-dev-zrg0q2rhv7shv7hr/ENGESVP2DV # No parameter, should execute only bible and lpts updates # time python3 load/DBPLoadController.py test # Successful tests with source on local drive # time python3 load/TestCleanup.py test HYWWAV # time python3 load/TestCleanup.py test HYWWAVN_ET-usx # time python3 load/TestCleanup.py test ENGESVP2DV # time python3 load/DBPLoadController.py test /Volumes/FCBH/all-dbp-etl-test/ HYWWAVN2ET # time python3 load/DBPLoadController.py test /Volumes/FCBH/all-dbp-etl-test/ ENGESVP2DV # Successful tests with source on s3 # time python3 load/TestCleanup.py test UNRWFWP1DA # time python3 load/TestCleanup.py test UNRWFWP1DA-opus16 # time python3 load/DBPLoadController.py test s3://dbp-etl-upload-dev-zrg0q2rhv7shv7hr UNRWFWP1DA # time python3 load/TestCleanup.py test HYWWAV # time python3 load/TestCleanup.py test HYWWAVN_ET-usx # time python3 load/DBPLoadController.py test s3://dbp-etl-upload-dev-zrg0q2rhv7shv7hr HYWWAVN2ET # time python3 load/TestCleanup.py test ENGESVP2DV # time python3 load/DBPLoadController.py test s3://dbp-etl-upload-dev-zrg0q2rhv7shv7hr ENGESVP2DV # Combined test of two dissimilar filesets on s3 # time python3 load/TestCleanup.py test UNRWFWP1DA # time python3 load/TestCleanup.py test HYWWAV # time python3 load/TestCleanup.py test HYWWAVN_ET-usx # time python3 load/DBPLoadController.py test s3://dbp-etl-upload-dev-zrg0q2rhv7shv7hr UNRWFWP1DA HYWWAVN2ET # Some video uploads # time python3 load/TestCleanup.py test ENGESVP2DV # time python3 load/DBPLoadController.py test /Volumes/FCBH/all-dbp-etl-test/ ENGESVP2DV # time python3 load/DBPLoadController.py test /Volumes/FCBH/all-dbp-etl-test/ video/ENGESV/ENGESVP2DV # time python3 load/DBPLoadController.py test /Volumes/FCBH/all-dbp-etl-test/ video/ENGESX/ENGESVP2DV # Successful tests with source on local drive and full path # time python3 load/TestCleanup.py test GNWNTM # time python3 load/TestCleanup.py test GNWNTMN_ET-usx # time python3 load/DBPLoadController.py test /Volumes/FCBH/all-dbp-etl-test/ GNWNTMN2ET # time python3 load/TestCleanup.py test GNWNTM # time python3 load/TestCleanup.py test GNWNTMN_ET-usx # time python3 load/DBPLoadController.py test /Volumes/FCBH/all-dbp-etl-test/ text/GNWNTM/GNWNTMN2ET ### prepare test data in bucket ### aws --profile DBP_DEV s3 sync /Volumes/FCBH/TextStockNo/Barai_N2BBBWBT_USX/ s3://dbp-etl-upload-dev-zrg0q2rhv7shv7hr/Barai_N2BBBWBT_USX/ ### aws --profile DBP_DEV s3 sync /Volumes/FCBH/TextStockNo/Orma_N2ORCBTL_USX/ s3://dbp-etl-upload-dev-zrg0q2rhv7shv7hr/Orma_N2ORCBTL_USX/ ### aws --profile DBP_DEV s3 sync /Volumes/FCBH/TextStockNo/Urdu_N2URDPAK_USX/ s3://dbp-etl-upload-dev-zrg0q2rhv7shv7hr/Urdu_N2URDPAK_USX/ # Test stock number upload from Drive with path # time python3 load/TestCleanup.py test BBBWBT # time python3 load/TestCleanup.py test BBBWBTN_ET-usx # time python3 load/DBPLoadController.py test s3://dbp-etl-upload-dev-zrg0q2rhv7shv7hr/ Barai_N2BBBWBT_USX # time python3 load/TestCleanup.py test ORCBTL # time python3 load/TestCleanup.py test ORCBTLN_ET-usx # time python3 load/DBPLoadController.py test s3://dbp-etl-upload-dev-zrg0q2rhv7shv7hr/ Orma_N2ORCBTL_USX # time python3 load/TestCleanup.py test URDPAK # time python3 load/TestCleanup.py test URDPAKN_ET-usx # time python3 load/DBPLoadController.py test s3://dbp-etl-upload-dev-zrg0q2rhv7shv7hr/ Urdu_N2URDPAK_USX # python3 load/TestCleanup.py test ABIWBT # python3 load/TestCleanup.py test ABIWBTN_ET-usx # python3 load/DBPLoadController.py test s3://dbp-etl-mass-batch "Abidji N2ABIWBT/05 DBP & GBA/Abidji_N2ABIWBT/Abidji_N2ABIWBT_USX" # This one BiblePublisher has two copies of 1CO:16, but I can only find one in the USX file. # python3 load/TestCleanup.py test ACHBSU # python3 load/TestCleanup.py test ACHBSUN_ET-usx # python3 load/DBPLoadController.py test s3://dbp-etl-mass-batch "Acholi N2ACHBSU/05 DBP & GBA/Acholi_N2ACHBSU - Update/Acholi_N2ACHBSU_USX" # python3 load/TestCleanup.py test CRXWYI # python3 load/TestCleanup.py test CRXWYIP_ET-usx # python3 load/TestCleanup.py test CRXWYIN_ET-usx # python3 load/DBPLoadController.py test s3://dbp-etl-mass-batch "Carrier, Central N2CRXWYI/05 DBP & GBA/Carrier, Central_P1CRXWYI/Carrier, Central_P1CRXWYI_USX"
40.477064
174
0.779012
2,433
0.275725
0
0
0
0
0
0
5,420
0.614234