query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
6947c18462ebf575f5e142929300ec3c | dd753cd1f739f6f8bb90b07182ab6b43 | 单件方式装配报告数据 | {
var data = new RFIDData(guid);
data.Workpiece = workpiece;
data.Clean = clean;
data.Gauge = gauge;
data.Assemble = assemble;
switch (workpiece)
{
case EnumWorkpiece.A:
data.ProcessDataList.A... | 0 |
17a102559c34b2d6b89302e3d9d160f0 | 3d42734a49749ec0bbb53b94cc9db6fe | Convenience method to get the sorted SKU options based on SKU option display name on catalog default locale. | {
return await Partner.ServiceClient.GetAsync<ResourceCollection<SkuDownloadOptions>>(
new Uri(
string.Format(
CultureInfo.InvariantCulture,
$"/{PartnerService.Instance.ApiVersion}/{PartnerService.Instance.Configurat... | 0 |
f4dc0a3cfc569ecc5a0ee9ff81374f94 | 13f2cbb03b599ae82ae4c82fad37323b | <p>
Redo the change relationship path action.
</p> | List<TreePath> list = getExpandedPaths(node);
TreePath[] paths = getSelectionPaths();
treeModel.reload(node);
expandPaths(list);
addSelectionPaths(paths);
} | 0 |
3981ffe31f3ce458c8646d61246fc19e | 59c2439538c84a3177ac86d9a781967d | Allows to fetch a request asynchronously with Gson.
When using this method, null-safety is not guaranteed! This method should only be used from Java code, not from Kotlin. | class VGSShow private constructor(
context: Context,
private val vaultId: String,
private val environment: VGSEnvironment,
private var url: String?,
private var port: Int?
)
@AnyThread
fun requestAsync(path: String, method: VGSHttpMethod, payload: Map<String, Any>) {
requestAsync(VGSRequ... | 0 |
f5a5d770c510e88d784b05f34a388ccc | f408ee6af2a5342b1a5cbf392f6e59bf | Put all TD items back to the TD pool before put back the Ep0 object | IN TD_STRUCT *ptrTD )
{
SetTDLinkPtrValidorInvalid( ptrTD, FALSE );
} | 0 |
6697ef0754b075a1ca711ac16bfd3753 | 602479a40fc27b28bccae57ff7955f59 | Print out the drives on this machine,
and other interesting details. | {
int i;
fprintf (st, "SEL 2314 Disk Processor II\r\n");
fprintf (st, "Use:\r\n");
fprintf (st, " sim> SET %sn TYPE=type\r\n", dptr->name);
fprintf (st, "Type can be: ");
for (i = 0; disk_type[i].name != 0; i++) {
fprintf(st, "%s", disk_type[i].name);
if (disk_type[i+1].name !... | 1 |
df526cc0ccc622bcf1ae908396231cf4 | b293c16d7345f50ddc638f98d3a4ec06 | End-to-end tokenization for Electra models. | tokenizer: Tokenizer = None,
token_indexers: Dict[str, TokenIndexer] = None,
lazy: bool = False) -> None:
super().__init__(lazy)
self._tokenizer = tokenizer or WordTokenizer()
self._token_indexers = token_indexers or {"tokens": SingleIdTokenInd... | 0 |
6d945b1fb356fbf371cced001aa43ae6 | 91daaf72b2991e78658587e662d1ca53 | 문자 하나가 한글 또는 알파벳인지 검사 | public class CheckUtil
public static boolean isAlphaOrDigital(char c) {
return isDigital(c) || isAlpha(c);
} | 0 |
5c34e9e472e5f9b34c16df90c6f617a1 | 66b77b1f225d1e34d49255bddec9d68b | The age group the trip passenger(s) belongs to | final class OptArgs
public function getAgeGroup()
{
return $this->_ageGroup;
} | 1 |
2445e7bdfd12d605c5fe7e997eb02dea | dd16abf7074171c93977b6a97742cbba | A getter method to get a company's balance sheets quarterly removable data. | res = self._get_json('BALANCE_SHEET')
balance_sheets = res.get('quarterlyReports')
if not balance_sheets:
raise base_api.StonkApiException('This stonk does not exist in the stonk data api we are using :(')
return balance_sheets | 1 |
c08d39b1639157543c53eb506586c077 | 872d874380741d3f6ff8cf902fc7d703 | Безопасная установка начальной позиции в потоке | {
if (v_initDefaultDevice.Value)
{
MainStream.v_stream_status = StreamStatus.PLAY;
}
timerForCurrentPosition_Tick(null, null);
timer_playng.Enabled = false;
timer_playng.Interval = 100;
... | 0 |
72d5b0c9ba29769aa2cc95328127800c | 9da174dfa281c9d425988a76f472704b | Convert Video to Animated GIF format. # noqa: E501
Automatically detect video file format and convert it to animated GIF format. Supports many input video formats, including AVI, ASF, FLV, MP4, MPEG/MPG, Matroska/WEBM, 3G2, OGV, MKV, M4V and MOV. Uses 1 API call per 10 MB of file size. Also uses 1 API call per additio... | namespace ytgify.Interfaces
void Convert(string sourceVideoPath, string outputGifPath, GifyRequest requestSettings); | 1 |
0beeaa304e1b7ed2bad8b94466166a70 | 9af837431e102a40d31e1de1488c389f | Indicates the start of a sequence of operations directly caused by the
user.
Indirect and direct sequences may nest within eachother | void beginSequence(); | 1 |
c3f449658d9fd8edf555089e55a577fa | 2952fe50914860ff9f71130f181ac735 | Получение пути от начальной вершины до конечной. | namespace FlowOptimization.Matrix
class PathsMatrix : Matrix
public int[] GetPath(int start, int end)
{
int pathIndex = -1;
for (int i = 0; i < _decodedMatrix.Length; i++)
{
int firstNode = _decodedMatrix[i][0];
if (firstNode == start)
... | 1 |
9b10c830f1dcf9b33dd3008f5e772725 | d168070991478933a7483faf5b0f008c | This title isn't in the collection, but the author's other
books should still come up. | url = f"{reverse('book-list')}?ordering=title&case_insensitive=true"
response = self.client.post(url, data=self.valid_books, format='json')
expected_result = [
{"title": "Head First Desing Patterns", "author": "Elisabeth Freeman", "edition_year": 2004},
{"title": "Interne... | 0 |
e0efd0268aaba115d3dd789a26339c0f | d6f697aa1280c9458ce61526e1948b2b | Decrement Repost Count | class Board extends AbstractDocument implements SoftDeleteable
public function decrementPostCount()
{
$this->postCount--;
} | 0 |
7684feb6320dc9b3406abd2ed7e80a5e | 2d3bcd3f1c1edb8cbedc550d6dec6f66 | Overridden multiplication function to multiply two complex numbers | cnum = self._ol_to_comp(cnum)
r,i = self.r, self.i
r2 = r * cnum.r -(i * cnum.i)
i2 = r * cnum.i + i * cnum.r
return Complex(r2,i2) | 1 |
2580e3f86ce15c13610d616b596d1fcd | 96260af77186506e609ba5ac901e1e41 | Displays a form to edit an existing registroTramite entity. | class genericController extends Controller
public function editAction(Request $request, $id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository($this->entity)->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Tipo entity.');
... | 1 |
9f68f5a49fc12eb59c50d749809847dd | a415f4bae701cce2c406da350f875b07 | Plot/save generated images through training | if not os.path.exists("plots"):
os.makedirs("plots")
for i, figure in enumerate(self.figures):
figure.savefig(f"plots/img_{epoch:04}_{i}.png", bbox_inches="tight")
pyplot.show() | 1 |
e127c6d52e7e1444915e2a609e1ae289 | 21ffa79a72e80b6144f552ca0f7d3f38 | 传入url返回一个电影列表 | response = requests.get("https://movie.douban.com/", headers=HEADER, timeout=timeout)
if str(response.status_code) == '200':
response.encoding = "utf-8"
html = response.text
movie_info_list = self._new_movie(html)
return movie_info_list
else:
... | 1 |
7ed7332272fd893bacb211538e208fec | 37e5e82dda44b481ced0a27e2b44ba11 | Vrne vsebino tabele v obliki niza. | ArrayList<ArrayList<String>> data = new ArrayList<ArrayList<String>>();
for (Korisnik k : lista) {
ArrayList<String> podaci = new ArrayList<String>();
podaci.add(k.getKorisnickoIme());
podaci.add(k.getTip().toString());
podaci.add(k.getIme());
podaci.add(k.getPrezime());
podaci.add(k.getBrojTelefo... | 1 |
6249d69300bd236a60ebc445249e90fe | 3cc0d164136dc91512935c3d00792ac0 | Clears all currently selected days | {
h.SelectedIndex = 0;
m.SelectedIndex = 0;
note.Text = "";
foreach (int i in days.CheckedIndices)
{
days.SetItemCheckState(i, CheckState.Unchecked);
}
Enable.Checked = false;
} | 1 |
c25743d345e73cf94c0b195ce2fd1b56 | 55f8843b3b78d25b5e6a49537372a89f | Assume non padding elements are part of sequence | def get_non_pad_mask(seq):
assert seq.dim() == 2
return seq.ne(Constants.PAD).type(torch.float).unsqueeze(-1) | 1 |
696d7d920ac12a1e121e49172defd260 | 5f90d24481d0a77fbbe36fdc5ab540bf | SQLクエリを取得する | {
try {
if ($this->query_sql === null) {
$this->compile();
}
}
catch (\Exception $ex) {
error_log(__METHOD__.': '.$ex);
die();
}
return $this->query_sql;
} | 1 |
e13876f48375b87727b4c76a956a9555 | 6bd510c9db70f95d93116f7be41b2dc5 | Asserts whether the left hand side is greater than the right hand side | where T1 : IConvertible, IComparable
where T2 : IConvertible, IComparable
{
bool retVal;
var msg = string.Empty;
var compareVal = 0;
if (!this.AssertComareTo(leftHandSide, rightHandSide, ref msg, ref compareVal))
{
... | 0 |
56aa629817b7082691beb69f5c6d0752 | 5662be9c07876da655e8cfc8feb9b2aa | 【异步方法】删除部门 | return new Promise((resolve, reject) => {
deleteDepartment(payload).then(response => {
if (response && response.data.errCode === 0) {
resolve(response)
} else {
reject(response.data)
}... | 1 |
f36c0aab2e405e0f8bf1322213b5128a | 4b4eae40729be2f3b5ce94232293f928 | Write calculations result to the "To" EditText. | public class MainActivity extends AppCompatActivity
private void updateResultText() {
resultView.setText(model.getInputValue() + " " + model.getCountryFrom() + " = " + model.getResult() + " " + model.getCountryTo());
} | 0 |
5468472b338e184beb90384124a7b636 | 3722dc7df0f197169bf71f1822c402f8 | Distance in nautical miles between the two points. | def dist_mnh(x, y):
dlon, dlat = _dlon_dlat(x, y)
return abs(dlon) + abs(dlat) | 0 |
2e7b095dc0e7f1921c53b84e051d27ea | 29fdfda2ec6692f02ff9f311523db7ff | Returns True if the last web request resulted in an erroneous HTTP code (like 500) | def wasLastRequestDBMSError():
return kb.lastErrorPage and kb.lastErrorPage[0]==kb.lastRequestUID | 0 |
12ba229993406730e1834523e0b4cfb1 | e44f9cdc3c2363b8a1f8f5e9ee7f5092 | 修改CzybmAuthority | try {
if (tbModule != null && tbModule.getModuleId() != null && authorityId != null) {
stModuleService.authoritydelete(tbModule.getModuleId().toString(), authorityId);
comAuthorityService.create();
}
return null;
} catch (ServiceException e) {
return null;
} catch (Exception e) {
return nul... | 0 |
2e0b9c49d80df7f580d0804c764d3ff3 | 8f78ef0ea293a79ac714961ba2b7b0f0 | Executes an instance of the job returned by getJob() using
the given map as inputs. | JobResult launchJob(Job job, JobParameters params); | 1 |
5c411412c7c70cded66f4189b011df9f | bad6989489f1e106a7957c8d6ff4339d | 피부색을 검출하여 마스크 이미지를 만듦 | if plot : print("Getting mask...")
output = self.frame.copy()
output = cv2.medianBlur(output,5)
low_orange = np.array([16.8/2-sens,0.5*255,0.5*255], dtype = np.float32)
upp_orange = np.array([16.8/2 +sens,255,255], dtype = np.float32)
kernel = cv2.getStructuringElement(c... | 0 |
2588961831b51e5bb29bece8ca7faabf | b3720901015070f533d8d8aef25ce3f5 | 删除登录回调 | func deleteCallback(){
logging.Info("update call back")
} | 0 |
0b29a47064f3c8c590071b13c214e8f6 | 7984fed79d3dac1efc0c1b91804a0136 | 주변 대학교 목록을 셀렉트 박스로 만드는 함수 | function getSchoolList(){
$.ajax({
processData: false,
type: 'POST',
url: "/admin/reviewgroup/schoolList",
contentType: 'application/json',
data: "",
dataType: 'json',
success: function(data){
$('#schoolList').empty();
var tdHtml = "";
... | 1 |
88c3d152fed192ebdc0cb0538e780c88 | 63aadc2d13294795b1002ae6fd6027db | Sets the size of the internal buffer used to exchange data with the USB
stack for write operations. Most users should not need to change this. | public class UUIDGetter
public void setBufferSize(int theBufferSize) { myBufferSize = theBufferSize; } | 1 |
95e084b06e2f1c0df86d91897eb30031 | 8af81b10a10b5dc40a3e61f447269f5d | Interceptor just before sending back changes | class reflex_defaultBehaviour extends mod_behaviour
public function reflex_beforeStorageChange() {
return $this->editor()->beforeEdit();
} | 1 |
d1d4c783b43bf50c955b5162f941aef4 | 79bca840ed564b24b69192675fbb0742 | Dispose additives specific to VendingMachineOne. | where TProduct : Product
where TMoney: Money
where TImage: Image
where TMachine : VendingMachine<TProduct, TMoney, TImage>
{
services.AddScoped<IRepository<TProduct>, EFRepository<TProduct>>();
services.AddScoped<IRepository<TMoney>, EFRepo... | 0 |
ead8c1267be245e9aa9f312fabca1528 | bc217f7bfbd5a6794ed77ea89a953142 | toolBar设置状态栏高度的marginTop | ViewGroup.LayoutParams params = toolbar.getLayoutParams();
int paddingTop = DimenUtils.getStatusBarHeight(context);
if (paddingTop == 0) {
try {
throw new Exception("can't get status bar height ! Error !");
} catch (Exception e) {
e.printStackTrace();
}
}
params.hei... | 1 |
3fcad03d999e40241ac456ae77855c7d | e5f77b8e510c5d0887bd1ac9ac966b41 | Release unmanaged resources.
<br/>
This method recursively delete the temp folder created by this instance. | {
Boolean result = false;
try
{
Directory.Delete(TempFolderPath(), true);
result = true;
}
catch
{
}
return result;
} | 1 |
6e281f4f82d99a054e6180bf32ad2a36 | a150728c082933f3e89f9b4b7c2a5e7e | Stores a globally-visible state variable. | export default class GprcCucumber
storeValueInGlobalScope(variableName: string, value: never) {
globalVars.set(variableName, value);
} | 1 |
5f084e98ff9a76961dfc6601f95075f9 | 86c14665e9f174f5ee4ba4a0147e816f | Возвращает счёт матча. | {
Match match = this.GetMatchById(id);
if (match.Result == null)
{
throw new ArgumentException(ExceptionMessages.MatchNotPlayed);
}
return match.Result.ToString();
} | 1 |
cb70eabb2d30b80a0314d7ab9ccbb7b2 | a93faab74f833d289d56f1bff2e3d4c0 | 由于每页只显示10个,需要将mList拆开传递 | class UserLists extends Component
handlePages(pages, lists, totalPages) {
let pageListsArr = []
if (pages < totalPages) {
pageListsArr = lists.slice(pages * 10, pages * 10 + 10)
} else {
pageListsArr = lists.slice(pages * 10)
}
this.setState({pageLists: pa... | 1 |
ca6d2c436a8f695c3ef9d62aaffda076 | ef1e143584802bc4a4c39f4979c075f3 | Test if a df datetime column is correctly converted to time periods | dti = pd.date_range(start, periods=15, freq='H')
for datetime in dti:
pass | 0 |
2d374ace6c656e5cbf16371f91cf05d4 | 3c319b5e2c4322ea168e6c2c401d9411 | Selects virtqueue with given index | virtq_select(index);
size_t num_descs = virtq_num_descs();
ASSERT(num_descs <= 4096 && "too large queue size");
offset_t avail_ring_off = sizeof(struct virtq_desc) * num_descs;
size_t avail_ring_size = sizeof(uint16_t) * (3 + num_descs);
offset_t used_ring_off =
ALIGN_UP(avail_ring_off +... | 1 |
41512b660b453852d5cd22f2a804624a | a28bbbe9c16bf51658d10adb1b1792f6 | -#-#-#-# MAIN #-#-#-#-# | cat("#######################################################################################################\n")
cat("# WELCOME TO THE WGBS INTERACTIVE MODE #\n")
cat("###################################################################################... | 0 |
385d0e348823da22461a69a92243b410 | 0a518a4a6cec078e00b1da9804b90cae | 初始化节点设备端口列表 | class Server:
def create_port_list(self,start_port):
port = Port()
port_list=port.create_port_list(start_port,len(self.device_list))
return port_list | 1 |
d2dc87949f0075780b363893e519d9f6 | eb454b3ffcef89ef434cc6d29e5e67f7 | Button 14 on fifth joystick. | class KeyCode
get Joystick5Button19() {} | 0 |
c4a80c68bf686dc6d1d816e0755c733c | 37411d66067a920ce5bbb40868105f71 | Deserializes a given file to a given list | namespace AccountingODS.Serialization
IList<Data.Invoice> DeSerialize(string filename); | 1 |
7e6cf81dcd9dbf49860fb64178257aaf | afe976545c50519ade4c9b24bd5df659 | 改行する (インデントは考慮せず単に \n を追加) | abstract class AbstractTagBuilder(val parseMode: ParseMode)
fun nl(): Unit = append("\n") | 1 |
95d436afa0ded3914b4bbe2023895aa0 | 3a0e1eb9746f2e3d3b18e532a8f2b9e9 | Creates a form to edit a Oferta entity. | class profileActions extends sfActions
public function executeEditOffer(sfWebRequest $request)
{
$this->topicList = Doctrine_Core::getTable('Topic')->getActiveList();
$this->offerId = $this->getRoute()->getObject()->getId();
$this->topicId = Doctrine_Core::getTable('Category')->getTopicId( $this->getRoute()->get... | 1 |
1367ffebbb9ecb19980bafee3c2456b6 | 755774f87b9f894945bb798c46da49d2 | push the current state to stack and prepare for new segment to be read | void segmentHandler( void )
{
row( 0 );
col( colIndex );
row( segData[ colIndex ] );
if( ++colIndex >= (int)(sizeof(segData) / sizeof(segData[0])) ) colIndex = 0;
} | 0 |
910f2156df28aac52de9c92af32a149a | 99cd3c1d8affd562cea0460d7845b128 | @brief Method to check if wall exists in front of the robot | std::cout << "wallFront" << std::endl;
std::string response;
std::cin >> response;
return response == "true";
} | 1 |
abd9f2cb2c26eb8f632c5d79e7e6aeb8 | be6e09b782a0e10855fb0a0711a35efa | Gets the vpn_ip of this IPSecConnectionTunnel.
The IP address of Oracle's VPN headend. | class GetGatewayVpnAttachmentsAttachmentResult(dict):
def internet_ip(self) -> str:
return pulumi.get(self, "internet_ip") | 0 |
877bed436588c5dfca43f743244c4106 | 9112861325671716e3237f6aa3d8e273 | 頂点の法線を計算
頂点の属するface面より平均?正規化した頂点法線を求める | vec3D v1,v2,aN;
for (int i = 0; i <faces.size(); i++){
v1 = vec3D(verts[faces[i].a],verts[faces[i].b]);
v2 = vec3D(verts[faces[i].a],verts[faces[i].c]);
aN = v1.cross(v2).normalize();
faces[i].averageN = aN;
}
} | 0 |
0a79e222d6665c932752909da99f4c44 | 1af418cf72180bce4f2a3b205e06d62d | POST /textbooks
POST /textbooks.json | @textbook = Textbook.new(textbook_params)
@textbook.user = @current_user
if @textbook.save
render json: @textbook, status: :created
else
render json: @textbook.errors, status: :unprocessable_entity
end
end | 1 |
2e790483d33685f57eaae3967f03e2e4 | c1f33974a1a84e1a29dc86851072295f | check that given photopoint contains all the keys needed to filter | class SimpleDecentFilterCopy(AbsAlertFilter[PhotoAlert]):
def _alert_has_keys(self, photop):
for el in self.keys_to_check:
if el not in photop:
self.logger.info(None, extra={"missing": el})
return False
if photop[el] is None:
self.logger.info(None, extra={"isNone": el})
return False
return Tru... | 1 |
73f43c47a5d1fb0711102c14e8643d03 | 3c9e78b680d4a6e91da520b069d639cf | 此函数仅截取图片中心正方形,截取长度为原始图片最短边长 | def cutout_center(image: np.ndarray, width=30, height=30):
im = np.asarray(image)
shape = np.shape(image)
center = (shape[0] / 2, shape[1] / 2)
half_width = width / 2
half_height = height / 2
limit_dim1 = (
int(center[0] - half_height),
int(center[0] + half_height)
)
limi... | 0 |
a6eae6c326e35b632c340acb5961581a | 086571b5e7df65025ab48f8d88a05de8 | Quantidade de vezes que uma letra k aparece em uma string. | def f(t, d):
return d.count(t) | 1 |
5f9667ea5309863acf72a20fa034da46 | adae2ee55f24a2dc83d43fc356ac0913 | returns a list of lists of (lat, lng) tuples that are relatively close to each other | class GeomTools(object):
def makeNearbyKeys(self, lat, lon, max_lat_delta=0.02, max_lon_delta=0.03,
grid_size=0.01, min_delta=0.013):
import itertools
lat_increments = set()
lon_increments = set()
for i in [-1, 1]:
current_lat = lat
lat_incr... | 0 |
7484a8b1bcdce5b123ee585ba845cf33 | 9de0a4385307b22a7ca0f33b1586609b | Given serialized list of card_configs, convert back. | def postprocess_card(raw_card: dict, raw_tx: str, sender: str, vouts: list,
blockseq: int, blocknum: int, deck) -> dict:
nderror = {"error": "Number of decimals does not match."}
_card = {}
_card["version"] = raw_card["version"]
_card["number_of_decimals"] = raw_card["number_of_deci... | 0 |
7c957af353c067fab73fe90be428f496 | 82adb5eede928442439c80a17d0ac182 | Clean meta data value and trim double spaces | $value = html_entity_decode($value);
$value = str_replace('\r', ' ', str_replace('\n', ' ', $value));
$value = preg_replace('`<[^>]*>`i', ' ', $value);
$value = preg_replace('` {2,}`i', ' ', $value);
$value = preg_replace('`^[\s:]+`i', '', $value);
return trim($value);
} | 1 |
1541979df248e9f73c9633fa6a7a89e1 | 3349c8a8f7540ec0e33714aef2e4a329 | permet de récupérer toutes les cartes de la collection de l'utilisateur | namespace Antinomia.Battle public class MainJoueur : NetworkBehaviourAntinomia
public List<GameObject> getCartesMain() {
CartesMain = new List<GameObject>();
foreach (Transform child in transform) {
CartesMain.Add(child.gameObject);
}
return CartesMain... | 0 |
84becca79d4283ede164baacdc8076e4 | 8b1e9f8383f476389da6a23718353784 | Creates and builds a local view for the given view ID independently from the current view. | ViewProviderService v = getCurrentViewProvider();
if (v != null) {
return v.addToView(loc);
}
return null;
} | 0 |
a417d2a8abd5a656f35a2d183a191b9e | 6872d8b0daf3ee44e39daab67ecff1d1 | Приветствие при работе в командной строке. | text = 'Добро пожаловать!'
user_name = update.message.chat.first_name
logging.info('Пользователь {} начал работу с ботом'.format(user_name))
update.message.reply_text(text) | 0 |
901ecbdf78f684fed2716f3852aa99fb | bec573c6032e58c48212811889a1c2c0 | Test with a vector and a 2d array. | interp = Interpolator(np.random.randn(10, 2), np.random.randn(10, 1))
self.assertEqual(interp([0.01, 0.01]).shape, (1,))
self.assertEqual(interp([[0.01, 0.01], [-0.01, -0.01]]).shape, (2, 1)) | 1 |
9ce579a873de8a653ebf99f3ace8b328 | f89a162b587979d307b817d9550bf8e3 | True if this source has already been checked out on the local autoproj
installation | class Base
def checked_out?
File.exists?(@checkout_dir)
end | 1 |
3c21d52e62c1be05c1ecd6df87e1a943 | a55a22019709dc8c4aaeba53ab74a1b8 | 微信内置浏览器全屏 | function fullScreen() {
let ua = navigator.userAgent;
if (ua.match(/iPhone|iPod/i) != null) {
$('._toolBarZoomIn').on('click', () => {
$('#toast', parent.document).show();
if (toast) {
clearTimeout(toast);
}
toast = setTimeout(() => {
... | 1 |
bc5c66cfe084e5fc32ead1c381878244 | af2ac7fe651f7e53d4afd42f00890d57 | sets squares of a solved puzzle to zero until only a certain number of squares remain solved | public class SectorEngine : MonoBehaviour
public void donePuzzle(){
if (puzzle_count > 0) {
puzzle_count--;
}
} | 0 |
5aa20c4b0a898b48b9e0185d1abc675b | 508334c248ccb1939e24163f0735460a | Возвращает условие для sql запроса данных объектных типов данных | bool checkType = false, bool selectForced = false)
{
#region Проверка типа
if (checkType)
{
if (type == null)
throw new ArgumentNullException("type", "не должен быть null");
Type baseType = type;
while (baseType != null)
{
if (baseType.Name == typeof(BaseEntityObject).Na... | 1 |
0c3a498cc6c25a5f6a7f40debb674420 | d4e9fbcdf0716cc5b0e646af4f948d37 | Reset the node's executed tasks counter to zero. | class Node:
def _children_reset(self):
self.executor_cleanup() | 0 |
af74fa38f4cfdde5888b9636fc402295 | dc523b3d21103465fdbb345b2dabbadc | returns an array of parking levels for an instance of parking lot | class ParkingLevel
def parkingspaces
ParkingSpace.all.select{ |parkingspace| parkingspace.parkinglevel == self}
end | 0 |
099f2f5c33db041de8f2cbf8484f82e6 | 557fb3efda2a46a0d9c60b1d2455ed12 | 根据各个点的标签,更新聚类中心 | n = len(c)
tmp = np.zeros((30, 2))
num = np.zeros(30)
k = -1
for i in range(n):
t = c[i]
if t == -1:
continue
if t > k:
k = t
num[t] += 1
tmp[t] += points[i]
k = k + 1
for i in range(k):
tmp[i] = tmp[i] / num[i]
... | 1 |
dd0c2ed96b5340802aa1a5b82ff01493 | 87e82f4c2bddc078b6b71f03a95f5e82 | Calculates the total cost that every passenger spent on transportation,
taking into account the number of passengers and price per passenger | class Travel:
def _calculate_cars_cost(self) -> float:
return self._car_price * len(self._cars) | 0 |
036ac0842fb103de261cfb6b0e051536 | 3b667b2d49b1755624da7385359e8d6d | #Find the contiguous subarray within an array (containing at least one number) which has the largest product.
# tricky case: nega * nega = posi | class Solution(object):
def maxProduct(self, nums):
if not nums:
return 0
imax, imin = 1, 1
ans = nums[0]
for num in nums:
if num < 0:
imax, imin = imin, imax
imax = max(num, imax * num)
imin = min(num, imin * num)
... | 1 |
d8c234ee1440c66f6b0a2f352238bc29 | 2d20bc53a254ac7c4bd3b1c76acbf09a | PrioritySchedulerFIFO | void sched_fcfs(void) {
} | 0 |
af9fe9763fab496b10e58058b9d70b5f | 3ddb010931630e91c50ec2dba382bfa3 | Count all occurrences of <paramref name="element"/> in the collection. | namespace Breifico
int Search(IList<T> input, T element); | 0 |
1e9469ad0928845283bf594990c087da | 5190cf5fde35617841208d00770927fa | init NXTe.
NOTE that the specified port has to be initialized for I2C (LOWSPEED_9V) before invoking this. | void init_NXTe22(U8 port_id)
{
ecrobot_send_i2c(port_id, NXTe_I2C_ADDR, I2C_SC18IS602_F0[0], (U8 *)&I2C_SC18IS602_F0[1], 1);
} | 1 |
8b7447291a4ef4fa0c31e5752797e940 | 089714da89a5246e4e67899be36de3b8 | This function is the same as the regular do_mbox_recv except that it is assumed
to be called from inside a function's critical section. This is used in keyboard.c
to prevent race conditions. | PUBLIC int do_mailbox_wait(int mbxid, const struct active_config * config, struct pstats * stats)
{
return (active_wait(&mbxpool, mbxid, config, stats));
} | 0 |
0c2a1bca485af93a284969ec477505f8 | 4b73740fc5625b5eac9e1e9fa5f3dfae | Find the mime for a file on the local file system | {
Validator::checkFile($pathname);
$self = $this;
return Util::executeFunction(
function () use ($pathname, $self) {
return finfo_file(
Util::getFileInfo(),
$self->getBasePath() . $pathname->local(),
FILEINFO_MIME_TYPE
);
},
'Filicious\Exception\AdapterException',
0,
'Could ... | 1 |
f169c7283e4ebf2b3566eb57e746580c | cabea32ecaf4def41afc27b8c247bb2d | Template context processor: add the simple keyword search form to context | def searchform(request):
return {'kwsearch_form': KeywordSearchForm()} | 1 |
caaeec700b51e62b9463be06b69483e5 | 25e8777d4617204ddc07c4218a44f519 | Returns a 3-tuple of (hue, lightness, saturation) float values (between
0.0 and 1.0). | r = float(r) / 255.
g = float(g) / 255.
b = float(b) / 255.
mini = min(r,g,b)
i = (r+g+b) / 3.
if i == 0:
s = 0.
else:
s = 1. - mini/i
if s == 0.:
h = 0.
else:
h = ((r-g)+(r-b)) / 2.
h /= sqrt((r-g)*(r-g) + (r-b)*(g-b))
h = acos(h)
... | 0 |
f79cfc609c00bef5333af31851b27f39 | 400e25487dd7324407a47d896b26201c | Simulates one time step for the given systems (orientation of spins).
For that it uses the methods of markov-chain monte carlo to calculate a possible
next state and accepting it with a propability that is related to the difference
in energy between the new and the old state. With the variable beta one can modify
the t... | def QA_MC_step():
for mc in range(MC_STEP):
rand_trotter = np.random.randint(0, TROTTER)
rand_row = np.random.randint(0, L)
rand_col = np.random.randint(0, L)
delta_e_local_1 = 2 * SPIN_CONFIGS[rand_trotter, rand_row, rand_col] * (SPIN_BOUNDS[rand_row, rand_col, 2] * SPIN_CONFIGS[ran... | 1 |
9785033dc95fda380fbbdf0febdc39ae | dfd7d6d5a2c026979e4daaa521115949 | Get keys of used IPTC tags | output = []
for cameraID, data in self.master.cameras.iteritems():
for configuration in data['exif']:
output.append(configuration[field])
return sorted(set([x for x in output if x is not None]), key = lambda s: s.lower()) | 0 |
3b4e655526e162922e0488b3fe444a1d | 4b1d13b4d06b09930159a81921a7eb85 | Returns the last known validation status of the specified field. This
method is used to find out whether the status of a field has changed. If
no status is known, the field is considered valid and not visited. | public Boolean getValidationStatus(); | 1 |
59eae448f0a6ea472bf92ae51dd01898 | 367fa6cf4e9895d6e17afc3ac0d45af9 | [float] 跌停价 | class Market:
def low(self, param):
records = self.platform.get_kline(self.time_frame)
records.reverse()
result = float((records)[param][3])
return result | 0 |
22be433862d465b87438561eebd0e441 | 1cac4b9541b1b894c725c5e0ba0f5800 | Find Question filtered by character. | class CharFrom(FindAll):
def __init__(self, chars):
self.chars = chars | 0 |
77718f76686935aa2d6552b4adbefde6 | d0e8037a5f161357d9302774752d7172 | Add a prior to the list. | class CustomQtListEditorKlass(CustomEditorKlass):
def add_before(self):
self.add_item(0) | 1 |
66b2d255bf117883937c9526ec25960c | ab4af8f8e12c68d3e16e9ac79f6c6ba7 | Gets (as xml) the "freezer_l" attribute | fixed = self._attributes['fixed']
if fixed == '':
return None
else:
return _translate_xmlbool(fixed) | 0 |
5b2e1b292da664ab8337bc457b0c0243 | df9882d8dfe7c29f552dfac5cf72dbd3 | Heartbeat will beat every second for us to see if the
MCU is working correctly | void loop(){
if (millis() > lastHeartBeat + HEARTBEAT_DELAY){
lastHeartBeat = millis();
sendHeartbeat();
}
if (millis() >= nextUpdateTime && (currentMode ==4 || currentMode==5)){
if (nextUpdateStatus==1){
if (currentMode == 4){
nextUpdateTime=millis()+7000;
}else{
nextUpdateTime=millis()+3000;
... | 1 |
5296e1f499f0ed25ee8e776e1f98b64f | e8b0b9f51d07cbd27fb7752e6ccfceca | move window ============================================== | {
#if defined(_WIN32)
cocos2d::Director* pDirector = cocos2d::Director::getInstance();
cocos2d::GLView* pGLView = pDirector ? pDirector->getOpenGLView() : NULL;
HWND hwnd = pGLView ? pGLView->getWin32Window() : NULL;
if (hwnd)
{
RECT rectCurrentWindow = { 0, 0, 0, 0 };
GetWindowRect(hwnd, &rectCurrentWindow... | 1 |
c63d3d86790f5eeac78c25112999bf1e | 6411bc5a5a5b55968bc6e86ca08372f2 | 设置+ - 的颜色 | if (val % 2 === 0) {
return { name: '双', color: '#da1c10'}
} else {
return { name: '单', color: '#4777c3'}
}
} | 0 |
47bacee29548054c12a233e6112295c5 | add8aa10c4ad3021c5c9f888f2f26dca | 获得省级区域统计 | var qxsl = ctx + "/blspController/getqhxmsl";
var mapchar = new Array();
var mapchart = new Array();
$.ajax({
url: qxsl,
type: 'get',
async: true,
dataType: 'json',
success: function (result) {
var map = [{"name": "章丘区", "value": 0},
{"... | 0 |
d04717b097fdbe83e868429db8f706d7 | db358158643d92b9ce8b096cf7e9f090 | Get a key name based on function, arguments and keyword arguments. | key = args
if kwargs:
key += "##kwargs##", tuple(sorted(kwargs.items()))
return key | 1 |
797337eb94820413f3d2a4c95ad36521 | 38d737fbdfb4dbe82acd57e3f5c8f085 | if a nav item has children, add the 'has-children' class to it | if not nav:
return ''
if request.endpoint == nav.get('endpoint', ''):
return ' class=active'
child_nav_list = nav.get('child', [])
for child_nav in child_nav_list:
if request.endpoint == child_nav.get('endpoint', ''):
return ' class=active'
return '' | 0 |
b3bb361002d0ea10abfff712abb7b7ac | d79a0c42f9424c91ccde4293f74bc20b | 创建一个面板,面板中心显示一个标签,用于表示某个选项卡需要显示的内容 | {
if (component==null) component = new JPanel();
addTab(text, component);
setSelectedComponent(component);
return component;
} | 0 |
825952b1030848d3efa6b63056762d93 | 80e2d86f5aa685cd3d4f28157466fe69 | Pure convenience to allow setting of quadrature rule in constructor | TPZIntQuad::TPZIntQuad(int OrdK, int OrdE){
fIntKsi = gIntRuleList.GetRule(OrdK);
fIntEta = gIntRuleList.GetRule(OrdE);
fOrdKsi = OrdK;
fOrdEta = OrdE;
} | 1 |
79c7737e6bc1dbc6bbcbaf2af0f743b1 | f26a528b5e4c39c89a5d62996848a7cc | 打印当前状态并生成下一个状态 | void run()
{
read_tuple();
cout << left
<< setw(12) << "步骤"
<<setw(50) << "状态栈"
<<setw(31) << "符号栈"
<<setw(46) << "剩余输入串"
<<setw(20) << "分析动作"
<<endl;
if(Analysis() == 1)
{
printf("\ntrue!\n");
}
else
printf("\nerror!\n");
} | 0 |
c211d42727f03448c2c86f67b00474bb | 35483120133ef0c1d02d5c87999e3ea8 | Sets the projection to retain-none-values mode. | List<Expression> projectExpressions,
List<Attribute> projectAttributes)
throws OptimizationException, SNEEConfigurationException {
List<Attribute> requiredAttributes = new ArrayList<Attribute>();
for (int i = 0; i < getExpressions().size(); i++) {
List<Attribute> requiredAttributesX = ge... | 0 |
967af5f69ecb6eebc6635e765a9000e4 | 414b1cac2df7caa6daf21c681dbae102 | Normalized mutual information | def normalized_mutual_information(img_x, img_n):
img_size = img_x.shape
img_n = cv2.resize(img_n, dsize=img_size, interpolation=cv2.INTER_LANCZOS4)
hist_X = np.histogram(img_x.flatten(), bins=256)[0]
hist_N = np.histogram(img_n.flatten(), bins=255)[0]
hist_XN = np.histogram2d(img_x.flatten(), img_n.... | 1 |
cf0552358d1d99c88858e1b09a8f0191 | aebf1843d2e6fa8202c43993d466a357 | @brief called if there is any error on the upstream socket when using the
redirect pipe. | static void pipeout_error(char* str) {
pipeout_open();
pipeout_write(str, strlen(str));
pipeout_close();
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.