Return filepath as a class attribute
770463
def _map_trajectory(self):
        
        self.trajectory_map = {}
        with open(self.filepath, 'r') as trajectory_file:
            with closing(
                    mmap(
                        trajectory_file.fileno(), 0,
                        access=ACCESS_READ)) as mapped_file:
                progress = 0
                line = 0
                frame = -1
                frame_start = 0
                while progress <= len(mapped_file):
                    line = line + 1
                    # We read a binary data from a mapped file.
                    bline = mapped_file.readline()
                    # If the bline length equals zero we terminate.
                    # We reached end of the file but still add the last frame!
                    if len(bline) == 0:
                        frame = frame + 1
                        if progress - frame_start > 10:
                            self.trajectory_map[frame] = [
                                frame_start, progress
                            ]
                        break
                    # We need to decode byte line into an utf-8 string.
                    sline = bline.decode("utf-8").strip('\n').split()
                    # We extract map's byte coordinates for each frame
                    if len(sline) == 1 and sline[0] == 'END':
                        frame = frame + 1
                        self.trajectory_map[frame] = [frame_start, progress]
                        frame_start = progress
                    # Here we extract the map's byte coordinates for the header
                    # And also the periodic system type needed for later.
                    progress = progress + len(bline)
            self.no_of_frames = frame
70436
def dump_to_path(self, cnf, filepath, **kwargs):
        
        _not_implemented(self, cnf, filepath, **kwargs)
1070309
def filepath(self, filename):
        """"""

        return os.path.join(self.node.full_path, filename)
253474
def load_class(path):
    
    class_data = path.split(".")
    if len(class_data) < 2:
        raise ValueError(
            "You need to pass a valid path like mymodule.provider_class")
    module_path = ".".join(class_data[:-1])
    class_str = class_data[-1]
    module = importlib.import_module(module_path)
    return getattr(module, class_str)
1260458
def from_filepath(cls, filepath):
        ''''''
        assert(os.path.exists(filepath))
        return cls(read_file(filepath))
1329731
def get_dir(self, scope, class_):
        
        prop_name = '{scope}_{class_}_dir'.format(**locals())
        value = getattr(self.wrapper, prop_name)
        MultiPath = Multi.for_class(self.path_class)
        return MultiPath.detect(value)
620307
def file_path(type = nil, suffix = '.dat')
      name = self.case.class.benchmark_name.dup
      name << '#' << short_name
      type and name << '-' << type
      name << suffix
      File.expand_path(name, self.case.class.output_dir)
    end
1284644
def _path_from_module(module):
        """"""
        # Convert paths to list because Python's _NamespacePath doesn't support
        # indexing.
        paths = list(getattr(module, '__path__', []))
        if len(paths) != 1:
            filename = getattr(module, '__file__', None)
            if filename is not None:
                paths = [os.path.dirname(filename)]
            else:
                # For unknown reasons, sometimes the list returned by __path__
                # contains duplicates that must be removed.
                paths = list(set(paths))
        if len(paths) > 1:
            raise ImproperlyConfigured(
                "The bot module %r has multiple filesystem locations (%r); "
                "you must configure this bot with an AppConfig subclass "
                "with a 'path' class attribute." % (module, paths))
        elif not paths:
            raise ImproperlyConfigured(
                "The bot module %r has no filesystem location, "
                "you must configure this bot with an AppConfig subclass "
                "with a 'path' class attribute." % (module,))
        return paths[0]
763031
def from_file(cls, path):

        

        with open(path, 'r', errors='replace') as f:
            return cls(f.read())
1358091
def SetFileAttributes(filepath, *attrs):
	
	nice_names = collections.defaultdict(
		lambda key: key,
		hidden='FILE_ATTRIBUTE_HIDDEN',
		read_only='FILE_ATTRIBUTE_READONLY',
	)
	flags = (getattr(api, nice_names[attr], attr) for attr in attrs)
	flags = functools.reduce(operator.or_, flags)
	handle_nonzero_success(api.SetFileAttributes(filepath, flags))
1177297
def fromFile(cls, filepath):
        
        xdata = ElementTree.parse(nstr(filepath))
        xroot = xdata.getroot()

        # collect variable information
        name = xroot.get('name')
        ver = float(xroot.get('version', '1.0'))

        if not name:
            name = os.path.basename(filepath).split('.')
            if name == '__init__':
                name = os.path.normpath(filepath).split(os.path.sep)[-2]
            name = projex.text.pretty(name)

        icon = xroot.get('icon', './icon.png')

        ximport = xroot.find('import')
        if ximport is not None:
            importpath = ximport.get('path', './__init__.py')
        else:
            importpath = './__init__.py'

        params = {'description': '', 'author': '', 'email': '', 'url': ''}
        for param, default in params.items():
            xdata = xroot.find(param)
            if xdata is not None:
                params[param] = xdata.text

        # generate the proxy information
        proxy = PluginProxy(cls, name, ver)
        proxy.setImportPath(importpath)
        proxy.setDescription(params['description'])
        proxy.setAuthor(params['author'])
        proxy.setEmail(params['email'])
        proxy.setUrl(params['url'])
        proxy.setFilepath(filepath)

        return proxy
1282248
@Nullable
  public <V extends FileAttributeView> V getFileAttributeView(
      final JimfsPath path, Class<V> type, final Set<? super LinkOption> options) {
    return store.getFileAttributeView(
        new FileLookup() {
          @Override
          public File lookup() throws IOException {
            return lookUpWithLock(path, options).requireExists(path).file();
          }
        },
        type);
  }
1033817
def parse_file_path(cls, file_path):
    """"""
    address = None
    pattern = cls.file_regex.match(file_path)
    if pattern:
      address = pattern.group(1)
    return address
482616
def get():
        """"""
        return {
            attr: getattr(Conf, attr)
            for attr in dir(Conf()) if not callable(getattr(Conf, attr)) and not attr.startswith("__")
        }
756422
def path(self, *paths, **kwargs):
        
        return self.__class__(self.__root__, *paths, **kwargs)
442698
def for_name(modpath, classname):
    '''
    
    '''
    module = __import__(modpath, fromlist=[classname])
    classobj = getattr(module, classname)
    return classobj()
299573
public static String classpathFromClass(Class<?> clazz) {
        String aname = clazz.getPackage().getName().replaceAll("\\.", "/") + "/" +  clazz.getSimpleName()+".class";
        String apath = ClassLoader.getSystemClassLoader().getResource( aname).getPath();
        String path = null;
        if (apath.contains("!")) {
            path = apath.substring(0, apath.indexOf("!")).replace("file:", "");
        } else {
            path = apath.substring(0, apath.indexOf(aname));
        }
        return path;
    }