text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Phytopathology 18: 222 (1928)

#### Original name
Cylindrocladium macrosporum var. macrosporum Sherb.

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
package org.innovateuk.ifs.competition.documentation;

import org.innovateuk.ifs.BaseControllerMockMVCTest;
import org.innovateuk.ifs.competition.controller.CompetitionSearchController;
import org.innovateuk.ifs.competition.resource.CompetitionCountResource;
import org.innovateuk.ifs.competition.resource.search.CompetitionSearchResult;
import org.innovateuk.ifs.competition.transactional.CompetitionSearchService;
import org.junit.Test;
import org.mockito.Mock;

import java.util.ArrayList;

import static org.innovateuk.ifs.commons.service.ServiceResult.serviceSuccess;
import static org.innovateuk.ifs.competition.builder.UpcomingCompetitionSearchResultItemBuilder.newUpcomingCompetitionSearchResultItem;
import static org.mockito.Mockito.when;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

public class CompetitionSearchControllerDocumentation extends BaseControllerMockMVCTest<CompetitionSearchController> {
    @Mock
    private CompetitionSearchService competitionSearchService;

    @Override
    protected CompetitionSearchController supplyControllerUnderTest() {
        return new CompetitionSearchController();
    }

    @Test
    public void live() throws Exception {
        when(competitionSearchService.findLiveCompetitions()).thenReturn(serviceSuccess(new ArrayList<>(newUpcomingCompetitionSearchResultItem().build(2))));

        mockMvc.perform(get("/competition/live")
                .header("IFS_AUTH_TOKEN", "123abc"))
                .andExpect(status().isOk());
    }

    @Test
    public void projectSetup() throws Exception {
        CompetitionSearchResult results = new CompetitionSearchResult();
        int page = 1;
        int size = 20;
        when(competitionSearchService.findProjectSetupCompetitions(page, size)).thenReturn(serviceSuccess(results));

        mockMvc.perform(get("/competition/project-setup")
                .param("page", String.valueOf(page))
                .param("size", String.valueOf(size))
                .header("IFS_AUTH_TOKEN", "123abc"))
                .andExpect(status().isOk());
    }

    @Test
    public void upcoming() throws Exception {
        when(competitionSearchService.findUpcomingCompetitions()).thenReturn(serviceSuccess(new ArrayList<>(newUpcomingCompetitionSearchResultItem().build(2))));

        mockMvc.perform(get("/competition/upcoming")
                .header("IFS_AUTH_TOKEN", "123abc"))
                .andExpect(status().isOk());
    }

    @Test
    public void nonIfs() throws Exception {
        CompetitionSearchResult results = new CompetitionSearchResult();
        int page = 1;
        int size = 20;
        when(competitionSearchService.findNonIfsCompetitions(page, size)).thenReturn(serviceSuccess(results));

        mockMvc.perform(get("/competition/non-ifs")
                .param("page", String.valueOf(page))
                .param("size", String.valueOf(size))
                .header("IFS_AUTH_TOKEN", "123abc"))
                .andExpect(status().isOk());
    }

    @Test
    public void count() throws Exception {
        CompetitionCountResource resource = new CompetitionCountResource();
        when(competitionSearchService.countCompetitions()).thenReturn(serviceSuccess(resource));

        mockMvc.perform(get("/competition/count")
                .header("IFS_AUTH_TOKEN", "123abc"))
                .andExpect(status().isOk());
    }

    @Test
    public void search() throws Exception {
        CompetitionSearchResult results = new CompetitionSearchResult();
        String searchQuery = "test";
        int page = 1;
        int size = 20;
        when(competitionSearchService.searchCompetitions(searchQuery, page, size)).thenReturn(serviceSuccess(results));

        mockMvc.perform(get("/competition/search")
                .param("searchQuery", searchQuery)
                .param("page", String.valueOf(page))
                .param("size", String.valueOf(size))
                .header("IFS_AUTH_TOKEN", "123abc"))
                .andExpect(status().isOk());
    }

    @Test
    public void feedbackReleased() throws Exception {
        CompetitionSearchResult results = new CompetitionSearchResult();
        int page = 1;
        int size = 20;
        when(competitionSearchService.findPreviousCompetitions(page, size)).thenReturn(serviceSuccess(results));

        mockMvc.perform(get("/competition/post-submission/feedback-released")
                .param("page", String.valueOf(page))
                .param("size", String.valueOf(size))
                .header("IFS_AUTH_TOKEN", "123abc"))
                .andExpect(status().isOk());
    }
}


text:
package dummy

import (
	"encoding/json"
	"errors"
	"fmt"
	"github.com/scritch007/ShareMinatorApiGenerator/api"
	"github.com/scritch007/go-tools"
	"github.com/scritch007/shareit/types"
	"io/ioutil"
	"os"
	"path"
	//"path/filepath"
	"strconv"
	"strings"
	"sync"
	//"github.com/scritch007/shareit/database"
)

const (
	Name string = "DummyDb"
)

type pathAccesses struct {
	Accesses map[string]api.AccessType
}

type DummyDatabase struct {
	DbFolder       string `json:"db_folder"`
	commandsList   []*types.Command
	commandIndex   int
	downloadLinks  map[string]*types.DownloadLink
	accounts       []*types.Account
	accountsId     int
	accountsDBPath string
	sessionMap     map[string]*types.Session
	shareLinkMap   map[string]*types.ShareLink
	shareLinkPath  string
	accesses       map[string]*pathAccesses
	accessPath     string
	lock           sync.RWMutex
}

func NewDummyDatabase(config *json.RawMessage) (d *DummyDatabase, err error) {
	d = new(DummyDatabase)
	d.commandsList = make([]*types.Command, 10)
	d.commandIndex = 0
	d.downloadLinks = make(map[string]*types.DownloadLink)
	d.sessionMap = make(map[string]*types.Session)
	if err = json.Unmarshal(*config, d); nil != err {
		return nil, err
	}
	//Prepare the folder
	if _, err := os.Stat(d.DbFolder); err != nil {
		if os.IsNotExist(err) {
			tools.LOG_ERROR.Println("Error: the path %s, doesn't exist", d.DbFolder)
		} else {
			tools.LOG_ERROR.Println("Error: Something went wrong when accessing to %s, %v", d.DbFolder, err)
		}
		return nil, err
	}
	d.accountsDBPath = path.Join(d.DbFolder, "accounts.json")
	if _, err := os.Stat(d.accountsDBPath); err != nil {
		var fo *os.File
		if os.IsNotExist(err) {
			fo, err = os.Create(d.accountsDBPath)
			if nil != err {
				return nil, err
			}
			fo.Close()
		} else {
			return nil, err
		}
		d.accounts = make([]*types.Account, 10)
		d.accountsId = 0
		d.saveDb()
	} else {
		file, err := ioutil.ReadFile(d.accountsDBPath)
		if err != nil {
			return nil, err
		}
		err = json.Unmarshal(file, &d.accounts)
		if nil != err {
			return nil, err
		}
		d.accountsId = len(d.accounts)
		if 0 == d.accountsId {
			//Special case we need to allocate some memory anyway
			d.accounts = make([]*types.Account, 10)
		}
	}
	d.shareLinkPath = path.Join(d.DbFolder, "share_links.json")
	if _, err := os.Stat(d.shareLinkPath); err != nil {
		var fo *os.File
		if os.IsNotExist(err) {
			fo, err = os.Create(d.shareLinkPath)
			if nil != err {
				return nil, err
			}
			fo.Close()
		} else {
			return nil, err
		}
		d.shareLinkMap = make(map[string]*types.ShareLink)
		d.saveDb()
	} else {
		file, err := ioutil.ReadFile(d.shareLinkPath)
		if err != nil {
			return nil, err
		}
		err = json.Unmarshal(file, &d.shareLinkMap)
		if nil != err {
			return nil, err
		}
	}
	d.accessPath = path.Join(d.DbFolder, "access.json")
	if _, err := os.Stat(d.accessPath); err != nil {
		var fo *os.File
		if os.IsNotExist(err) {
			fo, err = os.Create(d.accessPath)
			if nil != err {
				return nil, err
			}
			fo.Close()
		} else {
			return nil, err
		}
		d.accesses = make(map[string]*pathAccesses)
		d.saveDb()
	} else {
		file, err := ioutil.ReadFile(d.accessPath)
		if err != nil {
			return nil, err
		}
		err = json.Unmarshal(file, &d.accesses)
		if nil != err {
			return nil, err
		}
	}
	return d, nil
}

func (d *DummyDatabase) Name() string {
	return Name
}

type LogLevel int

const (
	DEBUG LogLevel = iota
	INFO
	WARNING
	ERROR
)

func (d *DummyDatabase) Log(level LogLevel, message string) {
	switch level {
	case DEBUG:
		tools.LOG_DEBUG.Println("DummyDb: ", message)
	case INFO:
		tools.LOG_INFO.Println("DummyDb: ", message)
	case WARNING:
		tools.LOG_WARNING.Println("DummyDb: ", message)
	case ERROR:
		tools.LOG_ERROR.Println("DummyDb: ", message)
	}
}
func (d *DummyDatabase) SaveCommand(command *types.Command) (err error) {
	d.lock.Lock()
	defer d.lock.Unlock()
	if 0 == len(command.ApiCommand.CommandId) {
		d.commandsList[d.commandIndex] = command
		command.ApiCommand.CommandId = strconv.Itoa(d.commandIndex)
		command.CommandId = strconv.Itoa(d.commandIndex)
		d.commandIndex += 1
		if len(d.commandsList) == d.commandIndex {
			new_list := make([]*types.Command, len(d.commandsList)*2)
			for i, comm := range d.commandsList {
				new_list[i] = comm
			}
			d.commandsList = new_list
		}
	}
	d.Log(DEBUG, fmt.Sprintf("%s : %s", "Saved new Command", command.ApiCommand.Name))
	return nil
}
func (d *DummyDatabase) ListCommands(user *string, offset int, limit int, search_parameters *api.CommandsSearchParameters) ([]*types.Command, int, error) {
	d.lock.RLock()
	defer d.lock.RUnlock()
	tempResult := make([]*types.Command, d.commandIndex) // Maximum size this could have
	nbResult := 0
	for _, elem := range d.commandsList[0:d.commandIndex] {
		if elem.User == user {
			tempResult[nbResult] = elem
			nbResult += 1
		}
	}
	return tempResult[0:nbResult], nbResult, nil
}
func (d *DummyDatabase) GetCommand(ref string) (command *types.Command, err error) {
	d.lock.RLock()
	defer d.lock.RUnlock()
	command_id, err := strconv.ParseInt(ref, 0, 0)
	if nil != err {
		return nil, err
	}
	command = d.commandsList[command_id]
	return command, nil
}

