text:
package com.arm.carp.apps.linker

import com.arm.carp.apps.Version
import com.arm.carp.pencil.Printer
import java.io.PrintWriter
import java.io.File
import com.arm.carp.frontends.pencil.PencilFrontEnd
import scala.collection.mutable.HashSet
import scala.collection.mutable.HashMap
import scala.collection.mutable.ListBuffer
import com.arm.carp.pencil.Program
import com.arm.carp.pencil.Function
import com.arm.carp.pencil.StructType
import com.arm.carp.pencil.ScalarVariableDef
import com.arm.carp.pencil.Variable
import com.arm.carp.pencil.Checkable
import com.arm.carp.pencil.Common

/**
  * Linker application.
  *
  * Linker links multiple PENCIL files in a single file, automatically
  * assigning unique names to static functions. For non-static
  * functions, global types and constants names must be unique.
  */
object Main extends Common {

  private var correct = true

  private var debug = false

  private var prototypes_only = false

  private def same_constants(c1: Variable, c2: Variable) = {
    (c1, c2) match {
      case (s1: ScalarVariableDef, s2: ScalarVariableDef) => s1.expType == s2.expType && s1.init == s2.init
      case _ => false
    }
  }

  private def link(in: Seq[Program]): Program = {
    val names = HashSet[String]()
    val functions = ListBuffer[Function]()
    val types = HashMap[String, StructType]()
    val prototypes = HashMap[String, Function]()
    val structs = ListBuffer[StructType]()
    val consts = HashMap[String, Variable]()
    val const_list = ListBuffer[Variable]()

    def add_function_prototype(in: Function): Boolean = {
      if (!names.add(in.getName)) {
        prototypes.get(in.getName) match {
          case Some(function) if (function.ops.isEmpty || in.ops.isEmpty) => {
            if (!compatibleFunctions(function, in)) {
              complain("Incompatible previous function declarations for function: " + in.name)
              false
            } else {
              true
            }
          }
          case _ => {
            complain("Name conflict during linking: function " + in.name)
            false
          }
        }
      } else {
        true
      }
    }

    def add_constant(in: Variable): Boolean = {
      if (!names.add(in.name)) {
        consts.get(in.name) match {
          case Some(cst) => same_constants(in, cst)
          case _ => false
        }
      } else {
        const_list.append(in)
        consts.put (in.name, in)
        true
      }
    }

    for (prog <- in) {
      for (gtype <- prog.types) {
        types.get (gtype.name) match {
          case None => {
            types.put(gtype.name, gtype)
            structs.append(gtype)
          }
          case Some(struct) if !struct.compatible(gtype) =>
          complain("Name conflict during linking: struct " + gtype.name)
          case Some(struct) =>
        }
      }
      for (function <- prog.functions) {
        if (add_function_prototype(function)) {
          prototypes.put (function.getName, function)
          if (function.ops.isDefined) {
            functions.append(function)
          }
        }
      }
      for (const <- prog.consts) {
        if (!add_constant(const)) {
          complain("Name conflict during linking: const " + const.name)
        }
      }
    }
    val external = prototypes.values.filter(!functions.contains(_))
    functions.appendAll(external)
    new Program(functions.toList, structs.toList, const_list.toList)
  }

  private val inputFileNames = ListBuffer[(String, Boolean)]()
  private val headers = ListBuffer[String]()
  private var outputFileName: Option[String] = None

  private def parseCommandLine(args: List[String]): Unit = {
    args match {
      case Nil =>
      case "-d" :: rest =>
        debug = true
        parseCommandLine(rest)
      case "-h" :: rest => sayHelp()
      case "--version" :: rest => sayVersion()
      case "-o" :: x :: rest =>
        outputFileName = Some(x); parseCommandLine(rest)
      case "--prototypes-only" :: rest =>
        prototypes_only = true
        parseCommandLine(rest)
      case "--static" :: x :: rest => inputFileNames.append((x, true)); parseCommandLine(rest)
      case "--include" :: x :: rest => headers.append(x); parseCommandLine(rest)
      case x :: rest => inputFileNames.append((x, false)); parseCommandLine(rest)
    }
  }

