language
stringclasses
2 values
func_code_string
stringlengths
63
466k
python
def _mkstemp_copy(path, preserve_inode=True): ''' Create a temp file and move/copy the contents of ``path`` to the temp file. Return the path to the temp file. path The full path to the file whose contents will be moved/copied to a temp file. Whether it's moved or copi...
java
public List getAllCachedImages() { List ret = new ArrayList(m_variations.keySet()); Collections.sort(ret); return ret; }
java
@Override public void rot90(INDArray toRotate) { if (!toRotate.isMatrix()) throw new IllegalArgumentException("Only rotating matrices"); INDArray start = toRotate.transpose(); for (int i = 0; i < start.rows(); i++) start.putRow(i, reverse(start.getRow(i))); }
python
def format_decimal(self, altitude=None): """ Format decimal degrees with altitude """ coordinates = [str(self.latitude), str(self.longitude)] if altitude is None: altitude = bool(self.altitude) if altitude: if not isinstance(altitude, string_compa...
java
protected boolean handleCustomTypeToJson(TypedElementDefinition<?> column, String getter, String columnType, String javaMemberName, JavaWriter out) { return false; }
python
def setProduct(self, cache=False, *args, **kwargs): """Adds the product for this loan to a 'product' field. Product is a MambuProduct object. cache argument allows to use AllMambuProducts singleton to retrieve the products. See mambuproduct.AllMambuProducts code and pydoc for f...
java
private ModelAndView generateSuccessView(final Assertion assertion, final String proxyIou, final WebApplicationService service, final HttpServletRequest request, final Optional<MultifactorAuthenticationProvider> contextProvider, ...
java
public Matrix multiply(double c) { Matrix toReturn = getThisSideMatrix(null); toReturn.mutableMultiply(c); return toReturn; }
python
def from_msgpack(b, *, max_bin_len=MAX_BIN_LEN, max_str_len=MAX_STR_LEN): """ Convert a msgpack byte array into Python objects (including rpcq objects) """ # Docs for raw parameter are somewhat hard to find so they're copied here: # If true, unpack msgpack raw to Python bytes (default). # Ot...
python
def _op(self, operation, other, *allowed): """A basic operation operating on a single value.""" f = self._field if self._combining: # We are a field-compound query fragment, e.g. (Foo.bar & Foo.baz). return reduce(self._combining, (q._op(operation, other, *allowed) for q in f)) # pylint:disable=pr...
python
def _parse(self, init_info): """Initialize a FCP device object from several lines of string describing properties of the FCP device. Here is a sample: opnstk1: FCP device number: B83D opnstk1: Status: Free opnstk1: NPIV world wide port numbe...
java
@Deprecated public static StringBuffer convertToASCII(StringBuffer src, int options) throws StringPrepParseException{ UCharacterIterator iter = UCharacterIterator.getInstance(src); return convertToASCII(iter,options); }
python
def _fetch_url_data(self, url, username, password, verify, custom_headers): ''' Hit a given http url and return the stats lines ''' # Try to fetch data from the stats URL auth = (username, password) url = "%s%s" % (url, STATS_URL) custom_headers.update(headers(self.agentConfig))...
python
def resetTimeout(self): """Reset the timeout count down""" if self.__timeoutCall is not None and self.timeOut is not None: self.__timeoutCall.reset(self.timeOut)
java
public Matrix4x3d normalize3x3(Matrix4x3d dest) { double invXlen = 1.0 / Math.sqrt(m00 * m00 + m01 * m01 + m02 * m02); double invYlen = 1.0 / Math.sqrt(m10 * m10 + m11 * m11 + m12 * m12); double invZlen = 1.0 / Math.sqrt(m20 * m20 + m21 * m21 + m22 * m22); dest.m00 = m00 * invXlen; dest....
java
public static <T extends XMLObject> T transformSamlObject(final OpenSamlConfigBean configBean, final byte[] data, final Class<T> clazz) { try (InputStream in = new ByteArrayInputStream(data)) { val document = configBean.getParserPool().pa...
java
public RouteFilterRuleInner beginUpdate(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters) { return beginUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).toBlocking().single().body(); }
java
public static void copyZipWithoutEmptyDirectories(final File inputFile, final File outputFile) throws IOException { final byte[] buf = new byte[0x2000]; final ZipFile inputZip = new ZipFile(inputFile); final ZipOutputStream outputStream = new ZipOutputStream(new FileOutputStream(outputFile)...
java
public void marshall(RelationalDatabaseParameter relationalDatabaseParameter, ProtocolMarshaller protocolMarshaller) { if (relationalDatabaseParameter == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshal...
java
@Override public Name getName() { final NameableVisitor visitor = new NameableVisitor(); this.accept(visitor); return visitor.getNameAttribute(); }
java
private static <T> T fromJSON(byte[] src, Class<T> valueType) throws IOException { if (src == null) return null; return Manager.getObjectMapper().readValue(src, valueType); }
python
def _chglog(amend: bool = False, stage: bool = False, next_version: str = None, auto_next_version: bool = False): """ Writes the changelog Args: amend: amend last commit with changes stage: stage changes """ if config.CHANGELOG_DISABLE(): LOGGER.info('skipping changelog upda...
java
private void ensureParentValues(CmsObject cms, String valuePath, Locale locale) { if (valuePath.contains("/")) { String parentPath = valuePath.substring(0, valuePath.lastIndexOf("/")); if (!hasValue(parentPath, locale)) { ensureParentValues(cms, parentPath, locale); ...
python
def indices_within_times(times, start, end): """ Return an index array into times that lie within the durations defined by start end arrays Parameters ---------- times: numpy.ndarray Array of times start: numpy.ndarray Array of duration start times end: numpy.ndarray ...
java
public SeaGlassPainter getBackgroundPainter(SynthContext ctx) { Values v = getValues(ctx); int xstate = getExtendedState(ctx, v); SeaGlassPainter p = null; // check the cache tmpKey.init("backgroundPainter$$instance", xstate); p = (SeaGlassPainter) v.cache...
java
public static void validate(final String bic) throws BicFormatException, UnsupportedCountryException { try { validateEmpty(bic); validateLength(bic); validateCase(bic); validateBankCode(bic); validateCountryCode(bic); validateLo...
java
public PointerHierarchyRepresentationResult run(Database database, Relation<O> relation) { DBIDs ids = relation.getDBIDs(); WritableDBIDDataStore pi = DataStoreUtil.makeDBIDStorage(ids, DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_STATIC); WritableDoubleDataStore lambda = DataStoreUtil.makeDoubleStorag...
java
public void execute(final FifoTask<E> task) throws InterruptedException { final int id; synchronized (this) { id = idCounter++; taskMap.put(id, task); while (activeCounter >= maxThreads) { wait(); } activeCounter++; } ...
python
def verify( self, headers, serialized_request_env, deserialized_request_env): # type: (Dict[str, Any], str, RequestEnvelope) -> None """Verify if the input request timestamp is in tolerated limits. The verify method retrieves the request timestamp and check if it falls in th...
java
private void generateClassFiles(ClassTree classtree) throws DocletException { SortedSet<PackageElement> packages = configuration.typeElementCatalog.packages(); for (PackageElement pkg : packages) { generateClassFiles(configuration.typeElementCatalog.allClasses(pkg), classtree); } ...
java
private void checkDestructuringAssignment( NodeTraversal t, Node nodeToWarn, Node pattern, JSType rightType, String msg) { for (DestructuredTarget target : DestructuredTarget.createAllNonEmptyTargetsInPattern(typeRegistry, rightType, pattern)) { // TODO(b/77597706): this is not very efficient b...
java
@SuppressWarnings("unchecked") @Override public EList<ModelCheckerInstance> getModelCheckers() { return (EList<ModelCheckerInstance>) eGet(StorePackage.Literals.PROJECT__MODEL_CHECKERS, true); }
python
def fetch(args): """fetch a feed""" session = args['session'] for feed, filename in zip(args['feeds'], args['filenames']): try: resp = session.get(feed, timeout=5) content = resp.content except Exception: # pragma: no cover pass else: ...
java
private MultimediaInfo parseMultimediaInfo(File source, RBufferedReader reader) throws InputFormatException, EncoderException { Pattern p1 = Pattern.compile("^\\s*Input #0, (\\w+).+$\\s*", Pattern.CASE_INSENSITIVE); Pattern p2 = Pattern.compile( "^...
java
public static void updateProperty(Configuration conf, String prefix, String[] altPrefix, String key, Properties props, String propsKey, boolean required) throws ConfigurationParseException { String val = conf.get(prefix + key); String altKey = prefix + key; if (val == null) { // try altern...
python
def _clear_cache(url, ts=None): ''' Helper function used by precache and clearcache that clears the cache of a given URL and type ''' if ts is None: # Clears an entire ForeignResource cache res = ForeignResource(url) if not os.path.exists(res.cache_path_base): cli...
java
public static Chunk get(char c, Font font) { char greek = SpecialSymbol.getCorrespondingSymbol(c); if (greek == ' ') { return new Chunk(String.valueOf(c), font); } Font symbol = new Font(Font.SYMBOL, font.getSize(), font.getStyle(), font.getColor()); String s = String...
python
async def get(self, public_key): """ Receive account data Accepts: Query string: - "public_key" - str Query string params: - message ( signed dictionary ): - "timestamp" - str Returns: - "device_id" - str - "phone" - str - "public_key" - str - "count" - int ( wallets amount ...
java
public String text(String delimiter) { if (delimiter == null) delimiter = ""; StringBuilder sb = new StringBuilder(size() * 3); for (IWord word : this) { if (word instanceof CompoundWord) { for (Word child : ((CompoundWord) word).innerList) ...
java
public void getTraceSummaryLine(StringBuilder buff) { // Get the common fields for control messages super.getTraceSummaryLine(buff); buff.append("requestID="); buff.append(getRequestID()); }
python
def _init_orient(self): """Retrieve the quadrature points and weights if needed. """ if self.orient == orientation.orient_averaged_fixed: (self.beta_p, self.beta_w) = quadrature.get_points_and_weights( self.or_pdf, 0, 180, self.n_beta) self._set_orient_signatu...
python
def get_identities(self, item): """Return the identities from an item""" item = item['data'] for field in ["assignee", "reporter", "creator"]: if field not in item["fields"]: continue if item["fields"][field]: user = self.get_sh_identity(...
python
def multiplyC(self, alpha): """multiply C with a scalar and update all related internal variables (dC, D,...)""" self.C *= alpha if self.dC is not self.C: self.dC *= alpha self.D *= alpha**0.5
python
def set_params(self, prog=None, params=""): """ Add --params options for given command line programs """ dest_prog = "to {0}".format(prog) if prog else "" self.add_option("--params", dest="extra", default=params, help="Extra parameters to pass {0}".format(dest_pro...
java
public static void dumpIf(String name, Object obj, Predicate<String> evalPredicate, Predicate<Map.Entry<String, Object>> dumpPredicate, StringPrinter printer) { printer.println(name + ": " + obj.getClass().getName()); fieldsAndGetters(obj, evalPredicate).filter(dumpPredicate).forEach(entry -> { printer.println("...
python
def evaluate(self, reference_scene_list, estimated_scene_list=None, estimated_scene_probabilities=None): """Evaluate file pair (reference and estimated) Parameters ---------- reference_scene_list : list of dict or dcase_util.containers.MetaDataContainer Reference scene list...
java
@Override public void write(ByteCodeWriter out) throws IOException { out.writeUTF8Const(getName()); TempOutputStream ts = new TempOutputStream(); //ts.openWrite(); //WriteStream ws = new WriteStream(ts); ByteCodeWriter o2 = new ByteCodeWriter(ts, out.getJavaClass()); o2.writeShort(_met...
java
public int DamerauLevenshteinDistance(String string2, int maxDistance) { if (baseString == null) return string2 == null ? 0 : string2.length(); //string2 ?? "").Length; if (string2 == null || string2.isEmpty()) return baseString.length(); if(maxDistance == 0) return baseString.equals(string2) ? ...
python
def update_attribute_value_items(self): """ Returns an iterator of items for an attribute value map to use for an UPDATE operation. The iterator ignores collection attributes as these are processed implicitly by the traversal algorithm. :returns: iterator yielding tuple...
java
private int getLRDefinedWindow() { int leastRU = Integer.MAX_VALUE; int whichWindow = INVALIDWINDOW; // find least recently used window // supposedly faster to count down //for( int i = 0; i < NUMWINDOWS; i++ ) { for(int i = NUMWINDOWS - 1; i >= 0; --i ) ...
java
public static String showPasswordDialog(WindowBasedTextGUI textGUI, String title, String description, String initialContent) { TextInputDialog textInputDialog = new TextInputDialogBuilder() .setTitle(title) .setDescription(description) .setInitialContent(initialCo...
java
@SuppressWarnings({ "unchecked", "cast" }) public static <K, V> MapFieldLite<K, V> emptyMapField() { return (MapFieldLite<K, V>) EMPTY_MAP_FIELD; }
python
def list(self, cur_p=''): ''' View the list of the Log. ''' if cur_p == '': current_page_number = 1 else: current_page_number = int(cur_p) current_page_number = 1 if current_page_number < 1 else current_page_number pager_num = int(MLog.t...
java
public static <E> Optional<E> maybeFirst(Iterable<E> iterable) { dbc.precondition(iterable != null, "cannot call maybeFirst with a null iterable"); return new MaybeFirstElement<E>().apply(iterable.iterator()); }
python
def listen_tta(self, target, timeout): """Listen as Type A Target. Waits to receive a SENS_REQ command at the bitrate set by **target.brty** and sends the **target.sens_res** response. Depending on the SENS_RES bytes, the Initiator then sends an RID_CMD (SENS_RES coded for a Typ...
python
def info_gain_nominal(x, y, separate_max): """ Function calculates information gain for discrete features. If feature is continuous it is firstly discretized. x: numpy array - numerical or discrete feature y: numpy array - labels ft: string - feature type ("c" - continuous, "d" - discrete) spli...
python
def decrypt(data, key): '''decrypt the data with the key''' data_len = len(data) data = ffi.from_buffer(data) key = ffi.from_buffer(__tobytes(key)) out_len = ffi.new('size_t *') result = lib.xxtea_decrypt(data, data_len, key, out_len) ret = ffi.buffer(result, out_len[0])[:] lib.free(resu...
python
def __convertIp6PrefixStringToIp6Address(self, strIp6Prefix): """convert IPv6 prefix string to IPv6 dotted-quad format for example: 2001000000000000 -> 2001:: Args: strIp6Prefix: IPv6 address string Returns: IPv6 address dotted-quad format ...
python
def imagej_shape(shape, rgb=None): """Return shape normalized to 6D ImageJ hyperstack TZCYXS. Raise ValueError if not a valid ImageJ hyperstack shape. >>> imagej_shape((2, 3, 4, 5, 3), False) (2, 3, 4, 5, 3, 1) """ shape = tuple(int(i) for i in shape) ndim = len(shape) if 1 > ndim > 6...
python
def _GetDatabaseConfig(self): """ Get all configuration from database. This includes values from the Config table as well as populating lists for supported formats and ignored directories from their respective database tables. """ goodlogging.Log.Seperator() goodlogging.Log.Info("CLEAR"...
java
private String[] computeValueFromMappingValues(MtasParserObject object, List<Map<String, String>> mappingValues, Map<String, List<MtasParserObject>> currentList, boolean containsVariables) throws MtasParserException, MtasConfigException { String[] value = { "" }; for (Map<String, String>...
python
async def _set_state(self, state: int) -> bool: """Set the state of the device.""" try: set_state_resp = await self.api._request( 'put', DEVICE_SET_ENDPOINT, json={ 'attributeName': 'desireddoorstate', 'm...
python
def check_data(labels, data, args): """Check that all data were inserted correctly. Return the colors.""" len_categories = len(data[0]) # Check that there are data for all labels. if len(labels) != len(data): print(">> Error: Label and data array sizes don't match") sys.exit(1) # C...
java
public void marshall(ProjectStatus projectStatus, ProtocolMarshaller protocolMarshaller) { if (projectStatus == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(projectStatus.getState(), STATE_BINDING)...
python
def number_of_records_per_hour(self, value=None): """Corresponds to IDD Field `number_of_records_per_hour` Args: value (int): value for IDD Field `number_of_records_per_hour` if `value` is None it will not be checked against the specification and is assumed t...
python
def obtain_access_token(self): """Returns an OAuth 2 access token to make OAuth 2 authenticated read-only calls. :rtype: string """ if self.oauth_version != 2: raise TwythonError('This method can only be called when your \ OAuth version...
java
static DiyFp minus(DiyFp a, DiyFp b) { DiyFp result = new DiyFp(a.f, a.e); result.subtract(b); return result; }
java
public String[] getRuleSetDisplayNames(ULocale loc) { String[] names = getNameListForLocale(loc); if (names != null) { return names.clone(); } names = getRuleSetNames(); for (int i = 0; i < names.length; ++i) { names[i] = names[i].substring(1); } ...
java
public void addGLL( GLLSentence gll ) { try { if (gll.isValid()) position = gll.getPosition(); } catch (Exception e) { // ignore it, this should be handled in the isValid, // if an exception is thrown, we can't deal with it here. } }
python
def break_iterable(iterable, pred): """Break a iterable on the item that matches the predicate into lists. The item that matched the predicate is not included in the result. >>> list(break_iterable([1, 2, 3, 4], lambda x: x == 3)) [[1, 2], [4]] """ sublist = [] for i in iterable: i...
python
def parse_lcov_file_info(args, filepath, line_iter, line_coverage_re, file_end_string): """ Parse the file content in lcov info file """ coverage = [] lines_covered = [] for line in line_iter: if line != "end_of_record": line_coverage_match = line_coverage_re.match(line) ...
java
public Launcher env(String key, String value) { builder.environment().put(key, value); return this; }
python
def requiv_to_pot_contact(requiv, q, sma, compno=1): """ :param requiv: user-provided equivalent radius :param q: mass ratio :param sma: semi-major axis (d = sma because we explicitly assume circular orbits for contacts) :param compno: 1 for primary, 2 for secondary :return: potential and fillou...
java
public int getGroupForPrimary(long p) { p >>= 16; if(p < scriptStarts[1] || scriptStarts[scriptStarts.length - 1] <= p) { return -1; } int index = 1; while(p >= scriptStarts[index + 1]) { ++index; } for(int i = 0; i < numScripts; ++i) { if(scriptsI...
java
@Override public JSObject execute(String command) { Object returnValue = engine.executeScript(command); if (returnValue instanceof JSObject) { return (JSObject) returnValue; } return null; }
java
public void setBoardAlpha(float alpha) { if (mListeners != null) { for (StateListener l : mListeners) { l.onBoardAlpha(this, alpha); } } mContentView.setAlpha(alpha); }
java
public JavaPairRDD<K, Collection<V>> spanByKey(ClassTag<K> keyClassTag) { ClassTag<Tuple2<K, Collection<V>>> tupleClassTag = classTag(Tuple2.class); ClassTag<Collection<V>> vClassTag = classTag(Collection.class); RDD<Tuple2<K, Collection<V>>> newRDD = pairRDDFunctions.spanByKey() ...
java
public static String deidentify(String text, int left, int right, int fromLeft, int fromRight) { if (left == 0 && right == 0 && fromLeft == 0 && fromRight == 0) { return StringUtils.repeat('*', text.length()); } else if (left > 0 && right == 0 && fromLeft == 0 && fromRight == 0) { return deidentifyLeft(text, ...
java
public static String toPGString(byte[] buf) { if (buf == null) { return null; } StringBuilder stringBuilder = new StringBuilder(2 * buf.length); for (byte element : buf) { int elementAsInt = (int) element; if (elementAsInt < 0) { elementAsInt = 256 + elementAsInt; } ...
java
public static boolean is_kharanta(String str) { String s1 = VarnaUtil.getAntyaVarna(str); if (is_khar(s1)) return true; return false; }
python
def weave_layers(infiles, output_file, log, context): """Apply text layer and/or image layer changes to baseline file This is where the magic happens. infiles will be the main PDF to modify, and optional .text.pdf and .image-layer.pdf files, organized however ruffus organizes them. From .text.pdf,...
python
def in6_cidr2mask(m): """ Return the mask (bitstring) associated with provided length value. For instance if function is called on 48, return value is '\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'. """ if m > 128 or m < 0: raise Kamene_Exception("value provided...
java
public void addLine(String line) { int sep = line.indexOf('='); if(sep > 0) { put(line.substring(0,sep),line.substring(sep+1)); } }
java
public int setBytes(final long pos, final byte[] bytes) throws SQLException { final int arrayPos = (int) pos - 1; final int bytesWritten; if (blobContent == null) { this.blobContent = new byte[arrayPos + bytes.length]; bytesWritten = blobContent.length; this....
java
public static synchronized void mockStatic(Class<?> type, Method... methods) { doMock(type, true, new DefaultMockStrategy(), null, methods); }
java
public static void synchronizeViewers(ImageViewer first, ImageViewer... others) { Synchronizer mainSynchronizer=first.getSynchronizer(); for (ImageViewer other: others) { mainSynchronizer.add(other); } }
java
public SkillDetails withBulletPoints(String... bulletPoints) { if (this.bulletPoints == null) { setBulletPoints(new java.util.ArrayList<String>(bulletPoints.length)); } for (String ele : bulletPoints) { this.bulletPoints.add(ele); } return this; }
java
public String printShortLocaleTime() { _date.setTime(_localTimeOfEpoch); if (_shortTimeFormat == null) _shortTimeFormat = DateFormat.getTimeInstance(DateFormat.SHORT); return _shortTimeFormat.format(_date); }
python
def transform_generator(fn): """A decorator that marks transform pipes that should be called to create the real transform""" if six.PY2: fn.func_dict['is_transform_generator'] = True else: # py3 fn.__dict__['is_transform_generator'] = True return fn
python
def prep_parallel(self, binary_args, other_args): """Prepare the parallel calculations Prepares the arguments to be run in parallel. It will divide up arrays according to num_splits. Args: binary_args (list): List of binary arguments for input into the SNR function. ...
java
public static <T> ListStore<T> list(@NonNull File file, @NonNull Converter converter, @NonNull Type type) { return new RealListStore<T>(file, converter, type); }
java
private void scaleToOutputResolution(Image image) { float factor = m_sharedContext.getDotsPerPixel(); if (factor != 1.0f) { image.scaleAbsolute(image.getPlainWidth() * factor, image.getPlainHeight() * factor); } }
python
def Initialize(api_key, api_secret, api_host="localhost", api_port=443, api_ssl=True, asyncblock=False, timeout=10, req_method="get"): """ Initializes the Cloudstack API Accepts arguments: api_host (localhost) api_port (443) api_ssl (True) api_key ...
java
public void resetCursor() { if(buffer == null) { buffer = Pointer.create(new byte[bufsize], 0); } buffer.buffer[buffer.start] = 0; cursor = -1; lineptr = -1; linectptr = -1; token = -1; toktmp = -1; marker = -1; limit = -1; ...
java
protected boolean isFloatingPointType(Object left, Object right) { return left instanceof Float || left instanceof Double || right instanceof Float || right instanceof Double; }
python
def delta_E( reactants, products, check_balance=True ): """ Calculate the change in energy for reactants --> products. Args: reactants (list(vasppy.Calculation): A list of vasppy.Calculation objects. The initial state. products (list(vasppy.Calculation): A list of vasppy.Calculation ob...
python
def delete_vault(self, vault_id): """Deletes a ``Vault``. arg: vault_id (osid.id.Id): the ``Id`` of the ``Vault`` to remove raise: NotFound - ``vault_id`` not found raise: NullArgument - ``vault_id`` is ``null`` raise: OperationFailed - unable to complete r...
java
@Override public <K extends Serializable, V> Map<K, V> getCache() { return this.getCache(DEFAULT); }
java
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "Ring", substitutionHeadNamespace = "http://www.opengis.net/gml", substitutionHeadName = "_Ring") public JAXBElement<RingType> createRing(RingType value) { return new JAXBElement<RingType>(_Ring_QNAME, RingType.class, null, value); }
python
def getGenomeList() : """Return the names of all imported genomes""" import rabaDB.filters as rfilt f = rfilt.RabaQuery(Genome_Raba) names = [] for g in f.iterRun() : names.append(g.name) return names