func (d *DummyDatabase) DeleteCommand(ref *string) error {
	d.lock.Lock()
	defer d.lock.Unlock()
	return nil
}
func (d *DummyDatabase) AddDownloadLink(link *types.DownloadLink) (err error) {
	d.lock.Lock()
	defer d.lock.Unlock()
	d.Log(DEBUG, fmt.Sprintf("%s: %s", "Saving download link", link))
	d.downloadLinks[link.Link] = link
	return nil
}
func (d *DummyDatabase) GetDownloadLink(ref string) (link *types.DownloadLink, err error) {
	d.lock.RLock()
	defer d.lock.RUnlock()
	res, found := d.downloadLinks[ref]
	if !found {
		d.Log(ERROR, fmt.Sprintf("%s, %s", "Couldn't find download link", ref))
		return nil, errors.New(fmt.Sprintf("%s: %s", "Couldn't find this downloadLink", ref))
	}
	return res, nil
}

func (d *DummyDatabase) AddAccount(account *types.Account) (err error) {
	d.lock.Lock()
	defer d.lock.Unlock()
	i := 0
	var item *types.Account
	//Iter once to check if same user already exists
	for i < d.accountsId {
		item = d.accounts[i]
		i += 1
		if (item.Login == account.Login) || (item.Email == account.Email) {
			return errors.New("Account already exists")
		}
	}

	if len(d.accounts) == d.accountsId {
		new_list := make([]*types.Account, len(d.accounts)*2)
		for i, comm := range d.accounts {
			new_list[i] = comm
		}
		d.accounts = new_list
	}
	//Todo Check that no other account has the same (Id, authType)
	d.accounts[d.accountsId] = account
	account.Id = account.Email
	d.accountsId += 1

	d.Log(DEBUG, fmt.Sprintf("%s : %s", "Saved new Account", account))

	return d.saveDb()
}

func (d *DummyDatabase) GetAccount(authType string, ref string) (account *types.Account, id string, err error) {
	d.lock.RLock()
	defer d.lock.RUnlock()
	for i, elem := range d.accounts[0:d.accountsId] {
		if (ref == elem.Email) || (ref == elem.Login) {
			if 0 == len(authType) {
				// No authType specified, this should only be for internal use...
				return elem, strconv.Itoa(i), nil
			}
			_, found := elem.Auths[authType]
			if !found {
				message := fmt.Sprintf("Couldn't find this kind of authentication %s for %s", authType, ref)
				d.Log(ERROR, message)
				return nil, "", errors.New(message)
			}
			return elem, strconv.Itoa(i), nil
		}
	}
	message := fmt.Sprintf("Couldn't find the desired account %s:%s", authType, ref)
	d.Log(ERROR, message)
	return nil, "", errors.New(message)
}

func (d *DummyDatabase) UpdateAccount(id string, account *types.Account) (err error) {
	d.lock.Lock()
	defer d.lock.Unlock()
	account_id, err := strconv.ParseInt(id, 0, 0)
	if nil != err {
		return err
	}
	d.accounts[account_id] = account
	return nil
}

func (d *DummyDatabase) GetUserAccount(id string) (account *types.Account, err error) {
	d.lock.RLock()
	defer d.lock.RUnlock()
	for _, elem := range d.accounts[0:d.accountsId] {
		d.Log(DEBUG, fmt.Sprintf("Looking for %s comparing with %s", id, elem.Id))
		if id == elem.Id {
			return elem, nil
		}
	}
	message := fmt.Sprintf("Couldn't find the desired account %s", id)
	d.Log(ERROR, message)
	return nil, errors.New(message)
}

func (d *DummyDatabase) ListAccounts(searchDict map[string]string) (accounts []*types.Account, err error) {
	d.lock.RLock()
	defer d.lock.RUnlock()
	if 0 == len(searchDict) {
		d.Log(DEBUG, "No search parameters")
		return d.accounts[0:d.accountsId], nil
	}
	d.Log(DEBUG, fmt.Sprintf("We had some search parameters ", searchDict))

	accounts = make([]*types.Account, d.accountsId)

	i := 0
	for _, account := range d.accounts[0:d.accountsId] {
		for k, v := range searchDict {
			switch k {
			case "login":
				if strings.Contains(account.Login, v) {
					accounts[i] = account
					break
				}
			case "email":
				if strings.Contains(account.Email, v) {

					accounts[i] = account
					i += 1
					break
				}
			case "id":
				if strings.Contains(account.Id, v) {
					accounts[i] = account
					i += 1
					break
				}
			}
		}
	}
	return accounts[0:i], nil
}

func (d *DummyDatabase) StoreSession(session *types.Session) (err error) {
	d.lock.Lock()
	defer d.lock.Unlock()
	d.sessionMap[session.AuthenticationHeader] = session
	return nil
}
func (d *DummyDatabase) GetSession(ref string) (session *types.Session, err error) {
	d.lock.RLock()
	defer d.lock.RUnlock()
	session, found := d.sessionMap[ref]
	if !found {
		return nil, errors.New("Couldn't find session")
	}
	return session, nil
}

func (d *DummyDatabase) RemoveSession(ref string) (err error) {
	d.lock.Lock()
	defer d.lock.Unlock()
	delete(d.sessionMap, ref)
	return nil
}

func (d *DummyDatabase) SaveShareLink(shareLink *types.ShareLink) (err error) {
	d.lock.Lock()
	defer d.lock.Unlock()
	//TODO check if there is already a sharelink with this name and user
	shareLink.Id = *shareLink.ShareLink.Key
	d.shareLinkMap[*shareLink.ShareLink.Key] = shareLink
	return d.saveDb()
}

func (d *DummyDatabase) UpdateShareLink(shareLink *types.ShareLink) (err error) {
	d.lock.Lock()
	defer d.lock.Unlock()
	//TODO check if there is already a sharelink with this name and user
	shareLink.Id = *shareLink.ShareLink.Key
	d.shareLinkMap[*shareLink.ShareLink.Key] = shareLink
	return d.saveDb()
}

func (d *DummyDatabase) GetShareLink(key string) (shareLink *types.ShareLink, err error) {
	d.lock.RLock()
	defer d.lock.RUnlock()
	shareLink, found := d.shareLinkMap[key]
	if !found {
		message := fmt.Sprintf("Couldn't find share link %s", key)
		d.Log(ERROR, message)
		return nil, errors.New(message)
	}
	return shareLink, nil
}
func (d *DummyDatabase) RemoveShareLink(key string) (err error) {
	d.lock.Lock()
	defer d.lock.Unlock()
	delete(d.shareLinkMap, key)
	return d.saveDb()
}
func (d *DummyDatabase) ListShareLinks(user string) (shareLinks []*types.ShareLink, err error) {
	d.lock.RLock()
	defer d.lock.RUnlock()
	shareLinks = make([]*types.ShareLink, 30)
	currentId := 0
	for _, shareLink := range d.shareLinkMap {
		if shareLink.User == user {
			shareLinks[currentId] = shareLink
			currentId += 1
			if currentId == len(shareLinks) {
				new_list := make([]*types.ShareLink, len(shareLinks)*2)
				for i, comm := range shareLinks {
					new_list[i] = comm
				}
				shareLinks = new_list
			}
		}
	}
	return shareLinks, err
}

func (d *DummyDatabase) GetShareLinksFromPath(path string, user string) (shareLink []*types.ShareLink, err error) {
	d.lock.RLock()
	defer d.lock.RUnlock()
	return d.getShareLinksFromPath(path, user)
}

func (d *DummyDatabase) getShareLinksFromPath(path string, user string) (shareLinks []*types.ShareLink, err error) {
	shareLinks = make([]*types.ShareLink, 0, 10)
	var count = 0
	for _, shareLink := range d.shareLinkMap {
		if *shareLink.ShareLink.Path == path && shareLink.User == user {
			shareLinks = shareLinks[0 : count+1]
			shareLinks[count] = shareLink
			count += 1
			if count == cap(shareLinks) {
				newSlice := make([]*types.ShareLink, len(shareLinks), 2*cap(shareLinks))
				for i := range shareLinks {
					newSlice[i] = shareLinks[i]
				}
				shareLinks = newSlice
			}
		}
	}
	return shareLinks, nil
}

func (d *DummyDatabase) saveDb() error {
	//d.lock.Lock()
	//defer d.lock.Unlock()
	serialized, err := json.Marshal(d.shareLinkMap)
	if nil != err {
		d.Log(ERROR, "Couldn't serialize share links...")
		return err
	}

	var fo *os.File
	fo, err = os.OpenFile(d.shareLinkPath, os.O_WRONLY, os.ModePerm)
	if nil != err {
		return err
	}
	nbWriten, err := fo.Write(serialized)
	fo.Close()
	if nbWriten != len(serialized) {
		d.Log(ERROR, "Couldn't write serialized object")
		return errors.New("Couldn't write serialized object")
	}

	serialized, err = json.Marshal(d.accounts[0:d.accountsId])
	if nil != err {
		d.Log(ERROR, "Couldn't serialize accounts list...")
		return err
	}

	fo, err = os.OpenFile(d.accountsDBPath, os.O_WRONLY, os.ModePerm)
	if nil != err {
		return err
	}
	nbWriten, err = fo.Write(serialized)
	fo.Close()
	if nbWriten != len(serialized) {
		d.Log(ERROR, "Couldn't write serialized object")
		return errors.New("Couldn't write serialized object")
	}

	serialized, err = json.Marshal(d.accesses)
	if nil != err {
		d.Log(ERROR, "Couldn't serialize accesses...")
		return err
	}

	fo, err = os.OpenFile(d.accessPath, os.O_WRONLY, os.ModePerm)
	if nil != err {
		return err
	}
	nbWriten, err = fo.Write(serialized)
	fo.Close()
	if nbWriten != len(serialized) {
		d.Log(ERROR, "Couldn't write serialized object")
		return errors.New("Couldn't write serialized object")
	}

	return nil
}

