Get urls that scrapyd logs file by project name and spider name
        :param project_name: the project name
        :param spider_name: the spider name
        :return: two list of the logs file name and logs file url
549236
def get_logs(self, project_name, spider_name):
        
        url, method = self.command_set['logs'][0] + project_name + '/' + spider_name + '/', self.command_set['logs'][1]
        response = http_utils.request(url, method_type=method)
        html_parser = ScrapydLogsPageHTMLParser()
        html_parser.feed(response)
        html_parser.clean_enter_sign()
        return html_parser.result, [url + x for x in html_parser.result]
797897
def get_free_project_name(self, base_name):
        
        names = [p.name for p in self._projects.values()]
        if base_name not in names:
            return base_name
        i = 1

        projects_path = self.projects_directory()

        while True:
            new_name = "{}-{}".format(base_name, i)
            if new_name not in names and not os.path.exists(os.path.join(projects_path, new_name)):
                break
            i += 1
            if i > 1000000:
                raise aiohttp.web.HTTPConflict(text="A project name could not be allocated (node limit reached?)")
        return new_name
936486
def log_path(scraper):
    
    return os.path.join(scraper.config.data_path,
                        '%s.jsonlog' % scraper.name)
978624
private String getProjectFile( String projectName, String filePattern)
    {
    String projectFile = null;
    if( !StringUtils.isBlank( filePattern))
      {
      Matcher matcher = projectFilePattern_.matcher( filePattern);
      if( matcher.matches())
        {
        projectFile =
          StringUtils.isBlank( matcher.group(2))
          ? filePattern
          : matcher.group(1) + projectName + matcher.group(3);
        }
      }
    
    return projectFile;
    }
333443
def get_project_filenames(self):
        """"""
        recent_files = []
        if self.current_active_project:
            recent_files = self.current_active_project.get_recent_files()
        elif self.latest_project:
            recent_files = self.latest_project.get_recent_files()
        return recent_files
860493
def get_logs(self, project, release_id, **kwargs):
        
        route_values = {}
        if project is not None:
            route_values['project'] = self._serialize.url('project', project, 'str')
        if release_id is not None:
            route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int')
        response = self._send(http_method='GET',
                              location_id='c37fbab5-214b-48e4-a55b-cb6b4f6e4038',
                              version='5.0-preview.2',
                              route_values=route_values,
                              accept_media_type='application/zip')
        if "callback" in kwargs:
            callback = kwargs["callback"]
        else:
            callback = None
        return self._client.stream_download(response, callback=callback)
890241
def get_project(self, name):
        
        if self._cache is None:  # pragma: no cover
            result = self._get_project(name)
        elif name in self._cache:
            result = self._cache[name]
        else:
            self.clear_errors()
            result = self._get_project(name)
            self._cache[name] = result
        return result
252702
def get_project_by_name(project_name,**kwargs):
    
    user_id = kwargs.get('user_id')

    projects_i = db.DBSession.query(Project).join(ProjectOwner).filter(
                                                    Project.name==project_name,
                                                    ProjectOwner.user_id==user_id).order_by('name').all()

    ret_projects = []
    for project_i in projects_i:
        try:
            project_i.check_read_permission(user_id)
            ret_projects.append(project_i)
        except:
            log.info("Can't return project %s. User %s does not have permission to read it.", project_i.id, user_id)

    return ret_projects
8648
def get_project(self, project_name):
        
        headers = {}
        params = {}
        resource = "/"

        (resp, header) = self._send("GET", project_name, None, resource, params, headers)
        return GetProjectResponse(resp, header)