  private def sayHelp() {
    System.err.println("Usage: [[--static] input-file]* [--version] [-o output-file] [--include header]*")
    System.exit(0)
  }

  private def sayVersion() {
    System.err.println("PENCIL Linker")
    System.err.println(Version.getFullVersionInfo)
    System.exit(0)
  }

  private def complain(message: String) {
    System.err.println("Linker error:" + message)
    correct = false
  }

  def main(args: Array[String]) {
    parseCommandLine(args.toList)

    if (inputFileNames.isEmpty) {
      return
    }

    val frontend = new PencilFrontEnd

    val buff = new ListBuffer[Program]()

    for ((prog, static) <- inputFileNames) {
      val pencil = frontend.parse(prog, headers, debug, static)
      pencil match {
        case None => complain("one of the input files contains an error")
        case Some(pprogram) =>
          {
            Checkable.walkProgram(pprogram)
            buff.append(pprogram)
          }
      }
    }

    val pencil = link(buff.toList)

    if (!correct) {
      System.exit(-1)
    }
    val writer = new Printer
    val code = writer.toPencil(pencil, true, !prototypes_only)

    outputFileName match {
      case Some(fname) =>
        val file = new PrintWriter(new File(fname))
        file.append(code)
        file.close
      case None =>
        println(code)
    }
  }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
in Hu, Lu & Jiang, Acta Mycol. Sin. 8(3): 184 (1989)

#### Original name
Meliola hainanensis Y.X. Hu

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Reuzze\ReuzzeBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Bids
 *
 * @ORM\Table(name="bids", indexes={@ORM\Index(name="fk_bids_users1_idx", columns={"user_id"}), @ORM\Index(name="fk_bids_entities1_idx", columns={"entity_id"})})
 * @ORM\Entity
 */
class Bids
{
    /**
     * @var integer
     *
     * @ORM\Column(name="bid_id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $bidId;

    /**
     * @var string
     *
     * @ORM\Column(name="bid_amount", type="decimal", precision=12, scale=2, nullable=false)
     */
    private $bidAmount;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="bid_date", type="datetime", nullable=false)
     */
    private $bidDate;

    /**
     * @var \Reuzze\ReuzzeBundle\Entity\Users
     *
     * @ORM\ManyToOne(targetEntity="Reuzze\ReuzzeBundle\Entity\Users")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="user_id", referencedColumnName="user_id")
     * })
     */
    private $user;

    /**
     * @var \Reuzze\ReuzzeBundle\Entity\Entities
     *
     * @ORM\ManyToOne(targetEntity="Reuzze\ReuzzeBundle\Entity\Entities")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="entity_id", referencedColumnName="entity_id")
     * })
     */
    private $entity;

    /**
     * Get bidId
     *
     * @return integer
     */
    public function getBidId()
    {
        return $this->bidId;
    }

    /**
     * Set bidAmount
     *
     * @param string $bidAmount
     * @return Bids
     */
    public function setBidAmount($bidAmount)
    {
        $this->bidAmount = $bidAmount;

        return $this;
    }

    /**
     * Get bidAmount
     *
     * @return string
     */
    public function getBidAmount()
    {
        return $this->bidAmount;
    }

    /**
     * Set bidDate
     *
     * @param \DateTime $bidDate
     * @return Bids
     */
    public function setBidDate($bidDate)
    {
        $this->bidDate = $bidDate;

        return $this;
    }

    /**
     * Get bidDate
     *
     * @return \DateTime
     */
    public function getBidDate()
    {
        return $this->bidDate;
    }

    /**
     * Set user
     *
     * @param \Reuzze\ReuzzeBundle\Entity\Users $user
     * @return Bids
     */
    public function setUser(\Reuzze\ReuzzeBundle\Entity\Users $user = null)
    {
        $this->user = $user;

        return $this;
    }

    /**
     * Get user
     *
     * @return \Reuzze\ReuzzeBundle\Entity\Users
     */
    public function getUser()
    {
        return $this->user;
    }

    /**
     * Set entity
     *
     * @param \Reuzze\ReuzzeBundle\Entity\Entities $entity
     * @return Bids
     */
    public function setEntity(\Reuzze\ReuzzeBundle\Entity\Entities $entity = null)
    {
        $this->entity = $entity;

        return $this;
    }

