Gets the organization for the given package (or Maven group id).
13337
public static String getOrganizationForPackage(GraphRewrite event, String pkg)
    {
        final String pkgComparison = pkg + ".";
        String organization = null;
        for (Map.Entry<String, String> entry : getMappings(event).entrySet())
        {
            final String pkgPattern = entry.getKey() + ".";
            if (StringUtils.startsWith(pkgComparison, pkgPattern))
            {
                organization = entry.getValue();
                if (LOG.isLoggable(Level.FINE))
                {
                    LOG.fine(" -- Found organization: " + organization);
                }
                break;
            }
        }
        return organization;
    }
1292013
def info(self, id):
    """"""
    #self._update_index() # This is commented because it leads to
                          # excessive network load
    if id in self._packages: return self._packages[id]
    if id in self._collections: return self._collections[id]
    self._update_index() # If package is not found, most probably we did not
                         # warm up the cache
    if id in self._packages: return self._packages[id]
    if id in self._collections: return self._collections[id]
    raise ValueError('Package %r not found in index' % id)
567922
public String getJavaPackage() {
		String javaPackage = getJavaGroupId(); 
		if (!isGroupIdSuffixedWithArtifactId()) {
			javaPackage += "." + getJavaArtifactId(); 
		}
		return javaPackage.toLowerCase();
	}
381621
public DbOrganization getOrganization(final String organizationId) {
        final DbOrganization dbOrganization = repositoryHandler.getOrganization(organizationId);

        if(dbOrganization == null){
            throw new WebApplicationException(Response.status(Response.Status.NOT_FOUND)
                    .entity("Organization " + organizationId + " does not exist.").build());
        }

        return dbOrganization;
    }
1243522
def folder_path_for_package(cls, package: ecore.EPackage):
        """"""
        parent = package.eContainer()
        if parent:
            return os.path.join(cls.folder_path_for_package(parent), package.name)
        return package.name
767539
def get_organization(self, **kwargs):
        
        resp = self._get(self._u(self._ORGANIZATION_ENDPOINT_SUFFIX),
                         **kwargs)
        resp.raise_for_status()
        return resp.json()
933108
public Iterable<MavenProjectModel> findByGroupArtifactVersion(String groupId, String artifactId, String version)
    {
        String key = generateMavenKey(groupId, artifactId, version);
        Iterable<MavenProjectModel> facet = this.findAllByProperty(MavenProjectModel.MAVEN_IDENTIFIER, key);

        return facet;
    }
763240
public static String getPackageNameFromPid(Context context, int pid) {
        ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
        List<RunningAppProcessInfo> processes = am.getRunningAppProcesses();
        for (RunningAppProcessInfo info : processes) {
            if (info.pid == pid) {
                String[] packages = info.pkgList;
                if (packages.length > 0) {
                    return packages[0];
                }
                break;
            }
        }
        return null;
    }
1190690
@Override
  public PackageDescriptor add(String pm, String groupId, String artifactId, String version) {
    PackageCoordinate pkg = PackageCoordinate.newBuilder()
        .withFormat(pm)
        .withNamespace(groupId)
        .withName(artifactId)
        .withVersion(version)
        .build();
    return add(Collections.singletonList(pkg));
  }
242011
private Artifact getArtifactFromMavenCoordinates(final String artifact) throws MojoFailureException {

    String[] parts = StringUtils.split(artifact, ":");

    String version;
    String packaging = null;
    String classifier = null;

    switch (parts.length) {
      case 3:
        // groupId:artifactId:version
        version = parts[2];
        break;

      case 4:
        // groupId:artifactId:packaging:version
        packaging = parts[2];
        version = parts[3];
        break;

      case 5:
        // groupId:artifactId:packaging:classifier:version
        packaging = parts[2];
        classifier = parts[3];
        version = parts[4];
        break;

      default:
        throw new MojoFailureException("Invalid artifact: " + artifact);
    }

    String groupId = parts[0];
    String artifactId = parts[1];

    return createArtifact(artifactId, groupId, version, packaging, classifier);
  }
951592
def get_group_for_activity(self, module=None, project=None, **kwargs):
        

        _module_id = kwargs.get('module', module)
        _project_id = kwargs.get('project', project)
        _url = GROUPS_URL.format(module_id=_module_id, project_id=_project_id)
        return self._request_api(url=_url).json()
711260
@Override
	public Organization org() {
		if(org==null) {
			try {
				if((org = OrganizationFactory.obtain(env(), user()))==null) {
					org = Organization.NULL;
				}
			} catch (Exception e) {
				org = Organization.NULL;
			}
		} 
		return org;
	}
1313521
public static Organization unserializeOrganization(final String organization) throws IOException {
        final ObjectMapper mapper = new ObjectMapper();
        mapper.disable(MapperFeature.USE_GETTERS_AS_SETTERS);
        return mapper.readValue(organization, Organization.class);
    }
200615
public String getPackageGroup() {
    String packageName = interfaceClass.getPackage().getName();
    String[] parts = packageName.split("\\.");
    return parts[parts.length - 1];
  }
890874
public RespokeGroup getGroup(String groupIDToFind) {
        RespokeGroup group = null;

        if (null != groupIDToFind) {
            group = groups.get(groupIDToFind);
        }

        return group;
    }
90507
GroupIds getGroupIds(Node groupNode) throws RepositoryException
   {
      String storagePath = getGroupStoragePath();
      String nodePath = groupNode.getPath();

      String groupId = nodePath.substring(storagePath.length());
      String parentId = groupId.substring(0, groupId.lastIndexOf("/"));

      return new GroupIds(groupId, parentId);
   }
331139
@Override
	public List<CommerceShipment> findByGroupId(long groupId) {
		return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
	}