Utility method to create a default options structure with the lazy parsing inside

    :param lazy_mfcollection_parsing:
    :return: the options structure filled with lazyparsing option (for the MultifileCollectionParser)
771834
def create_parser_options(lazy_mfcollection_parsing: bool = False) -> Dict[str, Dict[str, Any]]:
    
    return {MultifileCollectionParser.__name__: {'lazy_parsing': lazy_mfcollection_parsing}}
784534
def _build_parser_for_fileobject_and_desiredtype(self, obj_on_filesystem: PersistedObject, object_typ: Type[T],
                                                     logger: Logger = None) -> Dict[Type, Parser]:
        

        parsers = OrderedDict()
        errors = OrderedDict()
        try:
            p = self.__build_parser_for_fileobject_and_desiredtype(obj_on_filesystem,
                                                                   object_typ=object_typ,
                                                                   logger=logger)
            parsers[object_typ] = p
        except NoParserFoundForObjectExt as e:
            logger.warning("{} - {}".format(type(e).__name__, e))
            errors[e] = e
        except NoParserFoundForObjectType as f:
            logger.warning("{} - {}".format(type(f).__name__, f))
            errors[f] = f

        # do not explore subclasses for collections
        if is_collection(object_typ, strict=True):
            if len(errors) > 0:
                raise next(iter(errors.values()))
            else:
                return parsers

        # Finally create one such parser for each subclass
        subclasses = get_all_subclasses(object_typ)

        # Then for each subclass also try (with a configurable limit in nb of subclasses)
        for subclass in subclasses[0:GLOBAL_CONFIG.dict_to_object_subclass_limit]:
            try:
                parsers[subclass] = self.__build_parser_for_fileobject_and_desiredtype(obj_on_filesystem,
                                                                                       object_typ=subclass,
                                                                                       logger=logger)
            except NoParserFoundForObjectExt as e:
                logger.warning("{} - {}".format(type(e).__name__, e))
                errors[e] = e
            except NoParserFoundForObjectType as f:
                logger.warning("{} - {}".format(type(f).__name__, f))
                errors[f] = f

        if len(subclasses) > GLOBAL_CONFIG.dict_to_object_subclass_limit:
            warn('Type {} has more than {} subclasses, only {} were tried to convert it, with no success. You '
                 'can raise this limit by setting the appropriate option with `parsyfiles_global_config()`'
                 ''.format(object_typ, len(subclasses), GLOBAL_CONFIG.dict_to_object_subclass_limit))

        return parsers
664269
public MultipartFormDataParser createMultipartFormDataParser() {
        MultipartFormDataParser parser = new CommonsMultipartFormDataParser();
        if (tempDirectoryPath != null) {
            parser.setTempDirectoryPath(tempDirectoryPath);
        } else {
            parser.setTempDirectoryPath(SystemUtils.getProperty("java.io.tmpdir"));
        }
        if (maxRequestSize > -1L) {
            parser.setMaxRequestSize(maxRequestSize);
        }
        if (maxFileSize > -1L) {
            parser.setMaxFileSize(maxFileSize);
        }
        if (maxInMemorySize > -1) {
            parser.setMaxInMemorySize(maxInMemorySize);
        }
        parser.setAllowedFileExtensions(allowedFileExtensions);
        parser.setDeniedFileExtensions(deniedFileExtensions);
        return parser;
    }
442961
def create_from_ll(cls, lls:LabelLists, bs:int=64, val_bs:int=None, ds_tfms:Optional[TfmList]=None,
                num_workers:int=defaults.cpus, dl_tfms:Optional[Collection[Callable]]=None, device:torch.device=None,
                test:Optional[PathOrStr]=None, collate_fn:Callable=data_collate, size:int=None, no_check:bool=False,
                resize_method:ResizeMethod=None, mult:int=None, padding_mode:str='reflection',
                mode:str='bilinear', tfm_y:bool=False)->'ImageDataBunch':
        ""
        lls = lls.transform(tfms=ds_tfms, size=size, resize_method=resize_method, mult=mult, padding_mode=padding_mode,
                            mode=mode, tfm_y=tfm_y)
        if test is not None: lls.add_test_folder(test)
        return lls.databunch(bs=bs, val_bs=val_bs, dl_tfms=dl_tfms, num_workers=num_workers, collate_fn=collate_fn,
                             device=device, no_check=no_check)