    /**
     * Get entity
     *
     * @return \Reuzze\ReuzzeBundle\Entity\Entities
     */
    public function getEntity()
    {
        return $this->entity;
    }
}


text:
<?php

declare(strict_types=1);

namespace blink\typing;

use blink\core\NotSupportedException;
use blink\typing\types\UnionType;

/**
 * Class Parser
 *
 * @package blink\typing
 */
class Parser
{
    protected Registry  $registry;
    protected Tokenizer $tokenizer;

    public function __construct(Registry $registry)
    {
        $this->registry  = $registry;
        $this->tokenizer = new Tokenizer();
    }

    /**
     * @param Token[] $tokens
     * @param int $pos
     * @return Type
     */
    protected function parseScalarType(array $tokens, int $pos): Type
    {
        $token = $tokens[$pos];

        $token->expect(Token::TEXT);

        return $this->registry->getType($token->getValue());
    }

    public function parse(string $definition): Type
    {
        $tokens = $this->tokenizer->tokenize($definition);

        if (empty($tokens)) {
            throw new SyntaxException('The type definition is empty');
        }

        return $this->parseInternal($tokens);
    }

    /**
     * @param Token[] $tokens
     * @param int $pos
     * @return Token[]
     */
    protected function findSubTokens(array $tokens, array $stopTypes, int $pos): array
    {
        $angles = $parentheses = [];

        for ($endPos = $pos; ; $endPos++) {
            $token = $tokens[$endPos] ?? null;
            if (!$token) {
                break;
            }

            if ($token->is(Token::OPEN_ANGLE)) {
                $angles[] = $endPos;
            } elseif ($token->is(Token::OPEN_PARENTHESES)) {
                $parentheses[] = $endPos;
            } elseif ($token->is(Token::CLOSE_ANGLE)) {
                array_pop($angles);
            } elseif ($token->is(Token::CLOSE_PARENTHESES)) {
                array_pop($parentheses);
            }

            if ($token->isAny($stopTypes) && empty($angles) && empty($parentheses)) {
                break;
            }
        }

        if (!empty($angles)) {
            throw new SyntaxException('The token < is not properly closed');
        }

        if (!empty($parentheses)) {
            throw new SyntaxException('The token ( is not properly closed');
        }

        return array_slice($tokens, $pos, $endPos - $pos);
    }

    /**
     * @param Token[] $tokens
     * @param int $pos
     * @return Type
     * @throws SyntaxException
     */
    public function parseInternal(array $tokens): Type
    {
        $pos = 0;

        if (count($tokens) === 1) {
            return $this->parseScalarType($tokens, $pos);
        }

        if ($tokens[$pos]->is(Token::TEXT)) {
            return $this->parseSimpleType($tokens);
        } elseif ($tokens[0]->is(Token::OPEN_PARENTHESES)) {
            return $this->parseTupleType($tokens);
        } else {
            throw new SyntaxException('Unexpected token ' . $tokens[0]->type());
        }
    }

    /**
     * @param Token[] $tokens
     * @return Type
     * @throws SyntaxException
     */
    protected function parseSimpleType(array $tokens): Type
    {
        $pos    = 0;
        $endPos = count($tokens) - 1;

        while ($endPos > $pos) {
            $token = $tokens[$pos];
            $next  = $tokens[$pos + 1];
            if ($next->is(Token::OPEN_ANGLE)) {
                $token->expect(Token::TEXT);
                $subTokens = $this->findSubTokens($tokens, [Token::CLOSE_ANGLE], $pos + 1);
                $parameterTypes = $this->parseGenericParameterTypes(array_slice($subTokens, 1));
                $subType        = $this->registry->genericOf($token->getValue(), $parameterTypes);
                if (!isset($type)) {
                    $type = $subType;
                } elseif ($type instanceof UnionType) {
                    $type->appendType($subType);
                } else {
                    $type = new UnionType(
                        $type,
                        $subType,
                    );
                }
                $pos += count($subTokens) + 1;
            } elseif ($next->is(Token::UNION)) {
                $subTokens = $this->findSubTokens($tokens, [Token::UNION], $pos + 2);
                $subType   = $this->parseInternal($subTokens);

                if (!isset($type)) {
                    $type = $this->registry->unionOf(
                        $this->parseScalarType($tokens, $pos),
                        $subType,
                    );
                } elseif ($type instanceof UnionType) {
                    $type->appendType($subType);
                } else {
                    $type = $this->registry->unionOf(
                        $type,
                        $subType,
                    );
                }

                $pos += count($subTokens) + 1;
            } else {
                throw new SyntaxException('Unexpected token ' . $next->type());
            }
        }

        return $type;
    }