func (d *DummyDatabase) GetAccess(user *string, path string) (api.AccessType, error) {
	d.lock.RLock()
	defer d.lock.RUnlock()
	return d.getAccess(user, path)
}

func (d *DummyDatabase) getAccess(user *string, path string) (api.AccessType, error) {
	var user_email string
	if nil == user {
		user_email = ""
	} else {
		user_email = *user
	}
	accesses, found := d.accesses[user_email]
	if !found {
		// If user is not Nil then look for the public accesses
		if nil == user {
			return api.NONE, nil
		}
		accesses, found = d.accesses[""]
		if !found {
			return api.NONE, nil
		}
	}
	//Now check for the path
	splittedPath := strings.Split(path, "/")
	finalAccessType := api.NONE
	for i := len(splittedPath); i > 0; i-- {
		accessType, found := accesses.Accesses[strings.Join(splittedPath[:i], "/")]
		tools.LOG_DEBUG.Println("Looking for access to ", strings.Join(splittedPath[:i], "/"))
		if found {
			finalAccessType = accessType
			break
		}
	}
	if api.NONE == finalAccessType && nil != user {
		return d.getAccess(nil, path)
	}

	return finalAccessType, nil
}
func (d *DummyDatabase) SetAccess(user *string, path string, access api.AccessType) error {
	d.lock.Lock()
	defer d.lock.Unlock()
	var user_email string
	if nil == user {
		user_email = ""
	} else {
		user_email = *user
	}

	accesses, found := d.accesses[user_email]
	if !found {
		//Create accessPath dict
		accesses = new(pathAccesses)
		accesses.Accesses = make(map[string]api.AccessType)
		accesses.Accesses[path] = access
		d.accesses[user_email] = accesses
	}

	accesses.Accesses[path] = access
	d.saveDb()
	return nil
}

func (d *DummyDatabase) ClearAccesses() error {
	d.lock.Lock()
	defer d.lock.Unlock()
	d.accesses = make(map[string]*pathAccesses)
	d.saveDb()
	return nil
}


text:
	{{ date('Y', time()) }} {!! trans('base::common.copyright_text', ['link' => trans('base::common.copyright_link')]) !!}

	@if(env('APP_DEBUG') && Auth::user())

	@endif

		<notification :notification="notification" :key="index"
					  v-for="(notification, index) in notifications"></notification>

@yield('scripts')


text:
package edu.upc.eetac.dsa.where;

import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;

import com.google.gson.Gson;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.io.StringWriter;

import edu.upc.eetac.dsa.where.Client.Entity.Restaurant;
import edu.upc.eetac.dsa.where.Client.Entity.RestaurantCollection;
import edu.upc.eetac.dsa.where.Client.WhereClient;
import edu.upc.eetac.dsa.where.Client.WhereClientException;

/**
 * Created by Carolina on 18/01/2016.
 */
public class RestaurantListActivity extends AppCompatActivity {

    private final static String TAG = RestaurantListActivity.class.toString();
    private GetStingsTask mGetStingsTask = null;
    private RestaurantCollection restaurants = new RestaurantCollection();
    private RestaurantCollectionAdapter adapter = null;

    class GetStingsTask extends AsyncTask<Void, Void, String> {
        private String uri;

        public GetStingsTask(String uri) {
            this.uri = uri;
        }

        @Override
        protected String doInBackground(Void... params) {
            String jsonRestaurantCollection = null;
            try{
                jsonRestaurantCollection = WhereClient.getInstance().getRestaurants(uri);
                Log.d("CAROL", jsonRestaurantCollection);
            }catch(WhereClientException e){
                // TODO: Handle gracefully
                Log.d(TAG, e.getMessage());
            }
            return jsonRestaurantCollection;
        }

        @Override
        protected void onPostExecute(String RestCollect) {
            JSONObject jo = null;
            JSONArray resta = null;
            try {
                jo = new JSONObject(RestCollect);
                resta = jo.getJSONArray("restaurants");
            } catch (JSONException e) {
                e.printStackTrace();
            }
            Log.d("CAROL LINK", resta.toString());
            RestaurantCollection restCollection = (new Gson()).fromJson(RestCollect , RestaurantCollection.class);

            for(Restaurant rest : restCollection.getRestaurants()){
                restaurants.getRestaurants().add(restaurants.getRestaurants().size(), rest);
            }
            adapter.notifyDataSetChanged();
        }
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_restaurants_list);

        // Execute AsyncTask
        mGetStingsTask = new GetStingsTask(null);
        mGetStingsTask.execute((Void) null);

        // set list adapter
        ListView list = (ListView)findViewById(R.id.list);
        adapter = new RestaurantCollectionAdapter(this, restaurants);
        list.setAdapter(adapter);

        // set list OnItemClick listener
        list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                Intent intent = new Intent(RestaurantListActivity.this, RestaurantDetailActivity.class);
                String uri = WhereClient.getLink(restaurants.getRestaurants().get(position).getLinks(), "self").getUri().toString();
                intent.putExtra("uri", uri);
                startActivity(intent);
            }
        });

    }

}


text:
(function () {
	'use strict';

	// Find first ancestor of el with tagName, or undefined if not found
	function upTo(el, tagName) {
		tagName = tagName.toLowerCase();

		while (el && el.parentNode) {
			el = el.parentNode;
			if (el.tagName && el.tagName.toLowerCase() === tagName) {
				return el;
			}
		}

		return null;
	}

	Polymer({
		is: 'lfg-soundpanel',
		properties: {
			bundle: {
				type: String,
				observer: 'bundleChanged'
			}
		},

		/*
		 * Lifecycle
		 */

		ready() {
			const self = this;
			const soundsRep = NodeCG.Replicant('sounds', 'lfg-sounds');
			soundsRep.on('change', (oldVal, newVal) => {
				// If there is an existing <lfg-soundpanel-sound> element for this sound, edit that.
				// Otherwise, make a new one and add it to the DOM.
				newVal.forEach(sound => {
					const existingEl = self.$$(`lfg-soundpanel-sound[name="${sound.name}"]`);
					if (existingEl) {
						existingEl.volume = sound.volume;
						existingEl.file = sound.file;
					} else {
						const newEl = document.createElement('lfg-soundpanel-sound');
						newEl.name = sound.name;
						newEl.volume = sound.volume;
						newEl.file = sound.file;
						Polymer.dom(self.root).appendChild(newEl);
					}
				});

				// If there is an element for a sound that no longer exists, remove it.
				Polymer.dom(self.root).querySelectorAll('lfg-soundpanel-sound').forEach(el => {
					const foundCorrespondingSound = newVal.some(sound => {
						return sound.name === el.name;
					});

					if (!foundCorrespondingSound) {
						Polymer.dom(self.root).removeChild(el);
					}
				});
			});

			this.addEventListener('change', e => {
				const soundEl = upTo(e.target, 'lfg-soundpanel-sound');

				// Update the replicant with the new volume and file
				soundsRep.value.some((sound, idx) => {
					if (sound.name === soundEl.name) {
						soundsRep.value[idx].volume = soundEl.volume;
						soundsRep.value[idx].file = soundEl.file;
						return true;
					}

					return false;
				});
			});
		}
	});
})();


text:
namespace blink {

class CustomElementReaction;
class Element;

class CORE_EXPORT CustomElementReactionQueue final
    : public GarbageCollectedFinalized<CustomElementReactionQueue> {
  WTF_MAKE_NONCOPYABLE(CustomElementReactionQueue);

 public:
  CustomElementReactionQueue();
  ~CustomElementReactionQueue();

  DECLARE_TRACE();

  void add(CustomElementReaction*);
  void invokeReactions(Element*);
  bool isEmpty() { return m_reactions.isEmpty(); }
  void clear();

 private:
  HeapVector<Member<CustomElementReaction>, 1> m_reactions;
  size_t m_index;
};

}  // namespace blink

#endif  // CustomElementReactionQueue_h


text:
package uk.ac.ebi.pride.jmztab.utils;

import uk.ac.ebi.pride.jmztab.utils.errors.MZTabErrorList;

/**
 * Provide semantic validation for mzTab file.
 */
public class MZTabFileValidator {
    private MZTabErrorList errorList;

    public MZTabFileValidator(MZTabErrorList errorList) {
        this.errorList = errorList == null ? new MZTabErrorList() : errorList;
    }

}


text:
package core

import (
	"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/oci/oci-go-sdk/v43/common"
)

// ChangeBootVolumeBackupCompartmentDetails Contains the details for the compartment to move the boot volume backup to.
type ChangeBootVolumeBackupCompartmentDetails struct {

	// The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment to move the boot volume backup to.
	CompartmentId *string `mandatory:"true" json:"compartmentId"`
}

func (m ChangeBootVolumeBackupCompartmentDetails) String() string {
	return common.PointerString(m)
}