180600
def ParseFileObject(self, parser_mediator, file_object):
    
    mft_metadata_file = pyfsntfs.mft_metadata_file()

    try:
      mft_metadata_file.open_file_object(file_object)
    except IOError as exception:
      parser_mediator.ProduceExtractionWarning(
          'unable to open file with error: {0!s}'.format(exception))

    for entry_index in range(0, mft_metadata_file.number_of_file_entries):
      try:
        mft_entry = mft_metadata_file.get_file_entry(entry_index)
        self._ParseMFTEntry(parser_mediator, mft_entry)

      except IOError as exception:
        parser_mediator.ProduceExtractionWarning((
            'unable to parse MFT entry: {0:d} with error: {1!s}').format(
                entry_index, exception))

    mft_metadata_file.close()
874227
def get_m2m_widget(cls, field):
        
        return functools.partial(
            widgets.ManyToManyWidget,
            model=get_related_model(field))
398630
function makeDefaultOptions() {
  return {
    baseUrl: "/djedi",
    batchInterval: 10, // ms
    defaultRender: state => {
      switch (state.type) {
        case "loading":
          return "Loading…";
        case "error":
          return `Failed to fetch content 😞 (${
            state.error.response != null ? state.error.response.status : -1
          })`;
        case "success":
          return state.content;
        // istanbul ignore next
        default:
          return null;
      }
    },
    fetch: defaultFetch,
    languages: {
      default: "en-us",
      additional: [],
    },
    uri: {
      defaults: {
        scheme: "i18n",
        namespace: "",
        path: "",
        ext: "txt",
        version: "",
      },
      namespaceByScheme: {
        i18n: "{language}",
        l10n: "local",
        g11n: "global",
      },
      separators: {
        scheme: "://",
        namespace: "@",
        path: "/",
        ext: ".",
        version: "#",
      },
    },
  };
}
98148
def get_default_pandas_parsers() -> List[AnyParser]:
    
    return [SingleFileParserFunction(parser_function=read_dataframe_from_xls,
                                     streaming_mode=False,
                                     supported_exts={'.xls', '.xlsx', '.xlsm'},
                                     supported_types={pd.DataFrame},
                                     option_hints=pandas_parsers_option_hints_xls),
            SingleFileParserFunction(parser_function=read_df_or_series_from_csv,
                                     streaming_mode=False,
                                     supported_exts={'.csv', '.txt'},
                                     supported_types={pd.DataFrame, pd.Series},
                                     option_hints=pandas_parsers_option_hints_csv),
            ]
242933
def _make_parser(**kwargs):
    
    # Optional arguements for configparser.SafeConfigParser{,readfp}
    kwargs_0 = filter_options(("defaults", "dict_type", "allow_no_value"),
                              kwargs)
    kwargs_1 = filter_options(("filename", ), kwargs)

    try:
        parser = configparser.SafeConfigParser(**kwargs_0)
    except TypeError:
        # .. note::
        #    It seems ConfigParser.*ConfigParser in python 2.6 does not support
        #    'allow_no_value' option parameter, and TypeError will be thrown.
        kwargs_0 = filter_options(("defaults", "dict_type"), kwargs)
        parser = configparser.SafeConfigParser(**kwargs_0)

    return (kwargs_1, parser)
