content
stringlengths
22
815k
id
int64
0
4.91M
def rds_instance_ha_check(cache: dict, awsAccountId: str, awsRegion: str, awsPartition: str) -> dict: """[RDS.1] RDS instances should be configured for high availability""" response = describe_db_instances(cache) myRdsInstances = response["DBInstances"] response = describe_db_snapshots(cache) myRdsS...
0
def remove_tags(text, which_ones=(), keep=(), encoding=None): """ Remove HTML Tags only. `which_ones` and `keep` are both tuples, there are four cases: ============== ============= ========================================== ``which_ones`` ``keep`` what it does ============== ============= ...
1
def count_char(char, word): """Counts the characters in word""" return word.count(char) # If you want to do it manually try a for loop
2
def run_on_folder_evaluate_model(folder_path, n_imgs=-1, n_annotations=10): """ Runs the object detector on folder_path, classifying at most n_imgs images and manually asks the user if n_annotations crops are correctly classified This is then used to compute the accuracy of the model If all images are s...
3
def get_sos_model(sample_narratives): """Return sample sos_model """ return { 'name': 'energy', 'description': "A system of systems model which encapsulates " "the future supply and demand of energy for the UK", 'scenarios': [ 'population' ]...
4
def generate_gallery_md(gallery_conf, mkdocs_conf) -> Dict[Path, Tuple[str, Dict[str, str]]]: """Generate the Main examples gallery reStructuredText Start the mkdocs-gallery configuration and recursively scan the examples directories in order to populate the examples gallery Returns ------- md...
5
def load_all_yaml(stream: Union[str, TextIO], context: dict = None, template_env = None) -> List[AnyResource]: """Load kubernetes resource objects defined as YAML. See `from_dict` regarding how resource types are detected. Returns a list of resource objects or raise a `LoadResourceError`. **parameters** ...
6
def parse_gridspec(s: str, grids: Optional[Dict[str, GridSpec]] = None) -> GridSpec: """ "africa_10" "epsg:6936;10;9600" "epsg:6936;-10x10;9600x9600" """ if grids is None: grids = GRIDS named_gs = grids.get(_norm_gridspec_name(s)) if named_gs is not None: return named_gs...
7
def test_try_premium_at_start_new_account_different_password_than_remote_db( rotkehlchen_instance, username, db_password, rotkehlchen_api_key, rotkehlchen_api_secret, ): """ If we make a new account with api keys and provide a password different than the one the remot...
8
def make_quantile_normalizer(dist): """Returns f(a) that converts to the quantile value in each col. dist should be an array with bins equally spaced from 0 to 1, giving the value in each bin (i.e. cumulative prob of f(x) at f(i/len(dist)) should be stored in dist[i]) -- can generate from distribution ...
9
def text(): """ Route that allows user to send json with raw text of title and body. This route expects a payload to be sent that contains: {'title': "some text ...", 'body': "some text ....} """ # authenticate the request to make sure it is from a trusted party verify_token(req...
10
def rbac_show_users(tenant=None): """show rbac""" tstr = " -tenant=%s " % (tenant) if tenant else "" rc = run_command("%s user-role -op list-user-roles %s" % ( g_araalictl_path, tstr), result=True, strip=False, debug=False) assert rc[0] == 0, rc[1] return ya...
11
def RPL_ENDOFINFO(sender, receipient, message): """ Reply Code 374 """ return "<" + sender + ">: " + message
12
def combined_score(data, side_effect_weights=None): """ Calculate a top-level score for each episode. This is totally ad hoc. There are infinite ways to measure the performance / safety tradeoff; this is just one pretty simple one. Parameters ---------- data : dict Keys should incl...
13
def volatile(func): """Wrapper for functions that manipulate the active database.""" def inner(self, *args, **kwargs): ret = func(self, *args, **kwargs) self.refresh() self.modified_db = True return ret return inner
14
def send_html_mail(from_mail: str, to_mail: str, subject: str, message: str) -> None: """ Wrapper to send_mail(..., html=True) """ send_mail(from_mail, to_mail, subject, message, True)
15
def configure( account: Optional[str] = None, token: Optional[str] = None, use_ssl: bool = True, port: Optional[int] = None, tmp_workspace_path: Optional[str] = None, ): """One time setup to configure the SDK to connect to Eto API Parameters ---------- account: str, default None ...
16
def input_risk_tolerance(): """ This allows the user to enter and edit their risk tolerance. """ if g.logged_in is True: if g.inputs is True: risk_tolerance_id = m_session.query(model.User).filter_by( id=g.user.id).first().risk_profile_id risk_tolerance = ...
17
async def get_stream_apps( start: Optional[int] = 0, # pylint: disable=unsubscriptable-object size: Optional[int] = 10, # pylint: disable=unsubscriptable-object ): """ Get all streaming applications. start: Start index of the applications size: Number of sessions to fetch """ conf = get_...
18
def check_context(model, sentence, company_name): """ Check if the company name in the sentence is actually a company name. :param model: the spacy model. :param sentence: the sentence to be analysed. :param company_name: the name of the company. :return: True if the company name means a compan...
19
def getItemSize(dataType): """ Gets the size of an object depending on its data type name Args: dataType (String): Data type of the object Returns: (Integer): Size of the object """ # If it's a vector 6, its size is 6 if dataType.startswith("VECTOR6"): return 6 ...
20
def replace_symbol_to_no_symbol(pinyin): """把带声调字符替换为没有声调的字符""" def _replace(match): symbol = match.group(0) # 带声调的字符 # 去掉声调: a1 -> a return RE_NUMBER.sub(r'', PHONETIC_SYMBOL_DICT[symbol]) # 替换拼音中的带声调字符 return RE_PHONETIC_SYMBOL.sub(_replace, pinyin)
21
def elbow_kmeans_optimizer(X, k = None, kmin = 1, kmax = 5, visualize = True): """k-means clustering with or without automatically determined cluster numbers. Reference: https://pyclustering.github.io/docs/0.8.2/html/d3/d70/classpyclustering_1_1cluster_1_1elbow_1_1elbow.html # Arguments: X (nu...
22
def FloatDateTime(): """Returns datetime stamp in Miro's REV_DATETIME format as a float, e.g. 20110731.123456""" return float(time.strftime('%Y%m%d.%H%M%S', time.localtime()))
23
def create_directory(dir_path): """Creates an empty directory. Args: dir_path (str): the absolute path to the directory to create. """ if not os.path.exists(dir_path): os.mkdir(dir_path)
24
def xyz_to_rgb(xyz): """ Convert tuple from the CIE XYZ color space to the sRGB color space. Conversion is based on that the XYZ input uses an the D65 illuminate with a 2° observer angle. https://en.wikipedia.org/wiki/Illuminant_D65 The inverse conversion matrix used was provided by Bruce Lindbloo...
25
def delete_before(list, key): """ Return a list with the the item before the first occurrence of the key (if any) deleted. """ pass
26
def add_dft_args( parser: ArgumentParser, dft_args: ParamsDict, help_prefix: str = "", flag_prefix: str = "", ): """Add arguments to parser. Args: parser : parser you want to complete dft_args : default arguments (arg_name, dft_value) flag_prefix : prefix before...
27
def resliceSurfaceAndSave(imp, heightmap, save_dir, numslices_above, numslices_below): """ Reslices the image imp along the precomputed heightmap and saves the result. (part 2 of minCostZSurface) For parameters see global variables on top of script. """ title=imp.getTitle() # reslice IJ.log("Reslicing along sur...
28
def test_main(): """Testing main entry point""" exit_code = UpdateUserTest().run() if exit_code != 0: raise ValueError("Incorrect exit code. Exit code: {}".format(exit_code))
29
def _score(estimator, X_test, y_test, scorer, is_multimetric=False): """Compute the score(s) of an estimator on a given test set. Will return a single float if is_multimetric is False and a dict of floats, if is_multimetric is True """ if is_multimetric: return _multimetric_score(estimator,...
30
def asynchronous(datastore=False, obj_store=False, log_store=False): """Wrap request handler methods with this decorator if they will require asynchronous access to DynamoDB datastore or S3 object store for photo storage. If datastore=True, then a DynamoDB client is available to the handler as self._client. If ...
31
def show_manipulation(x, model, index = 0, dataset = 'mnist'): """This function is used to show manipulation of our capsules in the DigitCaps layer Args : --x: input DigitCaps, which have shape [1, 10, 16] --model: model instance --index: batch index --dataset: 'mnist' as d...
32
def get_translatable_models(): """ Get the translatable models according to django-modeltranslation !! only use to migrate from django-modeltranslation !! """ _raise_if_not_django_modeltranslation() return translator.get_registered_models()
33
def schedule_dense_arm_cpu(attrs, inputs, out_type, target): """dense arm cpu strategy""" strategy = _op.OpStrategy() isa = arm_isa.IsaAnalyzer(target) if isa.has_dsp_support: strategy.add_implementation( wrap_compute_dense(topi.nn.dense), wrap_topi_schedule(topi.arm_cpu....
34
def _parse_outer_cfg(outer_cfg: Sequence[str]): """Given a new configuration of gin bindings, apply it.""" # all the configs are currently in default_scope, so we should parse these # into that scope as well. This is annoying though as gin doesn't have this # functionality easily hence we do it by string manipu...
35
def default_select(identifier, all_entry_points): # pylint: disable=inconsistent-return-statements """ Raise an exception when we have ambiguous entry points. """ if len(all_entry_points) == 0: raise PluginMissingError(identifier) elif len(all_entry_points) == 1: return all_entry_...
36
def test_get_info(requests_mock): """ Tests get_info method correctly generates the request url and returns the result in a DataFrame. Note that only sites and format are passed as query params """ format = "rdb" site = '01491000%2C01645000' parameter_cd = "00618" request_url = 'https://...
37
def prep_academic_corpus(raw_academic_corpus, text_academic_corpus): """Extracts the text portion from the tar XML file of the ACL anthology corpus. :param raw_academic_corpus: base directory name of the tar file :type pickle_filename_bigrams: str :param pickle_filename_trigrams: File name for the outpu...
38
def read_prediction_dependencies(pred_file): """ Reads in the predictions from the parser's output file. Returns: two String list with the predicted heads and dependency names, respectively. """ heads = [] deps = [] with open(pred_file, encoding="utf-8") as f: for line in f: ...
39
def add_new_ingredient(w, ingredient_data): """Adds the ingredient into the database """ combobox_recipes = generate_CBR_names(w) combobox_bottles = generate_CBB_names(w) given_name_ingredient_data = DB_COMMANDER.get_ingredient_data(ingredient_data["ingredient_name"]) if given_name_ingredient_data: ...
40
def detect_entities(_inputs, corpus, threshold=None): """ Détecte les entités nommées sélectionnées dans le corpus donné en argument. :param _inputs: paramètres d'entrainement du modèle :param corpus: corpus à annoter :param threshold: seuils de détection manuels. Si la probabilité d'une catégorie d...
41
def request_video_count(blink): """Request total video count.""" url = "{}/api/v2/videos/count".format(blink.urls.base_url) return http_get(blink, url)
42
def version(): """Return a ST version. Return 0 if not running in ST.""" if not running_in_st(): return 0 return int(sublime.version())
43
def main(): """Deletes the branch protection rules for a branch (with prefix 'contrib/') after it has been deleted. Specifically, when we create an internal PR from a merged external PR, and the base branch of the external PR now becames the head branch of the internal PR - we remove the branch protections...
44
def getFile(path): """ Obtain a PDB file. First check the path given on the command line - if that file is not available, obtain the file from the PDB webserver at http://www.rcsb.org/pdb/ . Parameters path: Name of PDB file to obtain (string) Returns ...
45
def get_intervention(action, time): """Return the intervention in the simulator required to take action.""" action_to_intervention_map = { 0: Intervention(time=time, epsilon_1=0.0, epsilon_2=0.0), 1: Intervention(time=time, epsilon_1=0.0, epsilon_2=0.3), 2: Intervention(time=time, epsilo...
46
def alpha_sort(file): """ Rewrites csv sorting row according to the GT values, alphabetically. """ with open(file, encoding="utf8", errors='ignore') as csvFile: reader = csv.reader(csvFile) headers = next(reader, None) sorted_list = sorted(reader, key=lambda row: row...
47
def draw_labeled_bboxes(img, labels): """ Draw the boxes around detected object. """ # Iterate through all detected cars for car_number in range(1, labels[1]+1): # Find pixels with each car_number label value nonzero = (labels[0] == car_number).nonzero() # Identif...
48
def image_create(request, **kwargs): """Create image. :param kwargs: * copy_from: URL from which Glance server should immediately copy the data and store it in its configured image store. * data: Form data posted from client. * location: URL where the data for this image alr...
49
def test_null_transformer2(data): """Checks impute_algorithm='ts_interpolate'""" null_transform = NullTransformer( impute_algorithm="ts_interpolate", impute_all=False) null_transform.fit(data) assert null_transform.impute_params == dict( orders=[7, 14, 21], agg_func=np.me...
50
def media_check_handler(sender, instance, **kwargs): """[Mediaがアップロードされる時のシグナルハンドラ]""" count = Media.objects.filter(owner=instance.owner.id).count() # 1ユーザあたりの最大数を超えていたら例外を出して保管を拒絶する(クライアントには500が帰る). if count >= settings.MAX_MEDIA_COUNT: raise Exception('Too many media')
51
def calc_diff(nh_cube, sh_cube, agg_method): """Calculate the difference metric""" metric = nh_cube.copy() metric.data = nh_cube.data - sh_cube.data metric = rename_cube(metric, 'minus sh ' + agg_method) return metric
52
def median_boxcar_filter(data, window_length=None, endpoints='reflect'): """ Creates median boxcar filter and deals with endpoints Parameters ---------- data : numpy array Data array window_length: int A scalar giving the size of the median filter window endpoints : str ...
53
def make_movie(movie_name, input_folder, output_folder, file_format, fps, output_format = 'mp4', reverse = False): """ Function which makes movies from an image series Parameters ---------- movie_name : string name of the movie input_folder : string ...
54
def get_session() -> Generator: """ get database session """ db = SessionFactory() try: yield db finally: db.close()
55
def test_threaded_actor_api_thread_safe(shutdown_only): """Test if Ray APIs are thread safe when they are used within threaded actor. """ ray.init( num_cpus=8, # from 1024 bytes, the return obj will go to the plasma store. _system_config={"max_direct_call_object_size": 1024}, ...
56
def test_azure_storage_replace_entity_command(requests_mock): """ Scenario: Replace Entity. Given: - User has provided valid credentials. When: - azure-storage-table-entity-replace called. Then: - Ensure that the output is empty (None). - Ensure readable output message content. ...
57
def build_template_context( title: str, raw_head: Optional[str], raw_body: str ) -> Context: """Build the page context to insert into the outer template.""" head = _render_template(raw_head) if raw_head else None body = _render_template(raw_body) return { 'page_title': title, 'head'...
58
def _events_tsv(events, durations, raw, fname, trial_type, overwrite=False, verbose=True): """Create an events.tsv file and save it. This function will write the mandatory 'onset', and 'duration' columns as well as the optional 'value' and 'sample'. The 'value' corresponds to the marker...
59
def __get_folders_processes(local_path, dropbox_paths): """ Retrieves in parrallel (launching several processes) files from dropbox. :param local_path: path where the files will be downloaded :param dropbox_paths: remote dropbox's paths (pin's folder) :return: None """ pro_list = [] tes...
60
def inf_set_stack_ldbl(*args): """ inf_set_stack_ldbl(_v=True) -> bool """ return _ida_ida.inf_set_stack_ldbl(*args)
61
def _get_self_compatibility_dict(package_name: str) -> dict: """Returns a dict containing self compatibility status and details. Args: package_name: the name of the package to check (e.g. "google-cloud-storage"). Returns: A dict containing the self compatibility status and deta...
62
def checksum_md5(filename): """Calculates the MD5 checksum of a file.""" amd5 = md5() with open(filename, mode='rb') as f: for chunk in iter(lambda: f.read(128 * amd5.block_size), b''): amd5.update(chunk) return amd5.hexdigest()
63
def collect_gentxs(): """ nodef collect-gentxs """ _ = _process_executor("nodef collect-gentxs")
64
def CleanGrant(grant): """Returns a "cleaned" grant by rounding properly the internal data. This insures that 2 grants coming from 2 different sources are actually identical, irrespective of the logging/storage precision used. """ return grant._replace(latitude=round(grant.latitude, 6), ...
65
def OpenRegistryKey(hiveKey, key): """ Opens a keyHandle for hiveKey and key, creating subkeys as necessary """ keyHandle = None try: curKey = "" keyItems = key.split('\\') for subKey in keyItems: if curKey: curKey = curKey + "\\" + subKey else...
66
def import_clips_to_bin(project): """ Imports Clips from .clip_path to a new bin named as DEFAULT_BIN_NAME """ project.clips = [] # TODO reuse search_for_XDCAM media? for extension in ".mxf .mov .mp4 .avi .mp2".split(): project.clips += list(project.clip_path.glob(f"*{extension}")) ...
67
def eval_py(input_text: str): """Runs eval() on the input text on a seperate process and returns output or error. How to timout on a function call ? https://stackoverflow.com/a/14924210/13523305 Return a value from multiprocess ? https://stackoverflow.com/a/10415215/13523305 """ def evaluate(input_...
68
def map_assignment_of_matching_fields(dest, source): """ Assign the values of identical feild names from source to destination. """ for i in matching_fields(dest, source): if (type(getattr(source, i)) == uuid.UUID): setattr(dest, i, getattr(source, i).urn) elif (type(getattr(...
69
def task_convert_tables(depends_on, produces): """ Converts csv-file into latex tabular to include in paper """ table = pd.read_csv(depends_on) with open(produces, "w") as tf: tf.write(table.to_latex(na_rep="-", index=False))
70
def trim(str): """Remove multiple spaces""" return ' '.join(str.strip().split())
71
def requires_auth(): """ Checks that the user has authenticated before returning any page from this Blueprint. """ # We load the arguments for check_auth function from the config files. auth.check_auth( *current_app.config['AUTH'].get('reports', [['BROKEN'], ['']]) )
72
def build_model_svr(model_keyvalue, inputs, encoder = None, context = None): """Builds model from, seal_functions, model params. model_keyvalue: key identifying model inputs: properly formatted encrypted inputs for model encoder: SEAL encoder object context: SEAL context object "...
73
def find_similar(collection): """ Searches the collection for (probably) similar artist and returns lists containing the "candidates". """ spellings = defaultdict(list) for artist in collection: spellings[normalize_artist(artist)].append(artist) return [spellings[artist] for artist in ...
74
def vim_print(mse_ref, mse_values, x_name, ind_list=0, with_output=True, single=True, partner_k=None): """Print Variable importance measure and create sorted output. Parameters ---------- mse_ref : Numpy Float. Reference value of non-randomized x. mse_values : Numpy array. MSE's for r...
75
def from_column_list( col_names, col_types=None, col_blobs=None, col_metadata=None ): """ Given a list of names, types, and optionally values, construct a Schema. """ if col_types is None: col_types = [None] * len(col_names) if col_metadata is None: col_metadata = [None] * le...
76
def get_optimizer(lr): """ Specify an optimizer and its parameters. Returns ------- tuple(torch.optim.Optimizer, dict) The optimizer class and the dictionary of kwargs that should be passed in to the optimizer constructor. """ return (torch.optim.SGD, {"lr": lr,...
77
def _from_list(data: any) -> dict: """Convert lists to indexed dictionaries. :arg data: An ordered map. :returns: An ordered map. """ if isinstance(data, list): return dict([(str(i), _from_list(v)) for i, v in enumerate(data)]) if isinstance(data, dict): return dict([(key, _fro...
78
def parse_date(ses_date): """This parses a date string of the form YYYY-MM-DD and returns the string, year, month, day and day of year.""" [yr,mn,dy] = ses_date.split('-') year = int(yr) month = int(mn) day = int(dy[:2]) # strip of any a or b DOY = day_of_year(year,month,day) return ses_date,year,month,...
79
def get_access_token(consumer_key, consumer_secret): """ :return: auth token for mpesa api calls """ oauth_url = "https://api.safaricom.co.ke/oauth/v1/generate?grant_type=client_credentials" response = requests.get(oauth_url, auth=HTTPBasicAuth(consumer_key, consumer_secret)) access_token = jso...
80
def create_feed_forward_dot_product_network(observation_spec, global_layers, arm_layers): """Creates a dot product network with feedforward towers. Args: observation_spec: A nested tensor spec containing the specs for global as well as per-arm observations. ...
81
def check_collisions(citekeys_df): """ Check for short_citekey hash collisions """ collision_df = citekeys_df[['standard_citekey', 'short_citekey']].drop_duplicates() collision_df = collision_df[collision_df.short_citekey.duplicated(keep=False)] if not collision_df.empty: logging.error(f...
82
def p_pddl(p): """pddl : domain | problem""" p[0] = p[1]
83
def get_user(module, system): """Find a user by the user_name specified in the module""" user = None user_name = module.params['user_name'] try: user = system.users.get(name=user_name) except ObjectNotFound: pass return user
84
def appointments(request): """Page for users to view upcoming appointments.""" appointments = Appointment.objects.filter(patient=request.user.patient) context = { 'appointments': appointments } return render(request, 'patients/appointments.html', context)
85
def _SignedVarintDecoder(mask): """Like _VarintDecoder() but decodes signed values.""" local_ord = ord def DecodeVarint(buffer, pos): result = 0 shift = 0 while 1: b = local_ord(buffer[pos]) result |= ((b & 0x7f) << shift) pos += 1 if not (b & 0x80): if result > 0x7fff...
86
def is_valid_msg_type(x): """ @return: True if the name is a syntatically legal message type name @rtype: bool """ if not x or len(x) != len(x.strip()): return False base = base_msg_type(x) if not roslib.names.is_legal_resource_name(base): return False # parse array indic...
87
def test_export_exons_json(mock_app, gene_obj): """Test the CLI command that exports all exons in json format""" runner = mock_app.test_cli_runner() # GIVEN a database with a gene assert store.hgnc_collection.insert_one(gene_obj) # HAVING a transcript assert store.transcript_collection.insert...
88
def get_ascii_matrix(img): """(Image) -> list of list of str\n Takes an image and converts it into a list of list containing a string which maps to brightness of each pixel of each row """ ascii_map = "`^\",:;Il!i~+_-?][}{1)(|\\/tfjrxnuvczXYUJCLQ0OZmwqpdbkhao*#MW&8%B@$" brightness_matrix = get...
89
def to_scene_agent_prediction_from_boxes_separate_color( tracked_objects: TrackedObjects, color_vehicles: List[int], color_pedestrians: List[int], color_bikes: List[int] ) -> List[Dict[str, Any]]: """ Convert predicted observations into prediction dictionary. :param tracked_objects: List of tracked_obje...
90
def stretch(snd_array, factor, window_size, h): """ Stretches/shortens a sound, by some factor. """ phase = np.zeros(window_size) hanning_window = np.hanning(window_size) result = np.zeros( len(snd_array) /factor + window_size) for i in np.arange(0, len(snd_array)-(window_size+h), h*factor): ...
91
def read_csv(spark: SparkSession, path: str) -> DataFrame: """Create a DataFrame by loading an external csv file. We don't expect any formatting nor processing here. We assume the file has a header, uses " as double quote and , as delimiter. Infer its schema automatically. You don't need to raise an...
92
def send_task(task_name, task_kwargs, run_locally=None, queue_name=None): """ Sends task to SQS queue to be run asynchronously on worker environment instances. If settings.AWS_EB_RUN_TASKS_LOCALLY is set to True, does not send the task to SQS, but instead runs it right away in synchronous mode. May be ...
93
def guess_encoding(text): """ Given bytes, determine the character set encoding @return: dict with encoding and confidence """ if not text: return {'confidence': 0, 'encoding': None} enc = detect_charset(text) cset = enc['encoding'] if cset.lower() == 'iso-8859-2': # Anomoaly -- ch...
94
def setenv(app, name, value): """ Set an environment variable for an application. Note: this does not restart the application or any relevant other services. """ sudo('echo -n \'{value}\' > {filename}'.format( value=value, filename=env_filename(app, name) ))
95
def is_edit_end_without_next(line, configs): """ Is the line indicates that 'edit' section ends without 'next' end marker (special case)? - config vdom edit <name> ... end :param line: A str represents a line in configurations output :param configs: A stack (list) holding c...
96
def get_live_args(request, script=False, typed=False): """ Get live args input by user | request --> [[str], [str]]""" arg_string = list(request.form.values())[0] if script: return parse_command_line_args(arg_string) if typed: try: all_args = parse_type_args(arg_string) ...
97
def test_peek_returns_tail_val(dq): """Peek should return value of the tail.""" dq.appendleft(3) dq.appendleft(2) dq.appendleft(1) assert dq.peek() == 3
98
def open_csv(path): """open_csv.""" _lines = [] with codecs.open(path, encoding='utf8') as fs: for line in csv.reader(fs): if len(line) == 3: _lines.append(line) return _lines
99