text:
(function webpackUniversalModuleDefinition(root, factory) {
	if(typeof exports === 'object' && typeof module === 'object')
		module.exports = factory(require("babylonjs"));
	else if(typeof define === 'function' && define.amd)
		define("babylonjs-materials", ["babylonjs"], factory);
	else if(typeof exports === 'object')
		exports["babylonjs-materials"] = factory(require("babylonjs"));
	else
		root["MATERIALS"] = factory(root["BABYLON"]);
})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__) {
return /******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId]) {
/******/ 			return installedModules[moduleId].exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			i: moduleId,
/******/ 			l: false,
/******/ 			exports: {}
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.l = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// define getter function for harmony exports
/******/ 	__webpack_require__.d = function(exports, name, getter) {
/******/ 		if(!__webpack_require__.o(exports, name)) {
/******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ 		}
/******/ 	};
/******/
/******/ 	// define __esModule on exports
/******/ 	__webpack_require__.r = function(exports) {
/******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 		}
/******/ 		Object.defineProperty(exports, '__esModule', { value: true });
/******/ 	};
/******/
/******/ 	// create a fake namespace object
/******/ 	// mode & 1: value is a module id, require it
/******/ 	// mode & 2: merge all properties of value into the ns
/******/ 	// mode & 4: return value when already ns object
/******/ 	// mode & 8|1: behave like require
/******/ 	__webpack_require__.t = function(value, mode) {
/******/ 		if(mode & 1) value = __webpack_require__(value);
/******/ 		if(mode & 8) return value;
/******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ 		var ns = Object.create(null);
/******/ 		__webpack_require__.r(ns);
/******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ 		return ns;
/******/ 	};
/******/
/******/ 	// getDefaultExport function for compatibility with non-harmony modules
/******/ 	__webpack_require__.n = function(module) {
/******/ 		var getter = module && module.__esModule ?
/******/ 			function getDefault() { return module['default']; } :
/******/ 			function getModuleExports() { return module; };
/******/ 		__webpack_require__.d(getter, 'a', getter);
/******/ 		return getter;
/******/ 	};
/******/
/******/ 	// Object.prototype.hasOwnProperty.call
/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "";
/******/
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = "./legacy/legacy-shadowOnly.ts");
/******/ })
/************************************************************************/
/******/ ({

/***/ "../../node_modules/tslib/tslib.es6.js":
/*!***********************************************************!*\
  !*** C:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
  \***********************************************************/
/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__extends", function() { return __extends; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__assign", function() { return __assign; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__rest", function() { return __rest; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__decorate", function() { return __decorate; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__param", function() { return __param; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__metadata", function() { return __metadata; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__awaiter", function() { return __awaiter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__generator", function() { return __generator; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__exportStar", function() { return __exportStar; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spreadArrays", function() { return __spreadArrays; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncValues", function() { return __asyncValues; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__makeTemplateObject", function() { return __makeTemplateObject; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importStar", function() { return __importStar; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importDefault", function() { return __importDefault; });
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0

THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.

See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/* global Reflect, Promise */

var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return extendStatics(d, b);
};

function __extends(d, b) {
    extendStatics(d, b);
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}

var __assign = function() {
    __assign = Object.assign || function __assign(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
        }
        return t;
    }
    return __assign.apply(this, arguments);
}

function __rest(s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
}

function __decorate(decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
}

function __param(paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
}

function __metadata(metadataKey, metadataValue) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
}

function __awaiter(thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
}

function __generator(thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
}

function __exportStar(m, exports) {
    for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}

function __values(o) {
    var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
    if (m) return m.call(o);
    return {
        next: function () {
            if (o && i >= o.length) o = void 0;
            return { value: o && o[i++], done: !o };
        }
    };
}

function __read(o, n) {
    var m = typeof Symbol === "function" && o[Symbol.iterator];
    if (!m) return o;
    var i = m.call(o), r, ar = [], e;
    try {
        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
    }
    catch (error) { e = { error: error }; }
    finally {
        try {
            if (r && !r.done && (m = i["return"])) m.call(i);
        }
        finally { if (e) throw e.error; }
    }
    return ar;
}

function __spread() {
    for (var ar = [], i = 0; i < arguments.length; i++)
        ar = ar.concat(__read(arguments[i]));
    return ar;
}

function __spreadArrays() {
    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
    for (var r = Array(s), k = 0, i = 0; i < il; i++)
        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
            r[k] = a[j];
    return r;
};

function __await(v) {
    return this instanceof __await ? (this.v = v, this) : new __await(v);
}

function __asyncGenerator(thisArg, _arguments, generator) {
    if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
    var g = generator.apply(thisArg, _arguments || []), i, q = [];
    return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
    function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
    function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
    function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
    function fulfill(value) { resume("next", value); }
    function reject(value) { resume("throw", value); }
    function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
}

function __asyncDelegator(o) {
    var i, p;
    return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
    function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
}

function __asyncValues(o) {
    if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
    var m = o[Symbol.asyncIterator], i;
    return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
    function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
    function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
}

function __makeTemplateObject(cooked, raw) {
    if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
    return cooked;
};

function __importStar(mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result.default = mod;
    return result;
}

function __importDefault(mod) {
    return (mod && mod.__esModule) ? mod : { default: mod };
}

/***/ }),

/***/ "../../node_modules/webpack/buildin/global.js":
/*!***********************************!*\
  !*** (webpack)/buildin/global.js ***!
  \***********************************/
/*! no static exports found */
/***/ (function(module, exports) {

var g;

// This works in non-strict mode
g = (function() {
	return this;
})();

try {
	// This works if eval is allowed (see CSP)
	g = g || new Function("return this")();
} catch (e) {
	// This works if the window reference is available
	if (typeof window === "object") g = window;
}

// g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}

module.exports = g;

/***/ }),

/***/ "./legacy/legacy-shadowOnly.ts":
/*!*************************************!*\
  !*** ./legacy/legacy-shadowOnly.ts ***!
  \*************************************/
/*! exports provided: ShadowOnlyMaterial */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var _shadowOnly_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../shadowOnly/index */ "./shadowOnly/index.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ShadowOnlyMaterial", function() { return _shadowOnly_index__WEBPACK_IMPORTED_MODULE_0__["ShadowOnlyMaterial"]; });

/**
 * This is the entry point for the UMD module.
 * The entry point for a future ESM package should be index.ts
 */
var globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : undefined);
if (typeof globalObject !== "undefined") {
    for (var key in _shadowOnly_index__WEBPACK_IMPORTED_MODULE_0__) {
        globalObject.BABYLON[key] = _shadowOnly_index__WEBPACK_IMPORTED_MODULE_0__[key];
    }
}

/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node_modules/webpack/buildin/global.js */ "../../node_modules/webpack/buildin/global.js")))

/***/ }),

/***/ "./shadowOnly/index.ts":
/*!*****************************!*\
  !*** ./shadowOnly/index.ts ***!
  \*****************************/
/*! exports provided: ShadowOnlyMaterial */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _shadowOnlyMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./shadowOnlyMaterial */ "./shadowOnly/shadowOnlyMaterial.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ShadowOnlyMaterial", function() { return _shadowOnlyMaterial__WEBPACK_IMPORTED_MODULE_0__["ShadowOnlyMaterial"]; });

/***/ }),

/***/ "./shadowOnly/shadowOnly.fragment.ts":
/*!*******************************************!*\
  !*** ./shadowOnly/shadowOnly.fragment.ts ***!
  \*******************************************/
/*! exports provided: shadowOnlyPixelShader */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shadowOnlyPixelShader", function() { return shadowOnlyPixelShader; });
/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);

var name = 'shadowOnlyPixelShader';
var shader = "precision highp float;\n\nuniform vec3 vEyePosition;\nuniform float alpha;\nuniform vec3 shadowColor;\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n\n#include<helperFunctions>\n\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n\n#include<fogFragmentDeclaration>\nvoid main(void) {\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition-vPositionW);\n\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n\nvec3 diffuseBase=vec3(0.,0.,0.);\nlightingInfo info;\nfloat shadow=1.;\nfloat glossiness=0.;\n#include<lightFragment>[0..1]\n\nvec4 color=vec4(shadowColor,(1.0-clamp(shadow,0.,1.))*alpha);\n#include<fogFragment>\ngl_FragColor=color;\n}";
babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader;
/** @hidden */
var shadowOnlyPixelShader = { name: name, shader: shader };

/***/ }),

/***/ "./shadowOnly/shadowOnly.vertex.ts":
/*!*****************************************!*\
  !*** ./shadowOnly/shadowOnly.vertex.ts ***!
  \*****************************************/
/*! exports provided: shadowOnlyVertexShader */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shadowOnlyVertexShader", function() { return shadowOnlyVertexShader; });
/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);

var name = 'shadowOnlyVertexShader';
var shader = "precision highp float;\n\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#include<bonesDeclaration>\n\n#include<instancesDeclaration>\nuniform mat4 view;\nuniform mat4 viewProjection;\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\nvoid main(void) {\n#include<instancesVertex>\n#include<bonesVertex>\nvec4 worldPos=finalWorld*vec4(position,1.0);\ngl_Position=viewProjection*worldPos;\nvPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n\n#include<clipPlaneVertex>\n\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n}\n";
babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader;
/** @hidden */
var shadowOnlyVertexShader = { name: name, shader: shader };

/***/ }),

/***/ "./shadowOnly/shadowOnlyMaterial.ts":
/*!******************************************!*\
  !*** ./shadowOnly/shadowOnlyMaterial.ts ***!
  \******************************************/
/*! exports provided: ShadowOnlyMaterial */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ShadowOnlyMaterial", function() { return ShadowOnlyMaterial; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _shadowOnly_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./shadowOnly.fragment */ "./shadowOnly/shadowOnly.fragment.ts");
/* harmony import */ var _shadowOnly_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./shadowOnly.vertex */ "./shadowOnly/shadowOnly.vertex.ts");