779700
def get_all_job_list(agent):
    
    project_list = agent.get_project_list()
    if project_list['status'] == 'error':
        raise ScrapydTimeoutException
    project_list = project_list['projects']
    pending_job_list = []
    running_job_list = []
    finished_job_list = []
    for project_name in project_list:
        job_list = agent.get_job_list(project_name)
        # Extract latest version
        project_version = agent.get_version_list(project_name)['versions'][-1:]
        for pending_job in job_list['pending']:
            pending_job_list.append(JobListDO(project_name=project_name,
                                              project_version=project_version,
                                              job_id=pending_job['id'],
                                              spider_name=pending_job['spider'],
                                              job_status=JobStatus.PENDING
                                              ))
        for running_job in job_list['running']:
            running_job_list.append(JobListDO(project_name=project_name,
                                              project_version=project_version,
                                              job_id=running_job['id'],
                                              spider_name=running_job['spider'],
                                              start_time=running_job['start_time'],
                                              job_status=JobStatus.RUNNING
                                              ))
        for finished_job in job_list['finished']:
            finished_job_list.append(JobListDO(project_name=project_name,
                                               project_version=project_version,
                                               job_id=finished_job['id'],
                                               spider_name=finished_job['spider'],
                                               start_time=finished_job['start_time'],
                                               end_time=finished_job['end_time'],
                                               job_status=JobStatus.FINISHED
                                               ))

    return pending_job_list, running_job_list, finished_job_list
860893
def _get_index_urls_locations(self, project_name):
        # type: (str) -> List[str]
        

        def mkurl_pypi_url(url):
            loc = posixpath.join(
                url,
                urllib_parse.quote(canonicalize_name(project_name)))
            # For maximum compatibility with easy_install, ensure the path
            # ends in a trailing slash.  Although this isn't in the spec
            # (and PyPI can handle it without the slash) some other index
            # implementations might break if they relied on easy_install's
            # behavior.
            if not loc.endswith('/'):
                loc = loc + '/'
            return loc

        return [mkurl_pypi_url(url) for url in self.index_urls]
95135
def list_milestones(self, project_id, find=None):
        
        path = '/projects/%u/milestones/list' % project_id
        req = ET.Element('request')
        if find is not None:
            ET.SubElement(req, 'find').text = str(find)
        return self._request(path, req)
447036
def dump_logs(json_data, project_mapping, tag_name):
    
    pwd_dir_path, dump_file_name = _prepare_dump_info(project_mapping, tag_name)
    dump_json_file(json_data, pwd_dir_path, dump_file_name)
634863
def system_find_projects(input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/system/findProjects', input_params, always_retry=always_retry, **kwargs)
576736
def get_projects(self, **kwargs):
        

        _login = kwargs.get('login', self._login)
        search_url = SEARCH_URL.format(login=_login)
        return self._request_api(url=search_url).json()
532396
def get_urls(session, name, data, find_changelogs_fn, **kwargs):
    
    # check if there's a changelog in ../custom/pypi/map.txt
    map = get_url_map()
    if name.lower().replace("_", "-") in map:
        logger.info("Package {name}'s URL is in pypi/map.txt, returning".format(name=name))
        return [map[name.lower().replace("_", "-")]], set()
    # if this package has valid meta data, build up a list of URL candidates we can possibly
    # search for changelogs on
    if "info" in data:
        # add all URLs in pypi's meta data:
        # {
        #   "info": {
        #       "home_page":
        #       "docs_url":
        #       "bugtrack_url":
        #   }
        # }
        candidates = [
            url for url in
            [data["info"].get(attr) for attr in ("home_page", "docs_url", "bugtrack_url")]
            if url
        ]
        # the latest release page on pypi might also contain links, add it
        candidates.append("https://pypi.python.org/pypi/{name}/{latest_release}".format(
            name=name,
            latest_release=next(iter(get_releases(data)))
        ))
        # Check the download URL as well.
        if "download_url" in data:
            candidates.append(data["download_url"])
        if data['info']['description']:
            candidates.extend(changelogs.url_re.findall(data["info"]["description"]))
        return find_changelogs_fn(session=session, name=name, candidates=candidates)
    return set(), set()
743284
def get_projects(self, state=github.GithubObject.NotSet):
        
        
        url_parameters = dict()
        if state is not github.GithubObject.NotSet:
            url_parameters["state"] = state
            
        return github.PaginatedList.PaginatedList(
            github.Project.Project,
            self._requester,
            self.url + "/projects",
            url_parameters,
            {"Accept": Consts.mediaTypeProjectsPreview}
        )