query_id
string
corpus_id
string
query
string
code
string
label
int64
7b3fa9019ad344bf09784e489ac60ae6
0c00359b4add5a805ceb5875b979840f
Helper function to visualize the state of the 8 tile puzzle
void print_puzzle(uint8_t *state, uint8_t puzzleNSize) { uint8_t matrixSize = log2(puzzleNSize); uint8_t i = 0, j = 0, k = 0; printf("┌"); for (i = 0; i < matrixSize -1; i++) { for (j = 0; j < matrixSize; j++) printf("─"); printf("┬"); } fo...
1
cdcf5c249791356db595fd679edf86a3
d2db2ca2e5d4301332662b1f0213ab7f
Nastaví kolik vteřin musí uběhnout od načtení stránky, než uživatle může poprvé odeslat formulář.
class PagesAjax public function setPrepage ( $prepage ) { $this->perpage = ( int ) $prepage; }
0
1429ddb66bd30cbb8a6343d230bafed8
06e6fd1b2b8a4e0edcd22b64d35cc240
把异常的请求信息以及错误堆栈存入数据库
function reportException (type, message, errorurl, requrl, stack){ var bookie = {}; bookie.occurTime = new Date(); bookie.type = type; bookie.userPlatformInfo = getPlatformInfo(); bookie.message = message; bookie.errorurl = errorurl; bookie.requrl = requrl; bookie.stack = stack; cons...
0
75876618e09c34a2678b650fa8c3e599
1c2aaf9a0b4eb945aaa192edbbc615ef
Проверка наоичия сохраненной игры
with open('save/save1.json', 'r') as save_file: if len(save_file.read()) > 2: return True return False
1
18ee2cce09dac5b9e49e4e8d0f417bfb
19a6c9541163958dc32fc4547aed6721
Gets all punishments for a guild.
const { data } = await this.manager.request('/punishmentstats'); return { watchdog_lastMinute: data.watchdog_lastMinute, staff_rollingDaily: data.staff_rollingDaily, watchdog_total: data.watchdog_total, watchdog_rollingDaily: data.watchdog_rollingDaily, staff_total: data.staff_total }; }
0
9e630e661db1e5604e9f729b1213b02e
333872341db94d0222d7951ef8fb531d
用DataSet绑定GridView控件(常用)
namespace LibraryDemo_1.PC_pages public partial class BookIn : System.Web.UI.Page public void GridviewBind(DataTable dt) { this.GridView1.DataSource = dt; this.GridView1.DataBind(); }
0
df43265ad4bf1c4334bd01e40ec888fe
765c94008d850c4f2cbc67dc4da23557
Advances to the next plot and calls `func_name(*args, **kwargs)`.
class DynamicSubplot: def call(self, func_name, *args, **kwargs): self.next_subplot() func = getattr(self.plots[self.__curr_plot], func_name) func(*args, **kwargs)
1
8c6a64fb812550a0367c27f391ba079a
40e983d3d78a74fabb31023b17e056f5
r""" Saves the array of particle energies from the nMC simulations at proton energy, Ep, to a .npy file titled [Ep].npy located in the save_directory.
def save_eps(eps): save_file = open('save_eps.txt', 'w') save_file.write(str(eps)) save_file.close()
0
4f9f6297058dd12140a4428283849ef2
a42d6269255a0b2fbcdf547eb4a70b75
r"""The Application Protocol Port of the Profile.<br/>Minimum value = 1<br/>Maximum value = 65535.
try : return self._portprotoenabled except Exception as e: raise e
0
8845625d5b78286501d8f0239af29567
246f5ad755c36708ab4bebfdb134a3db
Called when a SetRelayOutputEvent is received.
public abstract class InstantaneousWaterHeater extends DeviceObject public static class Receiver extends DeviceObject.Receiver protected void onSetSetValueOfOnTimerRelativeTime(EchoObject eoj, short tid, byte esv, EchoProperty property, boolean success) {}
0
ea6c0435e69235bac044dbbbcaf495a4
75714e0381a68c9165a1f5f0eb7bd59e
Adds a value to the heap. Completes in O(log n) time. :@param val: The value to push onto the heap.
class MinHeap: def push(self, value) -> None: self.heap.append(value) last_val_index = len(self.heap) - 1 self._sift_up(last_val_index) return None
1
1251c4399dac4efef86a43136612b2fc
a4272cc04fe28fe7d03b59b3c62e6d33
returns the dates a user / group did change something in the system
try { return getCurrentEntry().getChangeDate(); } catch (Exception e) { prtlnErr("getChangeDate failed: " + e.getMessage()); return ""; } }
1
f9d0f53afac24168880dd55e400be5de
c45d1665764a7a1946346f7787b32a0a
Возвращает множество координат элементов тела змейки
class Snake getSnakePartsCoordinates() { let result = []; for(let part of this._body) { result.push({x: part.mapX, y: part.mapY}); } return result; }
1
414d053b3d215f21f301e9174d92cf5f
8c3ead66798d038797ae1481e7b1e152
Cette méthode s'occupe de bouger les photos vers la droite
public class PictureGaleryFragmentClass extends Fragment private void mooveOnRight(){ if(canMoove){ canMoove = false; numPhoto--; if(numPhoto == -1){ numPhoto = maListe.size()-1; } if (!alreadyDone && numPhoto == 0) { pi...
1
0768f11e96b599d7560c829012890a36
3521a7ad176c20d08854eda379b6a252
Сортировка по имени и возрасту
List<User> userList = new ArrayList<>(); for (int i=0; i<users.length; i++) { String[] tmpUser = users[i].split(" "); userList.add(new User(tmpUser[1], Integer.parseInt(tmpUser[0]), i)); } Comparator<User> comparator = (o1, o2) -> { if (o1.age == o2.ag...
0
529449395a0fb8e7253328d56c9c169e
e9b4868eaf5135cf431440bc31c99f24
Resets number of tricks each team has won
{ int i; pl_reset(); for (i = 0; i <= MAXTEAM; i++) { teams[i].te_turns = 0; teams[i].te_surrender = 0; } }
0
95525e9d7831fae7eeac3511e74e5190
c2e5d2afcc2ef6de7efd94a6b33ce1d4
Find all folders with template objects
namespace TweakApi.Api public partial class PortalTemplateFolderApi : IPortalTemplateFolderApi public List<PortalTemplateFolder> PortalTemplateFoldersGet (string filter = null) { ApiResponse<List<PortalTemplateFolder>> localVarResponse = PortalTemplateFoldersGetWithHttpInfo(filter); ...
1
e8a4bdf7fbc0ed0704d5e7bd2c6b4cf7
2416c9781d1630fbbbb1f32c30131529
\brief gives legal kills for pawn
{ Color Cur = pos->to_move; Color opp = ~Cur; bitboard_t myPieces = pos->color[Cur]; bitboard_t allPieces = pos->color[White] | pos->color[Black]; int ksq = position_king_square(pos, Cur); bitboard_t pinners = (position_rook_pieces(pos, opp) & B_RookAttacks[ksq]) | (position_bishop_pieces(pos, opp) ...
0
978b031c0a21dbc6210a19a0518c31db
7e9b3f78442fc6cb76be70e6fdd93ca2
Sort vehicle groups by the number of vehicles in the group
static bool VehicleGroupAverageProfitThisYearSorter(const GUIVehicleGroup &a, const GUIVehicleGroup &b) { return a.GetDisplayProfitThisYear() * static_cast<uint>(b.NumVehicles()) < b.GetDisplayProfitThisYear() * static_cast<uint>(a.NumVehicles()); }
0
3671a352f7043c76f297da2028646731
959452deb76582d0e498f4767568ccea
Vacia el combo indicado por ID.
var params = { accion: "select_agenda_combo" }; $.ajax({ type: "POST", url: "/sistema/ManageAgenda", data: params, dataType: "html", success: function (dataRes) { $("#" + _id_caja).empty(); $("#" + _id_caja).append('<option value="0">SE...
1
302cf8065ebc6f444c57befe762ba3b5
bbbe4426512f2d4e46c207a5d15f036d
Driver for the bonus assignment.
def bonus4(): player1 = Player() player1.gamble()
1
528ea49fd20c72e4fc714f92e4393731
e6baf2a9d9190e80ab6a9e9b39e96ce8
If key field supplied: returns [key=>value,key=>value,..] If key field not supplied: returns [value,value,..]
{ $out = array(); $result = $this->query($query, $parameters); $i = 0; while ($data = $result->fetch(PDO::FETCH_ASSOC)) { $out[$keyfield ? $data[$keyfield] : $i++] = $data; } return $out; }
1
7e6e9d64f78558459967b52b45f3dcce
3c49f1e475596d334003cc263d0d773f
returns the exception without printing it, useful for expected exceptions, signaling that an exception occurred
{ var temp = _lastException; _lastException = null; return temp; }
1
7abde0b6262c6e9e51c10b0cbade95c4
3ef467ca0fd145636b642ee883bec082
randomly generates grid with planes
class ComputerController: def placePlanesRandomly(self): numberOfPlacesPlanes = 0 columns = "ABCDEFGH" rows = "12345689" directions = ["up", "down", "left", "right"] while numberOfPlacesPlanes < 2: cabinLocation = random.choice(columns) + random.choice(rows) ...
1
8eef0f9fd7fc376b399deb875009dad6
a535817285850ab27af2fa38f912ea16
Calculates the cross-entropy loss between true labels and predicted labels for a time series which each time step has a binary label.
treatment_predictions = tf.reshape(treatment_predictions, [-1, self.max_sequence_length, self.num_treatments]) cross_entropy_loss = tf.reduce_sum( ( -( target_treatments * tf.log(treatment_predictions + 1e-8) + (1 - target_treatments) *...
1
d45a550973f0426ef0af34ea8dbaec4e
5489de973b5f57e45d6ba3afd01160e4
Send the frame done event.
class Client: def sendDone(self): self.s.send("DONE".encode("UTF-8"))
1
4bfc5c88236af15faaf7f700716d582a
55ee936aed381ba12fac2e38090a5b9b
查询固定表名的所有数据
class ConnectMysql(object): def find_all(self, tbname, show='*'): find_str = 'select {} from {};'.format(show, tbname) self.cur.execute(find_str) return self.cur.fetchall()
1
76f7679186aa785b1f25eba5959a1e79
ac164be60a3fcfe6507f2a50386ecc57
computes mean word length ina given text
def average_word_length(sentence): sum_length = 0 nr_words = 0 for word in sentence.split(): sum_length += len(word) nr_words += 1 return sum_length/nr_words
1
2f02c0a67f69500cb62eb78e495ce4e6
1c74127e08308f90e62803c81df83b1a
Set the 24Hr Graphs weather data.
export class WeeklyForecastComponent implements OnInit updateChart() { if(this.hourweather) { let degreeChart: any = []; let hourChart: any = []; this.hourweather.forEach(element => { hourChart.push(element.time+":00"); degreeChart.push(parseInt(element.degrees)); }); t...
1
a79a798d6152e30395cb8a560e75cde9
53f7258dd625f54c8e44d4615e93cd7b
Dopasowanie obrazu do okna z zachowaniem proporcji
{ try { Bitmap bmp; bmp = new Bitmap(pb.Width, pb.Height); float PictureBoxSizeRatio = (float)pb.Width / pb.Height; float ImageSizeRatio = (float)img.Width / img.Height; if (ImageSizeRatio > PictureBoxSizeRat...
1
a01bddaa4045b93271ae4ee8ec00e5ce
d4e4fc3a95360c79b65e1330f1b7b5ae
ListContainers returns the lists of containers for given cluster.
defer func() { if err := recover(); err != nil { fmt.Println(err) } }() cli, err := client.NewClientWithOpts(client.WithVersion("1.39")) if err != nil { panic(err) } images, err := cli.ImageList(context.Background(), types.ImageListOptions{}) if err != nil { panic(err) } return images, err }
0
398afe30ad77fab4690a862f31351267
5b5e37fb5d6e9b22bbe852eb87b3b13b
return arguments as a null-terminated array of pointers
char** args = new char* [cmd_.size() + 1]; for (size_t i = 0; i < cmd_.size(); ++i) args[i] = const_cast<char*>(cmd_[i].c_str()); args[cmd_.size()] = nullptr; return args; }
1
0238e6c396da5f0294be310614644199
d9d8af4558c1aac482a14728af2375fd
returns the postal code of a user, based on the session
{ long token = Convert.ToInt64(Request.Cookies["SessionToken"]); if (GetSessionData(token, out Tuple<int, string> data)) { string user_postal = data.Item2; return user_postal; } return "-1"; }
1
a178956a49acf06ad657809e20c4b7bc
ac559ef44eedb10da88f7141c0e50060
Once our scene has loaded correctly, spawn the player, assign it to the camera, and begin the first level.
namespace MonoGear.Entities public class Player : WorldEntityAnimated public override void OnLevelLoaded() { base.OnLevelLoaded(); var ents = MonoGearGame.FindEntitiesWithTag("PlayerSpawnPoint"); if (ents.Count > 0) { Position = new Vector2(ent...
0
729e0322b6e06bec2bc86a0421e545e1
0a14227e3b2bcd1c5bbdfa7521d7957d
Retrieve client row using client name
ClientBean findByName(String clientName);
1
6dd2cad24eb0d40396436a08d95592c0
cee1b5cc612e4ba057a1bfaf86e7ded1
配列のn列目とm列目の入れ替え
int swap_rows(matrix *mat, int n, int m){ int i; double s; for(i=0; i<mat->col; i++){ s = mat->element[n][i]; mat->element[n][i] = mat->element[m][i]; mat->element[m][i] = s; } return 0; }
0
171e9f544f35f1ccee26adbb23c9bc2d
03a3241d1939b06b5abc5f781e954214
显示住院视图列表中具体长期药物医嘱信息
{ tsyyList.Clear(); DataTable dt = _YongyaoListDal.GetYongyaoListOrderbyStartTime(_MzjldId, 6); int i = 0; if (dt.Rows.Count != 0) { foreach (DataRow dr in dt.Rows) { adims_MODEL.Yongyao yt1 = new adi...
1
4783e736f440dc532c62243a4529b4ef
b59ff768274a64cbde51b4ce077916fd
Gets the enabled state for a set of DNSSEC key.
string domainIdentifier) { var request = Client.Http.RequestBuilder( DnssecPath(accountId, domainIdentifier)); request.Method(Method.POST); return new SimpleDnsimpleResponse<DnssecStatus>(Client.Http.Execute(request.Request)); ...
0
c23c0403d80f8be7068be869af4675a7
0af022d014e2e4e34a6a7803117a11da
ako je vec ulogovan, redirektuj ga
class UserController extends ControllerBase public function loginRedirect() { if(isset($_SESSION['auth'])) { header('Location: /'); exit(); } }
1
a98748e5dfe76aed7e77b80826814fed
ae727da6efb4be0f2a2096ba621ed13d
返回函数的声明体,未包含定义部分
{ $name = $func->getName(); $args = []; if($func->getNumberOfParameters() > 0){ foreach ($func->getParameters() as $k => $v) { $args[] = $v->getName(); } } $sign = "function {$name}("; $sign .= implode(", ",array_map(function($arg){ return "$".$arg; },$ar...
1
23a422da31ac122510a97c35d8f9d3f8
21d4e6353a48def9ecee9d0fcf693d34
通过ID获取UsersContact
namespace BLL.RBAC.RBAC_用户 public class Rbac_userBLLImp:Rbac_userBLL public Rbac_user getContactObjectById(string id) { return rbac_userDal.findContactObjectsById(id); }
1
b804b607e96ab54bfff46df5ae32c04a
c3ffcff8826eef6734c7893616398994
Counts the days of week
data_file = parse(MY_FILE,",") counter = Counter(item["DayOfWeek"] for item in data_file) data_list = [ counter["Monday"], counter["Tuesday"], counter["Wednesday"], counter["Thursday"], counter["Friday"], counter["Saturday"], counter["Sunday"] ] ...
1
c16b66dae7403075fa3b7108a47e2e26
d15645231e67298f725567ae59c0500e
Récupération des actions sur une fiche grain de sable rattaché à la fiche evenements nouveaux
namespace EspaceClient.BackOffice.Silverlight.Data.Depots [MapResource(typeof(IDepotActionSpecifique), InstanceLifetime.Singleton)] public class DepotActionSpecifique : IDepotActionSpecifique public void GetActionsSpecifiques(Action<IEnumerable<ActionSpecifiqueDto>> callback, Action<Exception> error) { ...
0
78257c6985fe268e11bc2c14c6ffb905
a776d6dda7e821a25543cc2db07a7b3f
設定想法列表
[types.GET_IDEA_LIST](state,data){ state.users.blogList = data }
1
384c18e4529a930ba1a86c13041e92a5
d9a2ca4c1bc3a4bc2c2a328f175cd3ce
查询排行榜的总条数据
int selectListCountByRank(HashMap<Object, Object> mapForCount);
1
bdee63e9c7313df147e6371db6784bee
56466b9780f29dfc49c46a4ec868a15a
#' methods for exploring the coverage of confidence intervals for the median calculated in varying ways from the data. Borrows many methods from methods-CI-mean.R
tbl <- prop.table(table(bin(x, breaks, breaklast=NULL), useNA='ifany')) * 100 n <- length(x) p <- tbl/100 se <- sqrt(p*(1-p)/n) z <- qnorm(.975) upper.limit <- p + z*se lower.limit <- p - z*se tbl2 <- c(tbl, lower.limit*100, upper.limit*100) tbl.names <- names(tbl2) un.ordered.names <- tbl.names ord <- matc...
0
03609c3dc17de95d9f035f5932722046
bb8a746a118d6e5202217800e3d0cf77
查询选中省内所有的市,优先从数据库查询,如果没有查询到再去服务器查询
public class ChooseAreaActivity extends Activity private void queryCities() { cityList = zxmWeatherDB.loadCities(selectedProvince.getId()); if(cityList.size()>0) { dataList.clear(); for(City city:cityList) { dataList.add(city.getCityName()); } adapter.notifyDataSetChanged(); listView.setSelection...
1
f13e5de0b9dff46d98169a0caa38c65e
ee4e14b6b87543a0ac32978e1f341f46
Creates a new flight, adds aircraft and attaches to the package.
@Service @Transactional public class FlightServiceImpl implements FlightService @Override @Transactional public FlightEntity addFlight(AirportEntity airportFrom, AirportEntity airportTo, Date Start, Date time, AirplaneEntity airplane) { try { FlightEntity flight = new FlightEntity(); ...
1
f98bfb73cbca4bb64e23a02cd105cc7c
8fb19fae0488d1082dfe184ce950c9cb
VAE with convolutional layers.
class ConvVAEEncoder(nn.Module): def __init__(self, latent_dim, device, down_conv_layer=nn.Conv2d): super(ConvVAEEncoder, self).__init__() self.latent_dim = latent_dim self.device = device self.conv_1 = down_conv_layer(in_channels=3, out_channels=16,...
1
46de65c7b4316b9d489c444d1eea28c2
c23b0b0deb90218f7532ff4f0dd1d921
Double version of {@link #glVertexAttrib2f VertexAttrib2f}.
namespace OpenTK.Graphics.OpenGL public sealed partial class GL : BindingsBase public static void VertexAttrib2(Int32 index, Vector2d v) { GL.VertexAttrib2(index, v.X, v.Y); }
1
e34fe5f54639dc81934a88cab4f469a9
32cb07993f3c69017d8efc01f081c2a7
Get a new Memcache instance.
class MemcachedConnector protected function getMemcached() { return new Memcached; }
1
ad50b12f74653165492d55ac4efc471d
e606ff1528397208c32d976075112c4c
There is nothing meaningful to assert in this test, because crashOnSelf uses crashOnString, which is an oracle function that does nothing in our implementation.
abstract class TestCaseBase extends TestCase public static function assertDidNotCrash(): void { self::assertTrue(true); }
1
fec33d582b62c651377b5e5343d8238f
1278957e3e6700351b9028cc2518d6aa
Alternativa para Enum
namespace Skill2_1_CreateTypes class Program private static void CreatingAnEnumExample() { AlienState x = AlienState.Attacking; Console.WriteLine(x); }
0
159c3e74285c8a09d2696d1768be0bc7
d886c2d63ebf53c2a448b492a1c7f43a
Sumador de listas
acumulador = 0 for n in lista: acumulador += n return acumulador
1
0ac541a99c09aaff3ddcd59ca8d0d267
ad3f9ec452761aa20e7bc863505074d6
should be a list of strings
class NotificationFormatter(object): def __init__(self, names): self.names = names
1
4097963f5555defc34cd7246c4cfe2dc
651168192bb84e46d6292266e9bbf2b0
Sets whether the document should compress images in generated file formats like PDF.
public class MagickImage extends Magick public native void setCompression(int value) throws MagickException;
1
4365299d0715a5e0ea78c110b70f7358
c60cdbb3fbf11ef4c265ad74050ff226
Tests the decorator syntax for creating transforms
def test_transform_decos(): c1 = TestCoo1(1, 2, unit=(u.degree, u.degree)) @t.transform_function(TestCoo1, TestCoo2) def trans(coo1): return TestCoo2(coo1.ra.radian, coo1.dec.radian * 2, unit=(u.radian, u.radian)) c1._make_cart() c2 = c1.transform_to(TestCoo2) npt.assert_allclose(c2.ra.d...
1
271b43f05906c2bfafefc366102a26b6
9a0633b30bb4b4ddf1aa308a1dcec1cb
标准md5加密
public class SecurityUtil public static String md5Encrpt(String value){ StringBuilder sd = new StringBuilder(); try { MessageDigest md5 = MessageDigest.getInstance("MD5"); md5.update(value.getBytes()); byte[] target = md5.digest(); for (int i = 0; i < targ...
0
a3c386dc6cf4ba62bae67679c887279c
a6bf68f09d565b2f2859f43d98c07268
Takes a number of days and returns the timestamp for now + number of days
a_utc = arrow.get(timestamp) a_loc = a_utc.to('local') a_loc = a_loc.floor('day') a_loc = a_loc.shift(days=days) return a_loc.timestamp
0
873f159d3f9d05a1eafb750f931a46d5
36b0f41161a8927bdacd34551be09498
Overloaded stream insertion operator for printing diet plan to the screen Takes a reference to an ostream object for the left hand side and a reference to the diet plan object as the right Returns the modified left hand side
std::ostream &operator<<(std::ostream &_os, const Schedule &_obj) { return _os << _obj.getDepartureAirport() << ";" << _obj.getArrivalAirport() << ";" << _obj.getAircraft() << ";" << _obj.getDeparture() << ";" << _obj.getArrival() << ";" << ...
0
6b28b0a4479413bcbf0fe91fcd39d2de
ecedfb240f69953c417cc3005a42aefe
Print application config path.
void cmdline_print_cfg(void) { }
0
b0fd3c5cc9b2d59ad3d032d9d5a2f3e1
029d9786caa256c6b8562926403e8245
Set parameters. For competitive pyrolysis, reactions parameters are read from input file. Uncertain parameters and their values are specified.
bi.write_tmp_input_file(input_file_name, param_names, param_values) self.tau = self.param[0] self.T = self.x self.T_0 = self._x[0] self.time = (self.T - self.T_0)/(self.tau/60) self.T_end = self.x[-1] self.n_T_steps = len(self.x) self.pyro_model = Pyrolys...
1
2a4828863f507132b4e619bb16f46e4e
2731279bd131440037bf2faa2d5b70fb
Maps two lists of generic types index's together using matrix distance calculations
BlockingMap map2, int[] goodPairs) { Object[][] instanceBlocks1 = map1.getInstanceBlocks(); Object[][] instanceBlocks2 = map2.getInstanceBlocks(); int numInstances = instanceBlocks1.length; HashMap<String, int[]> combinedBlo...
0
8ffdcfafbac0bae58a79cc5d88a524f9
ca64324892626b0bcee36e9862d05293
Test case for backward-delete-char
throws OperationException { testKeyDown(startContent, expectedContent, "<backspace>", FakeEditorEvent.create( KeySignalType.DELETE, KeyCodes.KEY_BACKSPACE)); }
1
629f04719029929da97fdcc7dfe1bc1e
a4c4012837d72be0c049c84aee092215
中序遍历整个二叉树 , 然后将遍历结果保存到一个数组 nuns 里面
func getNums(nums *[]int, r *TreeNode) []int { if r.Right != nil { getNums(nums, r.Right) } if r != nil { *nums = append(*nums, r.Val) } if r.Left != nil { getNums(nums, r.Left) } return *nums }
0
70468e053329844730fa862c828bcb4a
99421207bd89ecf0c068452d1f18fbc5
Waehlt die naechste Umgebung aus
function nextEnemy() Alerts:add("Changed enemy.") SelectedEnemyNumber = SelectedEnemyNumber + 1 if SelectedEnemyNumber > #EnemyOptions[Player] then SelectedEnemyNumber = 1 end SelectedEnemy = EnemyOptions[Player][SelectedEnemyNumber] generator() end
0
7735932e5750c2164ac81f075518f88f
8e84978ec1c056297f6b2cc8d6da4fd3
Тестирование выхода из несуществующего аккаунта.
{ $client = static::createClient(); $client->request('DELETE', '/bank/delete', ['account_id' => 2]); $json = $client->getResponse()->getContent(); $output = json_decode($json, true); $this->assertEquals('failure', $output['result']); }
0
1c730adc3b469b6dba67943453ff54e6
be7776e4dfb5278d4021428cd3c76af9
Given an integer ID (EG generated using _ActivationFunction.get_id_from_func), return an instance of the activation function which has the same unique integer ID. This function is used when loading models (after the activation functions are saved using their integer IDs), to restore the correct activation function for ...
def getFunctionClass(functionID): d = { 1: Linear, 2: LinearDrag, 11: Gaussian, 12: GaussianDrag, 21: Lorentzian, 22: LorentzianDrag } return d[functionID]
1
e1277075620097e9cbcd3d38612c6412
29651e0c76be848ef52697d12cd177f1
проверка введеныъ данных в форме на существование в бд
class ModelIndex extends Model public function checkDataFromUserForm($spost, $file) { if(file_exists(Q_PATH.'/application/lib/ssCheckDataFromUserForm.php')){ include_once Q_PATH.'/application/lib/ssCheckDataFromUserForm.php'; } $this->var_model_index = new SSСheckDataFromUserForm(); ...
1
157e46e9f8fba7d79f3a334826491ad1
a3358b33c8de7358795a52e1653b96a3
Renders the road layer of the map
{ double scaley = view.getHeight() / (double) this.getHeight(); double scalex = view.getWidth() / (double) this.getWidth(); if (scaley > scalex) { scale = view.getHeight() / (double) this.getHeight(); } else { scale = view.getWidth() / (double)...
1
c7b8750ec68cef95f34dff2d3f97d099
4e2863a85392d6a0febe59188ea916fa
中断脚本执行,返回PHP E_ERROR错误
class PhpError public static function runtimeShutdown() { $e = error_get_last(); if (!empty($e)) { PhpError::errorHandler($e['type'], $e['message'], $e['file'], $e['line']); } }
0
b631da209c3141bc95c24fedbddf0745
8a56c588feb4e91762397aeca1f0848b
人間が理解しやすい形式で時刻を表示する。 ctimeを使って文字列を組み立ててから、その一部を抜き出す。
void showtime(long timeval) { char *cp; cp = ctime(&timeval); printf("%12.12s", cp+4); }
1
7f830635b2c757e451bb25323ade9d87
5c852b4ecaa572cba26a13c4d29f8cff
Updates a <b>CommRule</b> object to the database.
namespace B4F.TotalGiro.Fees.CommRules public static class CommRuleMapper public static void InsertOrUpdate(IDalSession session, ICommRule obj) { session.InsertOrUpdate(obj); }
1
563cde18d45bf068e86edfa00d2ef630
b65864f651166a10b45e58868d0e64d7
@brief true if position of particle is inside the backward lightcone of the observer, otherwise false. And Since
{ if( p[2] > -.1 || abs(p[0])*xfoc > -p[2] || abs(p[1])*yfoc > -p[2] ) return false; return true; }
1
6172ff8f19cf08b39d2b5acec20e8ecb
a602c04aaa1527a191ccedcfd4c2e693
Test empty xml tags/self closed tags are preserved when converting xml to array with attributes
public class JsonConverterTest extends TestCase public void testParseAttributes() { String[] inputs = new String[] { "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n< root \t\n />", "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n< root \t\n a='&ampa\"b' />", "<?xml version=\"1.0\" encoding=\"UTF-8\"?><...
1
97e93c88463b930c6d5e2cd2df1805c2
d5a1f3fd5d2bc1df2793decff2115193
Lists a touch cancelled event.
function onTouchCancel(e: TouchEvent): void { LAppDelegate.getInstance()._captured = false; if (!LAppDelegate.getInstance()._view) { LAppPal.printMessage('view notfound'); return; } const rect = (e.target as Element).getBoundingClientRect(); const posX = e.changedTouches[0].clientX -...
1
e88160a434f0f64b1fde4e4b2117fd8b
3ddc205aed5b0e26d7c64f540fd62f41
Get outside air temperature at specified times
def T(t): if t < 0: return meanT return meanT - amplT*sin(2*pi*t/yr)
1
63498d45251c8fb53fa3c00096827ff5
001bd2d2e617c7297c6aa4ccf50dc5a4
Sets the lambda 0, or central meridian in radial coordinates.
public class PolyconicProjection extends ProjectionImpl @Deprecated public void setOriginLatitude(double lat) { _lat0 = lat; projectionLatitude = Math.toRadians(lat); }
0
41e09aaaa150355ad0c10b6102db01c5
9a3d8b27a389a65b9725a39325dfaf7d
Get the trs suivi dt liv.
class RecapLignesMsa public function getSuiviPar(): ?string { return $this->suiviPar; }
0
8da152a2f34cc49da2a5575959793de1
f44f3cc61872754e6d7bd905f5d07e19
只保留字串中的數字並轉為number
function returnNum(str){ var len = str.length; var comp = "0123456789"; var temp=""; for(i=0;i<len;i++){ if(comp.indexOf(str.substring(i,i+1))>=0){ temp = temp+str.substring(i,i+1); } } return temp; }
0
a383ee744ebea30df667f1a87c5eec17
1092e805a38be269dae7395cb4a81f4e
Thread that is responsible for receiving ACLMessages
self.server = server self.socket = socket self.listener = None self.msg_buffer = collections.deque() self.msg_lock = threading.Lock()
0
e6f14e061a8a8f656d06164a9f038956
b9a7da4b55cc1b61349d28bd8b696a65
检查主板状态
int checkboard(void) { puts(sysinfo.board_string); return 0; }
0
3f1b7167af8fdaaeaa61463fb75746f6
5ce4b62c06199d612ea17febf801c20b
Sorts the Movie IDs based on ascending order and returns the array list
for (int i = 0; i < classic.size(); i++) { for (int j = 0; i < classic.size(); i++) { if ((classic[j].getRelease() + classic[j].getReleaseMonth()) < (classic[i].getRelease() + classic[i].getReleaseMonth())) { Movie temp(classic[j]); classic[j] = cl...
0
da3ae5489cbae7d2671d4d068e3702f4
d57972a3c12027782437386935d81b9f
Tests that the constructor throws an illegal argument exception if a negative number of zeros is specified
try { zoomPanel.setZoomFactor(zero); fail("zoomFactor is 0, IllegalArgumentException is expected."); } catch (IllegalArgumentException e) { } }
0
910e1fb8fcb1e93d88ac6515f38afeb0
38286857c3cfa0c14f7d7d946be4764a
Test case for list_identities List Identities # noqa: E501
class TestBit4idPathgroupIdentitiesApi(unittest.TestCase): def test_get_identity(self): pass
0
8ab7b18240f441e9b10ad3b647160ad3
ac2630ad45e768d74c687e9c7507fc48
Display a line based on start pos and line size
if length < 0 { return } ru := GetThinLine(false, true, false, true) for x := startX; x < startX+length; x++ { borderable.SetRune(x, startY, ru) } }
1
1e1c64319d6a5d820bb251830df981aa
33bce248c61579888867131400a3d2c4
Determines if this cell is in an incorrect state.
public boolean isInvalid();
1
d4e58c84fac995f58045684924ef16ed
d25655d239e5542aec766f965b201aeb
Set categories to be temporarily isolated in the view.
export class DiscoveryService setCategoryFilter(categories: string[]) { this._categoryFilter$.next(categories); }
1
b70c8af2c454593b2542130d4f743a99
f4cd6f5da57e39478267fc66c66f2800
Creates a gRPC server builder for the given port.
public class GrpcServer private void start() throws IOException { server = ServerBuilder.forPort(port).addService(new GreeterImpl()) .build().start(); System.out.println("service start..."); Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { System....
1
7f62b7c4fb978f55066fd57e5381dfb2
0da64a9e8c84ef84218ba2f6c999948a
Exit the dialog, deduce the necessary values from diplomacyManager if starting commission, as well as creating events using a callback function
if(not commission): self.destroy() return for faction_name, amount in self._last_commission_set.items(): utils.Debug.printDebug(faction_name, amount) current_faction_req = self._diplomacyManager._faction_requisition[faction_name] deduce_amount = self._itemPrices[faction_name] * amount after_commis...
1
aeddab76f80d46d58faaf05a7b94ff2a
eb227c33f627d412a54c263ad9ca5bcf
Checks whether a time slot is reserved
if slot.booked_by: return {'value': False, 'error': 'Slot is booked'} return {'value': True, 'error': None}
1
e4d1438b466e475e9422e08ee0b396af
aa9b334125b84f72fa7e4e53cdb474f7
Scales the model coodinates accodring to changes to the layout scale.
if (scale != 1.0f) { left = (int) Math.ceil(left * scale); top = (int) Math.ceil(top * scale); right = (int) Math.floor(right * scale); bottom = (int) Math.floor(bottom * scale); } }
1
88ffba04dea592594d797f541b2b5950
161b3a387ccac2858e919b7a1cfde9bb
Vérification d'un même produit en stock
export class Dialog4gModifBonEntreeLocal verifN_serieProduit(event: any) { const found = this.N_SerieStocke.find((element: any) => element == event.target.value); if (found != undefined) { this.verifStock = true; Swal.fire("Attention! Numéro Série existe déjà dans le stock."); } else { ...
1
6095d53827165b5e380cb90f88129481
9f0b87fb2c316f790277f552c84da884
Alter cron queue information before cron runs. Called by drupal_cron_run() to allow modules to alter cron queue settings before any jobs are processesed. An array of cron schedule information.
class SSLController public static function filter_cron_schedules( $schedules ) { if( isset( $schedules['weekly'] ) ) { return $schedules; } $schedules['weekly'] = array( 'interval' => 604800, 'display' => __( 'Once Weekly', 'th' ) ); return $schedules; }
1
7446898da8cfff4c1cd218067086a10f
bd6ea171dbaa8383eeee46dc6e14fcfe
Gets the audit records operations available to the partner.
{ List<IPartnerScenario> auditRecordScenarios = new ArrayList<IPartnerScenario>(); auditRecordScenarios.add( new GetAuditRecords( context ) ); auditRecordScenarios.add( new SearchAuditRecords( context ) ); return new AggregatePartnerScenario( "Auditing samples", auditRecordScenarios,...
1
33ebfbc0298c038ab09ed586b9508efd
7f61448ad6da3ef0f9cb03f40c5be655
Alternate Constructor:
cases like (1)
0
f7019bf92141f4a87349f22e63187874
2b578b3c11d5a2b811bc019e9f4f6302
QYXX_STOCK_FREEZE股权冻结信息
public @ResponseBody ListRange freezeStockRightList(FreezeStockRight freezeStockRight,Integer currentPage,Integer pageRows){ if(currentPage == null) currentPage =1; if(pageRows == null) pageRows = 15; return freezeStockRightService.freezeStockRightList(freezeStockRight,currentPage,pageRows); }
1
7a66584188a7f857f65db5a5e5aa92ec
54e5fbeda8154f472143cc794f986bea
고개를 특정 각도, 특정 속도로 움직이는 함수
namespace BL767.SimpleHostile public class Player : MonoBehaviourPunCallbacks private void HeadBob(float angle, float p_x_intensity, float p_y_intensity) { targetWeaBobPos = weaPareCurPos + new Vector3(Mathf.Cos(angle) * p_x_intensity, Mathf.Sin(angle * 2) * p_y_intensity, 0); }
1
46a2264924fcf3479dbf373538e2d50b
1ce8d4704c80cf7e0713736ccfdf2e58
Adds a specific L{ExceptionHandler} to the HTTP client @warning: SHOULD ONLY BE CALLED FROM A PROVIDER THROUGH A TEST FIXTURE
open class InternalRouter( private val wsRouter: WsRouter, private val eventManager: EventManager, private val routerConfig: RouterConfig ) open fun <E : Exception> addWsExceptionHandler(exceptionClass: Class<E>, exceptionHandler: WsExceptionHandler<in E>): InternalRouter { @Suppress("UNCHECKED_CAST...
0
cb7a8cdd67afdc25d3492ebff3176253
55569a4164dff9b359b8032d78ed10ab
Processes the airline RDD to obtain answers to the 4 questions in assignment.
cleaned_raw_data = dealWithOutliers(raw_df) cleaned_data_with_distances = addThreeAirports(cleaned_raw_data) cleaned_data_with_distance_and_time = parseDatetime(cleaned_data_with_distances) candidate = cleaned_data_with_distance_and_time.drop(['pickup_datetime'],axis=1) return candidate
0