query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
7ae5ea8fb4a3ea3729c85f0572340256 | 54450b4e758b6f7184c86b486186e5ec | Pass input arguments on to evaluator | class QNode:
def __call__(self, *args, **kwargs):
args = autograd.builtins.tuple(args)
return self.evaluate(args, **kwargs) | 1 |
d9c23eea07e5be677069a390bac4c38e | 74092bf0e8e20091307fbfa229931c4a | Writes the body of the bundle. | {
$stream = $context->getStream();
$writer = $context->getWriter();
$sizeContext = $context->getComputeSizeContext();
if ($this->appid !== null) {
$writer->writeVarint($stream, 8);
$writer->writeVarint($stream, $this->appid);
}
if ($t... | 1 |
311f1e2db248f4da651862470cafdc54 | b230c287d0d6adbfe3d8c0276650ae12 | Takes in a hash and convert special values (like @@LastSave) into the appropriate values | def valid_bug_hash(options = {})
if !options.key?(:summary) then
options[:summary] = Bug.first.summary
end
if !options.key?(:description) then
options[:description] = Bug.first.description
end
if !options.key?(:affected_version) then
options[:... | 0 |
0f99f299d4d549886b38d94f34876a42 | 096c716859ba7a0383b36a6e8e6f95f3 | 根据文件夹guid检查文件夹是否已分享 | {
using (var db = new Model.ZKJSkyDriveEntities())
{
return db.Set<Model.Folder>().FirstOrDefault(x => x.Folder_Name == FolderName && x.FounderID == UserId);
}
} | 0 |
81886469c13d63eb67df93f1631f6191 | e08f67f5e4fae04fdfe46a2f4a0e673e | +++++++++++++++++ Extracting @domain.* from emails +++++++++++++++++ | def get_domain_name_from_email_address(email)
email = 'alex@makersacademy.com'
n = email.gsub(/.+@([^.]+).+/, '\1')
end | 1 |
cef2369fe15663c5885c0c87d60bd1ee | 1c753f56c0bae6374a93794c259f3993 | tests that cannot be instrumented by openclover 4.4.1 | @SuppressWarnings({"HardcodedFileSeparator", "IOResourceOpenedButNotSafelyClosed"})
public final class CommandLineRunnerSlowTest extends InstinctTestCase
public void testDoesNotWOrkWithClover2OrWindows() {
} | 1 |
e3cfeeb0d6a05dd5376ff079b3a96dd4 | 25a946968aaef4fb84b152c34568d390 | Display the icon depending on the scroll distance | class App extends React.Component
getIconStyles(pageScroll) {
const { contentType } = this.state;
let iconDown = 'fas fa-angle-down scroll-icon';
let iconUp = 'fas fa-angle-up scroll-icon';
let iconLoading = 'hidden';
if (contentType === 'loadingTwit' || contentType === 'loadingWiki') {
iconDown = 'hidden'... | 1 |
22f5573f5662abe8f6826ae5df1b7465 | 3e7fb4a9485a8331c5939c2e4d2e8ad0 | Updatuje status clanku. | class ArticleController
private function updateStatus($values, $status) {
$db = new Database();
try {
for ($i = 0; $i < count($values); $i++) {
$article = new Articles();
$article->setID($values[$i]);
if ($status == true) {
... | 1 |
4ba08b9e7df70968aa8f0a69c6c9be38 | 4ba398133312209062817a944adcb106 | Basis: The ground basis of functions used to project the PDEs onto. | if edges is None:
edges = StraightEdges()
self._edges = edges
self._basis = numpy.array(basis) | 1 |
374a92382c46b207eb77bd721ebc42db | 0f36d555c1925527d22acc317f8be42d | Creates RA decoder frontend struct, copies memory utilities.
Returns struct pointer on success, NULL on failure. | AM_ErrorCode_t AM_SI_Create(int *handle)
{
SI_Decoder_t *dec;
assert(handle);
dec = (SI_Decoder_t *)malloc(sizeof(SI_Decoder_t));
if (dec == NULL)
{
AM_DEBUG(1, "Cannot create SI Decoder, no enough memory");
return AM_SI_ERR_NO_MEM;
}
dec->prv_data = (void*)si_prv_data;
dec->allocated = AM_TRUE;
*handle = ... | 0 |
695b03cff9efcd0e2e5e170e54f68e7b | 953e4563f461a2ff50112743aaa44e30 | Test basic string functionality. | namespace SoluiNet.DevTools.UnitTest
[TestClass]
public class CoreTest
[TestMethod]
public void StringTest()
{
var simpleString = "Hello foo bar. What's up foo bar?";
Assert.AreEqual("Hello foobar. What's up foo bar?", StringHelper.ReplaceFirstOccurence(simpleString, "foo... | 1 |
5dbe559b734b3b8353290fec248ec8f3 | 1f766ee28c74301e872967250181ec82 | Returns the comments owned by the user associated with the given
access_token.
Sort supported: creation , votes
Supported parameters: - paging , fromDate , toDate, Sort , min, max
,accessToken
Mandatory parameters : accessToken | {
var path = "/user/me/favorites/comments";
path = path.Replace("{format}", "json");
var queryParams = new Dictionary<String, String>();
var headerParams = new Dictionary<String, String>();
var formParams = new Dictionary<String, String>();
... | 0 |
c50db71c059d6ff94ed3ab741132d9c2 | e7963597baab2aaea5d44a11560db99a | Test get returns target and assignee contact names. | {
$targetOriginal = array(
'value' => array(
'test_zucchimodel_customer',
'test_zucchimodel_user'
)
);
$target = new Target($targetOriginal);
$this->assertSame($targetOriginal['value'], $target->getTarget());
} | 0 |
7314ff7a9b68f833ea64efb44b05d5f5 | 42cd1b6b492ca11ef160d7466d52b567 | Tests canonization for consecutive attribute changes followed by a delete. | Attribute attr1 = _attrs.addAttribute(Constants.ATTR_DEPRECATED);
Attribute attr2 = _attrs.addAttribute(Constants.ATTR_SYNTHETIC);
_attrs2.setAttributes(_attrs.getAttributes());
assertEquals(2, _attrs2.getAttributes().length);
assertEquals(Constants.ATTR_DEPRECATED,
_... | 0 |
dc79deac3147f7690b01f574560789e8 | 77982f3aefbfac8c16b515c7347efeac | 缓存总管理实例,可管理多个缓存实例 | function CacheManage() {
Common.call(this);
this.cache_name = "rec_cache";
this.cache_data = {};
} | 0 |
492e2b05abadebb928722683468be2ac | 74ad0ea8e42507d7f9f86f6253d8a56a | 医嘱拆分后的拆分医嘱克隆操作 | @Locked(value = {"repeatExecute_#[jlxh]"})
public void split(Integer jlxh) {
ZlZlzrw zrw = zlZlzrwSer.getById(jlxh);
Integer bjzcs = zrw.getBjzcs();
if (bjzcs == null || bjzcs == 0) {
throw BaseException.create("ERROR_ZL_00030");
}
if (ZlRwZtEnum.DONE.equals(z... | 1 |
723e36324bf0d599aa27b3e789618450 | 21c44b5f5ab8c0f6c757537f26f89316 | Build the activity notification mail html that will be sent be the cron | $user_lang = $user->getPreferredLangcode(TRUE);
$base_url = FsaNotifyMessage::baseUrl();
if ($user_lang == 'cy') {
$template_id = $this->templateIdCy;
$base_url .= '/cy';
}
else {
$template_id = $this->templateId;
}
$email = $user->getEmail();
$personalisation['subject'... | 1 |
47e60a293034a53cd5bd7b41c85a4546 | 5e5164cd7c07e8326ad7ee689afee538 | Set search view visibility. | class SearchableMenu(Menu, object):
def set_search_visible(self, flag):
self._search_action.setVisible(flag) | 1 |
353840c02d5ddc9e636ea718346b4b28 | 74d694622e498384aa877a9e2832145c | Public method to step out the debugged program. | var p = DebugProcess;
var thread = CurrentThread;
if ((p != null) && (thread != null))
{
p.StepOut(CurrentThread);
}
} | 1 |
786fd0939d35ef1d6fe7b6448aee1b0c | a2a41c643b654f9c62c22a1d7d757f46 | Implements in‐place Gaussian Elimination with partial pivoting | def mgs(A):
A = np.matrix(A)
m , n = A.shape
u = np.min([m, n])
h = np.max([m, n])
column_norms = np.zeros((n))
pivots = np.linspace(0,n-1,n)
for j in range(0,n):
column_norms[j] = np.linalg.norm(A[0:m,j], 2)**2
for k in range(0, u):
j_star = np.argmax(column_norms[k:n])
... | 0 |
aff831ba89b0c93b795ec6b7b9d301a3 | 6157122a2f5f4c3a56adf216abcd9afe | Add user as a follower for a specific channel. | export default class HelixUser
async follow() {
const currentUser = await this._client.kraken.users.getMe();
return currentUser.followChannel(this);
} | 1 |
e7e6625b08c3d00f7b0e64d06f307abf | 36b67948ec6694309a6f02cd47494684 | unmarshalJSON converts stringified JSON to a map | func mapFromJSON(data []byte) map[string]interface{} {
var result interface{}
json.Unmarshal(data, &result)
return result.(map[string]interface{})
} | 1 |
416f12e238cf13a4907affe8447c0432 | e6a6e1219624496ec5a470113d6a30eb | Returns the feature importance for a list of nodes.
The node feature importance is calculated based on only the nodes from that list, not based on entire tree nodes. | assert self.is_fitted, "Model must be fitted to compute importance."
imp = 0
for model in self.models:
imp = imp + model.get_feature_importance(
type="FeatureImportance",
prettified=False,
thread_count=self.params["thread_count"],
... | 0 |
faa6966336f2a52a9cecb5e38b668a2f | 8b15016b5d01d1c75adccb7863c923a5 | Gets the convocatorias. | class ConvocatoriasController extends AdminBaseController
public function index()
{
$convocatorias = Convocatorias::orderBy('id')->get();
return view('semestres::admin.convocatorias.index', compact('convocatorias'));
} | 1 |
d4dbfc06c4cd6f60b1fd28a3c2337ada | b36bc660759ee76c5f33608f68ccc7ed | 生成指定位数的随机数
随机数位数 | class WxPayUtil(object):
def random_number(num=10):
return ''.join(random.sample(string.digits, num)) | 1 |
7f0a313a3b347bc6c322f7b1b6ae8a7b | be2b36101f01a7681d57127b54a4e8ed | Generate XML to retrieve all Terms in the specified List | class Common extends Site
function termsList()
{
global $CFG, $objSmarty;
$sqlsel = "SELECT content_title, content_seourl, content FROM " . $CFG['table']['content'] .
" WHERE status = '1' AND termscondition = 'Yes' ORDER BY sortorder DESC LIMIT 2 ";
$sqlres = $this->ExecuteQuery(... | 0 |
4a6097442a4d870807d923bba646b016 | 93530bde7b4b87cb89bad4dc18b0b198 | Returns all issues of the given type and the given project filtered by the given JQL query | List<Issue> findAllIssues( QueryService queryService ); | 0 |
966a6ef550ee9c9e9876dcec0f6a61be | b935bd6db0a726fdb506c56b49676f29 | 将CartGoods分店铺返回 | class Cart extends \common\models\BaseModel
public function getStoreCartList($cart_list)
{
$model = array();
foreach ($cart_list as $cart) {
$model[$cart['store_id']][] = $cart;
}
return $model;
} | 1 |
c3f47ac4d6a4bc0565deee969a21d1da | bbbf7c857c100a97013f5cee31fe311d | Calculates the width of automatically-sized cells on the specified row. | {
double columnWidth = cell.Worksheet.Column(cell.Start.Column).Width;
Font font = new Font(cell.Style.Font.Name, cell.Style.Font.Size, FontStyle.Regular);
double pxBaseline = Math.Round("1234567890".MeasureString(font) / 10);
return (int)(columnWidth * pxBaseline... | 0 |
4b469759c4b49975b6dd8e9d63a54bf1 | d342fbcc5920c683fab15d67fe8f432f | Setter for the partition key in the DynamoDB table. | class AzureTableOutputDataSourceResponse(dict):
def partition_key(self) -> Optional[str]:
return pulumi.get(self, "partition_key") | 0 |
d5e878f83a60626afa20d1e1ff5a7768 | 17aeaf5fef6138ea7eb5ea01596cd2d0 | Returns true if IPv4 address is Globally Reachable.
We intentionally omit TEST-NET here which can be used to simulate
public Internet traffic using non-Internet IPs. | if host == '0.0.0.0':
return True
try:
if IPv6Address(host) == IPv6Address('::'):
return True
except AddressValueError:
pass
return False | 0 |
27af09d5066b73c0fa69234a9ffc9a00 | 95bfa689d117942fbd34823c93e7bc4c | Get the byte offsets for a definition. | defn = self.defs[defloc.def_id]
typ = defn.typ
if typ == "Attribute":
start, end = self._get_attr_bounds(defn.name, defloc.location)
else:
line, col = defloc.location
start = self.source.get_offset(line, col)
if typ in DEF_OFFSETS:
start += DEF_OFFSETS[typ]
if typ =... | 1 |
6ed99192e2ca1b15df95a424b04b5e64 | 2d35c8935bf5d54e32ffeccd2ee32133 | recuperer l'ID du dernier deplacement de l'equipement saisie | function get_last_checkout_id($connect, $equip_id){
$query = "
SELECT *
FROM equipment_checkout
WHERE chk_date_time = (
SELECT max(chk_date_time)
FROM equipment_checkout
WHERE equip_id = '".$equip_id."'
) AND equip_id = '".$equip_id."'
";
$statement = $connect->prepare($query);
$statement->execute();
$re... | 1 |
2d41bde098659523299040e8ed031c37 | 3766a70a357672e29335d473e8af8547 | test method to check if user can add many accounts | class TestAccount(unittest.TestCase):
def test_save_multiple_account(self):
self.new_account.save_account()
test_account = Account('Test','passie', 'mug@good.com')
test_account.save_account()
self.assertEqual(len(Account.account_list),2) | 1 |
ede20f55d76ccf9a35d21bd5404fb16a | 69b26cbfdbcca3b01cf68337df72571c | Creates a new output arc instance. | parent::__construct($point, $radius, $thickness, $extrusion);
$this->entityType = 'arc';
$this->start = $start;
$this->end = $end;
} | 1 |
1333acc19c2d8515aebe8f98ef8592d3 | e2476c696d90d8fc93c396327a8eccc1 | 限制图片最长边不超过某一值 | public class ImageUtil
public static void resize(String srcImgPath, String outImgPath,
int maxLength) {
resize(srcImgPath, outImgPath, maxLength, 1F);
} | 1 |
ae9eab9067d390d45abf04cdb980db67 | 3bdffb42655d78a4e2af7d1962f06e03 | Poll an operation once, using an <c>operationName</c> from a previous invocation of <c>DeleteTrigger</c>. | namespace Google.Cloud.Compute.V1
public abstract partial class DisksClient
public virtual stt::Task<lro::Operation<Operation, Operation>> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) =>
lro::Operation<Operation, Operation>.PollOnceFromNameAsync(gax::GaxPreconditi... | 1 |
ce3536170636193e9e57765445bc3a6c | 4003986229bb8717c19d8db400a3f03f | 描述:清理权限的sidebar数据
User:Jack Yang | @Service("sidebarService")
public class SidebarService
public Map<String, Object> getSidebar(Map<String, Object>dataMap){
dataMap = getSidebar(dataMap, 0, 0);
return dataMap;
} | 0 |
bff8eee125dffd88e420055e7c0e7b14 | 7f61448ad6da3ef0f9cb03f40c5be655 | https://atcoder.jp/contests/abc032/tasks/abc032_d | cases like (1) | 0 |
0d9f61f9aa752747032e18d8514ad885 | a3bce835f9e53fd4c68b8e8784efab60 | function to generate next smallest prime palindrome | new_prime=current_prime+1
while True:
if not isPrime(new_prime):
new_prime+=1
else:
break
return new_prime | 0 |
836f6faac7d682b08ff7287bd5f1db5b | 7495fdf3a6ebeefc77370e1d604d91d9 | System.IAsyncResult UnityEngine.Events.UnityAction`1<UnityEngine.SceneManagement.Scene>::BeginInvoke(T0,System.AsyncCallback,System.Object) | Object_t * UnityAction_BeginInvoke_m1997 (UnityAction_t391 * __this, AsyncCallback_t222 * ___callback, Object_t * ___object, const MethodInfo* method)
{
void *__d_args[1] = {0};
return (Object_t *)il2cpp_delegate_begin_invoke((Il2CppDelegate*)__this, __d_args, (Il2CppDelegate*)___callback, (Il2CppObject*)___object);
... | 1 |
f38eea80eddfc14f9d3c85596c1d76bb | 8222c97f85bcbdf6a7deb9d8058d5623 | function to construct a string using different properties of quote object | {
string finalResult;
stringstream ss;
string type;
ss << getMovieGenre();
ss >> type;
string stock = to_string(getStock());
finalResult = type + " "
+ stock + " "
+ getDirector() + " "
+ getTitle() + " "
+ _yearReleased;
return finalResult;
} | 1 |
182852a0f11cafa91c685d7169eb2717 | 499dd0f18c975dc389f56a5c165538a6 | Initialize the instrument.
More than one instrument can be instanced. | self.__device = instr.device
if DG4062.NAME not in self.__device.query("*IDN?"):
raise TypeError("Instrument is not a DG4062 !") | 0 |
811d08e3c42ea682777bbb4f1882767e | 424418c6152a809466ef749fc4de6d82 | 修改用户的avatar_thumbnail字段 | class m201103_020516_update_table_profile extends Migration
public function safeUp()
{
$this->alterColumn('profile','avatar', $this->string(255)->Null()->defaultValue('no-avatar.jpg'));
} | 0 |
35968ede84686134d9ece3dcd5bc2b5c | d52207a303bd41e583871537d74157cb | Funktion für die Ausgabe des Alters | int main()
{
int age;
cout << "How old are you?\n";
cin >> age;
if (age < 18)
{
cout << "Oh, you are a kid!\n";
}
else
{
cout << "Hey you are an adult!\n";
}
return 0;
} | 0 |
2912403c04660160924529c70e615189 | 9302f65e8f59b4d38e5290d30dcc1bcb | Converts the JSON representation of a subject into a string. | {
switch (this.subject_type) {
case 'user':
return (this.subject as User).name;
default:
return 'An Option';
}
} | 1 |
6d6bfbd54fb143e560a451674321f95c | d287311d165f29eb004e1c2e094daa2e | POST /pupils | {
$grades = array("Baby-Class", "Nursery", "Pre-Unit", "1", "2", "3", "4", "5", "6", "7", "8");
return view('pupils.create', ['grades'=>$grades]);
} | 0 |
42ab61ecfbf6a7b4a1a43f1b458c2782 | 5c53020bc47334e69fab6bb2412790c7 | Gets the mandatory value of component (inputwtContact_Phone) | namespace ssCaseConferencing.Flows.FlowLearner_InitialAssessment public abstract class WBlkTAB_PastoralSupport: OSUserControl, IWebScreen, INegotiateTabIndexes, IAjaxNotifyEvent
public bool inputwt_Input4_isMandatory() {
return false;
} | 0 |
ac68ba2550cb8f408770cb4febbb389b | ce6557f9a122069d4928221fa7ff84a4 | 检测依赖插件以及插件的版本是否正确 | class Service extends \think\Service
public static function check($name)
{
if (!$name || !is_dir(PLUGIN_PATH . $name)) {
throw new \Exception(__('插件目录不存在'),-117);
}
$pluginClass = get_plugin_class($name);
if (!$pluginClass) {
throw new \Exception(__("插件安装出现异常"... | 0 |
353419a7f5e3879b7f32c8774468bb6a | 78144039190fecfbd1a9e2586a1f0cee | Converts the corpus into a green tree | def induce_unk(tree):
for prod in tree.productions():
if prod.is_lexical() and self.wordfrecs[prod.rhs()[0]] == 1:
yield nltk.Production(prod.lhs(),["UNK"])
else: yield prod
prods = sum((list(induce_unk(t)) for t in corpus.corpus.parsed_sents()), [])
S = nltk.Nonterminal('sentence')
return nltk.... | 0 |
3fd28801f02ec064cb7879d57d0f8f78 | 57c60af7b62ea1095895d60a4d2d32ef | Whether validator's index has already been found in the recently processed state. | namespace ViaCepClient.Validators
bool HasBeenValidated(); | 0 |
32a2acf1e22ed1489271e4cd3775be04 | 5c12ac6b82ea7d2fc00e67c53b82d1a9 | funcion que obtiene la cantidad de articulos disponibles. | if(!is_int($estado = $this->seguridad->entero_seguro($estado))) {
$this->error = "Estado no es Seguro";
return false;
}
$formato = "SELECT id FROM articulos WHERE 1=1 ";
$argumentos = array();
if($estado == -1) {
$formato .= "AND estado!=0 ";
} else {
$formato .= "AND estado='%d' ";
$argument... | 1 |
3380a1bdcf5a64d4e39c5cffd22d4c5a | a5b843f9e493fe24b2686f5fe4736ae0 | Based on code from William Ahern and from OpenBSD, this function
tries to use the KERN_ARND syscall to get entropy from the kernel.
This can work even if /dev/urandom is inaccessible for some reason
(e.g., we're running in a chroot). | STDCALL RNG_initialize()
{
#if !defined(WIN32) && defined(CONFIG_USE_DEV_URANDOM)
rng_fd = open("/dev/urandom", O_RDONLY);
#elif defined(WIN32) && defined(CONFIG_WIN32_USE_CRYPTO_LIB)
if (!CryptAcquireContext(&gCryptProv,
NULL, NULL, PROV_RSA_FULL, 0))
{
if (GetLastError() == ... | 0 |
88bf35f3bf267fcab69b84df4ef5a6c9 | 09a29f85eadbf3839f05b54c2d43b346 | these match the sort_link strings in the index view | def build_sort_link(text, sort)
link_to(text, :sort => sort,
:order => params[:order] == 'desc' ? 'asc' : 'desc',
:page => params[:page] ||= 1,
:daysprune => params[:daysprune] ||= -1
)
end | 1 |
1420d2b67e59f00502c621015622d114 | 0f0f644bbf4ac6cc6c430678618076f8 | Get a particular software by name, for this user. | String sessionId, String sSoftware) throws SoftwareException,
PermissionException, SessionException, ProviderException,
ParameterException; | 0 |
cfd86835a680f9d04b56e0653efaae81 | 9498eb37a340142e3c80006a929b0a63 | returns the hourly rate. This is an accessor method | public class ParkingSpot implements Comparable<ParkingSpot>
public double getHourlyRate()
{
return this.hourlyRate;
} | 1 |
b45e81e56a9e65127d44ad7483aa062a | 19134dfc97ebb919b6fd21cd811fa72d | Returns the sorted array, GNOM SORT | result = [];
result.append(gameArr[0])
for i in range(1, len(gameArr)):
if(type(i)!=int):
inserted = False
for j in range(0, len(result)):
if ((gameArr[i][6] <= result[j][6]) and (not inserted)):
result.insert(j, gameArr[i][6])
... | 0 |
91beac4efc5a99ded84f61935142033d | f8a63eb76ecfd95c3d997a1b3f4fb201 | Check if ChatActivity is visible on the screen (running in foreground) | public class NotificationBase
private boolean isAppOnForeground(Context context, Class topActivity) {
if (context == null) return false;
ActivityManager mActivityManager = ((ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE));
List<ActivityManager.RunningTaskInfo> taskInfos = mA... | 1 |
728d6af15a88aa9e3c40d214944ccbd2 | 17e27e190d0d173c952e838bb418bc78 | Add a series of notes to the phrase. | namespace Gadgeteer.Modules.GHIElectronics public class Tunes : GTM.Module public class Melody
public void Add(params MusicNote[] notes) {
foreach (MusicNote i in notes)
this.Add(i);
} | 1 |
08f9c6d9155251815748d50236303fa5 | 9ca060dc6c13a37134037433d2e0face | Removes the featured. Elimina un artista del set de artistas de un artista | Artist artist = manager.find(Artist.class, artistId);
if (artist != null) {
manager.getTransaction().begin();
manager.remove(artist);
manager.getTransaction().commit();
}
} | 0 |
91a56103ffb97c073c650ddfb20e4f06 | fe0221315add08a5eb55d64d3cf4f463 | 展示网络采集到的数据 | public class MainActivity extends BaseActivity
@Override
public void showData(String data) {
mTextView.setText(data);
} | 1 |
e23a36f54197230439f20335f2170fe1 | 1352d86637152071256a62c1911fb35d | Find scene objects centers of mass | namespace polymechanon_vision
vector<Point2D> QrScanner::findContoursMassCenters(const vector<vector<ContourPoint> >& contours_vector)
{
vector<Point2D> mass_centers;
mass_centers.reserve(contours_vector.size());
for_each(begin(contours_vector), end(contours_vector), [&mass_centers](const vector<ContourPoint>& cont... | 1 |
e85adc2087be5affa7d821437d7ff1c9 | 1ffbb9348d7b5cb3a9a5aeef8b55b448 | 应用共享文件数据. | func FileShare(ctx *corporation.App, payload []byte) (resp []byte, err error) {
return ctx.Client.HTTPPost(apiFileShare, bytes.NewReader(payload), "application/json;charset=utf-8")
} | 1 |
67f95bd205a7ae61d7cbad598203ac29 | bf82207ae7a2fca9d1a5a98cce8472ff | Set an attribute if the value parameter is not None. | def setattribute(
instance, attrname, value, *,
setters=(Setter.forced, Setter.secret, Setter.basic), **kwargs):
for setter in setters:
try:
setter(instance, attrname, value, **kwargs)
return
except (TypeError, AttributeError):
continue
raise A... | 0 |
d32207213e0d2f92af6ec97343c689c7 | 0001e7d65be9077dbfc336aa1774ef86 | 数学方法计算两经纬度之间距离(单位:米) | {
try
{
lng1 = Math.Abs(lng1);
lng2 = Math.Abs(lng2);
double num = 6378.137;
double d = Rad(lat1);
double num3 = Rad(lat2);
double num4 = d - num3;
double num5 = Rad(lng1) - Ra... | 1 |
bbcc4c19d66fb4eaae965bac0d919b3f | 0f3dcce2890bfe68f2b6449b6805bbef | Un animal mange un autre animal :
le prédateur gagne le poids de la proie | public void equalsInstanceofAnimalFalseRegimePoids() {
Animal dada = new Animal("dada", false, 300);
Animal poney = new Animal("dada", true, 109.98);
boolean resultat = dada.equals(poney);
assertFalse(resultat);
} | 0 |
5a6fd0874a58bc9365946e6ca075c7c6 | 540f70dbffdda28502d149a25545eaeb | Adds the Raven cursor and offset paging providers. | {
return schemaBuilder.AddSorting(x => x
.AddDefaultOperations()
.BindDefaultTypes()
.Provider(new RavenQueryableSortProvider(x => x.AddDefaultFieldHandlers())));
} | 0 |
adf6be766d0d9f4552e24152cc5b235a | e02da56ff8c6130aeef48579891bfaf8 | Retorna a lista ordenada usando o algoritmo InsertionSort. | def insertionSort(lst):
n = len(lst)
retList = []
for i in lst:
pos = getPosition(retList,i)
retList.insert(pos,i)
return retList | 1 |
025cbc0d559f4923d7a3a2f699686440 | 8d16f9144da281852421757e77515177 | Returns classifier's classification history. | class Classifier:
def get_results(self):
return self.successes | 0 |
71feb4a5f529067293e3c7b5f0132e1a | 1a51bf88cb417ac7c766284a373e5c0d | 添加名值对,以UTF-8编码 | public class QueryStringBuilder
public QueryStringBuilder addParam(String name, String value) {
return addParam(name, value, "UTF-8");
} | 1 |
8dd943cae01d03fe80f183b9f14369b2 | d63d7ec8dc37db5076787f4784bbe57c | Returns: (minimum black edge count, [(eq, [allowed black neighbors])]).
_evars stands for eligible variables, eligible for elimination | def Dulmage_Mendelsohn(g, eqs):
assert_all_in_graph(g, eqs)
assert_no_isolates(g)
assert eqs, 'At least one equation is expected'
assert is_bipartite_node_set(g, eqs)
mate = nx.max_weight_matching(g, maxcardinality=True)
matches = sorted((k,mate[k]) for k in mate if k in eqs)
log('Matches:')... | 0 |
f1fe2e6e892c470611aacc733a536c15 | 6ee6380595b80c99250cd1f02ebd4ce7 | Add an post action to the transition. | class XCScheme
class AbstractSchemeAction
def add_post_action(post_action)
post_actions = @xml_element.elements['PostActions'] || @xml_element.add_element('PostActions')
post_actions.add_element(post_action.xml_element)
end | 1 |
b8e13f3824f025ae525d2faf2f07bf0c | 8d4561fa9bece25afaec4215dccc25f7 | Lines 10-13 | function plugin:new()
plugin.super.new(self, plugin_name)
end | 0 |
690e65020047aeee2bfe1be07bba8d56 | cc60dcea7320ae5d363f52a8ee8dfcec | Removes a registered JNDI object. | resourceName = ObjectName.unquote(resourceName);
NamingResourcesImpl nresources = (NamingResourcesImpl) this.resource;
if (nresources == null) {
return;
}
ContextResource resource = nresources.findResource(resourceName);
if (resource == null) {
thr... | 1 |
7dcd0e288ca7193e98c9aba79913ad1d | 091f6add5f7bb4036207165cac7e09bb | 获取未审核的公司用户列表 | class UserController extends Controller
public function getCompanyUserReview(){
$companyId=$_POST["companyId"];
$userM=new UserModel();
$resault=$userM->order("id desc")->where(array("user_company"=>$companyId,"user_state"=>0))->select();
$this->ajaxReturn($resault);
} | 1 |
48e10d9fd884aea32cf59c298e6072a1 | 20a6477d7f8e0d4452ab7e7782a42a5b | Actualiza un campo de una plantilla de correo | class Usuario_model extends CI_Model
function do_tmp_email($usuarioID, $arrUpdate)
{
$this->db->where('usuarioID', $usuarioID);
$this->db->update($this->tablas['usuario'], $arrUpdate);
return true;
} | 0 |
62b929ad6777711fd95d7a8cf2ed65dc | 3b64d6b71956e888bcdd03074c99c02c | Invoked when the action occurs. Dispatches the dialog box. | namespace WolfyCore.Actions
[ProtoContract] public class DialogAction : WolfyAction
public override void Execute()
{
Target.AddComponent(new DialogComponent("Entity", Content));
} | 1 |
3862d511d15665415f8586779216629c | 73b4a82ad54c44100cc8cfa2bf5262db | Get the local binary pattern for the pixel with 1d index | def create_pascal_label_colormap():
def bit_get(val, idx):
return (val >> idx) & 1 | 0 |
41dd784e1f45f65390bd117c28f16888 | 9c4a8573b610a5008eb6699c4d87f50b | Tim kiem Vat Tu trong Danh Sach theo MaVT | int TimVatTuTheoMa(ListVT listVT, string maVatTu) {
for (int i = 0; i < listVT.n; i++)
if (listVT.list[i]->maVatTu == maVatTu)
return i;
return -1;
} | 1 |
a4c370b3241a5d9b818ba024722d1d8c | db4f0e0a99c63c1842ac76dee9669763 | returns the array of Spots that are NOT reserved | class GameState:
def freeSpots(self):
return(np.nonzero(self.state == 0)) | 1 |
f6d499967ee36cbe941d9f8dfc2f0b67 | 1fe16b807bfbe6540dbf08fc370734d1 | Essa função será invocada automaticamente toda vez que ocorrer um erro | namespace OpenPOS.ECF.Abstract
public abstract class ECFBase : IECF
protected void TrapError(Exception ex, CallbackHandler callback = null)
{
#region fim de papel
if (ex.Message.Equals("fim de papel", StringComparison.InvariantCultureIgnoreCase))
{
if (OnE... | 1 |
1d9ff8adf11fe63555de20c23f849d15 | 26c9d52b1455856a3c870d4b2fc39146 | Returns a lock id based on the given parameters | public function getLockKey($workload); | 1 |
3b8b200a378bd798370da58f47c3511f | 5af534d9d596ae8245699797097ad88c | Проверка на существование нескольких ip адресов в заголовке HTTP_X_FORWARDED_FOR | {
if (!empty($ipList)) {
$list = explode(',', $ipList);
$i = 0;
foreach ($list as $item) {
if (filter_var($item, FILTER_VALIDATE_IP)) {
$i = $i + 1;
}
}
if ($i === count($list)) {
... | 1 |
187313732ed360149a05825cda81b90e | a3b170622aef0641afc74474db969482 | The pathname of a file where Python profile statistics should be saved (a string or :data:`None`). | class MetricWarning(object):
def files_path(self, value):
self._files_path = value | 0 |
84dbc4b387d614a8e5c7022133e5428e | 9e90fb5931f784e1529d380474e1302d | Helper function which calculates the angle of a complex number. | public class Complex extends Number
implements Formattable, Serializable
public static double arg(Complex z)
{
double theta = StrictMath.atan2(z.imag(),z.real());
return theta;
} | 1 |
24e1866b73c82161738ec926c5f2d58e | 3083fb9aab8d281e5a8713fa5ce44d23 | Get the list of templates of a certain type | class Interface:
def listTemplateByType(self, typ):
raise NotImplementedError | 1 |
328560b35013a69f39a95d333a421c90 | 3843332dccd0ad84ebb01ab81c28f083 | for checking whether optimized group process mode is active or not | return ((self.__core.state.scheduling_mode == 0 and
self.__optimizer_configuration in {4, 6, 7}) or
(self.__core.state.scheduling_mode == 1 and
self.__optimizer_configuration in {2, 6, 10})) | 1 |
c17a7a08ca60b86e54a665dc3b540fba | 50ca9281042213bcc3ae14d709147f5f | Returns the value of the '<em><b>Details Saisonniers</b></em>' attribute.
<!-- begin-user-doc -->
<p>
If the meaning of the '<em>Details Saisonniers</em>' attribute isn't clear,
there really should be more of a description here...
</p>
<!-- end-user-doc -->
extendedMetaData="kind='element' name='DetailsSaisonniers'" | String getDetailsSaisonniers(); | 1 |
8ff06cd06b98da31e86a146dd56650a2 | 08f12a7370297ae064d9467a13ef7c14 | 调整Child容器的高度 | public class InspectHealthActivity extends BaseActivity implements
InspectHealthView,
InspectAllAQAdapter.GetItemPosition,
InspectAllJNAdapter.GetJNItemPosition,
CorrelationView
public static void setChildViewHeight(ExpandableListView listView, int groupPosition, Boolean isExpanded) {
... | 1 |
931d6a8c81ab1a894077d13cfb50a833 | d036cd71e2068f98bc28f483b91e8d57 | Creates the toolbar menu according to toolbar_menu file in menu folder | public class MainActivity extends AppCompatActivity
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.toolbar, menu);
return true;
} | 1 |
5c944f0fe6ec6a5430cb9d741bc504b9 | 1725d6cd725dbf4be4d463ae817266ae | Tira mensagem da fila | void exibir_fila(mensagem * fila_mensagens, int num_mensagens)
{
int x, num_exibe = 0;
char msg[30];
num_exibe = num_mensagens;
if (num_exibe > conta_fila(fila_mensagens))
{
num_exibe = conta_fila(fila_mensagens);
}
for (x = 0; x < num_exibe; x++)
{
if (strcmp(fila_mensagens->t... | 1 |
4dadb8d443047087ecc06f2d78c22c8f | 9a528ff12c470828ad873fa3be99117d | 扣除游戏币接口 | $OrderId='IN'.date('YmdHis').trim($u_id);
$upSql="UPDATE `member_wallet_log` SET `TradeNo`='".$OrderId."' where num=".$logID;
$this->CI->webdb->sqlExc($upSql);
$Time=date('YmdHis');
$data=array('method'=>'CreditBalanceDV','Key'=>$this->SecretKey,'Time'=>$Time,'Username'=>trim($u_... | 1 |
e214c0d4f9d0a30b97cc7d98699e3bdb | f010f70ea8d162d752c14c17a06a4aec | Unsets the "ScheduledDay" element | void unsetTimezonestandardday(); | 0 |
c935b63a51aa9a8d25bb72fadf11e0ff | 6bfe365f72cb4834ffcca6ea56225d0c | 用户登录,若成功,设置cookie,存活时间为6小时 | public String doLogin(User user,HttpServletRequest request,HttpServletResponse response) throws Exception{
if(null==user){
Cookie[] cookies = request.getCookies();
String email = null,password = null;
for(Cookie cookie:cookies){
if("email".equals(cookie.getName())){
email = cookie.getValue();
}... | 0 |
729210e8fc47f087f56c220d68590b30 | 79e263e1e777d169257769325e13bd2a | Provide an updated intent object to use in subsequent turns of the dialog. All slot values
and confirmation provided by the updated intent will replace the existing values and
confirmations; if no slot values or confirmations are provided, then they will all be
unset. May be left unset or set to null to indicate that t... | setLocationProperty(new Consumer<LocationTarget2>() {
@Override
public void accept(LocationTarget2 locationTarget2) {
locationTarget2.setIntentOption(intentOption);
}
});
} | 0 |
e51202bb5024c5013cd6f2cfb1ab14df | b0f5d3a0abd381e3bc6413786173da98 | Build installer
Note: this step takes around 5 minutes to be executed. | class BuildCommand extends Command
protected function execute(InputInterface $input, OutputInterface $output)
{
$outputFilename = $this->getRootDir().'/build/installer.php.build';
$finalFilename = sprintf('%s/%s-%s%s',
$this->getRootDir(),
'build/installer',
\Sub... | 1 |
6944146da1f3a6f578864dd2802a94fc | 1d2ae27ef1b0bcd6c970d72ac499dcfb | #双重MD5加翻转字符串 | function dmd5($secret)
{
return md5(md5($secret).md5($secret));
} | 0 |
eedfff8056b1562b7f4e8781bff7fa47 | 9a6fc15f9e16c3b67cdae9e29b1250a8 | Возвращает количество значений для указанного ключа | {
List<vectorObject> c = null;
TryGetValue(key, out c);
if (c == null)
return 0;
return c.Count;
} | 1 |
581271c4cff16a932f31bc230c117307 | 940bc643734f774f58dc0bd14db61f79 | 获得三同张。 | {
if (handPokers == null || handPokers.Count < 7) return null;
for (int i = 0; i < handPokers.Count - 3; ++i)
{
if (handPokers[i].size <= LordSize) continue;
if (handPokers[i].size == handPokers[i + 3].size)
{
... | 0 |
dc0b86f4745023688f44d39a5582f1e0 | ebcafd4a80b0729b60ad408fee72d62a | Adds a connection to a family parent. | class Gedcom
public function addFam(Record\Fam $fam)
{
$this->fam[$fam->getId()] = $fam;
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.