Lines Matching +defs:mode +defs:name
201 PythonObject::ResolveNameWithDictionary(llvm::StringRef name,
203 size_t dot_pos = name.find('.');
204 llvm::StringRef piece = name.substr(0, dot_pos);
211 // There was a dot. The remaining portion of the name should be looked up in
213 return result.ResolveName(name.substr(dot_pos + 1));
216 PythonObject PythonObject::ResolveName(llvm::StringRef name) const {
217 // Resolve the name in the context of the specified object. If, for example,
218 // `this` refers to a PyModule, then this will look for `name` in this
219 // module. If `this` refers to a PyType, then it will resolve `name` as an
221 // then it will resolve `name` as the value of the specified field.
224 // refers to the `sys` module, and `name` == "path.append", then it will find
227 size_t dot_pos = name.find('.');
229 // No dots in the name, we should be able to find the value immediately as
231 return GetAttributeValue(name);
234 // Look up the first piece of the name, and resolve the rest as a child of
236 PythonObject parent = ResolveName(name.substr(0, dot_pos));
241 return parent.ResolveName(name.substr(dot_pos + 1));
772 Expected<PythonModule> PythonModule::Import(const Twine &name) {
773 PyObject *mod = PyImport_ImportModule(NullTerminated(name));
779 Expected<PythonObject> PythonModule::Get(const Twine &name) {
785 PyObject *item = PyDict_GetItemString(dict, NullTerminated(name));
1392 Expected<PythonFile> PythonFile::FromFile(File &file, const char *mode) {
1402 if (!mode) {
1406 mode = m.get();
1410 file_obj = PyFile_FromFd(file.GetDescriptor(), nullptr, mode, -1, nullptr,