returns an object Project which matches name
5442
def get_by_name(self, name):
        
        for p in self.project_list:
            if p.nme == name:
                return p
        return None
416399
function getUserSharedProjects(user) {
		return userProject.findOne({'username': user}, 'sharedProjects')
		.then(function(doc) {
			if (!doc) {
				return undefined;
			}
			var projects = doc.sharedProjects;
			projects = projects.map(function(project) {
				var name = path.win32.basename(project);
				return {'Name': name, 'Location': project};
			});
			return projects;
		});
	}
209140
private String getProjectName() {
    String pName = Strings.emptyToNull(projectName);
    if (pName == null) { 
      pName = Strings.emptyToNull(junit4.getProject().getName());
    }
    if (pName == null) {
      pName = "(unnamed project)";      
    }
    return pName;
  }
124679
def get_project(name)
      params = {
        'command' => 'listProjects',
	'listall' => true
      }

      json = send_request(params)
      projects = json['project']
      return nil unless projects

      projects.each { |n|
        if name.is_uuid? then
          return n if n['id'] == name
        else
          return n if n['name'] == name
        end
      }
      nil
    end
482069
def find_by_id(self, project, params={}, **options): 
        
        path = "/projects/%s" % (project)
        return self.client.get(path, params, **options)
157458
def project_search(auth=None, **kwargs):
    '''
    
    '''
    cloud = get_openstack_cloud(auth)
    kwargs = _clean_kwargs(**kwargs)
    return cloud.search_projects(**kwargs)
823238
def _get_task(name):
	''''''
	matches = [x for x in TASKS if x.match(name)]
	if matches:
		return matches[0]
1055032
def get_project(self, projectname):
        
        cmd = ["list", "accounts", "where", "name=%s" % projectname]
        results = self._read_output(cmd)

        if len(results) == 0:
            return None
        elif len(results) > 1:
            logger.error(
                "Command returned multiple results for '%s'." % projectname)
            raise RuntimeError(
                "Command returned multiple results for '%s'." % projectname)

        the_result = results[0]
        the_project = the_result["Account"]
        if projectname.lower() != the_project.lower():
            logger.error(
                "We expected projectname '%s' "
                "but got projectname '%s'." % (projectname, the_project))
            raise RuntimeError(
                "We expected projectname '%s' "
                "but got projectname '%s'." % (projectname, the_project))

        return the_result
1086952
function( name, actual, expected ) {
		var self = this, passed = true;

		try {
			self._objectMatch( actual, expected );
			passed = false;
		}
		catch ( e ) {
		}
		
		return self.ok( name, passed, self.notDeepEqual, 'Objects are not supposed to match' );
	}
721126
function getOldProjectName(projectDir) {
  var files = [];
  try {
    files = fs.readdirSync(projectDir);
  } catch (err) {
    return '';
  }

  var projectFile = '';
  files.forEach(function(fileName) {
    if (path.extname(fileName) === '.xcodeproj') {
      projectFile = path.basename(fileName, '.xcodeproj');
    }
  });

  return projectFile;
}
1172327
public CollectionRequest<ProjectStatus> findByProject(String project) {

        String path = String.format("/projects/%s/project_statuses", project);
        return new CollectionRequest<ProjectStatus>(this, ProjectStatus.class, path, "GET");
    }
1086628
def get_project(self, project):
        
        project = format_string(project)

        return self.get(
            '/projects/{project}'.format(project=project))
145794
def find_project_by_short_name(short_name, pbclient, all=None):
    """"""
    try:
        response = pbclient.find_project(short_name=short_name, all=all)
        check_api_error(response)
        if (len(response) == 0):
            msg = '%s not found! You can use the all=1 argument to \
                   search in all the server.'
            error = 'Project Not Found'
            raise ProjectNotFound(msg, error)
        return response[0]
    except exceptions.ConnectionError:
        raise
    except ProjectNotFound:
        raise
42786
def get_project(self, project_id):
        ''''''
        project_response = self.get_request('projects/%s' % project_id)
        return Project(self, project_response['project'])
1033504
def get_object_by_name(content, object_type, name, regex=False):
    '''
    
    '''
    container = content.viewManager.CreateContainerView(
        content.rootFolder, [object_type], True
    )
    for c in container.view:
        if regex:
            if re.match(name, c.name):
                return c
        elif c.name == name:
            return c
313377
def get_item_project(self, eitem):
        

        project = None
        eitem_project = {}
        ds_name = self.get_connector_name()  # data source name in projects map

        if ds_name not in self.prjs_map:
            return eitem_project

        for tag in eitem['hashtags_analyzed']:
            # lcanas: hashtag provided in projects.json file should not be case sensitive T6876
            tags2project = CaseInsensitiveDict(self.prjs_map[ds_name])
            if tag in tags2project:
                project = tags2project[tag]
                break

        if project is None:
            project = DEFAULT_PROJECT

        eitem_project = {"project": project}

        eitem_project.update(self.add_project_levels(project))

        return eitem_project
28721
function verifyProjectNameDoesNotExist(req, res, next) {
  var projectName = req.body.name.toLowerCase();
  var dataStore = req.app.dataStore;

  // Get all project REST resources
  dataStore.getCollection('/projects', function(err, resources) {
    var alreadyExists = resources.some(function(resource) {
      return resource.data.name.toLowerCase() === projectName;
    });

    if (alreadyExists) {
      // The ID already exists, so send an HTTP 409 (Conflict)
      res.sendStatus(409);
    }
    else {
      next();
    }
  });
}