var ShadowOnlyMaterialDefines = /** @class */ (function (_super) {
    Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ShadowOnlyMaterialDefines, _super);
    function ShadowOnlyMaterialDefines() {
        var _this = _super.call(this) || this;
        _this.CLIPPLANE = false;
        _this.CLIPPLANE2 = false;
        _this.CLIPPLANE3 = false;
        _this.CLIPPLANE4 = false;
        _this.CLIPPLANE5 = false;
        _this.CLIPPLANE6 = false;
        _this.POINTSIZE = false;
        _this.FOG = false;
        _this.NORMAL = false;
        _this.NUM_BONE_INFLUENCERS = 0;
        _this.BonesPerMesh = 0;
        _this.INSTANCES = false;
        _this.rebuild();
        return _this;
    }
    return ShadowOnlyMaterialDefines;
}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialDefines"]));
var ShadowOnlyMaterial = /** @class */ (function (_super) {
    Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ShadowOnlyMaterial, _super);
    function ShadowOnlyMaterial(name, scene) {
        var _this = _super.call(this, name, scene) || this;
        _this.shadowColor = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"].Black();
        return _this;
    }
    ShadowOnlyMaterial.prototype.needAlphaBlending = function () {
        return true;
    };
    ShadowOnlyMaterial.prototype.needAlphaTesting = function () {
        return false;
    };
    ShadowOnlyMaterial.prototype.getAlphaTestTexture = function () {
        return null;
    };
    Object.defineProperty(ShadowOnlyMaterial.prototype, "activeLight", {
        get: function () {
            return this._activeLight;
        },
        set: function (light) {
            this._activeLight = light;
        },
        enumerable: true,
        configurable: true
    });
    // Methods
    ShadowOnlyMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
        if (this.isFrozen) {
            if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {
                return true;
            }
        }
        if (!subMesh._materialDefines) {
            subMesh._materialDefines = new ShadowOnlyMaterialDefines();
        }
        var defines = subMesh._materialDefines;
        var scene = this.getScene();
        if (!this.checkReadyOnEveryCall && subMesh.effect) {
            if (this._renderId === scene.getRenderId()) {
                return true;
            }
        }
        var engine = scene.getEngine();
        // Ensure that active light is the first shadow light
        if (this._activeLight) {
            for (var _i = 0, _a = mesh.lightSources; _i < _a.length; _i++) {
                var light = _a[_i];
                if (light.shadowEnabled) {
                    if (this._activeLight === light) {
                        break; // We are good
                    }
                    var lightPosition = mesh.lightSources.indexOf(this._activeLight);
                    if (lightPosition !== -1) {
                        mesh.lightSources.splice(lightPosition, 1);
                        mesh.lightSources.splice(0, 0, this._activeLight);
                    }
                    break;
                }
            }
        }
        babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);
        babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines);
        defines._needNormals = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForLights(scene, mesh, defines, false, 1);
        // Attribs
        babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForAttributes(mesh, defines, false, true);
        // Get correct effect
        if (defines.isDirty) {
            defines.markAsProcessed();
            scene.resetCachedMaterial();
            // Fallbacks
            var fallbacks = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["EffectFallbacks"]();
            if (defines.FOG) {
                fallbacks.addFallback(1, "FOG");
            }
            babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].HandleFallbacksForShadows(defines, fallbacks, 1);
            if (defines.NUM_BONE_INFLUENCERS > 0) {
                fallbacks.addCPUSkinningFallback(0, mesh);
            }
            //Attributes
            var attribs = [babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].PositionKind];
            if (defines.NORMAL) {
                attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].NormalKind);
            }
            babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForBones(attribs, mesh, defines, fallbacks);
            babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForInstances(attribs, defines);
            var shaderName = "shadowOnly";
            var join = defines.toString();
            var uniforms = ["world", "view", "viewProjection", "vEyePosition", "vLightsType",
                "vFogInfos", "vFogColor", "pointSize", "alpha", "shadowColor",
                "mBones",
                "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "vClipPlane5", "vClipPlane6"
            ];
            var samplers = new Array();
            var uniformBuffers = new Array();
            babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareUniformsAndSamplersList({
                uniformsNames: uniforms,
                uniformBuffersNames: uniformBuffers,
                samplers: samplers,
                defines: defines,
                maxSimultaneousLights: 1
            });
            subMesh.setEffect(scene.getEngine().createEffect(shaderName, {
                attributes: attribs,
                uniformsNames: uniforms,
                uniformBuffersNames: uniformBuffers,
                samplers: samplers,
                defines: join,
                fallbacks: fallbacks,
                onCompiled: this.onCompiled,
                onError: this.onError,
                indexParameters: { maxSimultaneousLights: 1 }
            }, engine), defines);
        }
        if (!subMesh.effect || !subMesh.effect.isReady()) {
            return false;
        }
        this._renderId = scene.getRenderId();
        subMesh.effect._wasPreviouslyReady = true;
        return true;
    };
    ShadowOnlyMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) {
        var scene = this.getScene();
        var defines = subMesh._materialDefines;
        if (!defines) {
            return;
        }
        var effect = subMesh.effect;
        if (!effect) {
            return;
        }
        this._activeEffect = effect;
        // Matrices
        this.bindOnlyWorldMatrix(world);
        this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
        // Bones
        babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindBonesParameters(mesh, this._activeEffect);
        if (this._mustRebind(scene, effect)) {
            // Clip plane
            babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindClipPlane(this._activeEffect, scene);
            // Point size
            if (this.pointsCloud) {
                this._activeEffect.setFloat("pointSize", this.pointSize);
            }
            this._activeEffect.setFloat("alpha", this.alpha);
            this._activeEffect.setColor3("shadowColor", this.shadowColor);
            babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindEyePosition(effect, scene);
        }
        // Lights
        if (scene.lightsEnabled) {
            babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindLights(scene, mesh, this._activeEffect, defines, 1);
        }
        // View
        if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Scene"].FOGMODE_NONE) {
            this._activeEffect.setMatrix("view", scene.getViewMatrix());
        }
        // Fog
        babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindFogParameters(scene, mesh, this._activeEffect);
        this._afterBind(mesh, this._activeEffect);
    };
    ShadowOnlyMaterial.prototype.clone = function (name) {
        var _this = this;
        return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new ShadowOnlyMaterial(name, _this.getScene()); }, this);
    };
    ShadowOnlyMaterial.prototype.serialize = function () {
        var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this);
        serializationObject.customType = "BABYLON.ShadowOnlyMaterial";
        return serializationObject;
    };
    ShadowOnlyMaterial.prototype.getClassName = function () {
        return "ShadowOnlyMaterial";
    };
    // Statics
    ShadowOnlyMaterial.Parse = function (source, scene, rootUrl) {
        return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new ShadowOnlyMaterial(source.name, scene); }, source, scene, rootUrl);
    };
    return ShadowOnlyMaterial;
}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["PushMaterial"]));

babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.ShadowOnlyMaterial"] = ShadowOnlyMaterial;

/***/ }),

/***/ "babylonjs/Misc/decorators":
/*!****************************************************************************************************!*\
  !*** external {"root":"BABYLON","commonjs":"babylonjs","commonjs2":"babylonjs","amd":"babylonjs"} ***!
  \****************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {

module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__;

/***/ })

/******/ });
});
//# sourceMappingURL=babylon.shadowOnlyMaterial.js.map


text:
''' Strings worker '''
import re
import pprint

class Strings(object):
    ''' This worker extracts all the strings from any type of file '''
    dependencies = ['sample']

    def __init__(self):
        ''' Initialize the Strings worker '''
        self.find_strings = re.compile(r'[^\x00-\x1F\x7F-\xFF]{4,}', re.MULTILINE)

    def execute(self, input_data):
        ''' Execute the Strings worker '''
        raw_bytes = input_data['sample']['raw_bytes']
        strings = self.find_strings.findall(raw_bytes)
        return {'string_list': strings}

# Unit test: Create the class, the proper input and run the execute() method for a test
def test():
    ''' strings.py: Unit test'''

    # This worker test requires a local server running
    import zerorpc
    workbench = zerorpc.Client(timeout=300, heartbeat=60)
    workbench.connect("tcp://127.0.0.1:4242")

    # Generate input for the worker
    import os
    data_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                             '../data/pe/bad/033d91aae8ad29ed9fbb858179271232')
    md5 = workbench.store_sample(open(data_path, 'rb').read(), 'bad_pe', 'exe')
    input_data = workbench.get_sample(md5)

    # Execute the worker (unit test)
    worker = Strings()
    output = worker.execute(input_data)
    print '\n<<< Unit Test >>>'
    pprint.pprint(output)

    # Execute the worker (server test)
    output = workbench.work_request('strings', md5)
    print '\n<<< Server Test >>>'
    pprint.pprint(output)

if __name__ == "__main__":
    test()


text:
from robot import utils
from robot.utils import asserts
from robot.utils.connectioncache import ConnectionCache
from robot.output import LOGGER
from robot.output.loggerhelper import Message

from utils import int_any_base
from mapping import *

