query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
924ea0247b3cf7fc8f27bbbdfa0bbec1 | 02ff1192c4d6c6900c713105fc94b01b | Registers the window message for notification when the taskbar button is created. | {
g_hInst = hInstance;
if ( IsWindows10() ) {
g_MsgTaskbarButtonCreated = RegisterWindowMessage( L"TaskbarButtonCreated" );
}
const DWORD style = WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS;
const int x = 0;
const int y = 0;
const int width = static_cast<int>( 1024 * GetDPIScaling() );
const int height = static_cas... | 1 |
40fecb6ed7ab4d3db09ab7da9285fe23 | 07ff0c4c81707699412ccdc78497f6d5 | Удаляет из списка всех мёртвых дронов | {
for (int index = 0; index < _signalDrones.Count; index++)
if (!Main.npc[_signalDrones[index]].active || Main.npc[_signalDrones[index]].type != mod.NPCType("SignalDron"))
{
_signalDrones.RemoveAt(index);
--index;
}
} | 1 |
40b0c828e40c9fa51996229cd1bef848 | 3cbce216eb7dbbd57bb8c6a143d38623 | Sets the given composable as a content of the current screen.
Use this in your tests to setup the UI content to be tested. This should be called exactly
once per test. | fun ComposeContentTestRule.setContentWithExplicitRoot(content: @Composable () -> Unit) {
setContent {
Box {
content()
}
}
} | 1 |
6be35aa2dbef9d5244d0df06e474a5df | e7ec81f68a4436bb2cb84b036a09d5f5 | convert the always-increasing linear file offset into a circular buffer offset | {
if(off >= chunkNum)
{
return off - chunkNum;
}else if(off < 0)
{
return off + chunkNum;
}
return off;
} | 1 |
80c641f9f45c37725fc1ef7430d43074 | 12222d6da5fce8ceefb769a77c32bff2 | 나누기 반올림 | function roundDiv(x: number, y: number): number {
return Math.round(x/y);
} | 1 |
61533cab7e524a5fd968ea554c5e6962 | 07e237e85ccaebe390c014762824f034 | Maps object coordinates from 3D (world) to 2D (screen) | a_2d->x = (viewer_coord->x * D) / (viewer_coord->z);
a_2d->y = (viewer_coord->y * D) / (viewer_coord->z);
} | 1 |
4452ddc70c06680b6df03919c6ee11bf | 68176c19f28398ca18f2839c365185f1 | Get maximum length of virtual_wall value.
maximum number of characters for a string | if(moments_qodef_options()->getOptionValue('number_of_chars') !== ''){
return esc_attr(moments_qodef_options()->getOptionValue('number_of_chars'));
} else {
return 45;
}
} | 1 |
b333a70c2cae65aa4cc37c2821b2a921 | 5359fc07e70274a356e837a6c372b2d0 | Interface for classes with lights that can be made blinking. | class Lights(object):
def __init__(self, dev):
self.dev = dev
self._white = None
self._blue = None | 0 |
021412a7ed158fff2cf98346f83d9b28 | 60e49616b5df75f84a7e43ff81d2f0af | converts Xpress' sen/rhs/rng triplets into SCIP's lhs/rhs pairs, only storing the right hand side | SCIP_LPI* lpi,
int firstrow,
int lastrow,
SCIP_Real* lhss,
SCIP_Real* rhss
)
{
assert(lpi != NULL);
assert(lpi->xprslp != NULL);
assert(firstrow <= lastr... | 1 |
0381c70f632c273a31460bad4e26ef94 | 274d905b04adae6c8b3d3c2898f75846 | 判断是否授权访问手机相册 | public class WifiFragment extends Fragment implements View.OnClickListener, RefreshView.OnHeaderRefreshListener
public boolean isCameraGranted() {
return ContextCompat.checkSelfPermission(mActivity, CAMERA) == PERMISSION_GRANTED;
} | 0 |
34f69d8ef85518ae93c959bbcea79bec | a882e6c7199c6312a1588ea34bcda480 | Tests calling a private method in a controller | public void testTestPrivateMethod() throws Exception {
HogeController c = new HogeController();
Method m = HogeController.class.getDeclaredMethod("testPrivateMethod");
m.setAccessible(true);
String r = (String) m.invoke(c);
assertEquals("testPrivateMethod", r);
} | 1 |
5b168561c81e03a8e323e59232a3f3eb | d9dc1d29ed3fdc199d236c3d8f44334c | Get Jira username. | public function getBitbucketUsername()
{
return $this->bitbucketUsername;
} | 0 |
ead2a0d1eb43cc308968791b251e1135 | d0ee49efc11615e5acc7262bf4c3f6b0 | # Initialize parameter estimates for trouble fitting the trait congruent model (convergence problems) | k <- theta <- s <- p <- Mode <- NULL
if (!is.null(initialFit)) {
k <- initialFit$k
theta <- initialFit$theta
s <- initialFit$shift
p <- initialFit$proportion
Mode <- initialFit$mode
}
if (!is.null(k) && !is.null(theta) &&!is.null(s) && !is.null(p) && !is.null(Mode)) return(initialFit)
i... | 1 |
1e7082d9ba39d2219a172b75fb1b9fa3 | e02a4a61c6784205d954cc1dfe312b0b | Create and setup QLabel lblCreateby | class ETime():
def create(self, box, row):
lbl = QLabel("End time")
box.addWidget(lbl, row, 0)
self.etime = QLineEdit('yyyymmddhh')
self.etime.setStyleSheet("color: grey")
self.etime.setToolTip("Enter the ending of the timerange to " +
"download (YYY... | 0 |
349ce582e3ba2aacc4401f91f0cb1dc8 | 0530db1432a015696359a29b3d795983 | This method let us to remove an object from the cache for the specific
key. | public class Cache<T>
public void removeObject(T object) {
jCache.remove(object);
} | 0 |
7af6289c2a41b5dc1968e9a91207557b | eb611784a7888df956b97739ef03e150 | 分配令牌数 | capacity_key = key + 'capacity'
if self.exists(capacity_key):
left_num = int(self.get(capacity_key))
else:
left_num = capacity
self.set(capacity_key, left_num)
micro_second_per_second = 1000000
microseconds = int(period * micro_second_per_secon... | 1 |
3cf7275f500c7ae3c17e566e20a0efb3 | 40d98c9ce8cf932458bc2292617a8e66 | Gets all group IDs that the given absence ID is assigend to | namespace Erris.BusinessLayer
public partial class ScopedCategoryBL : ErrisMISBaseBL<Entities, ScopedCategory>
public List<ScopedCatAbsenceForRegistrationGroup> GetRegistrationGroupAbsenceCategories(int[] categoryIds)
{
return (from sc in Context.ScopedCategories.OfType<ScopedCatAbsenceForRegist... | 0 |
a731c1d5a054ac533c094f1683c362bc | b69aa861a7d191aeae5098b2a79e3b04 | 查询平台租客总量 | class StatisticService extends BaseService{
function getTotalPlatformAmount(){
$pintai_statistic = M('pintai_statistic')->db(0, C('SLAVE_DB_CONF'))->find(1);
$pintai_statistic['total_amount_id'] = 0;
$pintai_statistic['total'] = 0;
M('pintai_statistic')->save($pintai_statistic);
$result = M('user_account')->d... | 0 |
70f22aa4ebbb751551330162c3514d81 | e8eb387eabf4cc9f7af257c0d1bce869 | : Keep track of squared of rewards, to compute an empirical variance | super().__init__()
self.reward_function = reward_function
self.last_values = {}
self.negative_slope = negative_slope | 0 |
b21144e85c70609550a71f4ec255eff0 | 15ea9996eefd4dee6d3349e2d2b4b289 | Returns true if the string contains only alphabetic chars, false
otherwise. | def alphc ( s ):
if len(s) == 0: return False
for c in s:
if not ellyChar.isLetter(c): return False
return True | 1 |
0bdf22bc3e29fc61c62eedc02bac6275 | 3c8bca6c1209b343c50eb608ecf901c8 | Find values from minval to maxval. | namespace ArcGISRuntime.Samples.Phone.Samples
public partial class EditRelatedData : Page
private IEnumerable<int> GetRangeValues(int min, int max)
{
for (int i = min; i <= max; i++)
yield return i;
} | 1 |
bc96d8f631a3db5c02ab3afb8e868d93 | 82ec3684d6182e7f1e776c108554294a | Apply the same sampling configuration for all battery levels: normal, low, and critical. | {
ret_code_t err_code;
uint8_t battery_level;
battery_level = (uint8_t)sensorsim_measure(&m_battery_sim_state, &m_battery_sim_cfg);
err_code = ble_bas_battery_level_update(&m_bas, battery_level, BLE_CONN_HANDLE_ALL);
if ((err_code != NRF_SUCCESS) &&
(err_code != NRF_ERROR_BUSY) &&
(err_code != NRF_ERROR... | 0 |
04ba0ff09eb246925b009782d0a8d997 | 18ddfb3e45713e99ddbe0faac0d09b27 | 单项属性固定值 | C addFixedValue(String name, Object value); | 1 |
d50dd250485e2f86be6735e2aa65f7c0 | 73cb4cbee445ed1cd30bfdcd037464c8 | Configures EntityFramework with PostgreSQL | {
var dbString = Configuration.GetValue<string>("DBConnectionString");
Console.WriteLine($"Connection string: {dbString}");
services.AddEntityFrameworkNpgsql().AddDbContext<AnnotationContext>(options =>
{
options.UseNpgsql(dbString);
... | 1 |
e81af2f81e7573b768e70cee1cf579ee | 0bb351d59897414030e50dc70f29c406 | @brief Formatea los datos en JavaScript. | $result = "var params = {};\r\n";
foreach(array_keys($js_string_params) as $param_key) {
$result .= "params['$param_key']='".$js_string_params[$param_key]."';\r\n";
}
foreach(array_keys($js_int_params) as $param_key) {
$result .= "params['$param_key']='".$js_int_params[$param_key]."';\r\... | 1 |
063602a40853996fd352ce89db43edb1 | 2ae5366686643fca49e99b230dec2de7 | True if has "sourceId" element | class StatsInfo extends \Protobuf\AbstractMessage
public function hasSourceId()
{
return $this->source_id !== null;
} | 1 |
b8b0bf6e9510fa47fcda205b3a41e7ec | 07f16725c43887c9542cf99affbda927 | Genera de forma aleatoria los barriles del nivel. | {
Box vertical = new Box(Vector3f.ZERO, 3, 40, 3);
vertical.scaleTextureCoordinates(new Vector2f(1, 1));
for (int i=1,x=30; i<=5; i++,x+=30)
{
Geometry verticalGeom = new Geometry("Barandal vertical", vertical);
verticalGeom.setMaterial(matMadera);
... | 0 |
2916b9d05b83360c576a9f375c89eb48 | e03bb9a971abb22ed69f07eecb3d7aeb | Copy package directory to temp directory | def create_package_dir(package_name):
template_pkg_name = os.path.join(os.path.dirname(__file__), "template")
new_pkg_name = os.path.join(os.getcwd(), package_name)
shutil.copytree(template_pkg_name, package_name)
os.rename(os.path.join(new_pkg_name, "template"), os.path.join(new_pkg_name, package_name)... | 0 |
9ca91dd6776eb2566c3517f9c39b9074 | 6eebba3f9ab672c9277b1f79e3211b72 | 输入两个稀疏矩阵M和N,并初始化Q,然后计算M*N的值赋给Q | int a[Q][N];
int at[N][Q];
int i,j;
for(i=0;i<Q;i++)
for(j=0;j<N;j++){
printf("a[%d][%d]",i+1,j+1);
scanf("%d",&a[i][j]);
}
for(i=0;i<N;i++)
for(j=0;j<Q;j++){
at[i][j] = a[j][i];
printf("%5d",at[i][j]);
}
printf("\n");
return 0;
} | 0 |
f8e77228602c819d47e2a6b8336de660 | c3c7edd54f7d31a47a91712d3eaddf88 | Visit a parse tree produced by {@link HTMLParser#cpFor}. | Parser p = new Parser(new StringReader("for(Integer i:crazyCollection);"));
List statements = p.parseStream();
ListIterator it = statements.listIterator();
Object result = null;
assertEquals("[(koala.dynamicjava.tree.ForEachStatement: (koala.dynamicjava.tree.FormalParameter: false (k... | 0 |
684495e176b8c64fe5731ddbd4d4077e | 38aa456c52abf858629192491cdf29aa | 资金动向交叉点创建 | jump_threshold = stock_dat.Close.median() * 0.01
stock_dat['changeRatio'] = stock_dat.Close.pct_change() * 100
stock_dat['preLow'] = stock_dat.Low.shift(1)
stock_dat['preHigh'] = stock_dat.High.shift(1)
stock_dat = stock_dat.assign(jump_power=0)
stock_dat['jump_po... | 0 |
3886c01aced32b73d856649f287cb79a | f698f70efaa852a4fd849f6890bffad0 | provera da li je korisnicko ime jedinstveno | namespace Seenema_pocetno.Klase
public class Korisnik
public static int ProvjeriKorime(string korime)
{
string upit = "select count(*) from korisnik where korisnicko_ime='" + korime + "';";
object ispravan = Baza.Instance.DohvatiVrijednost(upit);
return Convert.ToInt32(is... | 1 |
9f5c35cd1d05f896ca938a50175b314e | ce681d6450a12ee525c8d0138712f1a2 | add contents of table b to end of table a | {
int i;
for (i = 0; i < size; i++)
{
insert(b, i, a[i]);
}
} | 0 |
afc3b05c2539369f1a548dc4f968df39 | da919cc10407a4d14bd81a2b88fa8016 | 活动审核删除 | {
if($activity->status==1){
return ['result'=>'fail'];
}
else{
$activity->delete();
return ['result'=>'success'];
}
} | 1 |
e5354b10c1c36d87a359bfe266a957ba | 793e669d54901a360631000a585aa146 | 检验概率和是否等于1 | probability_num = int(probability_num)
if probability_num >= 100:
return True
if probability_num <= 0:
return False
a = random.randint(-(100-probability_num),probability_num)
return True if a >= 0 else False | 0 |
9de2bb814fa583471a35bcae163e84a5 | c39ca66ad358261e1ea9ee0664dd039a | Saturation max | fun saturation(): Saturation | 0 |
666d9a5aef3b0d6682854da70a3aa58c | 096c475d1e60577c27438b619785e415 | Procura e retorna um FAQElement dentro da coleção. | class FAQElement implements FAQElementInterface
public function exists() {
} | 0 |
08cafad35a6c8bbb8b8d4e373dbfc9d8 | 95eb0ed966d4a5c4a6afeffdafaf11b5 | 定时关闭设备 | {
if (dev != null)
{
if (dev.IsHandling)
{
Lamp_Order(false);
dev.Close(CloseType.Close);
}
dev.ReaderEvent -= new ReaderEventHandler(OnReaderEvent);
tmr1sec.Dispose();
}
} | 0 |
83df5bc180d13ca64e566aab1289e20b | 4178d825d6f6f9d2a7784635f5e582ed | функция конструктор для объекта задачи | class Task
public function __construct($id, $name, $email, $text, $imgUrl, $done)
{
$this->id = $id;
$this->name = $name;
$this->email = $email;
$this->text = $text;
$this->imgUrl = $imgUrl;
$this->done = $done;
} | 1 |
4c38c27a1a62642ce5d62c369dce26a1 | 068306e7f2361e87179361444e857640 | Get new probabilites for a given structure of a new ensemble, given its new energy and the original energy | def get_new_pro(id_pro, pramate_file):
pro_result={}
for key,valuex in id_pro.items():
value=list(valuex)[-1]
length=len(value)
pro_mol={'G':75.07,'A':89.09,'V':117.15,'L':131.17,'I':131.17,'F':165.19,'W':204.23,'Y':181.19,'D':133.10,'N':132.12,'E':147.13,'K':146.... | 0 |
8e793036465861eae779f2edb3a0d6fd | a406dccbcbdd91c9f9befeaca82fb46c | USART1_clock | {
uint32_t usart1Clk;
if (RCM->CFG3_B.USART1SEL == 0x00)
{
usart1Clk = RCM_ReadPCLKFreq();
}
else if (RCM->CFG3_B.USART1SEL == 0x01)
{
usart1Clk = RCM_ReadSYSCLKFreq();
}
else if (RCM->CFG3_B.USART1SEL == 0x02)
{
usart1Clk = LSE_VALUE;
}
else if (RCM->... | 1 |
fb1f7fb629cf792fd08af5946055ce91 | 68733defccfd5050b936a1be93a21a0d | get the user parameters for the default user | class modelAplication
public function _getParamsUserAdmin()
{
$response = new stdClass();
$query = 'SELECT mail, name FROM '.$this->prefix.'admin_users WHERE `id`= 1 AND `usertype`= 0';
$useradmin = $this->app['dbs']['mysql_silex']->fetchAssoc($query);
$response->mail = $useradmin['mail'];
... | 1 |
688324e880dd5865e0c6f3d9cd548fff | 16921b07b61eb570c8a899580d2d6e92 | Gets the value of the specified column as a Boolean -or- the specified default value if the column is null. | namespace Microsoft.Isam.Esent.Interop
public static partial class Api
public static bool? RetrieveColumnAsBoolean(JET_SESID sesid, JET_TABLEID tableid, JET_COLUMNID columnid)
{
return RetrieveColumnAsBoolean(sesid, tableid, columnid, RetrieveColumnGrbit.None);
} | 0 |
f3cf38369396f9387d8f5a5d9b1fb482 | a604284992f65ffc143d2ff9bd40fae7 | returns converted value for selected sensor | int Kobuki::feedback(int sensor_id)
{
if ((sensor_id == 8) || (sensor_id == 10) || (sensor_id == 25) || (sensor_id == 27) || (sensor_id == 34) || (sensor_id == 36) || (sensor_id == 38) )
{
int value = (rx_value[sensor_id + 1] << 8) | rx_value[sensor_id];
return value;
}
else
{
return (int)rx_value[sensor... | 1 |
dae1ee1873b7945c2d642b55ef63c98f | 262c3443005740add3d8ebd59f03396c | Install packages from yarn. | export default class RNBundleBuildTask extends AbsBuildTask
protected onInstallDependencies(projectRootDir: string): boolean {
return FEShell.yarn(projectRootDir);
} | 1 |
24266a2e3df1fe7af5880fdd5fe3fad5 | 1b5dc593a499b91c7fba4d57664b518c | プレーヤー全員を表示する | public abstract class Ensyuu13_3_Player
public void showPlayersHand(){
System.out.print(toString());
showHands();
} | 0 |
e9a51d72a61bbc6691ebbc59088a6a80 | 1be966f5be4e0f22cbdee8691af739d6 | Converts a given decimal (i.e. base-10 integer) to a list containing the
base-k equivalant.
For example, for n=34 and k=3 this function should return [1, 0, 2, 1]. | def from_binary_convert_list(n):
conversion_list = []
conversion_value = 1
index = 0
while index <= n:
conversion_list.insert(0, conversion_value)
conversion_value *= 2
index += 1
return conversion_list | 0 |
9c56c731a53738ba583fb982c6e2df04 | c272eadf0aced69bfdbe370548230720 | Returns all ASCII 7 bit numeric characters in an array. | {
return new[]
{
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
'o', 'p... | 0 |
a8c806234b11ad1fa0fe81e288634f84 | ef50fcfc395265fd07e936553a5f4050 | Builds a diagonal covariance matrix starting from the vector of variance. | class DiagonalCovarianceMatrix(CovarianceMatrix):
def __init__(self, variance_vector):
super(DiagonalCovarianceMatrix, self).__init__()
self._variances = np.atleast_1d(np.asarray(variance_vector, dtype=np.double))
if len(self._variances.shape) != 1:
raise ValueError("variance_vector ... | 1 |
de7b9e35908087525c9b3f22ffa86e9e | dd490ab9d6ee7139ee1606b180699081 | Displays previous page. | public class StatsActivity extends ToolBarActivity
public void buttonShowPreviousPage(View view) {
if(hasPreviousPage) {
currentPageDisplay--;
insertDataOnTableFromPage(currentPageDisplay);
}
} | 1 |
2743e4ab40ba7a783fec4f4df339c30d | 0286d450dc5f39ed8fb4539f1fe94bc6 | Gets load balancer frontend IP configuration. | def frontend_ip_configuration_id(subscription_id, resource_group_name, load_balancer_name, name):
return '/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Network/loadBalancers/{2}/frontendIPConfigurations/{3}'.format(
subscription_id,
resource_group_name,
load_balancer_name,
... | 1 |
cd27c52c5648d18fc5ffbf979ff2c008 | cb92de6156b2a2632dc52b972db9f65a | 获取合同日志 | class ContractLogsController extends Controller
public function show($id)
{
} | 1 |
80c9778c162ecac60fbc4a3090cb8390 | 872f2a13a0c095a115ceb7847955137a | 将路径中的文件名取出 | namespace AMSDCMDataTranslator.Models
public abstract class FileOperator:IFileOperable
private string[] GetFileName(string[] FilePath)
{
if (FilePath.Length == 0)
{
return null;
};
for (int i = 0; i < FilePath.Length; i++)
{
... | 1 |
20f069ec06269b5f5fb84c951edd3cc8 | 0e965aa3e2794f984ee06118f22373bc | Map an instance of a [StoreModel] to a [Store] model | @Slf4j
@Service
public class StoreService
private JPAStore convertToEntity(StoreDto clientDto) {
return modelMapper.map(clientDto, JPAStore.class);
} | 0 |
3c9aa22b0bbea9c47cb93518527396ab | aeb65f932ba79823287726417cdad198 | Checks that user form is submitted. | class OrganizationTestCase(TestCase):
def test_submit_form(self):
response = self.c.get("/submit_form")
self.assertTrue(response.status_code, 302) | 0 |
fbe0c988b57da0c7b2e60b164b51dd74 | 858fe3cd58c33cbfef56879ff837a333 | No input as everything has already been sent to the browser. | class GeometryCustomFieldType extends AdminPageFramework_CustomFieldType
public function replyToGetInputIEStyles() {
return "";
} | 1 |
1d8b9613fc34ff41bd4a306605c8dd54 | bc45714869977d4f2fc66ad7e679a66b | this method returns the total number of passengers which are in the car at a
given time | public int getPassengersInFlight(); | 0 |
77c3a2c99540a4faf7faf2769fbe75eb | ae231ca7732fcd71b66761a578478f63 | Attempt to give change from an inventory, such as a shop's cash register. | Map<Integer, StackWithAmount> lookaside = getAmountsMapping();
for (ItemStack item : isItemsToGive) {
if (item == null)
continue;
int amountToAdd = item.getAmount();
while (amountToAdd > 0) {
int partialSpaceIndex = findSpace(item, look... | 0 |
edcf08018e02dcedaea602c4ab435501 | 04b3b826babf3280211b9b0f7a52ce2f | Sets the trigger holdoff events. | bool pyniscope::ConfigureTriggerSoftware(double holdoff, double delay){
return scope.ConfigureTriggerSoftware((ViReal64)holdoff, (ViReal64)delay);
} | 1 |
750850b98d49e524d0829faef1c8d719 | 320ceac820a477ec659ed51b4b25e635 | Convert a timestamp (beats) into time (seconds) | int32_t MidiFile::getTimeDiff(float dTimeDiff) {
if(dTimeDiff == 0.0)
return 0;
if(_beatTime == 0.0)
return 0;
return (int32_t)((dTimeDiff / _beatTime) * _timeDivision + 0.5);
} | 0 |
eaedfc523054cf4cc7f426988cd464d9 | b2a257e4cd354c4cd1eda2d516a525c8 | Delete this playlist. | class YaMusicClient:
def delete_playlist(self, playlist_id: int) -> None:
path = f'users/{self._oauth_cred.user_id}/playlists/{playlist_id}/delete'
self._request('POST', self.API_HOST, path) | 1 |
493574a7e72b7af9130f3e0f0fb4527b | bb48581ba42f4d5e5596047827d4b95e | 发送图片消息,$imageid是微信素材内的MediaId | $url = $this->msgSend."?access_token={$this->actoken}";
$message = array();
$message['touser'] = $openid;
$message['msgtype'] = "image";
$message['image']['media_id'] = $mediaid;
$paras = wysBasic::jsonEncode($message);
$data = comHttp::doPost($url, $paras, 3);
... | 1 |
38b805a8908110036063438244f27611 | f51bb912fef35207e204fe3c61c2bacf | # Safety
The caller must ensure that the resources held by `raw_handle` outlives
the resulting `Descriptor` instance. | let raw_fd = tcp_stream.as_raw_fd();
Self {
descriptor: ManuallyDrop::new(unsafe { File::from_raw_fd(raw_fd) }),
resources: WriteResources::TcpStream(tcp_stream),
}
} | 1 |
9fb4f354e64d38696d2a508d7742e23a | adb4c1e3d2870e63bf06eabdfa3a94e8 | Test to feed a work type that already exists. | async def test_flow_works(hass):
result = await run_flow(hass, [True, True])
assert result["type"] == "create_entry"
assert result["result"].state == "loaded" | 0 |
33de12041a289c2103d54a6fad437b6e | 865d551e26856d588d72d3353c77c38f | Permittivity of silica function | def eps_SiO2_func(wl):
width = 0.078
f = 1/wl
f0 = 1/0.670
epsi = 2.45e-5 * np.exp(-np.divide(np.square(f-f0),2.*width**2.))
return 2.13353 + 1j * epsi | 1 |
727d8a5fab7cb1e0cf8435b8069c744d | 8854ca0649652aefd111c39c837a103a | Do heuristic test to see if this is binary.
We check for characters above 128 in the first few bytes, and
if we find them we forget the html default.
Kludge to trap binary responses from illegal HTTP0.9 servers.
characters < 128 will be read as ASCII. | int ch, bin;
float hi, tot;
FILE *file;
file = fopen(filename, "rb");
if( file == 0 ) return -1;
tot = hi = bin = 0;
while( (ch = fgetc(file) ) != EOF && (++tot < MAX_READ) ) {
if( '\0' == ch ) {
bin = 1;
break;
}
if( (ch < 32 || ch > 127) && (... | 1 |
7316e9257d1ccbfcde8f6bd7f96b5cc1 | 776b95e37fac59616be74910c033e1b0 | Decrements the R reference count, destroying the object when the count reaches zero. | ULONG cRef = InterlockedDecrement(&m_cRef);
if (0 == cRef) {
delete this;
}
return cRef;
} | 1 |
58842474e877fabe6580fca9fce649f9 | a2ecbaa7a130bc28946e9a4032e56d41 | Проверка, что авторизованный пользователь может отредактировать свой пост | self.authorized_client = Client()
self.authorized_client.force_login(self.author)
total_number_of_id = len(
Post.objects.filter(author=self.author).values_list('id',
flat=True))
url = reverse('post_edit',
... | 1 |
bb526c797cf707d77cad1db51fb7615b | 0336a3d529f664d37c21d5cced2fd8e6 | 根据w2index获得index2w | class PosTran:
def w2point(self, w1point):
return self.point2point(self.w1, w1point, self.w2) | 0 |
a077c9938213f541f76c704db7269985 | 7dc3507b4255aa6428ff86c27aa84415 | 获取用户已经使用的优惠券 | try:
today = datetime.today()
db_coupons = db.query(Coupons).filter(
Coupons.user_id == user_id,
Coupons.is_use == 0,
Coupons.expiration_time >= today
).all()
ret = []
for coupons in db_coupons:
ret.append({
'id'... | 0 |
0fcb7fc7ec60c56834c53eeb659a3ab3 | e74eb15184c0f2d3e3add203ef4a4442 | 获取我的钱包在$hash中收到的比特币个数 | export class MultiPie
getAmountIn(amount) {
return window.multiPieContract.getAmountIn(window.tronWeb.toHex(amount)).call();
} | 0 |
0e9095b7716f15c51abb904a49832f57 | 3046de58805e1931f3383a1682bfb2cb | Return location of next existing block. | class Block(object):
def nextfree(self):
raise TypeError("Block.nextfree not implemented") | 0 |
b3000a3e17c807e93e37afc96c67ac1e | 3087a727ee97e3b9044655199bab684b | Exactly the same as above,
but for buttons | button = wx.Button(parent, -1, label, pos)
self.Bind(wx.EVT_BUTTON, handler, button)
return button | 1 |
42a813ae1289212b7471e14a14d0033b | bb9e806fab33c789cc83f5c8b59e77ac | sap xep ten lop theo thu tu tang dan | if (values.size() >= 2) {
for (int i = 0; i < values.size() - 1; i++) {
for (int j = i + 1; j < values.size(); j++) {
ObjectMonHoc obj1 = (ObjectMonHoc) values.get(i);
ObjectMonHoc obj2 = (ObjectMonHoc) values.get(j);
try{
... | 0 |
f6de385a5d57afc83ee4721c3f5b84d9 | 3dc2d46e5aa709c2cff1290745c45927 | This test verifies that we don't trigger warnings for expressions that
couldn't be incorrectly evaluated | public void testDataModelExpressions() throws Exception {
Assertions.assertEquals("leaf",
evaluator.eval(context,"forest.tree.branch.twig"),
"Invalid result: " + "forest.tree.branch.twig");
} | 0 |
fb59b2d4b1fda4bb8efd823e0e46ffb4 | 20ce4f240ce3f3c218564d2b9844313b | 设置长整型值到指定变量名的变量对象 | public class database
public void setLong(String name, long value) throws SQLException {
int[] indexes=getIndexes(name);
for(int i=0; i < indexes.length; i++) {
statement.setLong(indexes[i], value);
}
} | 1 |
10ddd5c892768d5c36176a0175f6181c | 73936fdb1c1f6ebe8b9f848baf645466 | Returns the meta object for the containment reference list '{@link DFN.StringToken#getLiterals <em>Literals</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EAttribute getEnumeration_Literals(); | 0 |
0f794b7ce7dbbcad52e601d134a7fa63 | 2ba2d35bf655778eba752f21d1a8e8d8 | Collect SysConfig from each node | class netcollect(DeamonBase):
def splitConfig(self): | 0 |
526ac3db59810424b3d5b08583549afc | 30165102a3913b2ba8cc40863bbdf4f2 | 口座 グリッドセルダブルクリック時処理 | namespace SkyCar.Coeus.UI.SM
public partial class FrmOrganizationManager : BaseFormCardList<OrganizationManagerUIModel, OrganizationManagerQCModel, MDLSM_Organization>
private void gdGrid_DoubleClickCell(object sender, Infragistics.Win.UltraWinGrid.DoubleClickCellEventArgs e)
{
SetGridDataToCard... | 1 |
3d8e35dfc85616820484ea30995eba02 | 1d593488e6f71c4d4085c744853c0fe3 | 根据single_list中每列的Seq_ID从refseq2taxid中查找对应的taxid,RefSeq_assembly_accession并插入和替换之后计算相同基因组的覆盖率 | def gene_cov_at_trpt_level(totalCount,covFiles,gene,exnFile):
exn_df = pd.read_csv(exnFile,sep='\t',header=0,low_memory=False)
gene_cov_df = pd.DataFrame()
for f in covFiles:
cov_df = pd.read_csv(f,sep='\t',header=None,names=['num','chr','end5','end3','strand','len'])
gene_df = exn_df[exn_df... | 0 |
4bcd5f6bf64a49a9a074bcefc2ac29de | a101a4f2b04b38738e2e0717e012937e | returns a forward index (DocID -> Doc words) | resolved_index = defaultdict(set)
for word in Word.objects.prefetch_related('document_set'):
for doc in word.document_set.all():
resolved_index[word.text].add(doc.url)
return dict(resolved_index) | 0 |
664800f7918f7a8190fddf8f33e35e8e | dc4574b74106aeeceffcadc41a19bde1 | Méthode permet de voir le tableau de l'utilisateur tout en vérifiant si l'utilisateur entré est bien suivi | public class AcceuilChercheurController implements Initializable
public void buttonOuiSuiviEvent(ActionEvent event){
spinnerFrequence.setVisible(true);
labelFreq.setVisible(true);
labelAlpha3.setVisible(true);
spinnerAlpha3.setVisible(true);
buttonNonSuivi.setSelected(false);
... | 0 |
cba0865bcab9c69c82f8d86472dc8794 | de0ab1354c920ecc36c51a817a465e72 | Start the recording and animate the RecordingButton | public class VoiceMainActivity extends AppCompatActivity implements View.OnClickListener{
private void startRecordAction() {
isRecording = true;
playAnimRecord();
recordAlert();
} | 1 |
d7dfb3c47e01cbccd41b14b3b5d8e6be | 488d05a6b31ad45813bf14dfa73b2587 | Collects selected presentation elements of one of the two types | def get_selected_elements():
selection = uidoc.Selection
selection_ids = selection.GetElementIds()
elements = []
for element_id in selection_ids:
elements.append(doc.GetElement(element_id))
return elements | 0 |
d7d7845c7273b7abee78ec6660b87460 | b3775e9b297d751a578acaee01b91120 | The setSize function sets the Objects size to an int passed into it | class battleShip(ship): # battleShip is a class with the parent class ship
# constructor for battleShip class
def setSize(self, size):
self.size = size | 1 |
50ddf28fe52ddd367954ace5c2a70f61 | afd043550961bb60eb1fe85fdfe6572d | 判断模型输出的结果是否与标签相近, 准则为判断最大数所在的行,label为3*1规格 | class MapAlgorithm:
def label_convergence(labels: np.array, preds: np.array, thres_=0.001) -> bool:
thres_ = thres_ * labels.shape[0]
count_ = sum(labels!=preds)
return count_ < thres_ | 0 |
dcfa4f26d38a5233392c9adf55751625 | 3a03928987664f7036eb38df28b91d49 | 设置元素获得焦点时触发事件 | mounted(el) {
el.focus()
} | 0 |
bb80a2542b285ab7fef4afbad2135080 | d16bd6e03f1efff7b1d71bd1b38b8e61 | Loads the proper number of verses given the chapter and the book | function getVerses (chapter) {
var Verses = chapter.getElementsByTagName('Verse');
return Verses;
} | 0 |
b0296eca0677abb74ca5fc9ce190d830 | c94c4b4c0446578627db44126556624b | Method to check whether the SavePrint command can be executed. | if (!this.isPrintPreviewSetupAssistanceEnabled_) {
return false;
}
return !this.destinations_.some(
(destination: Destination): boolean =>
destination.id !== GooglePromotedDestinationId.SAVE_AS_PDF);
} | 1 |
76ae956adec8fa1eb4b4e2a35fb20887 | ef70179e4a067fb76169cf83b5087386 | ポーカーの手札が記入されたファイルを読み込み | System.out.println("棋譜を読み込みます。");
kihu_list.clear();
Move move = new Move();
Move input_move = null;
File file = new File(input_file);
try {
FileReader filereader = new FileReader(file);
BufferedReader br = new BufferedReader(filereader);
String str = br.readLine();
while(str != null) {
inpu... | 0 |
cdf844d9c0ad43c72c5a0be7bbcb85f6 | 30d8d429f6d848b4db74c88afa005ac0 | This checks for DOM nodes and 3rd party lib objects that should not be deep copied | return object
&& isExtensible(object)
&& !Node.prototype.isPrototypeOf(object)
&& (typeof BaseAudioContext === 'undefined' || !BaseAudioContext.prototype.isPrototypeOf(object))
&& !(object instanceof Date)
&& !(object instanceof RegExp)
&& !(object instanceof Map)
&& !(object instanceof WeakMap)
&& !(o... | 1 |
f2faa0730e694cefde48304f2ba94fe2 | daa5b12e68e59d5259c874f492d283c1 | Returns license popup content. | if ( !data.license ) {
throw new Error('License file was requested, but no license was specified')
}
const result = [
'Unless stated otherwise all works are:',
'',
getPeopleHTML(data.authors, {displayCopyright: true, displayYears: true}),
'',
'and licensed under:',
'',
getLicensesHTML(data.license, '... | 1 |
03f461c91a9618db9ad9c2df20f841d4 | e2f1092ff32d2f99485619309e4838d6 | 根据路径获取所有Controller的类 | class Eternal_Acl_Resource_Generator_Structure_File extends Eternal_Acl_Resource_Generator_Structure_Abstract
private function getControllers( $path) {
try{
$dir = new DirectoryIterator($path);
}catch(Exception $e){
throw new Eternal_Acl_Resource_Generator_Exception("Directory $path no... | 1 |
bf4263131da03bc4e02f8d7cca28ff9f | f33889176060c7514f35ecc0ce5a8700 | Обработка нажатия кнопки для очистки списка предпочтений | {
if (panelControl_TextEditor.Visible) return;
if (XtraMessageBox.Show("Очистить текущий плейлист?",
"Подтверждение",
MessageBoxButtons.OKCancel,
MessageBoxIcon.Question)
... | 1 |
b1246e585ba6ccd7750e699b21d44f1b | 678e196119b9df2d25aa87502b297864 | Returns a string representation of the term with a ^ representing the exponent | class Exponent implements Expression
@Override
public String toString() {
return "(" + base + ")^" + power;
} | 1 |
6d748e78669462ca5e87d4b3e2ed280e | 28c962bda65a3beb5288e19148584c8f | Gets the value of the vacttslangpack property.
possible object is
{@link VACTTSLANGPACK } | @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"isAddress",
"isMode",
"isVersion",
"isDeviceRegistered",
"isPeakDeviceRegistered",
"isPeakDeviceRegisteredTime",
"isKeepAliveInterval",
"isConfiguredDevice",
"isConfiguredExtension",
"isServiceEngine",
"... | 0 |
a31c0b7741efb90da8018bd7afac1666 | 3d7d1f3b25e544079d8c97002ffdc49b | 整合出一個“消除”動作的結果數據 | lines_eliminated = [ ]
for r in range(LINE_NUM) :
if self.is_full(r):
lines_eliminated.append(r)
for r in lines_eliminated:
self.copy_down(r)
for c in range(COLUMN_NUM):
self.area[0][c] = WALL_BLANK_LABEL
eliminated_num ... | 1 |
b0902a87f775673df48bcd8f775ee084 | 65a15217e567f5e327de45f4ebd90621 | Returns the object method name that has to be invoked. | public abstract class AbstractCallMethod
extends AbstractClassicTag
protected abstract String getObjectName(); | 0 |
ab61517bef70448023817469084af16d | 1f7f5c93ececa480261a8da9f8c21c3a | Alle Info-Objekte eines Nutzerprofils loeschen. | UserAdditionalInfoTableUtil.delete(this, data);
SqlGenerator gen = this.getSqlGenerator();
UserInfoTable tbl = UserInfoTableUtil.newUserInfoTable();
String sql = gen.generateDeleteSql(tbl, new FieldList(tbl.getField(UserInfoTable.Entity.ID_USER_ID)));
this.executeUpdate(sql, data);
UserAttributeTable atbl ... | 1 |
6041abd0c6e79a88264684156a345261 | 4bec42cf40497f7904df8fe64050c833 | Função para cálculo da distância euclidiana entre duas matrizes. | {
int numberOfNode = (int) Mat1.size();
output = 0;
for(int i = 0; i < numberOfNode; i ++ )
{
for(int j = 0; j < numberOfNode; j ++)
{
output += (Mat1[i][j] - Mat2[i][j])*(Mat1[i][j] - Mat2[i][j]);
}
}
output = sqrt(output);
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.