    protected function parseTupleType(array $tokens): Type
    {
        throw new NotSupportedException('tuple type is not supported yet');
    }

    /**
     * @param Token[] $tokens
     * @return Type[]
     */
    protected function parseGenericParameterTypes(array $tokens): array
    {
        $pos    = 0;
        $endPos = count($tokens) - 1;
        $types  = [];

        while ($pos <= $endPos) {
            $subTokens = $this->findSubTokens($tokens, [Token::COMMA], $pos);
            $types[]   = $this->parseInternal($subTokens);
            $pos       += count($subTokens) + 1;
        }

        return $types;
    }
}


text:
//
//  WYPhotoViewCell.h
//  WYPhotoBrowse
//
//  Created by liyongfang on 2017/10/17.
//  Copyright © 2017年 liyongfang. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "WYPhotoBrowseModel.h"

@protocol WYPhotoViewCellDelegate <NSObject>
/**
 * @brief 单击手势点击
 */
- (void)clickSingleGesture;
/**
 * @brief 图片加载失败
 */
- (void)wyPhotoBrowseCellLoadImageFaliured;

@end

@interface WYPhotoViewCell : UICollectionViewCell
/** 模型 */
@property (nonatomic, strong) WYPhotoBrowseModel *model;
/** 图片 */
@property (nonatomic, strong) UIImageView *imageView;
/** 代理 */
@property (nonatomic, weak)id<WYPhotoViewCellDelegate>delegate;

@end


text:
<?php
namespace Topxia\Service\Sms\SmsProcessor;

use Topxia\Service\Common\ServiceKernel;

class BaseProcessor
{
    protected function getUsersMobile($userIds)
    {
        $mobiles = $this->getUserService()->findUnlockedUserMobilesByUserIds($userIds);
        $to      = implode(',', $mobiles);

        return $to;
    }

    protected function getUserService()
    {
        return ServiceKernel::instance()->createService('User.UserService');
    }

    protected function getSettingService()
    {
        return ServiceKernel::instance()->createService('System.SettingService');
    }
}


text:
package com.sprinklercontrol.model;

/**
 *
 * @author kyle
 */
public class TxMsgDeleteSchedule extends TxMsg {
    private ScheduleEntry entry;

    public TxMsgDeleteSchedule(ScheduleEntry entry) {
        this.entry = entry;
    }

    @Override
    public byte[] getBytes() {
        int days = 0;
        if (entry.daysOfWeek.contains(Day.M)) {
            days |= 0x2;
        } else if (entry.daysOfWeek.contains(Day.T)) {
            days |= 0x4;
        } else if (entry.daysOfWeek.contains(Day.W)) {
            days |= 0x8;
        } else if (entry.daysOfWeek.contains(Day.R)) {
            days |= 0x10;
        } else if (entry.daysOfWeek.contains(Day.F)) {
            days |= 0x20;
        } else if (entry.daysOfWeek.contains(Day.S)) {
            days |= 0x40;
        } else if (entry.daysOfWeek.contains(Day.U)) {
            days |= 0x80;
        }

        byte op = entry.open ? OPDELETESCHEDOPEN : OPDELETESCHEDCLOSE;
        byte[] retval = { TXSTART, op, (byte)entry.zone, (byte)entry.hour, (byte)entry.minute, (byte)days, (byte)entry.idx, FILL,
                                  FILL, FILL, FILL, FILL, FILL, FILL, FILL, FILL,
                                  FILL, FILL, FILL, TXEND};

        return retval;
    }
}