class Picmg:
    def get_picmg_properties(self):
        return self._ipmi.get_picmg_properties()

    def activate_fru(self, fruid=0):
        """Sends a _Set FRU Activation_ command to the given fru."""
        fruid = int(fruid)
        self._ipmi.set_fru_activation(fruid)

    def deactivate_fru(self, fruid=0):
        """Sends a _Set FRU Deactivation_ command to the given fru."""
        fruid = int(fruid)
        self._ipmi.set_fru_deactivation(fruid)

    def clear_activation_lock_bit(self, fruid=0):
        """Clears the activation lock bit for to the given FRU.
        """
        fruid = int(fruid)
        self._ipmi.clear_fru_activation_lock(fruid)

    def clear_deactivation_lock_bit(self, fruid=0):
        """Clears the deactivation lock bit for to the given FRU.
        """
        fruid = int(fruid)
        self._ipmi.clear_fru_deactivation_lock(fruid)

    def issue_frucontrol_cold_reset(self, fruid=0):
        """Sends a _frucontrol cold reset_ to the given FRU.
        """
        fruid = int(fruid)
        self._ipmi.fru_control_cold_reset(fruid)

    def issue_frucontrol_diagnostic_interrupt(self, fruid=0):
        """Sends a _frucontrol diagnostic interrupt_ to the given FRU.
        """
        fruid = int(fruid)
        self._ipmi.fru_control_diagnostic_interrupt(fruid)

    def get_fru_led_state(self, fru_id, led_id):
        """Returns the FRU LED state.
        """
        fru_id = int(fru_id)
        led_id = int(led_id)

        self._cp['led_state'] = self._ipmi.get_led_state(fru_id, led_id)

        self._debug('LED state is %s' % self._cp['led_state'])

    def led_color_should_be(self, expected_color, msg=None, values=True):
        """Fails if Picmg FRU Led color is not as given value.

        `expected_color` value can be:
        Blue, Red, Green, Amber, Orange, White
        """
        expected_color = find_picmg_led_color(expected_color)
        if self._cp['led_state'].override_enabled:
            actual_color = self._cp['led_state'].override_color
        else:
            actual_color = self._cp['led_state'].local_color

        asserts.assert_equal(expected_color, actual_color, msg, values)

    def led_function_should_be(self, expected_function, msg=None, values=True):
        """Fails if Picmg FRU Led function is not as given value.

        `expected_function` value can be:
        ON, OFF
        """
        expected_function = find_picmg_led_function(expected_function)
        if self._cp['led_state'].override_enabled:
            actual_function = self._cp['led_state'].override_function
        else:
            actual_function = self._cp['led_state'].local_function

        asserts.assert_equal(expected_function, actual_function, msg,
                values)

    def led_state_should_be(self, expected_state, msg=None, values=True):
        """Fails if Picmg FRU Led State is not as given value.

        `expecte_state` value can be:
        Local Control, Override, Lamp Test
        """
        ac = self._active_connection
        expected_state = find_picmg_led_function(expected_state)
        if ac._led.override_enabled:
            pass
        elif ac._led.override_enabled:
            function = ac._led.override_function
        else:
            function = ac._led.local_function
        asserts.assert_equal(expected_function, function, msg, values)

    def set_fru_led_state(self, fruid, ledid, state, color):
        """Set the FRU LED State.
        """

        fruid = int(fruid)
        ledid = int(ledid)
        state = find_picmg_led_function(state)
        color = find_picmg_led_color(color)

        led = pyipmi.picmg.LedState()
        led.fru_id = fruid
        led.led_id = ledid
        led.override_color = color
        led.override_function = state

        self._ipmi.set_led_state(led)

    def set_port_state(self, interface, channel, flags, link_type,
            link_type_ext, state, link_class=0):
        """Sends the "PICMG Set Portstate" command.

        `interface` is one of the following interface types: BASE, FABRIC,
        UPDATE_CHANNEL.

        `channel` is the interface channel ID. `flags` is the lane mask and one
        of the following values: LANE0, LANE0123.

        `link_type` is one of the following values: BASE, ETHERNET_FABRIC,
        INFINIBAND_FABRIC, STARFABRIC_FABRIC, PCIEXPRESS_FABRIC.

        `link_class` is the channel signaling class capability and hast to be
        one of the following values: CLASS_BASIC, CLASS_10_3125GBD.

        `link_type_ext` is one of the following values: BASE0, BASE1,
        ETHERNET_FIX1000_BX, ETHERNET_FIX10GB_X4, ETHERNET_FCPI,
        ETHERNET_FIX1000KX_10G_KR, ETHERNET_FIX10GK_X4, ETHERNET_FIX40G_KR4

        `state` is the link state and has to be one of the following values:
        ENABLE, DISABLE.

        Note: Link Grouping ID is not supported yet

        Example:
        | Set Port State | BASE | 1 | LANE0 | BASE | BASE0 | ENABLE
        """

        link_descr = pyipmi.picmg.LinkDescriptor()
        link_descr.interface = find_picmg_interface_type(interface)
        link_descr.channel = int(channel)
        link_descr.link_flags = find_picmg_link_flags(flags)
        link_descr.type = find_picmg_link_type(link_type)
        link_descr.sig_class = find_picmg_link_signaling_class(link_class)
        link_descr.extension = find_picmg_link_type_extension(link_type_ext)
        link_descr.grouping_id = 0
        state = find_picmg_link_state(state)
        self._ipmi.set_port_state(link_descr, state)

    def get_port_state(self, interface, channel):
        """Returns the link and state of the interface link.

        Example:
        | ${link} | ${state}=  | Get Port State | FABRIC | 1 |
        """

        interface = find_picmg_interface_type(interface)
        channel = int(channel)
        return self._ipmi.get_port_state(channel, interface)

    def port_state_should_be(self, interface, channel, expected_state):
        """Fails if the returned port state is not equal the expected.
        """

        interface = find_picmg_interface_type(interface)
        channel = int(channel)
        expected_state = find_picmg_link_state(expected_state)
        (link, state) = self._ipmi.get_port_state(channel, interface)
        asserts.assert_equal(expected_state, state)

    def link_flags_should_be(self, interface, channel, expected_flags):
        """Fails if the link flags does not match the expected flags.
        """

        interface = find_picmg_interface_type(interface)
        channel = int(channel)
        expected_flags = find_picmg_link_flags(expected_flags)
        (link, state) = self._ipmi.get_port_state(channel, interface)
        asserts.assert_equal(expected_flags, link.link_flags)

    def link_type_should_be(self, interface, channel, expected_type,
                expected_ext):
        """Fails if the link type is not as the expected.
        """

        interface = find_picmg_interface_type(interface)
        channel = int(channel)
        expected_type = find_picmg_link_type(expected_type)
        expected_ext = find_picmg_link_type_extension(expected_ext)
        (link, state) = self._ipmi.get_port_state(channel, interface)
        asserts.assert_equal(expected_type, link.type)
        asserts.assert_equal(expected_ext, link.extension)

    def link_signaling_class_should_be(self, interface, channel,
                expected_class):
        """Fails if the link type is not as the expected.
        """

        interface = find_picmg_interface_type(interface)
        channel = int(channel)
        expected_class = find_picmg_link_signaling_class(expected_class)
        (link, state) = self._ipmi.get_port_state(channel, interface)
        asserts.assert_equal(expected_class, link.sig_class)

    def get_power_level(self, fruid, power_type, offset):
        """return the specified power level for the fru
        `fruid`

        `power_type`

        `offset`

        """
        fruid = int_any_base(fruid)
        power_type = int_any_base(power_type)
        offset = int_any_base(offset)

        pwr = self._ipmi.get_power_level(fruid, power_type)
        return pwr.power_levels[offset]

    def get_fan_speed_properties(self, fruid):
        """
        """
        fruid = int_any_base(fruid)
        return self._ipmi.get_fan_speed_properties(fruid)

    def get_fan_override_level(self, fruid):
        """
        """
        fruid = int_any_base(fruid)
        (override_level, local_level) = self._ipmi.get_fan_level(fruid)
        return override_level

    def set_signaling_class(self, interface, channel, signaling_class):
        """*DEPRECATED* Sends the `Set Channel Siganling Class` command.

        `interface` the interface type (BASE, FABRIC, UPDATE_CHANNEL)

        `channel` is the interface channel ID.

        `class` is the channel signaling class capability and hast to be one of
        the following values: CLASS_BASIC, CLASS_10_3125GBD.
        """

        interface = find_picmg_interface_type(interface)
        channel = int(channel)
        signaling_class = find_picmg_signaling_class(signaling_class)
        self._ipmi.set_signaling_class(interface, channel, signaling_class)

    def get_signaling_class(self, interface, channel):
        """*DEPRECATED* Sends `Get Channel Signaling Class` command
        """

        interface = find_picmg_interface_type(interface)
        channel = int(channel)
        self._ipmi.get_signaling_class(interfac, channel)

    def get_pm_global_status(self):
        """
        """
        return self._ipmi.get_pm_global_status()

    def get_pm_channel_status(self, channel_number):
        """
        """
        channel_number = int_any_base(channel_number)
        return self._ipmi.get_power_channel_status(channel_number)

    def get_hotswap_sdr(self, entity):
        """Get the entities hotswap sensor SDR
        Entity can be specified by 'entitiy_id:entity_instance'

        Valid entitiy_id:
            Power Module= 0x0a
            Cooling Unit = 0x1e
            Picmg Front Board= 0xa0
            Picmg Rear Transition Module= 0xc0
            Picmg Advanced MC = 0xc1
            Picmg Microtca Carrier Hub = 0xc2
            Picmg Shelf Management Controller = 0xf0
            Picmg FIlteration Unit = 0xf1
            Picmg Shelf FRU Information = 0xf2
        """
        (entity_id, entity_instance) = entity.split(':')
        entity_id = find_entity_type_id(entity_id)
        entity_instance = int_any_base(entity_instance)

        for sdr in self._sdr_entries():
            if (sdr.type is not pyipmi.sdr.SDR_TYPE_FULL_SENSOR_RECORD and \
                    sdr.type is not pyipmi.sdr.SDR_TYPE_COMPACT_SENSOR_RECORD):
                continue
            if sdr.sensor_type_code != \
                    pyipmi.sensor.SENSOR_TYPE_FRU_HOT_SWAP:
                continue
            if sdr.entity_id == entity_id and \
                    sdr.entity_instance == entity_instance:
                return sdr

        raise AssertionError('Hotswap Sensor for entity %s %s not found' \
                % (entity_id, entity_instance))

    def prefetch_hotswap_sdr(self, entity):
        if 'prefetched_hotswap_sdr' not in self._cp:
            self._cp['prefetched_hotswap_sdr'] = {}

        sdr = self.get_hotswap_sdr(entity)
        self._cp['prefetched_hotswap_sdr'][sdr.device_id_string] = sdr

    def prefetch_all_hotswap_sdr(self):
        """Scan all SDRs from sdr list for hotswap sensors and prefetch."""

        if 'prefetched_hotswap_sdr' not in self._cp:
            self._cp['prefetched_hotswap_sdr'] = {}

        for sdr in self._sdr_entries():
            if (sdr.type is not pyipmi.sdr.SDR_TYPE_FULL_SENSOR_RECORD and \
                    sdr.type is not pyipmi.sdr.SDR_TYPE_COMPACT_SENSOR_RECORD):
                continue
            if sdr.sensor_type_code != \
                    pyipmi.sensor.SENSOR_TYPE_FRU_HOT_SWAP:
                continue

            self._info('HS SDR %s found' % sdr.device_id_string)
            self._cp['prefetched_hotswap_sdr'][sdr.device_id_string] = sdr

    def _find_hotswap_sdr_by_entity(self, entity):
        (entity_id, entity_instance) = entity.split(':')
        entity_id = find_entity_type_id(entity_id)
        entity_instance = int_any_base(entity_instance)
        if 'prefetched_hotswap_sdr' in self._cp:
            for name in self._cp['prefetched_hotswap_sdr']:
                hs_sdr = self._cp['prefetched_hotswap_sdr'][name]
                if hs_sdr.entity_id == entity_id and \
                        hs_sdr.entity_instance == entity_instance:
                    return hs_sdr
        else:
            self._info('HS SDR not found')

    def _get_hotswap_state(self, sdr):
        state = self.get_sensor_state(None, sdr)&0xff

        if state & state-1 is not 0:
            raise AssertionError('sensor reports invalid state 0x%02x'
                    % (state))

        for s in xrange(7, -1, -1):
            if state & (1<<s):
                return s

    def get_hotswap_state(self, entity):
        sdr = self._find_hotswap_sdr_by_entity(entity)
        return self._get_hotswap_state(sdr)


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
in Yamamoto & Nannenga-Bremekamp, Proc. K. Ned. Akad. Wet. 98(3): 324 (1995)

#### Original name
Stemonaria clausifila Nann.-Bremek. & Y. Yamam., 1995

### Remarks
null


text:
package com.github.scr.hashmap.collections;

import com.github.scr.hashmap.Constants;
import com.google.common.collect.Iterables;
import com.google.common.collect.Iterators;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.io.DataOutput;
import java.io.IOException;
import java.lang.reflect.Array;
import java.nio.LongBuffer;
import java.util.Arrays;
import java.util.Collection;
import java.util.PrimitiveIterator;