3697
function getDefaultOpts(simple) {
  'use strict';

  var defaultOptions = {
    omitExtraWLInCodeBlocks: {
      defaultValue: false,
      describe: 'Omit the default extra whiteline added to code blocks',
      type: 'boolean'
    },
    noHeaderId: {
      defaultValue: false,
      describe: 'Turn on/off generated header id',
      type: 'boolean'
    },
    prefixHeaderId: {
      defaultValue: false,
      describe: 'Specify a prefix to generated header ids',
      type: 'string'
    },
    headerLevelStart: {
      defaultValue: false,
      describe: 'The header blocks level start',
      type: 'integer'
    },
    parseImgDimensions: {
      defaultValue: false,
      describe: 'Turn on/off image dimension parsing',
      type: 'boolean'
    },
    simplifiedAutoLink: {
      defaultValue: false,
      describe: 'Turn on/off GFM autolink style',
      type: 'boolean'
    },
    excludeTrailingPunctuationFromURLs: {
      defaultValue: false,
      describe: 'Excludes trailing punctuation from links generated with autoLinking',
      type: 'boolean'
    },
    literalMidWordUnderscores: {
      defaultValue: false,
      describe: 'Parse midword underscores as literal underscores',
      type: 'boolean'
    },
    strikethrough: {
      defaultValue: false,
      describe: 'Turn on/off strikethrough support',
      type: 'boolean'
    },
    tables: {
      defaultValue: false,
      describe: 'Turn on/off tables support',
      type: 'boolean'
    },
    tablesHeaderId: {
      defaultValue: false,
      describe: 'Add an id to table headers',
      type: 'boolean'
    },
    ghCodeBlocks: {
      defaultValue: true,
      describe: 'Turn on/off GFM fenced code blocks support',
      type: 'boolean'
    },
    tasklists: {
      defaultValue: false,
      describe: 'Turn on/off GFM tasklist support',
      type: 'boolean'
    },
    smoothLivePreview: {
      defaultValue: false,
      describe: 'Prevents weird effects in live previews due to incomplete input',
      type: 'boolean'
    },
    smartIndentationFix: {
      defaultValue: false,
      description: 'Tries to smartly fix indentation in es6 strings',
      type: 'boolean'
    },
    disableForced4SpacesIndentedSublists: {
      defaultValue: false,
      description: 'Disables the requirement of indenting nested sublists by 4 spaces',
      type: 'boolean'
    },
    simpleLineBreaks: {
      defaultValue: false,
      description: 'Parses simple line breaks as <br> (GFM Style)',
      type: 'boolean'
    },
    requireSpaceBeforeHeadingText: {
      defaultValue: false,
      description: 'Makes adding a space between `#` and the header text mandatory (GFM Style)',
      type: 'boolean'
    }
  };
  if (simple === false) {
    return JSON.parse(JSON.stringify(defaultOptions));
  }
  var ret = {};
  for (var opt in defaultOptions) {
    if (defaultOptions.hasOwnProperty(opt)) {
      ret[opt] = defaultOptions[opt].defaultValue;
    }
  }
  return ret;
}
252454
public static <IN extends CoreMap> CRFClassifier<IN> getDefaultClassifier() {
    CRFClassifier<IN> crf = new CRFClassifier<IN>();
    crf.loadDefaultClassifier();
    return crf;
  }
479481
def _ParseFilterOptions(self, options):
    
    names = ['artifact_filters', 'date_filters', 'filter_file']
    helpers_manager.ArgumentHelperManager.ParseOptions(
        options, self, names=names)

    extensions_string = self.ParseStringOption(options, 'extensions_string')
    self._ParseExtensionsString(extensions_string)

    names_string = getattr(options, 'names_string', None)
    self._ParseNamesString(names_string)

    signature_identifiers = getattr(options, 'signature_identifiers', None)
    try:
      self._ParseSignatureIdentifiers(
          self._data_location, signature_identifiers)
    except (IOError, ValueError) as exception:
      raise errors.BadConfigOption(exception)

    if self._artifact_filters or self._filter_file:
      self.has_filters = True
    else:
      self.has_filters = self._filter_collection.HasFilters()
