query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
1035c1687ef6bf39be76bab2db5302ba | 4ea63d6145ae5929012002693f7b0fec | 得到指定索引的值,如果出错,则返回空字符串。 | {
try
{
return array[index];
}
catch (IndexOutOfRangeException)
{
return string.Empty;
}
} | 1 |
4dbcf78e20b2b003dac34edb876cf721 | f65ef18e6f55ff2ce8499dd44d876559 | 寻找当前元素后面的所有兄弟元素 | function siblings(curEle){
return this.prevAll(curEle).concat(this.nextAll(curEle));
} | 0 |
79523c4aaca2dce502c3d123dfe96274 | 1139c90d282b0acee451394ff6d19b06 | Dequeue a received message matching name_or_msg_id. | rkey = self._rkey(connector_name, name)
msgs = self.broker.get_dispatched('vumi', rkey)
return [message_class.from_json(msg.body) for msg in msgs] | 0 |
f26581a29babd40ca195f6748809e9fa | 1505106645cf41ef0929db9536ac6a74 | @brief 擦除SPI-Flash整个芯片的数据 | {
this->rewind();
this->write_storage_data();
PAGE_TO_BUFFER(flash, 1);
BUFFER_WRITE(flash,0);
spi.write(0);
BUFFER_TO_PAGE(flash, 1);
} | 0 |
fc485e09f681e3c76f7cc9a8a1d37da1 | 6259af8f87e76fb06134a1d0481fbfad | Add a Station to a hash map | arriveStation = {'name': '', 'trips':0}
arriveStation['name'] = station
return arriveStation | 0 |
de689c7cb4c975f100b3969c04d50d1b | f2bb4d7241123d489486fc14783abc65 | Ensure the custom print options are visible.
<p>This is the equivalent of clicking the "more options" button to open the print service's
custom print options. openPrintOptions() must have been called first to expose the basic
print options. | IList<string> displayedOptions,
Windows.Graphics.Printing.PrintTaskOptions printTaskOptions)
{
{
displayedOptions.Clear();
displayedOptions.Add(Windows.Graphics.Printing.StandardPrintTaskOptions.Copies);
if (_printJobConfigurati... | 1 |
2c2cd63367035025c0b6954ad34d83d0 | 060a8f520759a466398d26d9af1b44d0 | determine the proper element that exists on the page and inject the corresponding data for it | function elementRender(element) {
element
ratingElement.innerHTML = ''
clientPhoto.setAttribute('src', all[counter]["user-photo"])
clientUser.innerHTML = all[counter]["user-name"]
ratingPopulator()
reviewElement.innerHTML = all[counter]["text-review"]
} | 1 |
a90b353e7368672c6a3c8373921e1cca | 071e2d0099017fcb11c328f156169cb1 | Tests the `Client::upload()` method. | class TestApiV1(TestCase):
def test_upload(self):
file = open('test.txt', 'w')
response = self.client.put(
'/api/v1/upload/',
{'file': file},
HTTP_CONTENT_DISPOSITION='form-data; name="file"; filename="test.txt"'
)
expected = {'detail': 'Authentication... | 1 |
2c462ed3392dc4a50d1dbcb993d065a8 | 9e97997c1d06cf5dc860b8107c091098 | Move the camera to the first marker. | public class MapMarkerFragment extends Fragment implements OnMapReadyCallback
public void focusLocation() {
if (getActivity() == null || isDetached() || map == null) return;
if (markersArray != null && markersArray.size() > 0)
map.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(marke... | 1 |
35ed29a66cc3c6cd90984550a7b5dbf1 | f076816e02f592ec09818e66fad83b36 | Increase the number of pages in the file by one. The new last page should be filled with zero bytes. | {
PagedFileHeader header = new PagedFileHeader();
header.firstFree = -1;
header.numPages = 0;
file.Write(StructureToByteArray(header));
PagedFile pfile = new PagedFile(file, buffer);
return pfile;
} | 0 |
2b50e4162766ec5e87424e27350dda0d | f287f8749774c2446e8c63eee9c0c3b0 | Remove the trailing / from baseUrl | class Router
public function setBaseUrl(string $baseUrl): void
{
$this->baseUrl = str_trim_end($baseUrl, '/');
} | 1 |
c42d19ba287ebba5685b79e10ac3cf64 | dbaad474c13d804b0d1a516c80d88297 | 随机出现不同的鱼 | public class Fish : MonoBehaviour
private void FishRandomSet()
{
float directionX = Random.Range(0, 2) * 2 - 1;
float directionY = Random.Range(0, 2) * 2 - 1;
speedX = Random.Range(0, 3.0f) / 2 * directionX;
speedY = Random.Range(0, 3.0f) / 2 * directionY;
FishMove();
... | 0 |
db26fc30f4c4a277045f6c9bdde6cc78 | d8d342ab669ba1b734d10f1de07bc55e | Set model values at particular indices. | default void set(final long vIndex, final double x, final double y,
final double z,
final double nx, final double ny, final double nz,
final double u, final double v)
{
setf(vIndex, (float) x, (float) y, (float) z,
(float) nx, (float) ny, (float) nz,
(float) u, (float) v);
} | 1 |
93b3ea55e4f545f80b83a31836275280 | 7ff135a05321945adb3a9b3a4f23b354 | Move an animal to a neighboring cell and either make it eat the
neighboring animal or get eaten. | {
if (isSettled) {
if (location->get_num_fruit() >= min_settle_fruit) {
remain();
}
else {
abandon();
}
}
else {
location->remove_fruit(appetite);
if ((destination != NULL) && (destination != location)) {
move_to_cell(destination);
destination = find_best_place();
}
else {
destination... | 0 |
719b194e644fc895d2a7e80c996c6310 | 97ef70ebce094f706bdd78df18f80709 | Calculates forces between joined tubes. | foreach (GraphicalModule gm in tabModules[tp]) {
gm.Force = PointF.Empty;
}
const float k = 75.0f;
foreach (GraphicalModule gm1 in tabModules[tp]) {
foreach (GraphicalModule gm2 in tabModules[tp]) {
if (gm2 == gm1) conti... | 1 |
04f0053cda0aa7e1bbc111bc4398c83e | eaa434c3e8d55b64cac4478f24813a16 | 找出字符串数组中字符长度为4的字符串 | let results = []
for (let i = 0; i < friends.length; i++) {
let friend = friends[i]
if (friend.length === 4) {
results.push(friend)
}
}
return results
} | 1 |
b4fa7c5d7449f84e4779ec1f37274db2 | 74f5f135edfe1f72d64b62f36d312262 | Search for the max and min of the data within the given bounds then
take the center point and shift the data vertically so that the center is at 0 | if(doX){
double maxInXData = getExtreme(true, false, this.data);
double minInXData = getExtreme(false, false, this.data);
double XDiff = maxInXData - minInXData;
double biggerAreaX = XDiff/(1.0 - (percentOverShootX/100.0));
double differenceInArea = biggerAreaX - XDiff;
double differenceToAddOnEach ... | 0 |
042c6b13f88fea528b8f867309ddd9bd | 09f7ac49480f0b49bbf70b6ebc2b9f59 | Test to see api call returns JSON. | class BasicTests(unittest.TestCase):
def test_get_results_json(self):
self.assertTrue(self.is_json(app.get_results())) | 1 |
cf83870e07e5a303f56a0095a1a5ca13 | 355c8db816d6baaafb981cac17fd6edc | Displaying relations of selected scientist | {
if (my_vector.size() == 0)
{
cout << "No scientist found.\n";
return;
}
system("CLS");
cout << BOLDWHITE << "-----------------------------------------------------------" << endl;
cout << BOLDCYAN << " Computer Scientist Database " << endl;
cout... | 0 |
de5541ae54fddd78272422eab0573b36 | 64c584b3427c32483e0cb7ebeb592273 | returns a dictionary of stems and their frequencies | class tds_scorer():
def freq_words(self,s):
s = self.rake_keywords(s)
complete_text = ' '.join(s)
return dict(Counter(complete_text.split(' '))) | 0 |
587ac80e36fa42f6f79659a618318079 | 2f44bfbc3523dbbeae8ee5ece88684de | 拡張子を外した文字列を返す | abstract class File{
public static function woExtension($str) {
return substr($str, 0, strrpos($str, '.'));
} | 1 |
d950ba2117cb685a6627bd0323347e53 | 4cb64775e333b75f82b9d899a96693a4 | Allow the use of javascript: in urls. | referrer = request.headers.get(b"referer", b"")
response_headers = [(b"Content-Type", b"text/javascript"),
(b"Access-Control-Allow-Origin", b"*")]
return (200, response_headers,
b"if ('DedicatedWorkerGlobalScope' in self &&" +
b" self instanceof DedicatedWo... | 0 |
d3ef553c059d361ef5395a0759caed07 | 3ddde3cd9939a89c89c82d40bd44c651 | Number of users who have put the resource on hold. | int getHeldResources(); | 0 |
7dc1e770ac2a8baa31adddb9e77456d3 | 9be7b7e40b05aca91e1aa807e03c1c45 | Loads the gene - function associations from the associations file. | function loadResources(geneFile) {
loadGene(geneFile);
} | 0 |
0276cc165905317b63a43f9a69a81c64 | 1355e013bffc9348ccf2d9b7a1eee23d | 根据城池坐标获取地图数据 | function globaldata:getCityHallData(_key)
return self.cityhalldata[_key]
end | 0 |
81d08d6a36c148bcfb760b7b9eb93019 | 59b12e87edbe4410cc3510087e108fab | Display status info of SPP processes. | cloud_name = ctx.obj['cloud_name']
LOGGER.debug('cloud_name:%s instance:%s', cloud_name, instance)
if cloud_name:
utils.cloud_run(cloud_name, ['ps', 'process-status', 'process_status'])
return
inst = MechInstance(instance)
if inst.created:
_, stdout, _ = utils.ssh(inst, 'ps -... | 1 |
eb06c4fd00c06ab0fbd24b08927d1c56 | 70e6dec7a8b7fa218a0e01cf4f68e749 | Tests Debug Text hidden in normal use | [Trait("Category", "CodeCompilerTest")]
public void DebugInfoCompileSourceStringTest()
{
compiler.includeDebugInformation = true;
CheckCompiling();
compiler.includeDebugInformation = false;
CheckCompiling();
} | 0 |
525bce6c2e1c834f73854c3ffc8d7284 | 2bb5742021b57ddde7c60908eb7768ca | 根据城市名称/城市编号 查询对应的分组信息 | Map<String,String> map = new HashMap<String, String>();
Integer codeCount = Integer.parseInt(cityCode);
String [] grades = {"1_10","10_25","25_50","50_100","100_150","150_200","200_300","300_+"};
if("4".equals(flag)){
if(codeCount<10){
map.put(tfbh, grades[0]);
}else if(codeCount>=10&&codeCount<25){... | 1 |
974ce8accb18d60a8d3a482e68694a5d | e3e7c540002b694ba2e687b96637148a | Sets the static data of a puzzle to save data. | public class SlidingPuzzlePiece extends Parent
public static void setPuzzlePiece(
final Vector<SlidingPuzzlePiece> newPuzzlePiece) {
SlidingPuzzlePiece.puzzlePiece = newPuzzlePiece;
} | 1 |
99969fa74ae61595b05c18a687ac88b6 | 1126aa137e71c9fe9445f7b6b15bfd28 | Method to get customer coupons by customer id and max price | public ResponseEntity<?> getAllCustomerCouponsByMaxPrice(@PathVariable String token, @PathVariable double maxPrice) {
Session session = sessionMap.get(token);
session.setLastLoginTime(System.currentTimeMillis());
Set<Coupon> customerCouponsByMaxPrice;
customerCouponsByMaxPrice = ((CustomerFacade) session.getFa... | 0 |
33173a6408a4463fd0ee2a83d9be3c40 | d5c1f6acc49d511e0f9874c54c1feb53 | Get reminder entity type. | {
$sender = $this->getReminder()->getSender();
if ($sender) {
return $this->entityNameResolver->getName($sender);
}
return null;
} | 0 |
a5ce026568ef84080c5f4fd29999ab6b | 7b7cf72ca9f101f50a69fbc009d6421c | The spectral classification type of the current target. | class BaseQuantize(object):
def target_type(self): | 0 |
2dfbe69343b9fa66d7d601c08b989dc8 | f0ed2bb2088c81a1024413a0c2fe94f7 | Testing to ensure that the non-generic JSON deserialization method returns the correct type. | SchemaRegistryJsonSchemaSerializer serializer = createSerializer();
MessageContent message = getSchemaRegistryJSONMessage();
Address address = serializer.deserialize(message, TypeReference.createInstance(Address.class));
} | 1 |
1d6872706b769e83f88a33f9a1fc47f3 | 04d665a07e602296efa689651e11df8b | 当前目录下建一个文件夹, 如果目录存在则无视 | public class YunkuFile
static void createFolder() {
DebugFlag.logInfo(TAG, "====== createFolder\n");
String returnString = YKHttpEngine.getInstance().createFolder(251025, "Folder Test");
DeserializeHelper.getInstance().deserializeResult(returnString);
} | 0 |
e0468f3195c9c81f34b59e36101e37ed | 90bcc9c5ef09c4b1729323115dfaf4c1 | you can only destroy your own records | class Call
def before_destroy
raise ActiveRecord::ReadOnlyRecord
end | 0 |
ddfc7e458630cb7680175cc6634d819f | 038403dc5f0e96791063c4c08019bcd4 | Constructs and sends an Automatic Speech Recognition request. | {
using (var call = m_Client.StreamingRecognize())
{
Task responseReaderTask = Task.Run(async () =>
{
while (await call.ResponseStream.MoveNext())
{
StreamingRecognizeResponse response = call.... | 1 |
df43e9388a5be26b3a115b77a0eca612 | dd10aedd0877e22de7338d94a74bdecb | Called by HTML to decide whether to show the search button | boolean shouldShowSearchMenuItem(); | 1 |
29f4545ef5a094ba1f74ae89758440ea | ea8d494bf2bb31a9368d069a99c21dd3 | Finds a file with relative filename and replaces the name with the absolute path. | name = name.strip()
path = path.strip()
for root, dirs, files in os.walk( path ):
if name in files:
return os.path.abspath( os.path.join(root, name) ) | 1 |
27bfa1e8b3cf0c063eb7e838e1baddda | 4ecff504c680dd24ad9e0db4ccff19b5 | Helper function to get a list stored as an environment variable string | int add_from_env(char* env_var, char sep)
{
const char *p=getenv(env_var);
if(!p)
{
return 0;
}
return add_list(p,sep);
} | 1 |
48bc93f412f40501fbba381990bae392 | 48c7dcdc3509ccb307243bf8cc54c971 | Manually creating a UUID from time stamp and MAC address | namespace LandmarkDevs.Core.Shared
[ExcludeFromCodeCoverage]
public static class GuidGenerator
public static Guid GenerateTimeBasedGuid(DateTime dateTime, PhysicalAddress mac)
{
return GenerateTimeBasedGuid(dateTime, GenerateClockSequenceBytes(dateTime), GenerateNodeBytes(mac));
} | 1 |
42aaf9f0facb6a031424767ab63b6444 | 04b1745a669b603d67c40178d191ebb5 | Sets the test jobs to run. | class TestPack
def set_active_tests(test_names)
@active_test_names = test_names
@active_test_dependencies.clear
@active_test_names.each { |test_name| @active_test_dependencies[test_name] = get_test_dependencies(test_name) }
end | 1 |
a27066706698c0ca25c871ab2ce2d1df | 8c442c9f8c4ece800057c6b44b8fce51 | シートのデータをカレンダーに登録する | const spreadSheet: any = SpreadsheetApp.openById('<スプレッドシートID>');
const sheet:any = spreadSheet.getSheetByName('<シート名>');
const columnIVals: any = sheet.getRange('J:J').getValues();
const lastRow: string = columnIVals.filter(String).length;
const data: Array<Array<string>> = [[title, place, purcha... | 0 |
87130fc9db71497e3ed5b60e388db836 | 047d8fb4c67f4f51f32521df6aaa128c | 境界球と境界球の衝突を調べる | {
return SphereSphere(sphereA.center, sphereA.radius, sphereB.center, sphereB.radius, out IntersectionSphereSphere intersection);
} | 1 |
1a85dd1a8b5670f3ea4b270ad168651f | decf7d004cdaa294848789f19ec556d2 | Runs the server on the vm number given | VMs_names = []
for x in range(NUM_SERVERS):
print("Creating Server " + str(x) + "...")
VMs_names.append("VM" + str(x))
image = conn.compute.find_image(IMAGE_NAME)
flavor = conn.compute.find_flavor(FLAVOR_NAME)
network = conn.network.find_network("internal")
server... | 0 |
416b4cd7386dd97efc9920645435a210 | a628af3910946dab3d22443492ed0f54 | <p>Tells whether a channel contains the wild character '*', for example
{@code /foo/*} or if it is {@link #isDeepWild()}.</p> | public class MediaType implements Comparable<MediaType>, Serializable
public boolean isWildcardType() {
return WILDCARD_TYPE.equals(getType());
} | 0 |
8ed376d14d40432563012ef0d4c12649 | 2373c0e4ada28915c00fd1b6195cffa8 | ManeuverRealizationSimulation 화면과 ViewModel을 바인딩 | @Page(R.layout.activity_main, 0)
class MainActivity : BaseActivityWrapper(), IMvvmView
override fun initViewModel() {
mainViewModel = ViewModelProvider(this)[MainViewModel::class.java]
lifecycle.addObserver(mainViewModel)
} | 0 |
ffe44a66d8c6cda2a66d62d7431f5455 | ae0dba7aecba5297edbfcceb37c9e6bf | Checks if entries are correctly classfied as valid and invalid based on challenge description | function isEntryValid( entry ) {
let minChar = entry.password[entry.min - 1];
let maxChar = entry.password[entry.max - 1];
return minChar == entry.char ^ maxChar == entry.char;
} | 1 |
107f3060908129aa84ddf4be1d3f5793 | 80c68210e4ef9737267c057abddfb798 | 创建切片的三种方法,后面两种方法创建的切片并没有提供对数组的直接引用,但数组时存在的,只是对程序员不可见,只能通过切片来操作数组 | var array [10]int = [10]int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
var slice = array[0:2]
fmt.Printf("%d\n", slice)
slice2 := make([]int, 5, 10)
slice2[0] = 100
fmt.Printf("%d\n", slice2)
slice0 := make([]int, 5, 10)
slice0 = append(slice0, 444, 555)
fmt.Printf("%d\n", slice0)
slice3 := ... | 1 |
e8366b46e2dc493fc3e0b68b68999f68 | 4468aa5f1f8a445989e774eb60470695 | 变化公里数,然后通知处于wait的状态并需要处理公里数的线程进行业务处理 | public class ExpressDemo static class Express
public synchronized void changeKm() {
this.km = 101;
notify();
} | 1 |
6f4263a0da9aa0f0acc3b6f40fe7f1e9 | 0861e3280c7da9dc8dfb5fa4027ba067 | Divides a nested sampling run into threads, using info on the indexes
at which points were sampled. See "Sampling errors in nested sampling | def dict_given_samples_array(samples, thread_min_max):
nlive_0 = (thread_min_max[:, 0] == -np.inf).sum()
nlive_array = np.zeros(samples.shape[0]) + nlive_0
nlive_array[1:] += np.cumsum(samples[:-1, 4])
assert nlive_array.min() > 0, (
'nlive contains 0s or negative values!' +
'\nnlive_arr... | 1 |
24c357df52f95c5f04d7262bf0a00fb6 | 71a0bee092e8be402dbd635e3ec64d79 | Creates a sprint for a team | class SprintController extends \BaseController
public function create($projectId)
{
$project = Project::find($projectId);
return View::make('sprint.create')
->with('project', $project);
} | 0 |
21a25cb17304fd4370d8f351f9e9fc22 | 7dff3ccd69010c39aa7dd045c24bb8a7 | 初始化语法分析器对象,清空rootToken,tokens和errorMsg | analyzerTokens = [];
analyzerCurrentToken;
numAnalyzerErrors = 0;
numAnalyzerWarnings = 0;
scope = -1;
scopeLevel = -1;
analyzerScopeArray = [];
scopeCounter = 0;
addition = false;
temporaryId = null;
temporaryValue = null;
temporaryType = null;
ast = new Tree();
... | 0 |
09b22659deba2b1e9927515dd167ad73 | ea1bff321a3f3e0b26dc32cb4ffdcb1d | Returns the greatest element in this set less than or equal to
the given element, or {@code null} if there is no such element.
or {@code null} if there is no such element
compared with the elements currently in the set
and this set does not permit null elements | public class ConcurrentSortedArraySet<E> implements Serializable, Cloneable, NavigableSet<E>
@Override
public E lower(E e) {
return null;
} | 0 |
000f891c2b2486b1783ce397816cd9e8 | f3cb4f5a3d1d97c7bfff51374845fde2 | 获取评级模板json | @Controller
public class RateTemplateAction extends BaseAction
@RequestMapping(value = "getRateTemplateJson.action", method = RequestMethod.POST, produces = "text/html;charset=UTF-8")
public @ResponseBody String getRateTemplateJson() {
String json = RESULT_EMPTY_DEFAULT;
try {
RateTemplate rateTemplate = new Ra... | 1 |
13ae1f1017a70ad5651aed802affad10 | 8262bdad8ab5c658b9ecde34d03791f0 | Test case for apiV11BuildingsByBuildingIdFilesByIdStartrefinementPost
Starts the refinement of a building file.. | namespace Madaster.API.Api
System.Threading.Tasks.Task<BuildingFileResponse> ApiV11BuildingsByBuildingIdFilesByIdActivePostAsync (Guid? buildingId, Guid? id, bool? isActive = null); | 0 |
c8542062c675e1865bf4a2ef191e30cd | 42f1141392ae5f472237627e2099dfd0 | Given a string, finds the first appearance of the
substring 'not' and 'bad'. If the 'bad' follows
the 'not', replaces the whole 'not'...'bad' substring
with 'good'.
Returns the resulting string. | if (badwords == null || str == null || str.length() == 0) {
return str;
}
str = badwords.matcher(str).replaceAll(replace);
str = replace_badwords.matcher(str).replaceAll(replace);
return str;
} | 0 |
165ce454cd5fbddb26e92140990728c4 | c94d1ce9e7add07fa8a6c328f52a17f0 | Indicates an error on cars loading | function movieLoadingError(error) {
return {
type: LOAD_MOVIES_ERROR,
error,
};
} | 0 |
bdc3de0401630a8b6a5893ba3d7320ba | d2eeac15ab05187f5bdbcfb5b06075d7 | 取消分享 可取消多个 | class M2 extends CI_Controller
public function cancel_share() {
$res = $this->check_token();
$key = $this->input->post('key');
$share_users = $this->input->post('share_users');
$this->db->where('key', $key);
$this->db->set('share_users', "REPLACE(share_users,',{$share_users}','')... | 1 |
5045b05b6b97d157cf7e6a81bd8dc7df | 6d9e9cc3bb940a7e1fb74b9260ec5743 | 针对IE8 9 设置的map方法 | function forIE () {
var html = document.getElementsByTagName('html')[0];
if (isIE(8)) {
addClass(html, 'ie8');
var wdh = document.body.clientWidth;
if (wdh < 1205) {
responsive(wdh);
}
eventUtil.addHandler(window, 'resize', function(){
var cWi... | 0 |
2d620c9c5640b60f7ff57ff1c2a962b3 | 17594ababfb0787808ddcc23b00108ae | Utility method to create an exception caused by a repository path which
is too long. | class PathError(Exception):
def __init__(self, *args, **kwargs):
Exception.__init__(self, *args) | 0 |
5125cb1fa5b02a529b79bb34b9c39d83 | d408f7e30f48d25ca7d66f8f2e9016f2 | Get value for key and coerce to one of allowed_values. | if mode == "ok-or-fail":
raise DBDatasetRuntimeException(
"Cannot coerce value [%s] to type [%s]" % (value, type))
if mode == "ok-or-none" or mode == "ok-or-null" or mode == "strict":
return None
return value | 0 |
c02624b16fba64457bd0af89f92da3c4 | 8fde95ee9ff61dda522645d0edb91e83 | 获取并修改body的背景颜色. | function setBackgroundColor(){
var bColor = "bColor";
if(checkCookie(bColor)){
bColor = getCookie(bColor);
var header = document.getElementById('header');
var submitBtn = document.getElementById('submitBtn');
var commonSite = document.getElementById('commonSite');
var weibo = document.getElementById('weibo'... | 0 |
01033d3f23a714a78c6ecee42442a9de | e71fd2829e28484173f558419dbfa512 | board is a 9 x 9 matrix. Cells are filled with either a digit from 1 to 9 or 0, which represents an empty cell. | def initialize_board():
b = zeros((9,9))
for r in range(9):
user_i = input("enter row #{}. No spaces or commas, zero for blank:".format(r))
b[r,:] = [int(user_i[i]) for i in range(9)]
return b | 1 |
22f6c72b546fc09f69be1550583bdcb2 | 2849a1b597a14e88bfc3d9e88ce12659 | Validates that the value of the <see cref="MEDIASUBTYPE_WAVE" /> property is correct. | public static void MEDIASUBTYPE_S340Test()
{
Assert.That(MEDIASUBTYPE_S340, Is.EqualTo(new Guid(0x30343353, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)));
} | 0 |
1193dcf7b993de4a16316f46b1fb63d6 | b9ba6f7dee37f62ef2f46e18a78a645e | 设置推荐阅读 | var content_id = this.data.selectItem.id;
var coterie_id = this.data.selectItem.coterie_id;
this.postSetRecommend(content_id,coterie_id,1);
} | 1 |
885e52914d290b2ac76ceebbefb76dd4 | ddab0da6672499bfa232e59a94af137a | 编辑游戏合辑 | $info = $this->get_one(array('guid' => $data->guid));
if (empty($info)) {
return $this->addGame($data);
}
$update_data = $this->getData($data);
$this->update($update_data, array('id'=>$info['id']));
$this->updateGameCompanyRelationship($data->operId, $data->id);
$aid = $info['id'];
$game_tag = $data->gameT... | 1 |
72c0b80214e6d283c02f63180e7c3125 | 2a2ecda90df207b626f3c6a78193df36 | Modeller for rendering sequence of points as polyline. | this.p0 = new Vec2d();
this.p1 = new Vec2d();
this.reset();
} | 0 |
f70bdc167a52396b678a8e203f46cc1f | 8dfb90bfddb80508cba9a684222f8a57 | 是否是WebView控件 | public class NewsDetailsActivity1 extends BaseActivity
private boolean isWebViewOverScreen() {
return mWebViewHeight > (mScreenHeight - getTopAndBottomHeight()) ? true : false;
} | 0 |
b80bb9145bc7015afa86d90d697c8c12 | 8e10186e3f1584a5a9f5adadc4df3613 | Will toNiceString() produce an exact representation? | $dumper = &$this->_getDumper();
return 'Expected true, got [' . $dumper->describeValue($compare) . ']';
} | 0 |
edd9ddf1d1cfb41f89e7113c9261285e | 1834bfa72367cff283e68f77fe0ffd48 | Alert Control이 보이기 전에 사이즈를 설정합니다. | const { message, title } = option
const isLargeText = message.length > ALERT_MAX_CONTENT_LENGTH
if (isLargeText) {
return { width: ALERT_WIDTH_LARGE, height: ALERT_HEIGHT_LARGE }
}
const isHaveHeader = typeof title === 'string' || typeof title === 'undefined'
const height = isHaveHeader ? ALERT_HEIGHT :... | 1 |
c4dc576af34a0dc0bf9ac1b81b5e3f70 | b8fe02d5d8b6b578a2abaf3e0fcd9ee9 | Sets the enabled of this ComAdobeGraniteRepositoryImplCommitStatsConfigProperties. | void setEnabled(boolean value); | 1 |
4e29207781ac5bf9949724b5e3540b22 | 23edc0593beb423d1e293698603f3b3f | Return cumulative distribution function (cdf) for the given image. | xp = get_module(C)
x = (logsumexp(C[xp.newaxis, :, :, xp.newaxis] +
img[:, xp.newaxis], axis=-2))
x = logsumexp(C.T[:, :, xp.newaxis, xp.newaxis] + x[:, xp.newaxis], axis=0)
return x | 0 |
59c4c34eb785ddd8aac56fe649f08267 | 3d5331adef960b5b8bb2ae95f3632e0d | 获取某个Y轴的颜色 | public class PercentChartView extends View
public int getYAxisColor() {
return yAxisColor;
} | 1 |
e56cb238e0712304fc36d20119592074 | b4416ad852d57445cd3d0da238b69edf | 新增事件跟踪 | class Order extends Controller
public function AddTrackLog()
{
$model = new OrderTrack();
$action_list = array_keys($model->getActionList());
$source_list = array_keys($model->getSourceList());
$source = I('post.source');
$action = I('post.action');
$ordernum =... | 1 |
c0399cb4fd1857a296eb1da0de747203 | b52cf477dd5aff00c15f6d35ed6e86ce | Kendisine gönderilen tipteki sınıfı veritabanına eklemek için kullanılacak | namespace CORE_MVC_STOK.DataAccess.Repository
void Create(T entity); | 1 |
a4406bc40bd0dd49f36055b3b5eeec31 | 87153c2408402307f6a4588dc5e43484 | mutateur permettant l'affectation du prenom de l'etudiant | {
int e_id = choisir_etudiant();
Personne la_personne = get_personne_id_etudiant(e_id);
Console.Out.Write("Nouveau prenom : ");
la_personne.prenom = Console.ReadLine();
maj_personne_prenom(la_personne);
} | 1 |
8f387a97ff4c9977ef6831d16e922dc3 | cc56f5722f7b45811d9c03e47d187d54 | Show plugin activation errors or warnings or notices by echoing it | class wpdb
public function show_errors( $show = true ) {
$errors = $this->show_errors;
$this->show_errors = $show;
return $errors;
} | 0 |
9a5ccf97a7e24f651e16c01c4bc56c5f | 32b35f70ad0947e9b3ef42c5bd5bfbba | Load stimuli for AU task. | fs = 2000
cur_path = os.path.normpath(folder_path + '/S' + str(subject) + '_E1_A1.mat')
data = sio.loadmat(cur_path)
emg = np.squeeze(np.array(data['emg']))
rep = np.squeeze(np.array(data['rerepetition']))
move = np.squeeze(np.array(data['restimulus']))
cur_path = os.path.normpath(folder_pat... | 1 |
255f26e3e0a85b6fdc148e6bef5cde67 | 8d272b492bb18481d474f2b44c60de79 | Add flattened nested rings. | func Ring(r orb.Ring, proj orb.Projection) orb.Ring {
return orb.Ring(LineString(orb.LineString(r), proj))
} | 0 |
7c521cb81fe7d7152c5c58046399c714 | 10f3d2a49ada0f9d8b31cbd3d80840ad | 上传excel加载任务列表 | let model = yield select(state => (state.upload))
let params = {
pageSize : model.pageSize,
pageIndex : model.pageIndex,
}
let { ret } = yield call(services.getUploadStuExcelList, parse(params));
if(ret && ret.errorCode == 9000){
yield put({
type : 'updateState',
payload : {
... | 1 |
9ad9ec1a28e1f138f85d19cfcb858d00 | 1a9a8b339472bbbd308d795673520386 | checks if the string has a number | def hasNumber(inputString):
return bool(re.search(r'\d+', inputString)) | 1 |
f1ff30bc10874297428edb8956c5149a | dc5101259840da378aa1d55ae682be61 | 根据depId找到对应的设备关联关系 | public class ProjDepDaoImpl implements ProjDepDao
public List<_ProjDep> listProjDepByDepId(int depId) throws DaoException {
List<_ProjDep> projDepList = new ArrayList<_ProjDep>();
PreparedStatement pstmt = null;
ResultSet rs = null;
try {
String sql = "select * from t_proj_dep where dep_id=?";
pstmt = con... | 1 |
8e58a8a651cde751c11d698e0309301e | 400c7fd4bb4c9b421e5375658d74d813 | This method updates course allocations. | $upper = $request->input('upper');
$teacher = $request->input('staff');
$year = $request->input('year');
$term = $request->input('term');
$class = $request->input('class');
$key = $request->input('key... | 1 |
2895a1f24042fea95c046a7173124f7b | 5072608109539364929f7084f666a5b1 | Process a presentation message. | class Gateway(object):
def _handle_presentation(self, msg):
if msg.child_id == 255:
self.add_sensor(msg.node_id)
self.sensors[msg.node_id].type = msg.sub_type
self.sensors[msg.node_id].protocol_version = msg.payload
self.alert(msg.node_id)
else:
... | 1 |
407854cff0028d5c311712b73259fb71 | 0cfc4b3acd920ebb6afbed26c0bbccd4 | Find the Parity Outlier | function findOutlier(integers) {
let even = [];
let odd = [];
for (var i = 0; i < integers.length; i++) {
let realNum = integers[i];
let num = integers[i] > 0 ? integers[i] : -integers[i];
if (num % 2 === 0) {
even.push(realNum);
}
else if (num % 2 === 1) ... | 1 |
8341c604134fd3da34f31bbb0cab6b81 | 328a89ce2a31a7d154b3fb049bc5d271 | !
@brief 合計のプレイ時間をロードする | void MainMenu::LoadBestTimes()
{
std::ifstream file(TIMES_FILE_PATH, std::ios::binary);
if (file.is_open()) {
int len, milisec;
file >> len;
for (int i = 0; i < len; ++i) {
file >> milisec;
best_times.push_back(milisec);
}
file.close();
}
e... | 0 |
125ed52e56e668f5891961b362287ac0 | bc390faee99a61e8a4bf7a42b7d2e3b8 | initialize with number of references we expect to see
we can add more later, but want to ensure known references have an entry
even if no records are observed mapping to it | def create_unknown_reference_records():
create_default_records() | 0 |
630d6639eb1e8d20b96f24f2417b0439 | 63667b56fa31b87140c5151373f1259d | Reset the instance pool and do a full scan for Homebridge instances | class Instances(object):
def refresh(self):
self._instances = self._get_instances() | 1 |
e3a0db3d5f07d86a4f733a8f53d72e30 | 3bcf30d1fa81f46f3f7ed5aa175aa2c2 | 播放swf文件 | {
$this->playhtmlstr = @sprintf('<embed src="%s" allowFullScreen="true" quality="high" width="480" height="400" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash"></embed>',$this->videoswfstr);
} | 1 |
5cdb31b3c2fe2f1299aad93579b3e611 | 077ab8aea79b63acf80c2d4fab3dea0d | 通过LassoCV 进行特征选择 | x = df.drop(y,axis=1)
y = df[y]
lr = LR(penalty="l1",dual=False).fit(x,y)
model = SelectFromModel(lr,prefit=True)
var = []
for i,j in enumerate(list(model.get_support())):
if j == True:
var.append(x.iloc[:,i].name)
return var | 0 |
fabb0f8e919fcd350b5084e6a5cf23d6 | 4be188c083e7cf28d2756736cb5f1ef5 | ResponseBase根据状态自动转换为IActionResult | {
object result = null;
if (data is DataTable)
{
var dataTable = ConvertUtil.ConvertDataTableToList(data as DataTable);
result = new { status = ActionResultCode.Success, data = dataTable };
}
else if (data is DataSet)
... | 0 |
a77d3db12bed89106bc9a654d95f6dc9 | 2f91e0484f07638964b55163ec4607a3 | Get Purchase Order Status Notifications Count | class PurchaseOrdersApiTest extends \PHPUnit_Framework_TestCase
public function testProcurementPurchaseordersCountGet()
{
} | 0 |
b1fe009c6a043ce859a10c3ae8ea4e98 | 2f784325ef7bde5b5509dafd9b33a222 | Generates a shared secret from two keys or key pars. These keys must have capability 'Exchange'.
The server/issuer of a key exchange is always the initiator and the client/audience is always the receiver
(no matter on which side this method is called). | (
CK_SESSION_HANDLE hSession,
CK_MECHANISM_PTR pMechanism,
CK_OBJECT_HANDLE hLocalKey,
CK_OBJECT_HANDLE hRemoteKey,
CK_ATTRIBUTE_PTR pTemplate,
CK_ULONG ulAttributeCount,
CK_OBJECT_HANDLE_PTR phKey,
CK_BYTE_PTR pExchangeIV,
CK_ULONG_PTR pExchangeIVLen
)
{
LOGSERVERI(tag,"%s IN",__FUNCTION... | 1 |
9066a8b7bfd3a44d8ebf9fa17ef9a7ed | f6cecb3c0cc9ea414218a6ae47eabeb7 | 启动指定线程并发的服务 | defer wg.Done()
sc := config.GetServerConfig()
seelog.Info("启动任务服务")
for i := 0; i < sc.RunProgramParaller; i++ {
seelog.Infof("启动任务服务 %d 号 启动成功", i)
wg.Add(1)
go startTask(wg)
}
} | 1 |
e82206bffed5c052681e219c9bf67221 | f193da815e1edb808029892fc68f4761 | Get the spotlight Tlds. | class Tld
public function getTransferTlds()
{
$this->getTldPrices();
return $this->registerTld;
} | 0 |
6b4ed3cae42e68fb9d34646f4010c3a6 | ce259739051ff1d1cf2694a558bcee87 | Subscribe price depth event. If the price depth is updated, server will send the data to client and onReceive in callback will be called. | namespace KFCC.Exchanges.EQuoine
public class EQuoineExchange : KFCC.ExchangeInterface.IExchanges
protected void UpdateDepth(string tradingpair, Depth d)
{
if (SubscribedTradingPairs == null)
return;
if (SubscribedTradingPairs.ContainsKey(tradingpair))
{
... | 0 |
92a5cf963924da45c79651c71dce2e1d | 310697a3629985ff4b7f66cb19162082 | Updates this 'experience' screen. | namespace TD
public class IngameUI : Singleton<IngameUI>
public void UpdateExperince(int Exp)
{
ExperienceLabel.text = string.Format("Exp:{0}", Exp);
} | 1 |
0344827163408311e89a85bdd64d9a08 | 25e88acf95212be433e5fe5e3c10231b | Reads the next 16 bits at the address after the one stored in the
register PC. | {
or_8bit(system.mcu.read_8bit(reg.pc + 1));
reg.pc += 2;
clocks += 8;
} | 0 |
2de5f1f90c8a7c550059f31152bad24f | 96b93bfdd2d3b00c0935663fa603bc7c | Convenience method to compute global mean temperature. | def tg_mean(tas: xarray.DataArray, freq: str = "YS"):
arr = tas.resample(time=freq) if freq else tas
return arr.mean(dim="time", keep_attrs=True) | 0 |
79c8d9d0d2b67b66258d1b4c9bb9dd14 | b4212901af9677988bf15bb0a0e0e52e | Get a list of all users # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True | class DdmAsyncClient(Client):
def list_users_async(self, request):
return self.list_users_with_http_info(request) | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.