query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
6e13638d4e5d0ccc4ed64769ea909e8b | 40db2d43f96774bbd2b38b7780dc860d | Searches for the song and returns the VideoID | query = song + " " + artist
search = sp.search(q=query, type="track")
uri = search["tracks"]["items"][0]["uri"]
return uri | 0 |
f3c4cfa515f2f1ea0686b4c3c8982c2d | f6783e57aafd2fe9b235d8977c68b051 | Shows all exhibitions. | public void showAllExhibitions(List<Exhibition> exhibitions); | 1 |
7f894391b2edb06d934e94c2dc0da95c | b9d8277dcfcfb73dc3bf084312b03e6e | Get all messages from a queue. | num_messages=NUM_MSGS, wait_time_seconds=WAIT_TIME,
attributes=['All']):
q = self.conn.lookup(queue)
q.set_message_class(RawMessage)
return q.get_messages(num_messages=num_messages,
visibility_timeout=visibility_timeout,
... | 1 |
1fa9f4c40073dfe5a1df67da080696cb | 407ef987c4e3b70dd869d6a8517c4ec8 | 决定当前任务的参与者角色名 | class JobNodeBaseInfo:
def role(self):
return self._role | 1 |
2749881bf105f927906651628d96e03c | afaa84dd7961ad481d9de205cabe903b | Constructeur privé qui initialise les attributs | class Personnage
public function _construct($force, $degats)
{
$this->setForce($force);
$this->setDegats($degats);
$this->_experience = 0;
} | 0 |
2eae3caf05a6b90acd6df6544583e2ca | aaeb5fc1b5c2862b1cc54a3de2d62988 | Clears the ads in the given range. After calling this method, the ad positions
will be removed from the placed ad positions and put back into the desired ad insertion
positions. | $node = $this->ensureNodeIsFresh($node);
$left = $node->getLeft();
$right = $node->getRight();
$width = $right - $left + 1;
try {
$this->connection->setAutoCommit(FALSE);
$this->connection->beginTransaction();
$this->connection->executeStatement('DELETE FROM ' . $this->tableName . ... | 1 |
4f43d6296b4da6b5a7a4c7c6fea91856 | 14e71d084846c9581e170fcc5c0bd0c2 | Marks an analysis as Not ready.
This sets the analysis' current interpretation's status to `Done` and creates
a new current interpretation with status `Not started` in `Not ready` state.
**Only works for analyses with a `Ongoing` current interpretation** | {
if ($this->currentElement instanceof SchemaElement) {
$elt = new NotationElement();
$this->currentElement->addNotationElement($elt);
$this->currentElement = $elt;
}
} | 0 |
8f32c485c06e9a0e6dbc235374eb4ae1 | b7c9081f97f0d531e7403a4797b8e549 | Get the current level cap | public static class Helper
public static int GetUnitCap()
{
return PlayerPrefs.GetInt (SceneManager.GetActiveScene ().name + "_UnitCap", 100);
} | 0 |
59ccd8f0672502abfd18dd274d4c4149 | b650a2e71a400818f46ddf5d3a6f7a5d | Parses a unique ID used to resynchronize user state after a temporary disconnection from a server. | {
$data = array(
'H' => 'highestmodseq',
'M' => 'messages',
'U' => 'uidnext',
'V' => 'uidvalidity'
);
$info = array();
foreach (explode('|', $id) as $part) {
if (isset($data[$part[0]])) {
$info[$data[$part[0]... | 1 |
e4ee3cd1a09998a2928ad1069b2d5857 | 532565288894f82634cf1e2f70c7a0a4 | methods to create default versions of enemies | Enemies::Enemies() {
eSpeed = (rand() % 25) + 25;
rFrame = 0;
lFrame = 0;
irFrame = 0;
ilFrame = 0;
jFrame = 0;
killed = false;
sf::IntRect batRect(0, 0, 50, 30);
sf::IntRect slimeRect(0,0,30,27);
sf::IntRect slime2Rect(0, 0, 30, 32);
int chance;
chance = rand() % 3 + 1;
... | 1 |
447f4f14114f312fdf8289cb632d89b0 | 13dd5cb088723aab22067a60159d2480 | \brief Function to perform Vector Real Multiplication | rf_public rf_vec2 rf_vec2_mul_v(rf_vec2 v1, rf_vec2 v2)
{
rf_vec2 result = {v1.x * v2.x, v1.y * v2.y};
return result;
} | 1 |
537c77801d3ee452bb6d1a242970621a | 4078a78881e6acc35bfba17b379ba334 | Validates a MoveAction, BeginMoveAction, or ExitAction for the given state.
The MoveAction or ExitAction is invalid iff
1. The ShuntingUnit is blocked by another ShuntingUnit and cannot leave the current track towards the specified direction
The BeginMoveAction is invalid iff
1. The ShuntingUnit is blocked on both side... | void validateMove(Ship ship, Planet destinationPlanet); | 0 |
8650d628731a0208b5a4c0653bfb263d | f6e44e431e22f787f835d21aaa8f6bb6 | Returns Database Connectivity flag | class MysqlDB{
public function isCon() {
return $this->isCon;
} | 1 |
c1f5d10af9890f0b03eda54247913937 | 8cbbcac30be23c064728f769c07e425f | !
Returns whether ticks are shown on the major scale.
\sa setShowMajorTicks(), setShowMinorTicks(), showMinorTicks() | public class Model implements Cloneable
public boolean isMajorTickmarksVisible() {
return majorTickmarksVisible;
} | 1 |
58981ebe70e9bfd3788f6f6f58e90993 | 33d012347a16c4f3fa314a1a5838f55d | 启用数据迁移。 | class PluginManager extends AbstractPluginManager
public function enable($config, $app)
{
$this->migrationSchema($app, __DIR__.'/Resource/doctrine/migration', $config['code']);
} | 1 |
205a19f6fdcff83b839d09ecf55f65f5 | 981a7991c2f5e88441de5a1545bbb202 | Creates a new Product model.
If creation is successful, the browser will be redirected to the 'view' page. | {
$request = Yii::$app->request;
$model = new Products();
$model->published = 1;
if($request->isAjax){
Yii::$app->response->format = Response::FORMAT_JSON;
if($request->isGet){
return [
'title'=> "Create new Products",
... | 1 |
b0501418c77fd9b67018f35795a09b6b | 37144b04ae2247bd283f169cb19b9e04 | 从Kafka获取指标 | int timeout) {
return tasks.entrySet().parallelStream().map(k -> {
String key = k.getKey();
Task value = k.getValue();
Object obj = null;
try {
obj = CompletableFuture.supplyAsync(() -> k.getValue().doTask())... | 0 |
c719e16f5dc701c1a5ecbb6875e80bcc | f1ed614c1dda6679a71660e7266b563d | 查询油耗信息总条数 | public int queryPersonCarCount(Object object) {
int count=0;
StringBuffer sql=new StringBuffer("select count(*) from distance where 1=1");
ResultSet res= DbUtil.executeQuery(sql.toString(), null);
try {
while(res.next()){
count= res.getInt(1);
}
} catch (SQLException e) {
e.printStackTrace();
}
return ... | 0 |
eda08d84e1c12d120ed22c1b96fa6cd3 | 1fd16c1e7bdbeb840eadb297c6702e93 | Get the domain record type that is subject of the request. | class DomainSendingRecordsSetArgs:
def record_type(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "record_type") | 1 |
da4da100a90ad3da3cb486fd08c7580e | ad19378771ba7e12661de291968ef9ef | returns the intersection between 2 arrays | function intersection(a, b) {
return a.filter(v => b.indexOf(v) !== -1);
} | 1 |
f1b9980b94a4d2aa9bd2ba80da1c6660 | 3c2c1af6a6a6aeac2934263fd3329924 | Exports the policies passed as dictionaries in the arguments to the
configuration file of the TestServer. The TestServer will serve these
policies after this function returns. | f = None
try:
f = open(opts.policyfile, "w")
conf.write(f, opts.veryverbose)
finally:
if f:
f.close() | 1 |
0c68ebd22bb2f9823b05a535598da8ed | 757bf69ac20a89514beda179c5232301 | Returns all the user files | List<UserFile> getAllFile(); | 1 |
1c3d81b9d3724268b4ca21249f834459 | 59cfa65ac4e47e8d4cd3183f52a21978 | Simple wrapper of Pandas.DataFrame.to_sql with defaults for our Supabase DB | tmp_str = 'sqlite:///{}'.format(database_filename)
engine = create_engine(tmp_str)
df.to_sql(database_filename, engine, index=False, if_exists='replace') | 0 |
95e2d9859f6222890d99bf25dbfa5e58 | e5bcefec24fe05d75cd7c80ca3e64dc2 | Provides information from metaweather.com, caches it for a while. | public class UnstableWeatherAPI implements WeatherAPI
public String getWeather(String city) throws ServiceNotAvailableException {
if (unavailableCities.add(city)) {
if (!weatherMap.containsKey(city)) {
weatherMap.put(city, city.length() > 5 ? "Rainy" : "Cloudy");
}
... | 0 |
a30812f4f70ca408233aefe245b38f67 | 8aca7fe21427eae60d055f1ba160a86f | RepositoryConfiguration constructor. | {
$this->filesystem = $filesystem;
$this->config = $config;
$this->stubs = (object) [
'repositories' => $filesystem->get(__DIR__ . '/../../stubs/repositories.stub'),
'repository' => $filesystem->get(__DIR__ . '/../../stubs/repository.stub'),
];
} | 1 |
98a3e0c094fc0ec10faa9aa6571c1c93 | b971e15349e1dd72b4d6c5aee68f1649 | Queries the client queue for any clients awaiting registration. | {
if (!_pending.ContainsKey(clientFingerprint))
{
_pending[clientFingerprint] = new ConcurrentQueue<Tuple<DateTime, FpTcpUtils.FpFunctions, string>>();
return null;
}
var result = new List<Tuple<FpTcpUtils.FpFunctions, string>>();
Tuple<DateTime, FpTcpUtils.FpFunctions,... | 1 |
73446bb76e17bfa4ae2be931e2eb9f0f | 9f5264baa0e2f3c48519388f089c2b4a | This fetches all currently active alerts.
i.e. GetAlerts | resp, err := httpRetry(http.MethodGet, alertmanagerURL+"/api/v2/alerts")
if err != nil {
return nil, err
}
var alertResponse []*types.Alert
dec := json.NewDecoder(resp.Body)
defer resp.Body.Close()
if errDec := dec.Decode(&alertResponse); errDec != nil {
return nil, errDec
}
return alertResponse, err
} | 1 |
7e557c7f188e70d9bb77973d33f9974d | 4ee011fad22a86f7eaac4090f3583cd0 | Validates the input parameters for the updateGlobal() method. | $hasUpdateValue = ($formParams['isupdate'] === self::IS_UPDATE_VALUE);
$hasProgramID = is_numeric($formParams['programid']);
return ($hasProgramID && $hasUpdateValue);
} | 1 |
405a545ce90c7b222af0714f71433956 | c7c1c39460a9f347dbba5023401c7003 | Evaluates if value es empty or None, if so returns default | if target is None:
target = value
return value if target is not None else valueDef | 0 |
7ef6511d3dc2217d088695615a1a4a4e | 3c94587d6672329727a02b9fe06db5f0 | Define all options modules with 'True'. | class AugmentationOptions(NamedTuple):
def all_activated(cls):
true_array = [True for _ in range(12)]
return cls(*true_array) | 1 |
0fe9b0b9178fae2bb7d7a28ce80edee7 | 05ef05e392f545e2137061e2a3df2c33 | 生成插件框架下的AOP Advisor类 | public class ShiroConfiguration
@ConditionalOnMissingBean
@Bean(name = "defaultAdvisorAutoProxyCreator")
@DependsOn("lifecycleBeanPostProcessor")
public DefaultAdvisorAutoProxyCreator defaultAdvisorAutoProxyCreator() {
DefaultAdvisorAutoProxyCreator defaultAdvisorAutoProxyCreator = new DefaultAdviso... | 0 |
8b5fedd4966e5747e16215705b1c51f6 | 922841d9df115151c1250208dd294446 | 解析微信链接界面 | class WxBot(object):
def visit_parse(self):
result=self.session.get(self.redirect_url,allow_redirects=False)
soup=BeautifulSoup(result.text,'lxml')
self.skey=soup.find('skey').text
self.wxsid=soup.find('wxsid').text
self.wxuin=soup.find('wxuin').text
self.pass_ticket = so... | 1 |
1b1f867f3f01071aa07d2a72591d10d3 | 299e3837d2b6ea19b54099df9136fd01 | receive commands from remote server and run on local machine | def remote_command(user, radar, command):
try:
signal.alarm(TIMEOUT)
failed = True
out = ''
cmdlist = ["ssh", user + '@' + radar, '"' + command + '"']
if radar[0] == 'a':
if 'linux' in radar or 'lnx' in radar:
cmdlist = ["ssh", user + '@' + radar, '-p', '7022', '"' + command + '"']
if 'qnx' in rada... | 0 |
73e951cd04e0d8b1069aa7b39463d08e | d9888ca7bbaa4e7fb24216f6e0c7df11 | Build a constraint matrix for this sudokue problem.
A sudoku board is converted to a convex optimization problem
by treating each cell as a size n binary vector, where a value
of 1 at position k indicates that cell's value is k. There are
n^2 cells on the board so a vector of size n*n^2=n^3 is needed
to encode all cell... | class SdkuBackend():
def __init__(self):
self.vars = range(9)
self.rows = range(9)
self.cols = range(9)
self.squs = range(9)
self.cons = range(27)
for i in range(9):
self.vars[i] = range(9)
for j in range(9):
self.vars[i][j] = Varia... | 0 |
ac108ec2eb116f6cf520a0f7a0b6336e | c59d61b11ef9a8c42636fac375aeee2b | Return the angle (in degrees) of this vector. | export class Vector implements AbstractVector
public angle(): Angle {
return Vector.vector2angle(this)
} | 1 |
df9342a275b3b0a6ba7b5253070869c8 | 8e4e3999bfaec7c8ed1aca2af2248209 | Write the XML-document to a given file.
Keywords arguments:
xml_fp -- An open filehandle. | class SignableDocument(object):
def write_xml_to_file(self, xml_fp):
doc_str = self.tostring(pretty_print=True)
xml_fp.write(doc_str)
xml_fp.flush()
if self.debug:
print "XML:"
print doc_str
xml_fp.seek(0) | 1 |
73eb61f528a5c36e98da7d7bd5592db0 | a1d51ba570ce2453a1fe0d58cfcbea0b | this function is passed to start_graphics. It clears the window and draws the paddles. | set_clear_color(0, 0, 0)
clear()
set_fill_color(0, 1, 0)
disable_stroke()
paddles()
ball()
print_scores() | 1 |
b51370b1ac53feb1994b13c21cc55588 | 10a3f8e601a34d9df6a7fe7423a3a67f | SwapPanel will set the given panel visible and put the others to the
background. | class Engine(object):
def do_switch(self, position, screen_name):
position = position.lower()
assert position in self.panel_positions
cls = screens._screens[screen_name.lower()]
if self.panels[position].name != screen_name:
self.panels[position] = cls(self) | 0 |
90bed68a2ed951ad4b9d4f6ca62c422a | 2b8ad0c1299f8100e7382a5ef735f2f8 | 设置中心X的值 | public class RotateFilter extends TransformFilter
public void setCenterX(float centerX) {
this.centerX = centerX;
} | 1 |
39e5faf5238a865cc0b5b7032b7fafa4 | 1b716bbb44a644a6f2d2c4c52e1e0f67 | ssssss形式の時間を"hh:mm:ss"形式へ変換する. | def sec_to_str(int)
unless int
str = "--:--:--"
return str
end
h = int / 3600
m = (int - h * 3600) / 60
s = int % 60
str = sprintf("%02d:%02d:%02d", h, m, s)
return str
end | 1 |
a156c7fdb318ac79a1ff1b718bb00a19 | 207723191a598ace6a99f2e5a7670cde | 8859_1인코딩을 KSC5601인코딩으로 변환한다. | {
try {
String str8859 = new String(str.getBytes("8859_1"), "GB2312");
return str8859;
} catch (UnsupportedEncodingException ioe) {
return str;
}
} | 0 |
770bebfb96e98afc4ea2062c9f50b623 | 70af1eccb691f2bf4312bf33eb33dde1 | 2. Read presentaciones de un grupo | {
$groups = DB::select(DB::raw("SELECT nom, id_club, id, tipo, dia_sem, (select to_char(hora_i::time, 'HH12:MI AM')) || ' - ' || (select to_char(hora_f::time, 'HH12:MI AM')) as horario FROM sjl_grupos_lectura WHERE id_club = '$idclub'"));
return view ('groups.showlist')->with('groups',$groups)->with... | 0 |
7a2cdc439c61742e70ebf1799512a4d9 | 6e97e804e18989677a94d77b0a60a812 | ! get the message from the RX buffer (legacy).
See usart_getnmsg() for info. | {
static char savmsg[1840] = " "
" "
" "
" "
" ... | 0 |
0e739f6335b8f0bbc0f854a7ead46470 | 0ae613a3b7ff775a6886221600b26c3b | 删除线性表,如果成功返回OK | {
if(L == NULL)
{
return ERROR;
}
SqlPtr temp1 = L;
SqlPtr temp2 = L->next;
while(temp2 != NULL)
{
free(temp1);
temp1 = temp2;
temp2 = temp2->next;
}
free(temp1);
L = NULL;
return OK;
} | 1 |
829accafa79942e0e30c32aca2a0498f | 5aee1c2f394e9d1d6528f4624c0fc15f | Buscamos todas las pestañas de esta ventana. | namespace mx
CTab * CPeWorksWindow::GetTab() const {
return const_cast<CTab *>(static_cast<const CTab *>(FindChild( CPeWorksLayout::MX_PEW_TABS )));
} | 0 |
d3973981aed0019d06f64d87314ca9f4 | 32c73fba44a9a6884bc23b15cc5a488a | 撤销离职 | namespace CNGWEB.CNGTZ
public class user : IHttpHandler
public void user_lizhi(HttpContext context)
{
string ID = context.Request["ID"];
string msg = context.Request["msg"];
string SQL1 = "UPDATE [CNGTZ].[dbo].[TZ_人员] SET [所属部门] ='02',[更新时间] = getdate() WHERE ID=@ID";
... | 0 |
d7e1564675e1f48344bfe7d854c37674 | 8ef740edb2e09b919cae8c0f6621ef40 | Returns the list of playback indeces that are used to traverse the cursor
object. | class TrjClass:
def GetIndices(self):
return range(self.NSkip, self.NCoords, self.NStride) | 1 |
1886487b65cc07d64719901d53bb883b | 6164481380fb422cb58b5f8646097a20 | Isolate the selected Sliders in the Slider Tree | for (int i = 0; i < controls.size(); i++)
if (controls.get(i) instanceof ActionSliderControl)
((ActionSliderControl) controls.get(i)).hideChildWindow();
} | 0 |
bb5a34bf44d3bca8e089be31b7cfcf70 | 3477c6b6b8f314f3de3dbcce4e37c5a7 | Description : Obtains Load Image Header if available from external memory
Arguments : none
Return value : none | ILboolean iLoadPsdInternal()
{
PSDHEAD Header;
if (iCurImage == NULL)
{
ilSetError(IL_ILLEGAL_OPERATION);
return IL_FALSE;
}
iGetPsdHead(&Header);
if (!iCheckPsd(&Header))
{
ilSetError(IL_INVALID_FILE_HEADER);
return IL_FALSE;
}
if (!ReadPsd(&Header))
... | 0 |
118697f2dcb3da8eefa9421e7ce02b49 | d10c4f4d6e904d7c4ac79e74ea232b7f | 通过教师的ID得到教师的名字 | String selectNameById(String teacherId); | 1 |
abc6661ecd6557b936b0e935948d06c4 | 3cbef2a33f0dee09c15524f5c08244fa | converts deprecated prometheus configs to plugin configs | old_volume = a["volume"]
a["volumes"] = []
backend_driver = old_volume["volume_type"]
a["volumes"] << {
"backend_name" => "default",
"backend_driver" => backend_driver,
backend_driver => old_volume[backend_driver]
}
a.delete "volume"
a["volume_defaults"] = ta["volume_defaults"]
a["use_multi_... | 0 |
cd14679d999c0fab7f0d0dbb1b163b46 | 8527910ba65d1a79a40cb0739c844c40 | set initial permissions for each part | String[] readFileArrayForManager = { "BS13.enc", "FCR.enc", "SVS.enc", "TA.enc" };
List<String> readFiles = Arrays.asList(readFileArrayForManager);
permissions.add(new Permission("manager", "universal", readFiles, new ArrayList<String>()));
String[] readFileArrayForRookie = { "BS13.enc", "SVS.enc" };
String[]... | 1 |
4e6b4b17924f83260a581905ad82c9cb | 6ad27c7dde5be5ec708bc8443fe7a8b8 | Resets the underlying unloaded criteria object with a new one. Used
my HABTM associations to keep the underlying array in sync. | if reference_criteria.children_criteria.empty?
@children_criteria = [reference_criteria.id]
else
@field_values = reference_criteria.field_values
@temporal_references = reference_criteria.temporal_references
@subset_operators = reference_criteria.subset_operators
@deri... | 0 |
fd0a94373a1458512d20c8fdba3a0367 | 68120d7a84ca75d58e70f78a8a92deb6 | 默认上传到七牛云中的文件名为:(年)(月)(日)(小时)(分钟)(秒).(文件后缀) | public class EmSalaryBase_UploadChangeController
private String mosaicFileName() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
Date date = new Date();
String nowtime = sdf.format(date);
String name = nowtime + filename + filetype;
return name;
} | 1 |
30071510f5c18286bab834266f85b9cb | 5a453d757f84f91996f4f88d20e29776 | 温度转换类 | class TemperatureConverter:
def judge(self, value):
if "f" in self.value:
self.f2centigrade(value)
else:
self.centigrade2f(value) | 1 |
c44ee7d9e246b1d188d6c84b9763742f | 8c5f1314a968b3612cbd4aae81ef94cb | 处理mysql环境下备份菜单的合并问题 | class Database extends AdminBase
public function backupListHandle($glob = null)
{
$list = [];
foreach ($glob as $name => $file)
{
if (!preg_match('/^\d{8,8}-\d{6,6}-\d+\.sql(?:\.gz)?$/', $name)) { continue; }
$name = sscanf($name, '%4s%2s%2s-%2s%2s%2s-%d');
... | 1 |
7ac825b3d5a6115fdbc6d4864238e860 | ce67d114ec492d78582c3700dae77405 | Get the analytics domains for what clicks should be logged | class Urls
def tracking_domains()
_params = {}
return @master.call 'urls/tracking-domains', _params
end | 1 |
e283052c9fe3a4765ab73a96130a568c | df10bc1a5e623ddd6e91afeabad435a4 | Specifies the storage account id. | class DestinationStorageAccountDetailsResponse(dict):
def storage_account_id(self) -> str:
return pulumi.get(self, "storage_account_id") | 1 |
5e84e403995c0696497fde657ecbf873 | b8cca6f0d8cf905c8dce65f0fef2b50f | Confirm submit final version | class BrowserTests(test.SeleniumTestCase):
def _submit_confirm(self, form_id):
time.sleep(SET_TIMEOUT)
self.wait_css('#%s input.btn-primary' % form_id)
self.click_css('#%s input.btn-primary' % form_id)
self.click_css('div.modal.aflo_confirm_dialog a.btn-primary') | 1 |
6bbbc76e9af4932c2fc9f28b9d8c87ed | 10cf595cbebfeeeebf6fe392b2635174 | Reusable Fade Out Function | function fade(o) {
objStyle = o.style;
if ((objStyle.opacity -= .1) < 0) {
objStyle.visibility="hidden";
} else {
setTimeout(function() {
fade(o);
},40);
}
} | 1 |
0d96045df5b03f0197d72844268302bd | 7f61448ad6da3ef0f9cb03f40c5be655 | 去掉title | cases like (1) | 0 |
52d75badbf865312c7cf36b815ec1fb4 | 3034d27505fbf6c2d1519a998592b5be | Just keep slicing it until we find something that
matches. It's good enough. | impl<'input> Lexer<'input>
fn slice_until_eof(&self, start: &Location) -> Option<&'input str> {
let start = start.absolute() - self.start_index.to_usize();
self.input.get(start..)
} | 0 |
8de6f43635b65471c97e1f597cf7ab9e | e7d3d65bb2b4304020019ec29905cc6d | Wis het het huidige model en zet alle parameters terug naar hun beginwaardes | @SideOnly(Side.CLIENT)
public class ResettableModelRenderer extends ModelRenderer
public void resetParameters()
{
this.rotationPointX = this.firstRotationPointX;
this.rotationPointY = this.firstRotationPointY;
this.rotationPointZ = this.firstRotationPointZ;
this.rotateAngleX = this.firstRotateAngleX;
this.ro... | 1 |
1c1dca099c6dc6b336378ff86897f00a | b4f0b4bc815743317e84ee86a7f4c1fe | Toggle the presence of a mine | void flagBlock(GameElement* gameBlock, int* flagct) {
gameBlock->isFlagged = !(gameBlock->isFlagged);
if (gameBlock->isMine)
++(*flagct);
} | 0 |
e5855f44080bd60da663ff35d2f1932c | a81b79a59646a5c4135548ac72b79b09 | Get hotfixes as a list. | class CsFixer extends Command
protected function getFixes(): string
{
return json_encode($this->getConfigHelper()->getConfig('csfixes'));
} | 0 |
c1440757d93994d8d66c72a61794ae1b | 7197f4b0f52626db2930e48ad214df12 | Test finding all unused tags. | qs = u'tags:\uff11\uff12\uff13\uff14\uff15'
res, results = self._common_normalize(qs)
filenames = get_filenames(results)
tags = get_filetags(results, self.f1.name)
DEBUG('results', results)
DEBUG('filenames', filenames)
DEBUG('tags', tags)
assert_equal(l... | 0 |
5324492ce973ab92212c767c89a67d5d | 23cbf2e0c325d157ab430260b8421f42 | fill array with values from the stdin | {
for (int i = 0; i < length; i++)
cin >>arrayPtr[i];
} | 1 |
665baf3c0b93d7b401468c666162a0b6 | 419560edc15e8a03c4bd92f277507652 | Clear all cache items via memcache_adapter.
This method is for testing purpose since each integration test should have
empty cache in the beginning. | class ChipVN_Cache_Adapter_Memcache extends ChipVN_Cache_Adapter_Abstract
public function flush()
{
$this->getCache()->flush();
} | 1 |
025aebd85a24d515223df6e697b8fa85 | 698f56ea610e424b129981f8a3c2603a | Generate a password synchronously. | {
using var argon2 = new Argon2id(Encoding.UTF8.GetBytes(passphrase))
{
DegreeOfParallelism = 4,
MemorySize = 2048,
Salt = salt,
Iterations = 12
};
return await argon2.GetBytesAsync(size).ConfigureAwa... | 0 |
d71025b64df281f6d80c1e6b6fb061f8 | e24485a1657375925a23a5e30c444330 | initialize a full set of points for the Nelder-Mead algorithm | class BayesianOptimization(object):
def init(self, init_points):
l = [numpy.random.uniform(x[0], x[1], size=init_points) for x in self.bounds]
self.init_points += list(map(list, zip(*l)))
y_init = []
for x in self.init_points:
if self.verbose:
print('Initializ... | 0 |
c1ebd354a64c45b4c4b23ca8e4580c88 | 797835df8c18d70544c392a9903b602c | nothing to do. it has been moved. | class TaskFirebaseAdapter(frag: TaskViewFragment, usr: User, wg: WG, context: Context) : RecyclerView.Adapter<TaskFirebaseAdapter.TaskHolder>()
override fun onChildMoved(snapshot: DataSnapshot?, preKey: String?) {
} | 1 |
d0598d4a49c5045b954a56da800811b5 | 18577a07ce6e5d6b07b7ca404be82f83 | converts RGB to HSV | function RGBtoHSV(c)
local r, g, b = c[1], c[2], c[3]
local min = math.min(r, g, b)
local max = math.max(r, g, b)
local delta = max - min
local h
local s
local v = max
if max ~= 0 then
s = delta / max
else
s = 0
h = -1
return h, s, v
end
if r == max then
h = (g - b) / delta
e... | 1 |
6c45026b0f08a940831402102810bbd6 | fe91a194a909ab31d9cb1668b43573dd | Returns all of the request type permissions for the specified DataMart | namespace Lpp.Dns.Api.Security
public class SecurityController : LppApiController<DataContext>
[HttpGet]
public IQueryable<AclProjectDataMartRequestTypeDTO> GetProjectDataMartRequestTypePermissions(Guid projectID, Guid? dataMartID = null)
{
var result = (from a in DataContext.Secure<AclP... | 1 |
353251b8e05fdcaa2031171f953f54db | 6cd92baa60b62e578551a35fa7927a3c | 同一組合企業のインタビューのうち、
インタビューStatusが1(完了)のものを表示 | class Admin_Admin_InterviewController extends BaseAdminController
private function valinterviewresultinform($applyUsrList, $case) {
foreach ($applyUsrList as $usr) {
if ($usr['apply_status'] != 'INTERVIEW_ADJUST') {
return $this->getText('interviewresult_talent_status_error');
}
}
return TRUE;
} | 0 |
fc3d745b2759e3e66e978f45a453c2d5 | 98b5fd8170d4a256f82d9e07c31d8e03 | Method to set the adapters for the view | public class IndividualCategoryActivity extends AppCompatActivity
private void initializeAdapters(){
CardViewEventAdapter adapter1 = new CardViewEventAdapter(context, events1);
rv1.setAdapter(adapter1);
CardViewEventAdapter adapter2 = new CardViewEventAdapter(context, events2);
rv2.setAd... | 1 |
4f400c1d5248c449f089336cb3cd490d | 30bfda96794681a17bc76d13bb41a65b | Read all files and build a model | self.clf = joblib.load(self.build_model_filename())
self.vectorizer = joblib.load(self.build_vectorizer_filename())
print "Successfully loaded ReadmeClassifier!" | 0 |
f9e80697e81c41f45ea76be504dba871 | 50245511d7ff28803874bf41fda481c2 | 엑셀다운로드 함수 | function excelViewAjax(currentPage, btCheck){
if($('#ex_filename').val()==""){
Swal.fire({
icon: 'error',
text: "파일을 업로드 하세요",
})
return;
}
var formData = new FormData();
formData.append("excelFile",$('#ex_filename')[0].files[0]);
formData.append("currentPage",currentPage);
formData.append("btCh... | 0 |
26ef9bb5432620d3f20be171ca5e9fe2 | 5df56591ee9983aa1e0486df47be3146 | Get last log insertion in Piwik to avoid duplicates | class Piwik_LogStats_Generator
public function getTimestampToUse()
{
return $this->timestampToUse;
} | 0 |
ddcb8dae6dd375d7903c09c85e3e17a9 | 692e89e4325405b25f16b75545557db9 | List of possible periods | {
ObservableCollection<string> periods = new ObservableCollection<string>();
periods.Add(1.ToString());
periods.Add(3.ToString());
periods.Add(6.ToString());
periods.Add(9.ToString());
periods.Add(12.ToString());
return periods;... | 1 |
15a724ad3bc73347024cf536a7548c2e | 9e7005b02fb1c560afd2ddbbff61cfb8 | Generate a list of related entity names that we expect to see in the
Person DeleteView. | class CleanMixin:
def _get_relation_objects_for_validation(self): | 0 |
e0b5a7c1c288bf1e0cbcd33230ad2a4c | 92e56cfb2fd7ecc975090276d7b7f1a8 | Method to set new pay for one lesson | @DatabaseTable(tableName = "LessonPayment")
public class LessonPayment
public void setPaymentAmount(String paymentAmount) {
this.paymentAmount = paymentAmount;
} | 1 |
aaa58e2a969d5aa61dbc2f80167256da | 0b5c70e9036c48e88a091662a19e325d | Расчет моды | namespace Actor
class ActorBackBone : IBaseActor
protected void CalculateMods()
{
StrengthMod = ConvertToMod(Strength);
DexterityMod = ConvertToMod(Dexterity);
ConstitutionMod = ConvertToMod(Constitution);
IntelligenceMod = ConvertToMod(Intelligence);
... | 1 |
cc8c2ed64cbb72b8fa6d8a7baccb5214 | c06448f0167588eb41f62f2e168d31fe | 调用store中的getState获取数据, 将数据设置给state | class Counter extends React.Component{
constructor(){
super();
this.state = {number:store.getState()};
} | 1 |
afdcda7bc9e85912b7b8bcda41fe39fc | ae64cfcf874b3b3e0bdd44b6bd75cefc | Method for search a document classes by last modified date in FileNet Engine | FileFormats getFileFormatsByModifiedDates(Boolean returnSubEntities, String modifiedAfter, String modifiedBefore) throws ApiException; | 1 |
a1d3892a560a3357258a51b739366963 | a69c70d5625948951580a88c72feb661 | 回归的alpha系数 | if(eps<100):
alpha = -8E-05*pow(eps,2) + 0.0171*eps + 0.0028
else:
alpha = 0.98
return alpha | 1 |
f93245e2f3dd008bbfe9c81e6c8b1290 | ab291f09c959a6abfc8bc8372db514ee | Just ensures that the SensorType column in the computerpref table has length of 255 (since older code used a length of 256, which is invalid in MySQL version 4.1). | namespace fawkes
size_t
KatanaInterface::maxlenof_sensor_value() const
{
return 16;
} | 0 |
2482bb925e1722608db140d75cf6ed4a | 73a23e6e24d5cc66073e2b2836ab2869 | Вывод расписания у определённого поезда. | {
$result = array();
if ($this->stationID == 0)
{
return false;
}
$modelRasp = JModelLegacy::getInstance('Yandexrasp', 'Railway2Model');
$modelRasp->setYandex(Railway2HelperCodes::getYandexById($this->stationID));
$dir = Railway2HelperCodes::getDefaultDir($this->stationID);
$modelRasp->setDire... | 0 |
fc98eca3d02461585a25f4e9678e852b | bc5002bd939269dd3d0f17269661c3c0 | Conjunto de testes que verifica a validade na criacao de grafos. | insere_aresta(5, "116319", 4, &Grafo->Adj[1]);
insere_aresta(6, "129011", 4, &Grafo->Adj[1]);
insere_aresta(7, "129020", 2, &Grafo->Adj[1]);
insere_aresta(8, "113042", 6, &Grafo->Adj[3]);
insere_aresta(10, "116394", 4, &Grafo->Adj[6]);
insere_aresta(10, "116394", 4, &Grafo->Adj[7]);
insere_a... | 0 |
d32f7a5d3a5e4e134aac8ceef6841efc | 044932841c21005223210ee9fdb0f56e | Нанести урон врагу | namespace Dungeon
class Map
public bool MakeDamageEnemy(int dung, int damage, int en)
{
if (en >= 0 && en < nEnemies)
{
enemies[en].attHP -= damage;
if (enemies[en].attHP <= 0)
{
return true;
}
... | 1 |
b32e54fd9ef0f86340062c7f86a08093 | c5272153b0ccacc8e9b2cbd364505197 | Helper function that reads the book name file and returns a dictionary mapping the book
id to the book name | def loadIdToName():
dictPath = './dict/'
dictInfoFile = open(dictPath + 'dictInfo.txt', 'r')
blockSize = int(dictInfoFile.readline())
blockNum = int(dictInfoFile.readline())
dictInfoFile.close()
dictionary = {}
for i in range(blockNum):
dictFile = open(dictPath + 'id2name_' + str(i) ... | 1 |
bcb7d73d861002fc0fb56c3c02206635 | 727b636088b19c59d9919e05600df4df | Merges the field definitions. | namespace DataDictionary.Tests.DBElements
public class DBField : Generated.DBField
public void Merge(DBField other)
{
if (getVariable() == other.getVariable())
{
setGuid(other.getGuid());
}
} | 1 |
f5b18e67c7a65fb526ae7aa03ee878c6 | d167e92165223cb89b680b29cc2f49bf | # likelihood-ratio test | glm_wrapper_2df <- function(snp) {
glm_formula <- paste0("outcome ~ ", snp, " * ", env, " + ", paste0(covars_1, collapse = " + "))
glm_formula_base <- paste0("outcome ~ ", env, " + ", paste0(covars_1, collapse = " + "))
glm_1 <- glm(glm_formula, data = figi, family = 'binomial')
glm_2 <- glm(glm_formula_base, d... | 1 |
c3f054f1f114fe8edee50d4e2750ed3b | 1899b4ced03929cd3e331fc7738f18b6 | 阻塞,每得到一个新的连接,就创建两个线程。一个接收客户端发来的数据,一个给客户端发送数据 | while True:
new_socket, client_addr = self.socket.accept()
print(client_addr)
t1 = threading.Thread(target=self.recv_data, args=(new_socket,))
t1.start()
print('线程启动') | 0 |
51e9421e1df7e6d621c98753f540f72c | 18704cb0e988026ab64508361f3044ef | 给模板对象添加控制对象属性 | namespace MACS.HttpServer public abstract class HttpTemplatePage : HttpNlsSupport
protected void AssignWebControls(object obj=null) {
if(obj == null)
obj = this;
foreach(FieldInfo fi in obj.GetType().GetFields(BindingFlags.Instance|BindingFlags.Public|BindingFlags.NonPublic|BindingFlags.Flat... | 1 |
1b480058370129c9c991b0d9008b50af | f3c30525d4aa312565267e41cb404094 | Update Coupon Expiration
This method check the coupon expiration and update the Active column ( boolean ) | namespace CCN.WebAPI.ApiControllers
[RoutePrefix("api/Rewards")]
public class RewardsController : ApiController
[Route("UpdateValidity")]
[HttpPost]
public JResult UpdateValidity([FromBody] CouponInfoModel model)
{
return _rewardsservice.UpdateValidity(model);
} | 1 |
5a3407a537f44dfaab50f4fa57726305 | de1d6358e0b11b918097c7a35ee4e836 | Patikrinama ar teisingai nurodytas naujos grupės vardas | {
$result = mysql_query( "SELECT * FROM `group` WHERE name='".$fvar['name']."'" );
if($result && mysql_num_rows($result) > 0)
return false;
return true;
} | 1 |
1627a25f8488d195c8acbab4dbed113b | 4ed35bacc91314a223c447f2a5f4b033 | Split command to list for pexpect. | def get_cmd_list(cmd_string):
cmd_string = cmd_string.replace(': ', ':')
cmd_string = cmd_string.replace('\'', '')
cmd_list = cmd_string.split(' ')
print(cmd_list)
return cmd_list | 1 |
82be326d298ef1e5b85feec94ccf2909 | 59328b0a24d8d6b2bab45362e8041541 | Does diffing work across a long text with many changes? | function computeTextDiff(before: string, after: string): Diff {
let diff = diffMatchPatch.diff_main(before, after);
diffMatchPatch.diff_cleanupSemantic(diff);
let beforeLine = "";
let afterLine = "";
let diffLines: DiffLine[] = [];
let beforeLineChanges: CharacterRange[] = [];
let afterLineChanges: Charac... | 1 |
809a7bc313cfba95494817cb89ce344b | b4f6052788aefff713292ade497f62e8 | Method to get the understandable format for route taken so far | if self.string is None:
routeString = ""
for aNode in self.nodes:
routeString += (str(aNode.getIdx()) + "_")
self.string = routeString[:len(routeString)-1]
return self.string | 1 |
39b0c2e1123769f82c70e777b03c1ae5 | 9b403c0554597fd0011c89cad2ed20df | 得到线程的结果 | class QueueThreadQt(QThread):
def get_result(self):
return self.result | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.