406984
def loader_options(self):
        
        all_keys = set(self.__attr_map.keys())
        # Go through the collected keys and through out all keys which are
        # subkeys of others to eliminate redundancy.
        for key in sorted(self.__attr_map):
            for idx in range(1, len(key)):
                sub_key = key[:-idx]
                if sub_key in all_keys:
                    all_keys.remove(sub_key)
        if provides_member_resource(self._context):
            # If the context is a member, we need to configure the loaders
            # for the entity class belonging to each of its resource
            # attributes. Only nested keys collected from the representer
            # configuration need to be configured (and the corresponding
            # nested entity attribute needs to be shortened).
            loader_option_map = defaultdict(list)
            for key in all_keys:
                entity_attr_names = self.__attr_map[key]
                if len(entity_attr_names) > 1:
                    ent_attr_name = entity_attr_names[0]
                    nested_attr_name = '.'.join(entity_attr_names[1:])
                    opts = loader_option_map[ent_attr_name]
                    opts.append(nested_attr_name)
            # Translate to entity classes as keys. This is tricky as the
            # keys in the loader option map can itself be nested attributes.
            for ent_attr_name, nested_attr_names in loader_option_map.items():
                ent_attr_name_tokens = ent_attr_name.split('.')
                ent_cls = get_entity_class(self._context)
                ent_cls_attr = getattr(ent_cls, ent_attr_name_tokens[0])
                ent_cls = ent_cls_attr.property.mapper.entity
                if len(ent_attr_name_tokens) > 1:
                    prefix = '.'.join(ent_attr_name_tokens[1:])
                    loader_option_map[ent_cls] = \
                            ["%s.%s" % (prefix, token)
                             for token in nested_attr_names]
                else:
                    loader_option_map[ent_cls] = nested_attr_names
                del loader_option_map[ent_attr_name]
        else:
            # If the context is a collection, we need to configure the
            # loader for its entity class.
            loader_option_map = {get_entity_class(self._context) :
                                 ['.'.join(self.__attr_map[key])
                                  for key in all_keys]}
        return loader_option_map
493969
def addFASTACommandLineOptions(parser):
    

    parser.add_argument(
        '--fastaFile', type=open, default=sys.stdin, metavar='FILENAME',
        help=('The name of the FASTA input file. Standard input will be read '
              'if no file name is given.'))

    parser.add_argument(
        '--readClass', default='DNARead', choices=readClassNameToClass,
        metavar='CLASSNAME',
        help=('If specified, give the type of the reads in the input. '
              'Possible choices: %s.' % ', '.join(readClassNameToClass)))

    # A mutually exclusive group for either --fasta, --fastq, or --fasta-ss
    group = parser.add_mutually_exclusive_group()

    group.add_argument(
        '--fasta', default=False, action='store_true',
        help=('If specified, input will be treated as FASTA. This is the '
              'default.'))

    group.add_argument(
        '--fastq', default=False, action='store_true',
        help='If specified, input will be treated as FASTQ.')

    group.add_argument(
        '--fasta-ss', dest='fasta_ss', default=False, action='store_true',
        help=('If specified, input will be treated as PDB FASTA '
              '(i.e., regular FASTA with each sequence followed by its '
              'structure).'))
1294251
def get_default_config_converters(conv_finder: ConversionFinder) -> List[Union[Converter[Any, ConfigParser], Converter[ConfigParser, Any]]]:
    
    return [ConverterFunction(ConfigParser, DictOfDict, config_to_dict_of_dict, custom_name='config_to_dict_of_dict',
                              function_args={'conversion_finder': conv_finder}),
            ConverterFunction(ConfigParser, dict, merge_all_config_sections_into_a_single_dict,
                              custom_name='merge_all_config_sections_into_a_single_dict',
                              function_args={'conversion_finder': conv_finder})]
387783
def get_default_object_parsers(parser_finder: ParserFinder, conversion_finder: ConversionFinder) -> List[AnyParser]:
    
    return [SingleFileParserFunction(parser_function=read_object_from_pickle,
                                     streaming_mode=False,
                                     supported_exts={'.pyc'},
                                     supported_types={AnyObject}),
            MultifileObjectParser(parser_finder, conversion_finder)
            ]
1089739
def _parse_multifile(self, desired_type: Type[T], obj: PersistedObject,
                         parsing_plan_for_children: Dict[str, AnyParser._RecursiveParsingPlan],
                         logger: Logger, options: Dict[str, Dict[str, Any]]) -> T:
        
        raise Exception('This should never happen, since this parser relies on underlying parsers')