query_id
string
corpus_id
string
query
string
code
string
label
int64
5d8eff4277a955a9cf460562992a1631
e4d97c818f65b50f6504a16c229a51b4
Invoked whenever a parent working copy has been discarded
final class ArcanistMercurialAPI extends ArcanistRepositoryAPI protected function didReloadWorkingCopy() { $this->rawDiffCache = array(); $this->branch = null; }
0
83e0222ce653d53bdda1f00f1baaf2a4
ae709b131a2cdea1011d79fd48e723d8
Returns the number of custom fields
class CustomFieldBag implements \IteratorAggregate, \Countable public function count() { return count($this->customfields); }
1
ffaf1d0f873f80b251fb003713143f22
51e03695d455847b10b9ac80a13060f5
单个分类下样式
class ApiArtStyles extends ArtsStyles public function getArtClassStyles($classId) { $arr = []; if ($classId) { $list = $this->getArtStyles(); if (!empty($list)) { foreach ($list as $key => $value) { if ($value['classId'] == $classId) { $arr[] = $value; } } } } return $arr; }
1
47e1b2a9af1f3f32f8456d43c699b56f
dbe5e19e8dceadeba9578451e01b31db
Removes all ratings connected with specified film
namespace Oscar.Dapper.Repositories public class FilmRepository public void DeleteLinkFilmAllActor(Guid filmGuid) { using (SqlConnection connection = new SqlConnection(Connection.Instance.ConnectionString)) { connection.Execute(@" DELETE FROM Actor...
0
1dd5b19d24b99dc50069996c58794b08
55dd496a90daf0440d7a00d3a7db7c71
use reST style
def test_parser_basic_content(settings): source = """Lorem **ipsum** salace""" render = RstBasicRenderer().parse(source) assert render == """<p>Lorem <strong>ipsum</strong> salace</p>\n"""
1
75567128c0e07aeb361b1afe3adb1f96
671d9000c8529e3a47e3d260ff0162de
Returns a matcher that matcher when the specified method is called for the $index time The method constraint must the of type equalTo ( which is the default type )
class SingleMatcher<Type> extends Matcher<Type> public static for<Type>(input: Type) { return new SingleMatcher<Type>((innerInput) => innerInput === input); }
0
6df8f281c89a535e7bf2efee9b6c39a6
bb774e2acadbd69568d7b0841087eca7
Callback on internal subset declaration.
static VALUE create_internal_subset(VALUE self, VALUE name, VALUE external_id, VALUE system_id) { xmlNodePtr node; xmlDocPtr doc; xmlDtdPtr dtd; Data_Get_Struct(self, xmlNode, node); doc = node->doc; if(xmlGetIntSubset(doc)) rb_raise(rb_eRuntimeError, "Document already has an internal subset"); dtd = ...
0
7721bdcde40919af442d61c4afb51fed
a88ffa19a69f361b4f572e79652be5fc
l'entity manager accede al DB e tramite il metodo find cerca l'oggetto che ha quell'id e lo restuisce come OrdinePizza
public class OrderController public Order getOrderById(int orderID){ OrderPrestashopDAO dao = new OrderPrestashopDAO(); return dao.getId(Order.URLORDER, orderID); }
0
d283063d71efcd7003fd3611a09c238e
a7da8545d917facdce990b88de515daf
function to check if there is hit in the cache.If not, put it there
bool access_cache(block *set, unsigned long tag) { clock++; block *b = find_block(set, tag); if (b != NULL) { hit_cnt++; update_block(b, tag); return true; } miss_cnt++; b = get_block(set); update_block(b, tag); return false; }
1
e8fe6cb229fb57c9ec9ec73c6204cece
cba9173c6de374f98705c37b39d7cbb0
校验游客必填信息
if (this.params.requiredVisitedEmp === "1") { if (!this.resDent.id) { this.utils.message.error('VIS_RESERVE_MSG6'); return false; } } if (this.params.requiredVisitedDept === "1") { if (!this.deptParam.id) { this.utils.message.error('VIS_RESERVE_MSG7'); retur...
1
837b8b9e45be8a328d0fe5f5b2fe3822
0c8cf7e973dbbcb3166cd60962909719
identify if the given event id contains the substring of the keywords, which read from config.
namespace Accela.ACA.BLL.EMSE bool IsConfigEventScript(string agencyCode, string eventName);
0
097f6f0468037044ac194fe87d5bf383
2455e49e8c238452f24c333efdb18e16
Delete a feature from the tag.
try: dataset = dtoolcore.ProtoDataSet.from_uri( uri=dataset_uri, config_path=dtoolcore.utils.DEFAULT_CONFIG_PATH ) except dtoolcore.DtoolCoreTypeError: dataset = dtoolcore.DataSet.from_uri( uri=dataset_uri, config_path=dtoolcore.utils.DEFAU...
0
5a3cc6e3fbeeb3eb33718c92bd53689a
51c974f6f9d5ff8963d31d5f2f197a5a
VERIFICAREA CORECTITUDINII COORDONATELOR
{ int ok = 1; if ((strcmp(tip, "munte") != 0) && (strcmp(tip, "citybreak") != 0) && (strcmp(tip, "mare") != 0)) { ok = 0; printf("Tipul poate sa fie:munte, citybreak ,mare\n"); } if (strcmp(dest, " ") == 0) { ok = 0; printf("Destinatia nu poate fi vida\n"); } if (zi > 31) { ok = 0; printf("Ziua nu ...
0
e906a166597a850a6d02228384225fa1
e270a4d729667e140405428ea0d3e572
! Initializes PIN and PORT for input
{ getRegAndBitmask(&clk_port, &clk_bitmask, _pinClock, INPUT); getRegAndBitmask(&din_port, &din_bitmask, _pinData, INPUT); getRegAndBitmask(&load_port, &load_bitmask, _pinLoad, INPUT); }
1
749a6a7477c912e1f09bc470cfee2689
669d803613d32bff928878ae12e19bc9
判断订单号是否为空,若为空则生成新的订单号
{ $chars = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9'); $orderId = ''; for($i = 0; $i < $length; $i++){ $orderId .= $chars[array_rand($chars)]; } if(substr( $orderId, 0, 1 ) == '0') { $orderId = $this->genOrderId( $length ); } $buylog = parent::get("orderId='{$orderId}'"); ...
0
804ca070afba9bb6a976ba2d8b2ada4d
67439ecd4b01acbaaeb0dc2a1efdc8df
"repair" one bit error by brute force.
if s == "": return s pos = random.randint(0,len(s)-1) c = s[pos] bit = 1 << random.randint(0,6) new_c = chr(ord(c)^bit) return s[:pos] + new_c + s[pos+1:]
0
3d09287d4dfe9acb015305569f96b0e3
e41a8bdf6dce0640b0c48970a4d4be65
Отключение плюрализации имен
namespace WhaleReport.MainDB.DAO internal class SuperDb : DbContext protected override void OnModelCreating(DbModelBuilder modelBuilder) { modelBuilder.Conventions.Remove<PluralizingTableNameConvention>(); base.OnModelCreating(modelBuilder); }
1
ac200cbdc01f21eeff01481902d1d521
382e2a4c78958dd662583e89ddf93e4d
Generates the first slice in the model as well as reseting the internal mechanisms to the initial slice.
public class PermutohedralLattice public void beginSlice() { m_nReplay = 0; }
1
cedf4ce50e8eb18551190734318540ff
2dddd15af0f83f24a9ed4996bcc09f71
convert a string with literal \uxxxx or \Uxxxxxxxx characters to UTF-8 note the double backslash is needed if called on a C string literal
$regex = '/\\\u([dD][89abAB][\da-fA-F]{2})\\\u([dD][c-fC-F][\da-fA-F]{2})|\\\u([\da-fA-F]{4})/sx'; return preg_replace_callback($regex, function($matches) { if (isset($matches[3])) { $cp = hexdec($matches[3]); } else { $lead = hexdec($matches[1]); $trail = hex...
1
bc2cade68c8b10eb9faaa1fdeba84567
ad039cab27c093361a4d1698fb41ca05
Converts CIE color space to RGB color space
var_Y = ( CIE_L + 16. ) / 116. var_X = CIE_a / 500. + var_Y var_Z = var_Y - CIE_b / 200. if var_Y**3 > 0.008856: var_Y **= 3. else: var_Y = ( var_Y - 16. / 116. ) / 7.787 if var_X**3 > 0.008856: var_X **= 3. else: var_X = ( var_X - 16. / 116. ) / 7.787 if var_Z**3 > 0.008856: var_Z **= 3...
0
e2d3ddc40a97213d0368e9be59ac1f59
f5a3b3717e37d50da02a54d91702815f
Change the price of the selected product
namespace Topelectro.Controllers [Authorize] [Route("api/[controller]")] [ApiController] public class ProductsController : ControllerBase [Route("Changeprice")] [HttpPost("{priceChange}")] public void Changeprice([FromBody] PriceChangeDTO priceChange) { _productOperat...
0
49931002ad04e6e1c51af21d31563934
f20934ffdcbb621a48dbf756b2959ffc
获取用户某个时间区段的信息
def queryUser(client, index, columns, field, value, time_from, time_to): query_range = { "_source": columns, "query": { "bool": { "must": [ {"range": { "localtime": { "from": time_from, ...
1
7ebc0f5bd97fd57bb65d22254b507105
8371905dd012f982dcd6eeb37d7c8c17
Resets the model's matrix to the identity matrix
if(self.matrixmode == CGL.MODELVIEW) then self.modelview = mat4_identity() else self.projection = mat4_identity() end end
1
9a7d331f793f91bf1843833625b65cbe
c59afccb7bb8eac18ace9a848f24bd97
获取SpringBoot侧边导航栏
@ApiIgnore @Controller @RequestMapping("/mainAction") public class MainAction @SuppressWarnings({ "unchecked", "unused" }) @RequestMapping("/getSidebar") public String getSidebar(HttpServletRequest request) { JtUser jtUser = (JtUser) request.getSession().getAttribute("jtUser"); String userRole = jtUser.getUserRol...
1
d66ea3d5d0e28af574b20064cc025f6d
7d55b4e97c0b6e994241a9d7071fceb8
configure and show either the Quanty input or the Machine select list
try: index = self.gridLayout.indexOf(self.fnum_cb) except NameError: index = self.gridLayout.indexOf(self.fnum_le) except: raise row, column, cols, rows = layout.getItemPosition(index) if value: self.fnum_cb.deleteLater() ...
1
71dbafdf82962733b0986162f17f741e
c960fa982324031d222d4bfe27bb5624
Kann true gesetzt werden, um die grafischen Elemente in Relation zur Desktopauflösung zu erzeugen oder false um dies zu vermeiden
class Ad public function setDesktop(bool $desktop): Ad { $this->desktop = $desktop; return $this; }
1
16556dacb63b0b753c938d053cb839ee
5de66aa602fff3c617864b417dbabb0a
返奖点百分比
class BkDistribution extends Distribution public function getpercent($uniacid) { $sysMd = new SysParams(); $percent_str = $sysMd->fetchOne($uniacid, 'price_percent'); $percent = explode(',', $percent_str['var']); return $percent; }
1
adfd1b558dc46c5cc372069fb7836aed
641ffb54ece85b7699a7d146b32bfb2a
Dibuja el boton para jugar
def dibujarMenu(ventana, imgBtnJugar): ventana.blit(imgBtnJugar,(ANCHO//2-128,ALTO//3))
1
f286979a26ff5a55ffa1a431b12b042b
27dc146b71890e02890c9e63fb2bf0fb
Convert the key to a string, by default just calls .ToString()
namespace NSX39Mog public class ComboItem<T> public override string ToString() { return Key; }
1
fb282c02e39364b83994d2938aa23c52
2a4fff871127acf8902e5689b0ee177e
Gets the additional charge list for selector.
{ var url = Requestor.FormatUrl(string.Format("{0}/{1}/charges", BaseUrl, id), Requestor.CreateQuery(listParams)); var charges = Requestor.DoRequest(url, "GET"); return Mapper<ChargeList>.MapFromJson(charges); }
1
710790e40b586db4aee2664e1177131e
d6dd01782babdc4d14595834cb891b59
マスキング文字が0文字の場合に例外が送出されること。
public class ShukinValidatorImplTest extends SimpleTestCase @Test(expected = NotAllowedNumberException.class) public void test_Validate_02() throws Exception { AmountOfMoney kingaku = new AmountOfMoney(0); ShukinBuilder sb = new ShukinBuilder(); sb.withKingaku(kingaku); Shukin shukin = sb.build(); service.va...
0
a8f8dbc03467ac374a610ae25d9f4827
568bab5e7f34d407d31d078fd060efa2
Native definition for COM marshalling of UnityEngine.Object
void UnityAnalyticsHandler_t142810584_marshal_com(const UnityAnalyticsHandler_t142810584& unmarshaled, UnityAnalyticsHandler_t142810584_marshaled_com& marshaled) { marshaled.___m_Ptr_0 = unmarshaled.get_m_Ptr_0(); }
0
b2c8d275f96b8ce549f358f7ef223f05
5ba9f2425c0c6fa23fa19525632e1411
Returns information about the filter of counter.
public function getFilterInfo();
1
d7b9fcee4cea28133290b7d5d43a8db5
457ae1d96b621d3e2523a7797209947b
Read in the directory information for the grp file.
void read_group_descriptor(struct file_system_type *fs){ unsigned long first_value; first_value = BASE_OFFSET + sizeof(superBlock); off_t offset = ( (first_value / block_size) + ((first_value % block_size) != 0) )*block_size; lseek(myfs.file_descriptor, offset, SEEK_SET); read(myfs.file_descriptor, &group1_d...
0
cdf6bf36681cafbed94ab67a3edaa290
9d54e679a7115065718fe92b46420c3d
Show app in fullscreen mode
void MainWindow::on_action_5_triggered() { showFullScreen(); }
1
29df47ee82ecc86fc8d8d72a6b8aaed2
ebd6e7499de287fbf952a9d0de612b86
设置军团长
{ let commanderId = game.modules.team.models.TeamModel.getInstance().commanderRoleid; let capatinId = this.roleInfo[0].roleid ; let roleid = this.roleInfo[this.selectIndex].roleid; if(typeof(commanderId) != "undefined" && commanderId != capatinId ) {...
1
8558b5ab44939efc17088126b49a862d
3877c1821bd9dc21aa57764f7e639e68
Method Description: response to mouse wheel changes. Depending upon what modifier keys are pressed, different actions will take place.
if(!this.active || this.display == null) return; if(wheelDelta > 0) { this.display.fireMouseWheel(x, y, true, wheelDelta); } else { this.display.fireMouseWheel(x, y, false, wheelDelta); } }
0
27088dae9edc3860e2cb85ef981783ef
7a77bd04cb6c11eae79e1527049c204e
Called at the end of each phase (epoch).
class DataGenerator(keras.utils.Sequence): def on_epoch_end(self): return
1
44266b51038d7637ab1c09a3f391f355
73434647508d23a3b03e57a671d155db
@brief Compute density map for fixed cells
int i0, j0, i1, j1; double x, y, s0, t0, s1, t1, deltaT0, nw, ne, se, sw; deltaT0 = deltaT*N; for (int i = 1; i <= width; i++) { for (int j = 1; j <= height; j++) { int cell_ij_index = GET_INDEX(i,j); x = i-deltaT0 * grid[cell_ij_index]....
1
a645912d6a9c2edb1f71fd11804c377e
5b4603db187212dc2af251c57f0968a3
Releases the old number.
class PhoneDirectory(object): def release(self, number): if not self.check(number): self.released.add(number)
1
8a432085013440f204cffa8f33ebc888
04eb3fb11d80e246eb7efea1bcef9a18
动态查询用户冻结与解冻信息
public Page<VCustomerFrozenUserVO, VCustomerFrozenUser> findVCustomerFrozenUsers( final Map<String, ?> param) throws Exception;
1
ef4e6127ca5fd717f889239673ec7f0d
4178d29170fcabf77e674f4291477972
Check matrix event signing using the test vectors from https://matrix.org/docs/spec/appendices.html
func TestKey_Sign_Consistency_TestVectors(t *testing.T) { for i := ParamsEncoding(0); i < ParamsEncodingLen; i++ { testConsistencyParams(DecodeParams(i), t) } }
0
e5b5b6fe2c9e65373cb9095ed146116f
9295294a290f9f89a77323bb25880562
Returns the meta object for the containment reference list '{@link e3Value.BusinessActor#getHasDependenceElements <em>Has Dependence Elements</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
EReference getBusinessActor_HasDependenceElements();
1
13fc3901e6f0fb219fea0c681fd367a6
a12f9632c3c1209799ddf21a7f9b36b0
decides how much gold is in a particualr vein
public class GameInstance implements Serializable public static int determineGoldVeinAmount() { return 60 + (int)(Math.random() * 60); }
1
62bf074079fe1fa866e47c5a7d50344c
b211cad8afff1bb83910ba6315f13d02
Converts from a coordinate given in pixels to a position in absolute units.
{ return new MPoint( coordinateInDeviceIndependentUnits.X * PixelDensity, coordinateInDeviceIndependentUnits.Y * PixelDensity); }
0
6dda3c46d0e56b6e40981ff0678fef33
d6b8cef1e89775f8f2d61743317e40c5
Opens an external page with all the dial in numbers.
class System(BaseV2, ISystem): def open_Dialer(self): self._logger.info("Launch Dialer application") self._exec("adb shell am start %s" % self.dialer_component)
0
eee51ff391800fc6c03125f522c99bfe
a204880ecb517f9ccf5873c26a67a126
设置 交易名称
@Entity @Table(name="account_transaction") public class AccountTransaction extends BaseEntity public void setName(String name) { this.name = name; }
1
ccac32e6bfe3aeff84ab3a737e781120
30c5084cd277d65f60a00a6555a2f9f2
Set colors of all curves
plot->yAxis->setLabelColor(TextColor); plot->yAxis->setTickLabelColor(TextColor); plot->xAxis->setTickLabelColor(TextColor); plot->xAxis->setBasePen(QPen(TextColor,TextWidth)); plot->yAxis->setBasePen(QPen(TextColor,TextWidth)); plot->xAxis->setTickPen(QPen(TextColor,Te...
0
b11628a673e6cb1cd37c2d553ec9baa1
cda27d985c0d829898b4dea4ccfa4aa6
サブウィンドウをトグル
namespace CSharpSample01 public partial class MainForm : Form private void childWindowCheckBox_CheckedChanged(object sender, EventArgs e) { subform.Visible = childWindowCheckBox.Checked; }
1
0ec6d472f68a1461f4e095b2bde45dd5
c17d34eab14bf7bd4fdc3ab8f05d5fae
This function opens a specific book and attempts to return it as a string
namespace DaggerfallWorkshop.Utility bool OpenBook(string name);
0
03b4f31305d68388e7312634cf283f0b
debde79ff29c7b6f361d18c363ad9838
Display a listing of the plots.
class ClaimPlotController extends Controller public function index() { return ClaimPlot::paginate($this->paginationRecordsAmount); }
1
ce6644a18019a00b71f93bb99488d706
3b4b3a31a798187e7a83e8639b3fa86f
Cria um carrinho de compras para o cliente passado como parâmetro. Caso já existe um carrinho de compras para o cliente passado como parâmetro, esse carrinho deverá ser retornado.
CarrinhoCompras carrinhoCompras = clienteCarrinho.get(identificacaoCliente.toUpperCase()); if (carrinhoCompras == null) { carrinhoCompras = new CarrinhoCompras(); clienteCarrinho.put(identificacaoCliente.toUpperCase(), carrinhoCompras); } return carrinhoCompras; ...
1
a271946af89410cbdc59d570d32d7056
29b9fa9275b08923ee2ef45133d959ac
Get 水印为图片时的参数列表,水印为图片时校验必填。
public class McuVideoParams extends AbstractModel{ public void setWaterMarkList(McuWaterMarkParams [] WaterMarkList) { this.WaterMarkList = WaterMarkList; }
0
7d6727c3eec709828628797f26581e5e
856699c2c2d585a4d9160b1e9fffadb4
Returns the value of the '<em><b>Has Property</b></em>' containment reference list. The list contents are of type {@link ServiceCIM.Property}. <!-- begin-user-doc --> <p> If the meaning of the '<em>Has Property</em>' containment reference list isn't clear, there really should be more of a description here... </p> <!-- ...
if (properties == null) { properties = new EObjectContainmentEList<Property>(Property.class, this, ReoPackage.PRIMITIVE_END__PROPERTIES); } return properties; }
1
927f0596c77533338b18f410ba2802f1
0bc3566a51d01f2e48f808fe6f674c98
Removes a Creep from the game
export default class RoomSpawnController extends RoomAccessor<SpawnTask[]> public removeCurrentTask(): void { const removeCreepNmae = this.memory[0]?.name if (removeCreepNmae && removeCreepNmae in Memory.waitSpawnCreeps) { delete Memory.waitSpawnCreeps[removeCreepNmae] } if (...
0
3e347c2c2f166f735d88aebf62d18754
d1b68dc37d36a9214614721c0745134c
Getter method for interfaces, mapped from YANG variable /network_instances/network_instance/policy_forwarding/interfaces (container) YANG Description: Configuration and operational state relating policy forwarding on interfaces.
class yc_interfaces_state_ietf_interfaces__interfaces_state(PybindBase): def _set_interface(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=YANGListType("name",yc_interface_ietf_interfaces__interfaces_state_interface, yang_name="interface", parent=self, is...
0
c686075721531dccaaf2d059f15adb7c
9130d00aec15c2d4dd5202e213d61031
@brief Função que realiza o parser do ficheiro Posts.xml e guarda numa árvore e numa tabela de Hash os dados. Também guarda na árvore dos users todos os posts que cada um criou.
class Base private function prepararArvore($xml){ try{$this->xml_formula = simplexml_load_string($xml); $this->xml = $xml; } catch(\Exception $e){ $this->error= 'XML INVALIDO!';} $this->lista_argumentos=$this->arg->CriaListaArgumentos($this->xml_formula); ...
0
feb7661d1ea2898ac37880bab63a4c2f
c6a47427461ab6383e19aef077a9c8e0
Set the authentication key length
public final class PasswordBasedEncryptionUtil public static class Builder public Builder keyLength(int keyLength) { this.keyLength = keyLength; return this; }
1
2788f7dfad59f6a52958c18188c6533d
63730bb06e8935ad1bacdae278d672a1
Function checks if two strings are anagrams. It initially removes all white spaces and transforms all letters into lower case. Then, it compares length of strings as an edge case check. If lengths are equal, it uses hash table method(dict) to count occurences of letters for each string. By subtracting occurences it det...
def anagram_checker(str1, str2): str1_cleaned = sorted(str1.replace(' ', '').lower()) str2_cleaned = sorted(str2.replace(' ', '').lower()) return str1_cleaned == str2_cleaned
0
a4e85666aa61c9d47f934d6d2a61793a
e8988704c439ecf36f5952c149bd901c
从任务集合中取出任务实例,不存在则新建任务放入Map中
public class ThreadPool public void setTaskMap(String key, Task task) { taskMap.put(key, task); }
0
d8ef88881720f0d3ce7235bd83a1f41f
8a652fc7bc15bc9c756a245a9d4a2fea
LDY Immediate
{ D->Cycles = 2; D->Regs.YR = MemReadByte (D->Regs.PC+1); TEST_ZF (D->Regs.YR); TEST_SF (D->Regs.YR); D->Regs.PC += 2; }
1
9879948ae612261e666dbaa70a1427df
45b43d7b21ce479e0f449151224ddf8d
@briefA karakter irányítását végző függvény.
public class PlayerControler : MonoBehaviour void FlipCharacter(float horizontal) { if (horizontal < 0 && !_Flipped) { _Flipped = true; transform.Rotate(FlipRotation); _MainCamera.transform.Rotate(-FlipRotation); _MainCamera.transform.localPosition = I...
1
f40cdeb16681567d0f68faf08dd117f2
4c9d24379a336415bc3ac6b20a8afbf7
Make sure there are no timers running from previous tests
class DashboardTest extends FeatureTestCase public function tearDown(): void { unset($this->timer); parent::tearDown(); }
1
ae3cff048cc87da041ae47001cb32a51
506cdf033e621fd072140257d81bbc2b
https://stackoverflow.com/a/46416353/870615
def chunks(iterator: Iterator[T], n: int) -> Iterator[Iterator[T]]: for first in iterator: rest_of_chunk = itertools.islice(iterator, 0, n - 1) yield itertools.chain([first], rest_of_chunk)
1
3faf96b0c244d1e603996a6e2956ec6d
8051b9c245973acf34bb2301962b1a52
Detect bird presence in wav file.
song = wave.open(file, mode='rb') frame_bytes = bytearray(list(song.readframes(song.getnframes()))) extracted = [frame_bytes[i] & 1 for i in range(len(frame_bytes))] message = "".join(chr(int("".join(map(str, extracted[i:i+8])), 2)) for i in range(0, len(extracted), 8)) decoded = message.split("###"...
0
d1a36d6951d30e9ca19e32725347038f
459decf3b5e714d9ea5e6eaa557b9973
\brief Sets the high limit parameter for a limit condition. \sideeffect None <b>Code Snippet</b> \snippet main.c snippet_ADC_SetHighLimit
int8_t tempLimitValue) { ReturnStatus status = RETURN_NOTOK; uint16_t regValue = 0x0000; regValue = TEMP_TO_REG_U16(tempLimitValue); status = adt7481_raw_write(i2c_dev, ADT7481_REG_W_REMOTE2_LOWLIMIT_L, (uint8_t)regValue); ...
0
df45a85e7fb7f1909170d25960b7c87d
9e8d215ad4e7c86ad0122c9f4a0aa3d0
Setter method for "readonly" tag attribute. (Mapping set in associated BeanInfo class.)
public class SelectTag extends org.apache.struts.taglib.html.SelectTag public void setReadOnly(boolean readOnly) { this.readOnly = readOnly; }
1
134891e0956b5283a6598b589cdd09d3
207908b09c373f2e428a359eb0d8a778
enter sleep on return from an interrupt service routine
enum intr_status old_status = get_intr_status(); if (old_status == INTR_ON) { asm volatile ("cli" : : : "memory"); } return old_status; }
0
7f5e7aad22af40bd4919808f8919ec5c
746b1d861bc7a92bc1be73eae16c9d75
get instances of all the classes needed to run an experiment
class LightningCLI: def instantiate_classes(self) -> None: self.config_init = self.parser.instantiate_classes(self.config) self.datamodule = self._get(self.config_init, "data") self.model = self._get(self.config_init, "model") self._add_configure_optimizers_method_to_model(self.subcomman...
1
c03a26976768f0f5381c4b290739370c
10a06537dabfcae07d03995c4bc58a88
現在の自分の順位を取得する。 ※ ログインが必須
class PlayerBusiness function GetCurrentRank(PlayerDTO $player) { }
1
ee1134c13d2287dde05d1818493d4c59
d3aa925f04ddf3330b43228e2240bcc9
Método para sumar un pasajero
class VuelosController public function savePassenger() { global $usermodel; $error = false; $ajax = array(); if (isset($_POST['passenger_name'])) { $name = $_POST['passenger_name']; $lastname = $_POST['passenger_lastname']; $birthday = $_POST['passenge...
0
63d27fc2761f46ee5a200ecd4b725000
d73405b5b1cd0da56b1cd9bcf7f9570e
byIdentifier Named scope to filter Parties by identifier on find
class TradingDataServiceServicer(object): def PartyByID(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
0
5de0ab6cbb60a8febfc506ea93ea73e2
656cde5f8f0f8e80d424d5a2059bb34c
Getter for the URL frontier
class DominatorTree(object): def post_frontier(self): return self._pdf
0
57d9a9bd54236ee475bf3aca64d5a221
2972533c8da3d961a7ef43c8eb898b92
Make bonds by distance clustered.
df["cluster"] = None df = df.sort_values("pval", ascending=True) clusnum = 1 unclustered = pd.isnull(df["cluster"]) while unclustered.any(): index_row = df.loc[unclustered, :].iloc[0] in_cluster = ( (df["chrom"] == index_row["chrom"]) & (df["pos"] >= index_row[...
1
27485b6e97d6b55121f204a854e5358f
db4900593814929dd124d923ff7e0288
Returns the network with the highest score
double score = std::numeric_limits<double>::max(); unsigned long index = 0; for (int i = 0; i < list.size(); i++){ if (score > list[i]->fScore){ score = list[i]->fScore; index = i; } } if (score == std::numeric_limits<double>::max()) return NULL; else retu...
1
5a5185e3b720d06ef77dedd8419598c1
5b16f26ab8fd743a4a970e0bdb8c0b20
Shows a window if unsaved progress is detected
AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMessage(R.string.unsaved_changes_dialog_msg); builder.setPositiveButton(R.string.discard, discardButtonClickListener); builder.setNegativeButton(R.string.keep_editing, new DialogInterface.OnClickListener() { ...
1
52933fb85f3766ffda20b1541122e558
631e7e412055d71a2b176c8bfd5a18f1
loads rqured translation and stores it to cache
{ if (f.fail()) { dprintf("Failed to open translation, skip.\n"); return; } dprintf("Read translation ...\n"); string strKey, strValue; while (readPair(f, strKey, strValue)) { set(strKey, strValue); } dprintf("Translation loaded to memory.\n"); }
1
dbea5068690c25ba346778c96b7bb142
5184716a896f13ba82721cf1e16e9347
检查测定站号是否在内存中的测定站列表中
var stationList = $(".station").children("div.station-list"); var flag = false; for (var i = 0; i < stationList.length; i++) { if (stationList[i].getAttribute("stationid") == id) { flag = true; break; } } return flag; }
1
2c1f42af8c0ef5288c30d56c6bad3df6
83b0cefd37c796c8c2e5e3b1b9ff5726
获得亚洲上海的当前时间,按格式为yyyy-MM-dd HH:mm:ss的字符串类型返回
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US); formatter.setTimeZone(TimeZone.getTimeZone("GMT+8")); Date currTime = new Date(); String thisTime = new String(formatter.format(currTime)); return thisTime; }
1
063eeab82f59040d789f10d58591fe0a
16d8762d623af696da013fbb76dd7d78
Whether chart tab is enabled
export default class Chart isScrollEnabled () { return this._chartPane.chartData().timeScaleStore().scrollEnabled() }
0
540229ccf85fa7a25cf6b557b1ee6f25
4004e2a8249d4aee794ece3b03cd0a4a
get the instance of the AuthComponent.
class ComAuth extends Zend_Auth public static function getInstance() { return parent::getInstance(); }
1
15e64fee5091f29253996d37929961d0
3af2abafbe420d72d95bc5f3ea018e93
Used to obtain the value of a signal inside a can message.
namespace uwp_technocoid_v10 class MidiController private int ExtractMidiMessageValue(IMidiMessage inputMidiMessage) { if (inputMidiMessage.Type == MidiMessageType.ControlChange) { MidiControlChangeMessage currentMidiMessage = (MidiControlChangeMessage)inputMidiMessag...
0
b24e8c01b8c08672a8450b6d1c76002f
a5197b188e7a0c29dc356c20db387516
List of server node names (not necessarily resolveable)
Collection<String> getServerNames();
1
e50be1169bdb7d290213303307bbcb2f
7173b126eb42710c7cb888f93d40bd48
! Returns the size of the internal read buffer. This limits the amount of data that the client can receive before calling the read() or readAll() methods. A read buffer size of \c 0 (the default) means that the buffer has no size limit, ensuring that no data is lost. \sa setReadBufferSize(), read()
public function getBufferSize();
1
09dddb3a368dcb1aab2ab21bfd355b97
97cebd4983177ce3d03f61205533de4b
Ustawianie źródeł danych dla dataGridView.
{ string id; string number; string country; string region; ...
1
89d1843273ed3cad9073a0f7bdf2dc75
d3a128d37bc56944edc1a536e11b70d9
生成一个长度为length的数组,数组中每个数据均为此值
{ double[] v = new double[length]; for(int i = 0; i < length;i++) { v[i] = val; } return v; }
1
ff427509544679136e7a0b7dd45d7970
5ffacb09ea1806ad501524b28fd9d104
双栈实现的后序遍历
binStack stack; stack.top = 0; while (tree || stack.top != -1) { if (tree) { stack.data[stack.top] = tree; stack.tag[stack.top] = 0; stack.top++; tree = tree->left; } else { if (stack.tag[stack.top - 1] == 1) { stack...
0
f9f7022babb84308ed0d6f3b2cd2b994
b9fbea4be4964741a26d38acb6c4f59b
simple accessor. Finds the country and returns its number of armies
int num = 0; for(Country c:this.countryList) { num+=c.getNumOfArmies(); } return num; }
0
45802cef1288995ece63e8370c079982
654d69edda8f5ed9ba5a4cfe13e7f8c0
Palauttaa taulukosta numeroa vastaavan characterin. Jos numero virheellinen palautta Characterin max valuen.
def get_char(num): idx = bisect.bisect(bound, num) return chars[idx]
0
d521eb58b0ae5926192843c6f178187a
d9bfbb0042a66636d5b567469af7b6be
从请求中获取登录名
if(null != request.getSession().getAttribute("loginName")){ return request.getSession().getAttribute("loginName").toString(); }else{ return ""; } }
1
ef4dacd18ca327740b1e72b7d7dab725
20172dfad3694298664a61e1b7827896
============ ЗАПОЛНЕНИЕ ТАБЛИЦЫ ОСНОВЫВАЯСЬ НА ПЕРЕДАННЫХ АРГУМЕНАХ ===============#
class MyWin(QtWidgets.QMainWindow): def SetTable(self, name, refresh_buffers = True): self.curTable = name if refresh_buffers: self.appendBuffer = [] self.delBufferId = [] self.curColumns = ("All", *self.myDb.Get_columns_names(self.curTable)) self.SetDefaultCheckS...
1
a9cf4358d57016c87e0c765121aad0ff
5e668afee41d3c8e389adbd0c21357a2
Authenticates a user in a user pool as an administrator. Works on any user. Access Level: Write https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_AdminInitiateAuth.html
Preconditions.checkArgument(!com.google.common.base.Strings.isNullOrEmpty(email), "'email' cannot be null or empty"); Preconditions.checkArgument(!com.google.common.base.Strings.isNullOrEmpty(password), "'password' cannot be null or empty"); createCognitoAdminUser(identityProviderId, email, ...
0
b353fa4883e4b1df61b7afe8c78829fb
a74ba468efc5796fb04ec854933bf307
Construct Instantiates validator factory. Requires an instance of service manager to be set.
class Validator public function __construct(\Origami\Entity\Manager\Config &$config, \Origami\Entity\Manager\Storage &$storage) { $this->setConfig($config); $this->setStorage($storage); }
0
1fd31665b79c30f47a33791207a7e59b
d8f47a7874732a95163f152cd8194654
Authenticates user owns email address
class NativeEmailAuthenticationMethod extends AbstractNativeAuthenticationMethod public function authenticate(array $data = []) { return $this->authenticateByField($data, 'email'); }
1
b00154a6809352ae58c150f7196b4810
be545a5ca72858f2eae718f493db2630
NewQuery builds a new Query struct based on the given spec
func NewNamespaceQuery(namespaces []string) *NamespaceQuery { return &NamespaceQuery{namespaces} }
0
7113f8bf3737fe4a33a0c9441f128e11
656a962b6b85b1035646e97ccef8e4d6
TopologyBuilder根据Spout和Bolt来构建出Topology Storm中任何一个作业都是通过Topology的方式进行提交的 Topology中需要指定Spout和Bolt的执行顺序
public class EventCountTopology private static void topology2(TopologyBuilder builder, Config conf) throws Exception { builder.setSpout("spout-random", new RandomSpout(), worker); builder.setBolt("bolt-user-count", new UserCountBolt(), worker) .fieldsGrouping("spout-random", new Fields("...
1
922a644b39453e3047461cbb204becf6
cab64aae3d6ca5f8104ef357f835e6eb
Need to come up with a lighter colour of gemColour for highlighting purposes, and as the inner colour of the Gem (to make it easier to read the Gem name).
pub fn furnace_grey() -> FuzzyPixel { FuzzyPixel { blue_min: 18, blue_max: 28, green_min: 18, green_max: 28, red_min: 20, red_max: 31, } }
0
bec0f5acb17720b01eb5e48a24d468bb
49f4ae5223f246f72abf12ac3bbd26f6
@brief Wczytywanie współczynnika. Używany tylko do wczytywania współczynnika, który nie jest częścią większego wielomianu
{ std::string newPolynomInString; std::cin.clear(); std::getline(std::cin,newPolynomInString); std::stringstream in(newPolynomInString); std::vector<double> polynom; int temp; while(in >> temp) { polynom.push_back(temp); } _n = polynom.size(); _p = new double[_n]; for(int i=0; i<_n; i++) ...
0
eca7b291bdeb3913111d9afd5be112bf
3075ad1712f45dc697292c5891bda212
Convertit l'image vers un format de tons de gris. Un tableau de pixel 'temporaire' est utilisé pour pouvoir parcourir et modifier tous les pixels de l'image originale.
Class Asido_Driver_Imagick2_Ext Extends Asido_Driver function __grayscale(&$tmp) { return false; }
0
1c4b9e4b14a407b5b8d30901928b3040
a16d7f5aa73eb678b1e045dba4a15c75
Results object with appropriate getters for the CreateWordList Choreo.
class Wordnik_WordList_DeleteWordList_Results extends Temboo_Results public function __construct($outputs = array()) { parent::__construct($outputs); }
0