query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
e52029438e231f836b66d6196bf7955d | ae525adfdf5d189f1e9e435310156e2a | Get Swim Team Id by Name | class SwimMeetMeta extends SwimTeamDBI
function getSwimMeetId()
{
return $this->__swimmeet_id ;
} | 0 |
cf3d942eb6cb9d9ff6abed9806892c4f | d6405cd9c5bbda78fda7060ffad68541 | Post 获取报价保险公司 | public class EtopFacade
public static Message postCanQuoteInsures(Map<String, Object> params) throws Exception {
String messagePrefix = "panda.insure.canQuoteInsures";
OTIContainer otiContainer = createOTIContainer();
Transaction transaction = otiContainer.newTransaction(messagePrefix + ".request",
messagePre... | 1 |
5c8de5dfa241e457df4142c73e80106a | 56c6f0127786f52b5fb2555db265d1f0 | función para comprobar que el inicio de sesión sea correcto o incorrecto | if (is_user (data)) {
app.session_user = get_user(data);
app.logged_in = true;
let welcome = `Bienvenido, ${app.session_user.username}`
clearHTML (get_element('login_errors'));
alert (welcome);
app.set_state('landing');
} else {
data.errors = {
... | 1 |
83b27abc7d1d6d7d0f9d9e5b5bca805c | bad7374b1ce7e657d9818cf433ce5b9b | go through every star and update their forces | public class ParticleForceRegistry
public void updateForces (float duration){
for (int i = 0; i < listLength; i++) {
Registry [i].fg.updateForce (Registry[i].particle, duration);
}
} | 1 |
da7d505ae8c194f3b958a43b5ebc2204 | 79eb1782453e92df50b9383c498db6fb | Method to retrieve the value of a single field from the target component by name index. | "This method is deprecated and will be removed in the next major release. Use GetField( Type, string, int, ITypeConverter ) instead.",
false)]
public virtual object GetField(string name, int index, ITypeConverter converter)
{
CheckDisposed();
CheckHasBeenR... | 1 |
fb183de51e15c0f715e71bac3e40cf12 | 278282032ff9909be003e72bcb180569 | Returns distance between two locations in feet | def get_distance(location1, location2):
pt1 = geopy.Point(location1[0], location1[1])
pt2 = geopy.Point(location2[0], location2[1])
dist = great_circle(pt1, pt2).km
return dist | 0 |
3a64851e3ab4015569a7a5c29423c30b | b39a5ffc01b62e20e7215fe232886d9c | Returns the number of rows in the matrix | public class DMatrix
public int getRowCount()
{
return _m;
} | 1 |
a9646982565976b19f8d5b75ecb079ea | 9048cc13da29b22dc4019266ce1036f4 | Node configuration (first node). | String key2 = "my_new_public_key";
EncryptionAlgorithm alg2 = EncryptionAlgorithm.RSA;
List<String> machines2 = new ArrayList<>();
machines2.add("m4");
machines2.add("m5");
machines2.add("m6");
Integer pPort2 = 1002;
Integer mPort2 = 2002;
Integer rPort2 = 3002;
String loc2 = "my_new_location";
St... | 1 |
ad3816471161db19b8f3807dea5b5401 | 7fd14d2483ad0c4ad66231766752ebf7 | 新規SetCommodityCompositionをデータベースに追加します。 | Long insert(SetCommodityComposition obj, LoginInfo loginInfo); | 1 |
54740208a5a336dc5042118965795167 | 6d159bf6925b111a641634a2e06be348 | 从http请求中获得字符串(并使用htmlspecialchars进行防xss处理) | class funcPunlic
public static function getStr($string)
{
$value = $string;
if (! get_magic_quotes_gpc()) {
$value = addslashes($string);
}
$value = str_replace("_", "\\_", $value);
$value = str_replace("%", "\\%", $value);
$value = nl2br($value);
... | 1 |
8ad5b5334dc41732bf48fefb6cb1c4df | e7e47cd2818b0fbc59857a5313e5c766 | Construct the throbber widget | class QtProgressBar(QtControl, ProxyProgressBar):
def create_widget(self):
self.widget = QProgressBar(self.parent_widget()) | 0 |
026b93a00547398590f488d5a63774df | 9418ca4477289a797977e27bc250102e | 断言value一定为true,如果不是会抛出相应的异常 | try:
assert actual == True
logger.info("断言成功,实际值:{} 为真".format(actual))
except AssertionError as e:
logger.error("断言失败,实际值:{} 不为真".format(actual))
raise AssertionError | 1 |
32d268c5b6c4976b13d4162f50fb17dd | 79e8d035221a0dc0e9388925921f7f20 | Dimension object for matrix columns. | super().__init__(name)
if not isinstance(value, np.ndarray):
value = np.array(value, dtype=dtype)
self._value = value | 0 |
4d2d4a6fadcc40cdc77b1c55d2aa3696 | 863fbec99a7b9ec7a0315b0285350df8 | Returns coarse grid resolution in Z direction | class HydroSystem(System2D):
def fzmi(self):
return int(np.fix(self.fzm/self.depth * self.nz)) | 1 |
40011d3888df3cb7ec20fc7fb9b9c304 | 18fbe89ce5c81fc08841abceb29cfbb5 | #returns the average value of a randomly sampled population. | f <- function(i) mean(rnorm(1e4, mean=i)) | 1 |
74a53ff2caac7b52c6d789e5feafe1b7 | 74ae7d3b6393439aec52acaa391a2ee4 | Prepare environment for metric generation. | class TextMetricSpec(tf.train.SessionRunHook):
def _prepare(self):
raise NotImplementedError | 1 |
134034cd83e9e9125907814355d0b866 | 60898f3b1adb9e935396c76e42d75e2c | 活动安排--最多个数 | public class Dp
public static int activitySelectionGreedy(int[] start, int[] end) {
Interval[] intvs = new Interval[start.length];
for (int i = 0; i < intvs.length; i++) {
intvs[i] = new Interval(start[i], end[i]);
}
Arrays.sort(intvs);
int ans = 1;
int base = intvs[0].end;
for (int i = 1; i < start.le... | 1 |
7433519309418ac5487b34452584ed73 | 7d1436170f9361fc8591ea88bf009115 | Returns True if both decks have the same strength. | if self.value != other.value:
return False
if self.value == hand_values[9]:
return True
if self.value == hand_values[8]:
return self.sf_lead == other.sf_lead
if self.value == hand_values[7]:
if self.quads[0] == other.quads:
... | 1 |
a96e2a7e33abee40d3817b116e25c7df | ccac755dfd8f9e6db1c6de87f313bb45 | 计算直方图相关性 | System.out.println("\n==========直方图比较==========");
double HISTCMP_CORREL_THRESHOLD = 0.9;
double HISTCMP_CHISQR_THRESHOLD = 0.4;
double HISTCMP_INTERSECT_THRESHOLD = 2.5;
double HISTCMP_BHATTACHARYYA_THRESHOLD = 0.2;
try {
long startTime = System.currentTimeMi... | 1 |
6a8944e5b9261781d2ae041d51a43436 | 4b83773a2459488730556f51b655c0f6 | calculates fibonacci sequence using the binet method | def fib(n):
return ((1+sqrt(5))**n-(1-sqrt(5))**n)/(2**n*sqrt(5)) | 1 |
5a43eca71144039e7dd2f925afafe767 | 276558b89990899664894f08f9fce942 | 输入层数,输出对应的金字塔 | function pyramid (n) {
if (n === 0) return []
let arr = []
for (let i = 1; i <= n; i++) {
arr.push(num(i))
}
return arr
} | 0 |
5c7872290387bdd2f363a9f443b3bfe7 | 8adbd49ee8382de4ea9d0c84ad55c0f8 | Nastaví zda se mají vykreslit pasovací čary pod obrázkem | class Image extends Api
public function setFaces($bool)
{
$this->fieldSettings['faces'] = (bool)$bool;
return $this;
} | 0 |
4a575f52d90d517fae515e577c0a45d9 | 6b5cdcd7c09fa2e18fa2c42712517806 | Short program to test usage of GSL functions | int
main (void)
{
int npts = 100;
int trials;
unsigned long int seed;
double lower = -sqrt (2.);
double upper = sqrt (2.);
double delta_x;
double delta_y;
double x = 0.;
double y = 0.;
double R_avg;
gsl_rng *rng_ptr;
rng_ptr = gsl_rng_alloc (gsl_rng_taus);
... | 1 |
9b58d09c221e8b9b5c57d60a7d46f286 | 33a1c6462134ffe5567b3a1ba91bfbb4 | =>노래와 앨범이 다시 제대로 매치시켜주는 함수 | while 1:
connection = pms.connect(
host='localhost',
port=3306,
user='db',
password='db!',
db='music',
charset='utf8')
print('음악번호를 입력하세요:', end=' ')
input_no = input()
try:
with connection.cursor(pms... | 1 |
7caf4e96e1857e2cc9de78bc901e438e | 74314c9065f609baf3c8134a58dc3b52 | Metodo che permette di verificare se un utente è gia presente in una prenotazione | @Service
public class ReservationService
public Boolean clientPresentBdd(UUID uuid) {
Optional<Client> cl = cliService.findByUuid(uuid);
if (cl.isPresent()) {
return true;
} else {
return false;
}
} | 0 |
dce54f4c21ba0021ee2477be0a0afcd7 | 870fe573b3bea4eb7d93d02930dda006 | Calls a write action repeatedly while copying bytes from a source list through a buffer.
If the provided source is a byte array, no intermediate buffer is created. | namespace System.IO public class ActionStreamWriter : System.IO.Stream
public override void Write(byte[] buffer, int offset, int count) {
_writeAction(buffer, offset, count);
} | 0 |
35b374407b786a8de100257ecfce963c | 8ed201f8f1564ea15f80d03d38e7200f | Method to create dummy books entries. | public class LoginPageController
public Object[][] createBookArray()
{
return library.createBookArray();
} | 0 |
98975be4ffc6847009b999618c3946f3 | e366c0838e4d0b77cba75db05380d3cd | The list of parameters that are passed to the function. For example,
a concat function may have 7 parameters ('There', ' ', 'are', ' ', 10,
' ', 'bottles.') | class ComponentContext(object):
def args(self):
return self._callable_information.args | 1 |
a739ca7dda3b4f028641a2a6926b79fb | c71af8a2646799905a3a2f5df46ed582 | 添加购物车内容进数据库 | class Cart extends Model
public function insertCart($data)
{
return Db::name('cart')->insert($data);
} | 1 |
95742ae802d8d8430b1325abf4f5cfed | 9621811c255d0b5473335220c0b51e0f | 创建初始操作时间 | class orderRecord extends source{
public function initCreateTime(){$this->createTime=time();} | 1 |
4fcde3115a722af244e193f4dfdc6d95 | a09c9ed2e3e3ff5f77f3677458944504 | Release an object referenced by its key. Its reference counter is decremented. | void releaseReference(long reference_id); | 1 |
48861fc7b878420329025b582b6e66e1 | 8bd10126968471e7ede44ace9acd3c2a | [SearchOf.dtoSearch] Getter | public class Urg0001s01Dto extends BaseDto
public String getCaseDivionSearch() {
return caseDivionSearch;
} | 1 |
6dc940e328e5be472b4bfdf0689d9add | 57b03925479c97f4ce736b77ae71b071 | ============ PURE DNS FILTERING ============ | pass_packet_through = True
for (matched_domain_name, (type_of_match, verdict)) in self.dns_rules_list:
if (type_of_match == "EXACT"):
if (matched_domain_name == domain_name):
if (verdict == "DROP"):
pass_packet_through = False
... | 1 |
19610d2329a2902f98bc2000f57d2e06 | 76a2478b36a8225e19e8d21bc9071c6d | 心情删除 | $input = Input::except('_token');
$mood_id = rtrim($input['mood_id'], ",");
$del_ids = explode(",",$mood_id);
$res = Mood::destroy($del_ids);
if ($res) {
$data = [
'status' => 'success',
'msg' => '删除成功!',
]... | 1 |
cf229dda18889d17a4e27989e787bd6a | e386bb7982bb868fff5b5d474c718e80 | set limits for image size according to the size of the available space, otherwise pictures will zoom to fill the
whole width, this can cause vanishing parts of the image as height is then higher than available space (missing logic in Image.Stretch = Uniform) | namespace Interface.View
public partial class MainWindow : Window
private void ResizeSetLabel(BitmapImage bmi)
{
if (LabelSetInfo.MinHeight < bmi.Height)
{
LabelSetInfo.Height = bmi.Height + 20;
}
else
{
LabelSetInfo... | 0 |
d3084e29d32378d59691ae226fc60905 | bcf6296e409ddd40649043df2feb2f11 | 把每条用电量化为小数集合的方法 | public IList doubleEach(); | 0 |
0546e7a9db2dbeb0995fb37cf72d91a5 | 7eb3dfff70fbb7fe8b4ec5d801ab04d3 | Get a DataFrame of the dates that are an early close. | def filter_early_data(df):
keep_rows = df.index.get_level_values(CommonFields.DATE) >= pd.to_datetime(DEFAULT_START_DATE)
df = df.loc[keep_rows]
for (fips, start_date) in CUSTOM_START_DATES.items():
location_id = pipeline.fips_to_location_id(fips)
keep_rows = (df.index.get_level_values(Commo... | 0 |
8b5636f54f24f4365e54f88d41c35215 | c98ffe9799f674808d0136069dbcc567 | Output the code lines of current script | $lines = file($this->file);
$total = count($lines);
$start = $this->line > 5 ? ( $this->line - 5 ) : 0;
$end = $this->line + 7;
$str = '<div style="background: none repeat scroll 0 0 #FFFFDD; border: 1px solid #E0E0E0; padding: 10px;">';
$str .= "<h2>---------- Debug Code... | 1 |
9137d3c21920b109faf581dd2c81cb32 | 946f941fb94f058ab1e24193506aa9e1 | Test case for get_namespaced_custom_object_scale | class TestAppsV1Api(unittest.TestCase):
def test_patch_apps_v1_namespaced_deployment_scale(self):
pass | 0 |
8bd065c99cd1f065d6aa746af3ef34ab | a3b571f16702beb643d279218a925216 | 支付账号收益 | $xml = $GLOBALS['HTTP_RAW_POST_DATA'];
$obj = simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA);
$res=object_array($obj);
if($res['result_code']=='SUCCESS'&&$res['return_code']=='SUCCESS'){
$order_log=$this->db->select('sal_id')->where('pay_sn',$res['out_trade_n... | 1 |
efc05d7df46719f5f75c76b7a997ac9e | 7f61448ad6da3ef0f9cb03f40c5be655 | Nothing to do. All the bits take care of themselves. | cases like (1) | 0 |
fb41e0a98729d94cf430a5498056c1dc | ca377a152d802528f972fcd7bcddf19e | M�todo que muestra los aparatados en los cuales hay tutoriales de cierta
pertenencia (Nuestros o Terceros). | {
var tutorias = db.Personas.Where(x => x.Tutorias.Count() > 0);
return View(tutorias.ToList());
} | 0 |
d9ac222a0cf314104f1547de85a2ec3b | 845f7f93ee302776118805a89fc277e2 | Maps the given type to it's Objective-C equivalent. Array types are mapped to their equivalent
IOSArray type and common Java classes like String and Object are mapped to NSString and
NSObject. | fun ConfigResourceBuilder.iosObjC(action: IosClassResourcesConfigBuilder.() -> Unit) {
val resourcesConfig = IosObjectiveCResourcesConfig()
action(IosObjectiveCResourcesConfigBuilder(resourcesConfig))
add(resourcesConfig)
} | 0 |
4dd87de318f1ee4807317621b8b2871a | dfdd54a5896dee426303a95306c1b176 | Fire the attempt event with the arguments. | class LasalleGuard implements Guard
protected function fireAttemptEvent(array $credentials, $remember = false)
{
if (isset($this->events)) {
$this->events->dispatch(new Attempting(
$this->name, $credentials, $remember
));
}
} | 1 |
1bf21ff2f5e3d0d8c8abc2e2ba08410a | 7967bf5e94d24b618e216b2b1be46c53 | Проверка на отсутствие данных в модели | {
if (this.AllData == null) return true;
if (this.AllData.Count == 0) return true;
return false;
} | 1 |
83603a696a7e910928ce6531612e60de | 1557854971209374a8be76bc27e3ebf0 | 统计一段时间周期内菜品平均得分 | class GcmcScore extends \CActiveRecord
public function statistical($column_type, $column_id){
$criteria = new \CDbCriteria;
$criteria->select = 'stars_num ,count(member_user_id) as member_user_id';
$criteria->compare('column_type', $column_type);
$criteria->compare('column_id', $column_i... | 0 |
240c81ee36db72628add4208cfb96b54 | 15640e8e2521fa48d29fe408c45dc8e4 | Method to fetch the price from mongo DB | export class RateRoute extends BaseRoute
private async get(req: Request, res: Response, next: NextFunction) {
try {
btcValue({ isDecimal: true })
.then(value => {
console.log(`$${value}`);
if (value === null || value === 0) {
throw Error('Could not get rate from API');... | 0 |
b04a56647c2dc768cb05993a4ec4ca07 | 84ed2162e6de0c0363e2bcf8ae00460b | Return an index value for a given button event code
returns 0 on non-button event. | {
if (setupButt->checkClicked(p))
{
return 0;
}
else if (manButt->checkClicked(p))
{
return 1;
}
else if (autoButt->checkClicked(p))
{
return 2;
}
else if (aboutButt->checkClicked(p))
{
return 3;
}
else if (exitButt->checkClicked(p))
{
return 4;
}
else return 5;
} | 1 |
e2292b7deae26c19823d0ff58f9ec4ef | 224f3262e8138c7a92500eb6126b0c67 | Время в минутах от последнего сканирования до текущего времени | class Google2FA extends Google2FAService
protected function minutesSinceLastActivity()
{
return Carbon::now()->diffInMinutes(
$this->sessionGet(Constants::SESSION_AUTH_TIME)
);
} | 1 |
07754f7019b7990bd2e563dec53f6a90 | ce82856997ec56ed3039daae12e02f43 | 選單管理 - 取得選單管理登入前_詳細 狀態 | public ActionResult MenuState()
{
if (Request.IsAjaxRequest())
return PartialView("MenuState");
return PartialView();
} | 0 |
693ccad4c5fd75676a28fc3361fe40eb | 670dd3085f244203f46fe78b3decd6aa | Gets text describing a NMActiveConnectionState enum value. | {
var nvc = GetNameValueCollectionFromEnumValue(enumType);
var description = nvc.Get(value);
return description;
} | 1 |
f4187cd3a19e649be1bf9ba0f4aa3af4 | 9fa18ecc3ecc94f7e4292aa038767794 | loads props automatically if log4j.properties is present in | PropertyResourceBundle bundle;
try {
bundle = new PropertyResourceBundle(new FileInputStream(Constants.LOG4J_FILE));
Enumeration<String> keys = bundle.getKeys();
Properties props = new Properties();
while (keys.hasMoreElements()) {
String key = keys.nextElement();
String value = bundle.getString... | 1 |
838be55039e05803ee6372c531bae0f6 | 698c90d7c8de923508e586562a283995 | Endpoint para remoção de um triângulo na API | class ReposicaoController extends Controller
public function destroy($id) {
return Response::json(['id'=>$id], 200);;
} | 0 |
494ef9b0a498523639ab258b7fa1483f | a96590f3432d8d1895dc94ddb00263b0 | Calculate a list of distances and their derivatives
Takes a set of cartesian geometries then calculate selected distances and their
cartesian gradients given a list of atom pairs. | def get_coords6d(xyz, dmax):
nres = xyz.shape[1]
N = xyz[0]
Ca = xyz[1]
C = xyz[2]
b = Ca - N
c = C - Ca
a = np.cross(b, c)
Cb = -0.58273431*a + 0.56802827*b - 0.54067466*c + Ca
kdCb = scipy.spatial.cKDTree(Cb)
indices = kdCb.query_ball_tree(kdCb, dmax)
idx = np.array([[i,j... | 0 |
68e8cc8b78898cf0c33ae43c49c60830 | 80d9d01ea4959d7b698698e1ae3710ed | This matcher validates all or part of an API response against a schema. If
the response violates the schema, it shows which parts of the response
failed to match our expectations.
be matchers (like `an_instance_of(String)`) or concrete values (like
`10`). | class RestResponseResponse(dict):
def regex(self) -> Optional['outputs.RestResponseResponseRegex']:
return pulumi.get(self, "regex") | 0 |
b8365220d444753c0796a32f655c3acc | 77eb2074e216c68dddc32e4513b5d156 | Update the orbital speed according to the slider's value | public class PlanetariumSettings : MonoBehaviour
public void OrbitalSpeedChange(float newOrbitalSpeed)
{
orbitalSpeed = newOrbitalSpeed;
} | 1 |
c7ea2c90d85f4fd697b6a26037e29d9e | 1885196b8ed9385d2033d1a378db160c | Set new alias for a topic and return the alias
returns None if can't set new alias | if registrationId.strip() == '':
return {'status': -1, 'error': 'registrationId is null'}
path = '%s%s' % (self.deviceUrl, '/alias')
jsondata = {'alias': alias, 'registrationId': registrationId}
req = tools().web_post(path, jsondata)
error = req.get("error")
i... | 0 |
d8b30d9c1e2aadc839cd8f4ea122c944 | 3a2e17c1fec3c7c906eea100b77e5901 | タイトル名格納メソッド | public class ShinkiTorokushaMeiboKokuminParam
public void setタイトル1(RString タイトル1) {
this.タイトル1 = タイトル1;
} | 1 |
013bd67911ba6b8756b981565b2f2ce1 | 48d0f7c8662e5af1141e1bb970562079 | Takes first element in list 'opened'
and push it back onto closed | Node * Astar::moveToClosed()
{
Node *temp=new Node();
temp=opened.front();
opened.pop_front();
closed[temp->getID()]=temp;
return closed[temp->getID()];
} | 1 |
8f3181f66cf44480f25d021ff831d3af | 77371eeaddfbd3948cdfc82f5713f5e1 | Store the original file | class TokenListDiff
public function setFileOrig($filename)
{
$this->setStringOrig(file_get_contents($filename));
} | 1 |
74a69aa27422ed42127563df4ef47987 | 37c1f5be327b43dd3f7d2d0b010e0e1d | Выключение доступности полей ФИО | {
FirstNameTb.IsEnabled = false;
SecondNameTb.IsEnabled = false;
PatronymicTb.IsEnabled = false;
GenderCb.IsEnabled = false;
DoBDp.IsEnabled = false;
AddressTb.IsEnabled = false;
PassportTb.IsEnabled = false;
PostCb.... | 1 |
ed33801e49f6adee490c9941d70147d0 | 94581da6537e204d8877a48fecf5a658 | Controls movement for blue crocs : fall down the lianas | {
if (pos.y >= 426 && (pos.x <= 846 || pos.x >= 1020))
{
pos.y -= BP_speed;
Animation();
}
} | 1 |
c0f4259deddc7c7d81b8a34f81ad924b | 8a8ea169fbdbec197536b148435494aa | Returns the id of all regions within the selected country. | $sql = "SELECT nri_region FROM nation_region WHERE nri_nation = ?";
return $this->db->query($sql, array($country))->result();
} | 1 |
b852a8f6f4a231f589bdb05e7e6f5ce8 | 1653810e07897a0da6e8bc76a3fb6694 | Joins a tribe by its name. | namespace Grappachu.Briscola.Interfaces
void Join(string playerName, IStrategy strategy); | 0 |
1233ed098393cf95afd835deeed91f1c | b1fdb6d4e18f6714f62d571c67053dc8 | Methode zur Auswahl und anschließendem Erstellen des Arrays
Nimmt das Fach und die Notenart an | {
List<Zeugnisfach> lstzfs = _vm.GetZFs();
int currentrow = HEADER_ROWS - 1;
foreach (Schueler s in _vm.GetSchueler())
{
gNoten.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1, GridUnitType.Auto) });
currentrow++;
AddTextBl... | 0 |
702ea4bf297eb48a8ef3dbdc2953a359 | 218daeefd69c3d3ced3be2b067778b85 | ユーザからトークンを作成し、トークンストレージに積む | async function createToken(user: User | string): Promise<string> {
if (typeof user === "string") {
const _user = await User.findOneById(user);
if (!_user) {
throw new Error("Unknown user.");
}
user = _user;
}
const snowflakeBase64 = encodeBase64(user.id);
cons... | 0 |
db9ff8cd716c1146bb38f79d7224fa17 | 1404e6dd82cf34bc89a2009bd299f916 | Propagate the wavefront through the Lyot coronagraph. | class PeakAchromaticMicrolensing(sncosmo.PropagationEffect):
def propagate(self,phase, wave, flux):
self.update_mu()
mu = np.expand_dims(self.mu(phase), 1)
return flux * mu | 0 |
c5f4c2a2b9536aae73998193a127a123 | ee3644e145bbb2504a5f26ed01dfacfe | main test method that sets up the test environment and launches the tests | namespace Puzzle_Solution
[TestFixture]
public class Solution_TestClass
public void Main( string [] args )
{
this.SetUpSingleThread();
this.Test1();
this.Test2();
this.RunSingleThreadedSolution();
} | 1 |
0df03becab749debbf6e2a1372fd3414 | e41217e05516fa92d17eb5b2e3b773d3 | 打开两个时间面板 | $("#time1").css("display","block");
$("#time2").css("display","block");
if(x=="radio1"){
$("#radio1").css("checked","checked");
showTime(x)
}else{
$("#radio2").css("checked","checked");
showTime(x)
}
} | 1 |
7104e9126e41733cf558c91f9f073c1f | 4838480abc7dbafa3fc0124afad35356 | Remove the line from the autoexecbuffer and update environment | tsearch_readline_end(tsearch_readline_state *stp)
{
if (stp->curline)
{
if (stp->curline != stp->buf.data)
pfree(stp->curline);
stp->curline = NULL;
}
pfree(stp->buf.data);
FreeFile(stp->fp);
error_context_stack = stp->cb.previous;
} | 0 |
da53f114a88403a5124a1c40b4ed3818 | 96d8395510ea0da67d2a9541099d85bd | Loads the skin. | {
Asteroids_Skin_Menu_Load_Selected_Skin();
player_sprite = current_skin.sprite;
if (!player_sprite)
player_sprite = CP_Image_Load(ASTEROIDS_PLAYER_SPRITE_PATH_DEFAULT);
bullet_sprite = CP_Image_Load("./Assets/bullet_long.png");
background_image = CP_Image_Load("./Assets/starfield.png");
enemy_sprites[0] = CP_I... | 1 |
135fa1a473a357eff652c443015efe5a | 58567d3b52d1976cd426c4a377e28206 | 根据id删除销售机会 | @ResponseBody
public ResultInfo delete(String ids) {
saleChanceService.delete(ids);
return success(Constant.OPT_SUCCESS);
} | 1 |
30e8ad12640ec107acf14fa3375f9372 | d9fa14bcc3f176023660c04710599aa1 | 從一個傳記中抽取名子 | def extract_noun_seqs(morph_dics):
dics = list(morph_dics)
seqs = []
seq = []
for i in range(len(dics)):
if dics[i]['pos'] == '名詞':
seq.append(dics[i]['surface'])
else:
if seq:
seqs.append(seq)
seq = []
words = filter(lambda x: len(... | 0 |
2c29f46864cc6d039504f4ab8ba69804 | 267f8ee70123db6464d970a7c8bc9bef | !
Sets the cursor to the shape identified by \a shape.
See \l Qt::CursorShape for the list of cursor shapes.
\sa shape() | CursorShape CView::
SetCursorShape(CursorShape shape)
{
CursorShape rtn = m_cursor_shape;
m_cursor_shape = shape;
m_hCursor = ::LoadCursor(0,
shape == arrow ? IDC_ARROW :
shape == help ? IDC_HELP :
shape == cur_wait ? IDC_WAIT :
IDC_NO);
return rtn;
} | 1 |
dae3c37a9f08e7494f72d21b8699650c | 244d65520a8ba22e72cce8d9c71c1b51 | Test the registry view to get one entry | $existing = array();
$type = array();
$theme = array();
$path = array();
$registry = views_theme($existing, $type, $theme, $path);
$this->assertTrue(isset($registry['views_view__frontpage']));
} | 1 |
f647235f5026970de8236cf00eb8083d | 1aae5388354c4a6de3b4b2f56dc79c53 | periodic adc process. this gets called from the main loop. | ISR(ADC_vect)
{
static int newV,newI1,newI2,lastV,Vtime;
int result,timerNow;
long phaseShiftedV;
timerNow=TCNT1;
result = ADCL<<ADCSHIFT;
result |= ADCH<<(8+ADCSHIFT);
switch(ADMUX & 0x0f)
{
case VOLTSPIN:
ADMUX = _BV(REFS0) | CT1PIN;
ADCSRA |= _BV(ADSC);
lastV=newV;
newV=re... | 0 |
eb5f36e0b613b47f8b74adf2f0d1117a | f6279775dd8708c633851741ced1bab2 | Prevents a user from creating a trip with a start date that has already passed | unless start_time >= Date.today
errors.add(:start_time, "request start date must be in the future")
end
end | 1 |
da8366d00a63359d531cccf83e99556d | 7072e4caf91bbb306e75e0a1ad2779d0 | Save info stat data to local file. | @EnableDiscoveryClient
@SpringBootApplication
public class DataProviderApp implements CommandLineRunner
public void saveStatistic() {
FileOutputStream out = null;
try {
out = new FileOutputStream(_fname, true);
out.write(new String("Port,Replies\n").getBytes());
for (Entry<String, Integer> entry : stats.en... | 1 |
5781b73501481991cf1f2e6cc329c9b0 | 500b6b79a769fcad531c3549b77ef3ed | Populate encrypter so that two consecutive ECB blocks of all As are
created. Then lower size of repeated As until two consecutive blocks are no
longer found. That gives the prefix length.
This could technically fail if the random bits were consecutive... but the
odds of that happening are extremely low. | let testString = 'A'
let encryptedDataLength = encryptionOracle.encryptECB(testString).length
let testLength = encryptedDataLength
while(testLength === encryptedDataLength) {
testString+='A'
testLength = encryptionOracle.encryptECB(testString).length
}
return testLength - encryptedDa... | 1 |
3cfc852ce988a93cac2e56b9740e8e77 | fc7408afbc6ff30627c1c4fd8b9558fb | Set a particular payload byte | {
debug_uart_printf(DBG_GRP_PAYLOAD, 5, "addr: %x reg: %x setting: %x\n", i2c_dev->address, reg, *data);
return i2c_write(i2c_dev, reg, data, 1);
} | 1 |
2f6457aac664643ea94e3e4e5ed02fd1 | 0414912401a3ab9e943bc67d8281e713 | Отображение формы изменения общей информации о конкурсе | return{
view:"window",
position:"center",
head:"Редактирование данных о кандидате",
id: "windowUpdateCandidate",
close: true,
modal: true,
body:{
view:"form",
id:"formUpdateCandidate",
width: 1200,
height: 420,
elements:[
{ view:"text", label:"Фамилия... | 0 |
81ab083899d7e6f4c6be34ec622b9fb3 | 96e626273b8015bbe67bc8b7d34a2878 | Returns a :class:`pyalgotrade.dataseries.DataSeries` with the close or adjusted close prices. | if not isinstance(param[0], pd.core.series.Series):
close = self.resolveSymbol('CLOSE', 0)
src = pd.Series(index=close.index)
src.fillna(param[0])
else:
src = param[0]
class Context:
def __init__(self, bs, ss):
self.curr... | 0 |
421f65bcfb98b147b02502dd9d4c3ba3 | 365b8978058e84d9c43c784f02b02103 | This is a safety mechanism to check whether or not an access point is
actually 'present'. This is intended to assist in cutting out the
access points that are just on the edge of being visible to our sensors. | class HomematicipAccesspointStatus(HomematicipGenericDevice):
def __init__(self, home):
super().__init__(home, home) | 0 |
cee8a2374296232f3867c91dca7a2c97 | 8cc16e2998630032a6f2bf35c49b74bb | regresa un valor en entero de la experiencia que aporta | class PlayerStorage
int loadExperience(){
return preferences.getInt("playerExperience", 0);
} | 1 |
5a2f482903ba39b6e890c98a38f8b9ac | e1086895854e8c76f14e8b6b59c92d82 | Crea i parametri di paginazione per le ricerche sintetiche. | {
if (isset($inputs['pagination']) && is_array($inputs['pagination'])) {
$startKey = Utils::checkNotEmpty($inputs['pagination'], 'start');
$offsetKey = Utils::checkNotEmpty($inputs['pagination'], 'offset');
$pageKey = Utils::checkNotEmpty($inputs['pagination'], 'page');
... | 1 |
21df09b3a40c11dd63b4289a42297e42 | f62331813663e3713f08a4a971b8fa18 | Change la carte pour les stats | String nomJoueur = "";
for(int i = 0; i<serveur.getGestionnairePartie().getPartie().getNombreJoueurs()-1; i++){
switch (i){
case 0:
nomJoueur = this.autreUnName.getText();
break;
case 1:
nomJoueur = this.autreDeuxName.getText();
break;
case 2:
nomJoueur = this.autreTroisName.... | 0 |
5ab97a850ec472539d71f3bf5537fbb8 | 97469cf455e2617cc26586fe188cff9b | 从指定的目录下历遍24小时的access.log文件进行服务的请求数据分析 | void access_log_date_task(const GRPCReq *request, GRPCResp *response)
{
try
{
vector<string> logfiles;
apiUtil->get_access_log_files(logfiles);
sort(logfiles.begin(), logfiles.end(), [](const string& a, const string& b) {
return a > b;
});
std::stringstream str_stream;
str_stream << "[";
size_t count... | 0 |
bdec2cb124e8e29258f47df23d6e782c | ec408137b3491bfb424acd1b71abe280 | Ensure the parameter of the contract matches with provided the reference object | namespace Jawilliam.CDF.CSharp.Awareness
public partial class CrefParameterServiceProvider : ISignatureEqualityCriterion<SyntaxNodeOrToken?, CrefParameterSyntax, CrefParameterSyntax>
partial void SignatureEqualityMatchAfter(CrefParameterSyntax original, CrefParameterSyntax modified, MatchingContext<SyntaxNodeOrToke... | 1 |
630c24f7d4e41e7eb302fbf0824c6529 | a4dc4e1412c0bcb7bee8969882a4a568 | По итогу выполнения функции енот станет голодным. | if self.satiety == 0:
self.get_dead_from_starvation()
if self.thirst == self.thirst_max:
self.get_dead_from_thirst()
if self.temperature == self.temperature_min:
self.get_dead_from_frost() | 0 |
1e8ea3de259c8aff90566dd72225e0df | 87c4b957cddae9b6c4c6d791feda6e93 | 获取当前登录用户的审批流信息 | namespace Hzdtf.Workflow.Controller
[Inject]
[ApiController]
[Route("api/[controller]")]
[Authorize]
public partial class MyApplyFlowController : PagingControllerBase<int, WorkflowInfo, IWorkflowService, DateRangePageInfo, ApplyFlowFilterInfo>
[HttpGet("GetFlowDetail/{workflowId}")]
public v... | 1 |
e01edb96345f5ad4e0721551ca21568b | 84c2612d400f783e2f9076977a172824 | Create the function dictionaries used to calculate time, radius, and velocity. Note this function only needs
to be called once. | if not self._force_use_masks:
self._active_mask = None
self._fluid_mask = None
else:
self._active_mask = self._create_mask()
self._fluid_mask = self._create_mask()
self._velocity_mask = self._boundary.create_velocity_mask(self._fluid_mask, self._di... | 0 |
307c2ab885352f9e89c2d2718d48c8c0 | fadda15cad02d15eea9930236da59f63 | GET: Bairros | {
if (((UsuarioMembership)Membership.GetUser()).TipoUsuario == TipoUsuario.ControlMapa)
{
return RedirectToAction("Index", "Home");
}
return View(await db.Municipios.ToListAsync());
} | 0 |
f5b2352cf1eec87b8a86aa3d8f47ef1a | 5b78a7499a6a432512b17f73744f6c93 | sets the percent chance to block an attack | function setCritRate(critRate)
CRITRATE = critRate
end | 0 |
b6214c2543eb47ffbaa895facdd7f683 | b3f0026e4f3e932a664aa1d24cac126b | Soustrait un nombre d'heures à la date | function remove_days_in_date(\DateTime $date, int $n_day) {
date_sub($date,date_interval_create_from_date_string("$n_day days"));
date_format($date,"Y-m-d h:i:s");
return date_format($date,"Y-m-d h:i:s");
} | 0 |
f7f05f29ddd0e612b22a04e0adf50774 | c98b4eaf820336d6c9974626f9897f44 | 获取oauth2 access_token,并设置实例变量 | payload = {self.PARAM_CORPID: self.__CORP_ID, self.PARAM_CORPSECRET: self.__CORP_SECRET}
response = requests.get(self._getfinalAPI(self.API_GETTOKEN), params=payload)
self.__AccessToken = response.json()[self.PARAM_ACCESS_TOKEN]
return | 1 |
2cafa2b1b9aa2e1dd34fa4a216cecf85 | dfa1a69f194109c6022b9f4ec7c0b060 | Call the functions that compose our KPI results. Note that we could be more
selective in calling these. So far performance has seemed OK so that has not been
a priority | d_kpis = [
["d_kpi__pass_accuracy_%", "a/b", "accurate_pass", "total_pass"]
,["d_kpi__open_play_pass_success_%", "a/b", "successful_open_play_pass", "open_play_pass"]
,["d_kpi__blocked_pass_%", "a/b", "blocked_pass", "total_pass"]
,["d_kpi__forward_pass_%", "a/b", "fwd_pass", "total_pass"]
,["d_kpi__backward_pass... | 0 |
711026e184bf88a6235a63c8b9737f67 | bfaf43a0dbf4421ddc1f810f9325b4a4 | 根据流程实例ID,流程定义ID,节点ID,获取审批意见信息。 | @Service
@OALogger
public class WorkflowService implements IWorkflowService,IWorkService
@SuppressWarnings("deprecation")
public java.util.List<com.strongit.workflow.bo.TwfInfoApproveinfo> getApproveInfosByPIId(
java.lang.String processInstanceId) {
return workflowDelegation.getApproveInfosByPIId(processInstanc... | 0 |
f5b72a43d4c622ab243b4f0bbd0efe02 | 7db6abbc9251d19e087deb00c4c255d8 | Пытается определить MIME тип указанного файла | if os.path.isfile(file_path):
return mimetypes.guess_type(file_path)[0]
else:
print('Error (get_mime_type):', file_path)
return None | 1 |
fcbaea807b7ee998e2f95e1a4fcc8753 | ed4bfdb5ff0304c8516697cbc883e0c7 | Tries to extract the value of an attribute from a list of attributes. | def extract_repeated_attr(param, field):
tmpval = getattr(param, field, None)
if tmpval is not None:
if isinstance(tmpval, (float, int, bool)):
y = tmpval
elif len(tmpval) > 0:
y = tmpval[0]
else:
y = None
return y
else:
return None | 0 |
4d5c101e506e394be01e69e9055f78af | 9ac66f6376c04ee4b7441077c7c2f440 | This function creates the statements to create integer or float variables in
a function instructions list. | args = []
for arg in stmt.args:
args.append(au.create_var_name(self._variable_names, arg, True))
return args | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.