/**
 * Created by scr on 7/2/15.
 */
public class LongBufferCollection implements IndexedCollection<Long> {
    @Nonnull
    private final LongBuffer BUFFER;

    @Nullable
    @Override
    public Long get(int index) {
        return BUFFER.get(index);
    }

    @Override
    public void writeOutput(DataOutput dataOutput) throws IOException {
        dataOutput.writeInt(Constants.MAGIC);
        dataOutput.writeInt(Constants.VERSION);
        int size = BUFFER.remaining();
        dataOutput.writeInt(size);
        for (int i = 0; i < size; ++i) {
            dataOutput.writeLong(BUFFER.get(i));
        }
    }

    public static class BufferIterator implements PrimitiveIterator.OfLong {
        @Nonnull
        private final LongBuffer BUFFER;

        public BufferIterator(LongBuffer buffer) {
            BUFFER = buffer.duplicate();
        }

        @Override
        public boolean hasNext() {
            return BUFFER.hasRemaining();
        }

        @Override
        public long nextLong() {
            return BUFFER.get();
        }
    }

    public LongBufferCollection(LongBuffer ints) {
        BUFFER = ints;
    }

    @Override
    public int size() {
        return BUFFER.capacity();
    }

    @Override
    public boolean isEmpty() {
        return BUFFER.capacity() > 0;
    }

    @Override
    public boolean contains(Object o) {
        if (!(o instanceof Long)) {
            return false;
        }
        Long oLong = (Long) o;
        return Iterators.contains(iterator(), oLong);
    }

    @Nonnull
    @Override
    public PrimitiveIterator.OfLong iterator() {
        return new BufferIterator(BUFFER);
    }

    @Nonnull
    public long[] toLongArray() {
        int size = size();
        long[] ret = new long[size];
        for (int i = 0; i < size; i++) {
            ret[i] = BUFFER.get(i);
        }
        return ret;
    }

    @Nonnull
    @Override
    public Object[] toArray() {
        return Iterables.toArray(this, Long.class);
    }

    @Nonnull
    @Override
    public <T> T[] toArray(T[] a) {
        int size = size();
        //noinspection unchecked
        a = a.length >= size ? a : (T[]) Array.newInstance(a.getClass().getComponentType(), size);
        for (int i = 0; i < size; ++i) {
            Array.setLong(a, i, BUFFER.get(i));
        }
        return a;
    }

    @Override
    public boolean add(Long aLong) {
        throw new UnsupportedOperationException();
    }

    @Override
    public boolean remove(Object o) {
        throw new UnsupportedOperationException();
    }

    @Override
    public boolean containsAll(Collection<?> c) {
        for (Object o : c) {
            if (!contains(o)) {
                return false;
            }
        }
        return true;
    }

    @Override
    public boolean addAll(Collection<? extends Long> c) {
        throw new UnsupportedOperationException();
    }

    @Override
    public boolean removeAll(Collection<?> c) {
        throw new UnsupportedOperationException();
    }

    @Override
    public boolean retainAll(Collection<?> c) {
        throw new UnsupportedOperationException();
    }

    @Override
    public void clear() {
        throw new UnsupportedOperationException();
    }

    @Override
    public long getLong(int index) {
        return BUFFER.get(index);
    }
}


text:
void sample_func()
{
  printf("Hello World!\n");
}


text:
package protolog_testing

import (
	"bytes"
	"flag"
	"fmt"
	"io"
	"os"
	"sync/atomic"
	"testing"
	"time"

	stdlogrus "github.com/Sirupsen/logrus"
	"go.pedge.io/protolog"
	"go.pedge.io/protolog/glog"
	"go.pedge.io/protolog/logrus"

	"github.com/stretchr/testify/require"
)

func TestRoundtripAndTextMarshaller(t *testing.T) {
	buffer := bytes.NewBuffer(nil)
	fakeTimer := newFakeTimer(0)
	logger := protolog.NewLogger(
		protolog.NewWritePusher(
			protolog.NewWriterFlusher(buffer),
			protolog.WritePusherOptions{
				Encoder: protolog.NewWireEncoder(),
			},
		),
		protolog.LoggerOptions{
			IDAllocator: newFakeIDAllocator(),
			Timer:       fakeTimer,
		},
	)
	logger.Debug(
		&Foo{
			StringField: "one",
			Int32Field:  2,
		},
	)
	logger.Info(
		&Baz{
			Bat: &Baz_Bat{
				Ban: &Baz_Bat_Ban{
					StringField: "one",
					Int32Field:  2,
				},
			},
		},
	)
	writer := logger.InfoWriter()
	for _, s := range []string{
		"hello",
		"world",
		"writing",
		"strings",
		"is",
		"fun",
	} {
		_, _ = writer.Write([]byte(s))
	}
	logger.Infoln("a normal line")
	logger.WithField("someKey", "someValue").Warnln("a warning line")

	puller := protolog.NewReadPuller(
		buffer,
		protolog.NewWireDecoder(),
		protolog.ReadPullerOptions{},
	)
	writeBuffer := bytes.NewBuffer(nil)
	writePusher := protolog.NewWritePusher(
		protolog.NewWriterFlusher(writeBuffer),
		protolog.WritePusherOptions{
			Marshaller: protolog.NewTextMarshaller(
				protolog.MarshallerOptions{
					DisableTimestamp: true,
				},
			),
		},
	)
	for entry, pullErr := puller.Pull(); pullErr != io.EOF; entry, pullErr = puller.Pull() {
		require.NoError(t, pullErr)
		require.NoError(t, writePusher.Push(entry))
	}
	require.Equal(
		t,
		`DEBUG protolog.testing.Foo {"string_field":"one","int32_field":2}
INFO  protolog.testing.Baz {"bat":{"ban":{"string_field":"one","int32_field":2}}}
INFO  hello
INFO  world
INFO  writing
INFO  strings
INFO  is
INFO  fun
INFO  a normal line
WARN  a warning line contexts=[{"someKey":"someValue"}]
`,
		writeBuffer.String(),
	)
}

func TestPrintSomeStuff(t *testing.T) {
	testPrintSomeStuff(t, protolog.NewStandardLogger(protolog.NewFileFlusher(os.Stderr)))
}

func TestPrintSomeStuffLogrus(t *testing.T) {
	logrus.SetPusherOptions(logrus.PusherOptions{})
	testPrintSomeStuff(t, protolog.GlobalLogger())
}

func TestPrintSomeStuffLogrusForceColors(t *testing.T) {
	logrus.SetPusherOptions(
		logrus.PusherOptions{
			Formatter: &stdlogrus.TextFormatter{
				ForceColors: true,
			},
		},
	)
	testPrintSomeStuff(t, protolog.GlobalLogger())
}

func TestPrintSomeStuffGLog(t *testing.T) {
	require.NoError(t, flag.CommandLine.Set("logtostderr", "true"))
	glog.Register()
	testPrintSomeStuff(t, protolog.GlobalLogger())
}

func testPrintSomeStuff(t *testing.T, logger protolog.Logger) {
	logger.Debug(
		&Foo{
			StringField: "one",
			Int32Field:  2,
		},
	)
	logger.Info(
		&Baz{
			Bat: &Baz_Bat{
				Ban: &Baz_Bat_Ban{
					StringField: "one",
					Int32Field:  2,
				},
			},
		},
	)
	writer := logger.InfoWriter()
	for _, s := range []string{
		"hello",
		"world",
		"writing",
		"strings",
		"is",
		"fun",
	} {
		_, _ = writer.Write([]byte(s))
	}
	logger.Infoln("a normal line")
	logger.WithField("someKey", "someValue").WithField("someOtherKey", 1).Warnln("a warning line")
}

type fakeIDAllocator struct {
	value int32
}

func newFakeIDAllocator() *fakeIDAllocator {
	return &fakeIDAllocator{-1}
}

func (f *fakeIDAllocator) Allocate() string {
	return fmt.Sprintf("%d", atomic.AddInt32(&f.value, 1))
}

type fakeTimer struct {
	unixTimeUsec int64
}

func newFakeTimer(initialUnixTimeUsec int64) *fakeTimer {
	return &fakeTimer{initialUnixTimeUsec}
}

func (f *fakeTimer) Now() time.Time {
	return time.Unix(f.unixTimeUsec/int64(time.Second), f.unixTimeUsec%int64(time.Second)).UTC()
}

func (f *fakeTimer) Add(secondDelta int64, nanosecondDelta int64) {
	atomic.AddInt64(&f.unixTimeUsec, (secondDelta*int64(time.Second))+nanosecondDelta)
}


text:
<?php

namespace Sonata\AdminBundle\Tests\Route;

use Sonata\AdminBundle\Route\QueryStringBuilder;
use Sonata\AdminBundle\Route\RouteCollection;

class QueryStringBuilderTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @dataProvider getBuildTests
     */
    public function testBuild(array $expectedRoutes, $hasReader, $aclEnabled, $getParent)
    {
        $audit = $this->getMock('Sonata\AdminBundle\Model\AuditManagerInterface');
        $audit->expects($this->once())->method('hasReader')->will($this->returnValue($hasReader));

        $admin = $this->getMock('Sonata\AdminBundle\Admin\AdminInterface');
        $admin->expects($this->once())->method('getParent')->will($this->returnValue($getParent));
        $admin->expects($this->any())->method('getChildren')->will($this->returnValue(array()));
        $admin->expects($this->once())->method('isAclEnabled')->will($this->returnValue($aclEnabled));

        $routeCollection = new RouteCollection('base.Code.Route', 'baseRouteName', 'baseRoutePattern', 'baseControllerName');

        $pathBuilder = new QueryStringBuilder($audit);

        $pathBuilder->build($admin, $routeCollection);

        $this->assertCount(count($expectedRoutes), $routeCollection->getElements());

        foreach ($expectedRoutes as $expectedRoute) {
            $this->assertTrue($routeCollection->has($expectedRoute), sprintf('Expected route: "%s" doesn`t exist.', $expectedRoute));
        }
    }

    public function getBuildTests()
    {
        return array(
            array(array('list', 'create', 'batch', 'edit', 'delete', 'show', 'export', 'history', 'history_view_revision', 'acl'), true, true, null),
            array(array('list', 'create', 'batch', 'edit', 'delete', 'show', 'export', 'acl'), false, true, null),
            array(array('list', 'create', 'batch', 'edit', 'delete', 'show', 'export', 'history', 'history_view_revision'), true, false, null),
            array(array('list', 'create', 'batch', 'edit', 'delete', 'show', 'export', 'history', 'history_view_revision', 'acl'), true, true, $this->getMock('Sonata\AdminBundle\Admin\AdminInterface')),
        );
    }

    public function testBuildWithChildren()
    {
        $audit = $this->getMock('Sonata\AdminBundle\Model\AuditManagerInterface');
        $audit->expects($this->once())->method('hasReader')->will($this->returnValue(true));

        $childRouteCollection1 = new RouteCollection('child1.Code.Route', 'child1RouteName', 'child1RoutePattern', 'child1ControllerName');
        $childRouteCollection1->add('foo');
        $childRouteCollection1->add('bar');

        $childRouteCollection2 = new RouteCollection('child2.Code.Route', 'child2RouteName', 'child2RoutePattern', 'child2ControllerName');
        $childRouteCollection2->add('baz');

        $child1 = $this->getMock('Sonata\AdminBundle\Admin\AdminInterface');
        $child1->expects($this->once())->method('getRoutes')->will($this->returnValue($childRouteCollection1));

        $child2 = $this->getMock('Sonata\AdminBundle\Admin\AdminInterface');
        $child2->expects($this->once())->method('getRoutes')->will($this->returnValue($childRouteCollection2));

        $admin = $this->getMock('Sonata\AdminBundle\Admin\AdminInterface');
        $admin->expects($this->once())->method('getParent')->will($this->returnValue(null));
        $admin->expects($this->once())->method('getChildren')->will($this->returnValue(array($child1, $child2)));
        $admin->expects($this->once())->method('isAclEnabled')->will($this->returnValue(true));

        $routeCollection = new RouteCollection('base.Code.Route', 'baseRouteName', 'baseRoutePattern', 'baseControllerName');

        $pathBuilder = new QueryStringBuilder($audit);

        $pathBuilder->build($admin, $routeCollection);

        $expectedRoutes = array('list', 'create', 'batch', 'edit', 'delete', 'show', 'export', 'history', 'history_view_revision', 'acl', 'child1.Code.Route.foo', 'child1.Code.Route.bar', 'child2.Code.Route.baz');
        $this->assertCount(count($expectedRoutes), $routeCollection->getElements());

        foreach ($expectedRoutes as $expectedRoute) {
            $this->assertTrue($routeCollection->has($expectedRoute), sprintf('Expected route: "%s" doesn`t exist.', $expectedRoute));
        }
    }
}


text:
module GHI
  module Commands
    class Close < Command
      attr_accessor :web

      def options
        OptionParser.new do |opts|
          opts.banner = <<EOF
usage: ghi close [options] <issueno>
EOF
          opts.separator ''
          opts.on '-l', '--list', 'list closed issues' do
            assigns[:command] = List
          end
          opts.on('-w', '--web') { self.web = true }
          opts.separator ''
          opts.separator 'Issue modification options'
          opts.on '-m', '--message [<text>]', 'close with message' do |text|
            assigns[:comment] = text
          end
          opts.separator ''
        end
      end

      def execute
        options.parse! args
        require_repo

        if list?
          args.unshift(*%W(-sc -- #{repo}))
          args.unshift '-w' if web
          List.execute args
        else
          require_issue
          if assigns.key? :comment
            Comment.execute [
              issue, '-m', assigns[:comment], '--', repo
            ].compact
          end
          Edit.execute %W(-sc #{issue} -- #{repo})
        end
      end

      private

      def list?
        assigns[:command] == List
      end
    end
  end
end


text:
package org.scalaide.ui.internal.handlers

import org.eclipse.core.runtime.IStatus
import org.eclipse.jface.dialogs.IDialogConstants
import org.eclipse.jface.dialogs.{MessageDialog => MD}
import org.scalaide.core.IScalaPlugin
import org.scalaide.core.internal.project.ScalaProject
import org.scalaide.util.internal.CompilerUtils
import scala.concurrent.Promise
import scala.tools.nsc.settings.ScalaVersion
import org.scalaide.util.eclipse.SWTUtils
import org.scalaide.util.eclipse.EclipseUtils

object ClasspathErrorPromptStatusHandler {

  /** Status code indicating there was a previous scala library detected
   *  on classpath. Linked to ClassPathErrorPromptStatusHandler
   *  via our statusHandlers extension (see plugin.xml)
   */
  final val STATUS_CODE_PREV_CLASSPATH = 1001

}

class ClasspathErrorPromptStatusHandler extends RichStatusHandler {

  override def doHandleStatus(status: IStatus, source: Object) = {
    val (scalaProject, continuation)  = source match {
      case (p: ScalaProject, c: Promise[_]) => (Some(p), Some(c.asInstanceOf[Promise[()=> Unit]]))
      case (_, c: Promise[_]) => (None, Some(c.asInstanceOf[Promise[()=> Unit]]))
      case _ => (None, None)
    }
    val shell = SWTUtils.getShell

    val title = "Prior Scala library version detected in this project"
    val expectedVer = IScalaPlugin().scalaVersion.unparse
    val projectName = scalaProject map ( _.underlying.getName()) getOrElse("")
    val message = s"The version of scala library found in the build path of $projectName is prior to the one provided by scala IDE. We rather expected: $expectedVer Turn on the source level flags for this specific project ?"

    val previousScalaVer = IScalaPlugin().scalaVersion match {
      case CompilerUtils.ShortScalaVersion(major, minor) => {
        // This is technically incorrect for an epoch change, but the Xsource flag won't be enough to cover for that anyway
        val lesserMinor = minor - 1
        f"$major%d.$lesserMinor%d"
      }
      case _ => "none"
    }

    if (scalaProject.isDefined) {
      val project = scalaProject.get

      val dialog = new MD(
        shell,
        title,
        null,
        message,
        MD.WARNING,
        Array(IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL),
        1)
      dialog.open()
      val buttonId = dialog.getReturnCode()
      if (buttonId == IDialogConstants.OK_ID)
        continuation.get trySuccess { () =>
          EclipseUtils.withSafeRunner("Error occurred while trying to set source level") {
            project.setDesiredSourceLevel(ScalaVersion(previousScalaVer), "Classpath check dialog tasked with restoring compatibility")
          }
        }
      else continuation.get trySuccess { () => }
    } else continuation map { _ failure (new IllegalArgumentException) }
  }

}


text:
using namespace ofp;

TEST(tablemod, wrongPropertySize_v5) {
  // The eviction property is supposed to be 8 bytes. This one is 16-bytes. The
  // message should be invalid.

  auto data = HexToRawData(
      "0511002000000000 FF00000000000000 0002001011223344 5566778899AABBCC");

  Message message{data.data(), data.size()};
  message.normalize();

  const TableMod *reply = TableMod::cast(&message);
  EXPECT_TRUE(reply == nullptr);
}


text:
<?php
/**
 * Created by PhpStorm.
 * User: andela
 * Date: 10/16/15
 * Time: 2:35 PM
 */

namespace Yemisi\Structure;

/**
 * Interface UserControllerStructure
 * @package Yemisi\Structure
 */
interface UserControllerStructure {

    /**
     * @param $app
     */
    public function userLogin($app);

    /**
     * @param $app
     */
    public function userLogout($app);

}


text:
=head1 NAME

Search::Kino03::KinoSearch::Highlight::Highlighter - Create and highlight excerpts.

=head1 SYNOPSIS

    my $highlighter = Search::Kino03::KinoSearch::Highlight::Highlighter->new(
        searchable => $searcher,
        query      => $query,
        field      => 'body'
    );
    my $hits = $searcher->hits( query => $query );
    while ( my $hit = $hits->next ) {
        my $excerpt = $highlighter->create_excerpt($hit);
        ...
    }

=head1 DESCRIPTION

The Highlighter can be used to select relevant snippets from a
document, and to surround search terms with highlighting tags.  It handles
both stems and phrases correctly and efficiently, using special-purpose data
generated at index-time.

=head1 CONSTRUCTORS

=head2 new( I<[labeled params]> )

    my $highlighter = Search::Kino03::KinoSearch::Highlight::Highlighter->new(
        searchable     => $searcher,    # required
        query          => $query,       # required
        field          => 'content',    # required
        excerpt_length => 150,          # default: 200
    );

=over

=item *

B<searchable> - An object which inherits from
L<Searchable|Search::Kino03::KinoSearch::Search::Searchable>, such as a
L<Searcher|Search::Kino03::KinoSearch::Searcher>.

=item *

B<query> - Query object or a query string.

=item *

B<field> - The name of the field from which to draw the excerpt.  The
field must marked as be C<highlightable> (see
L<FieldType|Search::Kino03::KinoSearch::FieldType>).

=item *

B<excerpt_length> - Maximum length of the excerpt, in characters.

=back

=head1 METHODS

=head2 create_excerpt(hit_doc)

Take a HitDoc object and return a highlighted excerpt as a string if
the HitDoc has a value for the specified C<< field >>.

=head2 highlight(text)

Highlight a small section of text.  By default, prepends pre-tag and
appends post-tag.  This method is called internally by create_excerpt()
when assembling an excerpt.

=head2 encode(text)

Encode text with HTML entities. This method is called internally by
create_excerpt() for each text fragment when assembling an excerpt.  A
subclass can override this if the text should be encoded differently or
not at all.

=head2 set_pre_tag(pre_tag)

Setter.  The default value is "<strong>".

=head2 get_pre_tag()

Accessor.

=head2 set_post_tag(post_tag)

Setter.  The default value is "</strong>".

=head2 get_post_tag()

Accessor.

=head2 get_searchable()

Accessor.

=head2 get_query()

Accessor.

=head2 get_compiler()

Accessor for the Search::Kino03::KinoSearch::Search::Compiler object derived from
C<< query >> and C<< searchable >>.

=head2 get_excerpt_length()

Accessor.

=head2 get_field()

Accessor.

=head1 INHERITANCE

Search::Kino03::KinoSearch::Highlight::Highlighter isa L<Search::Kino03::KinoSearch::Obj>.

=head1 COPYRIGHT

Copyright 2005-2009 Marvin Humphrey

=head1 LICENSE, DISCLAIMER, BUGS, etc.

See L<KinoSearch> version 0.30.

=cut