query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
5d2b600e39f92f2061c0f9ffe78e3396 | 5b971d92f27521c41dec50afcd4d4404 | Test for the create ride without origin. | url = reverse('way')
with mock.patch('way.views.Way.create') as way_mock:
way_mock.side_effect = DatabaseError()
response = self.client.post(url, json.dumps(self.data), content_type='application/json')
self.assertEqual(response.status_code, 400) | 0 |
7268f15b5106befcd690bd4612363168 | b4800d563f433d50f6d3ce1a3b105fc9 | Génère une jumpbox. | if "jump_host" in options:
jumphost = options["jump_host"]
else:
jumphost = None
if jumphost:
write(
"{l_corner}{left}{down}{right}{down}{jumpbox}{r_corner}\n".format(
l_corner=options["chars"]["topLeft"][options["style"]],
left=options["ch... | 1 |
4aea6c977a2d91fde29996463118bf9f | a9ce879ecefb6c95fac609ce3f5afd52 | Returns true if column selection is allowed, otherwise false. The default
is false. | public class UTableNode extends JPanel implements InterfaceRefresh, IntrfaceForDragAndDrop, InterfaceComponentSelectRegime, AutoCloseable
public boolean getTableColumnSelectionAllowed() {
return tableNodeMain.getTableColumnSelectionAllowed();
} | 1 |
3d87a5e15210161124480ca0b46ac8e5 | 7f61448ad6da3ef0f9cb03f40c5be655 | This function is intentionally left blank | cases like (1) | 0 |
c94f09ac83d941a1f7bb944e82f6dcac | 5bc99d957b195ab0ec2cd2682879ac26 | @brief Prints the Processor Information to the Serial Output. | void DecoderModule::print() {
} | 0 |
f791203aeac8008652b0b8eaadf5dbbb | a54c2a610f568001e665d97d9b772e19 | Calculate a correlation, with bootstrapped confidence intervals. | aResults = []
for i in range( int( trials ) ):
aTemp1, aTemp2 = funcResample2( aValues1, aValues2 )
aResults.append( func( aTemp1, aTemp2 ) )
actual, bootmean = func( aValues1, aValues2 ), mean( aResults )
if abs( actual - bootmean ) / float( actual ) > 0.05:
print >>sys.stderr, ... | 1 |
a6beee71c7ab8d17fac85f7516288a28 | dd0b79d47eb0da91e99f5bc8a7896f3b | Test whether a note is syncopated. [Not yet functional] | i = notes[arc[0]]
k = notes[arc[-1]]
if i.csd.value > k.csd.value:
passdir = 'falling'
elif i.csd.value < k.csd.value:
passdir = 'rising'
else:
return False
ints = pairwise(arc)
for int in ints:
n1 = notes[int[0]]
n2 = notes[int[1]]
rules1 = [i... | 0 |
d4e7a4b5f8689a6e501c794c7d1ce323 | d3bdfed11457a3b84105724d53ef601a | retorna link da página especificada | $params = array_merge(array('page' => $pagina), $params);
return 'index.php?' . http_build_query($params);
} | 1 |
402ed2552e834bfe7866e81f30566fd5 | a11496cbf98bf5b6ae63df0c7c9ce618 | 判断node1和node2是否为同一个集合 | class UnionFindSet(object):
def in_same_set(self, node_a, node_b):
return self.find_head(node_a) == self.find_head(node_b) | 1 |
31dfe7d544a5001c7e7e9931d5ce2b67 | 853a81c8f179968b772fe589d53a102a | Count the members in a sorted set within the given lexicographical range. | namespace CppRedisClient
size_t RedisClientImpl::zcount(const std::string& key, const int min, const int max)
{
_sendCommandToRedisServer("ZCOUNT", key, min, max);
return _getNumResponse();
} | 0 |
2cb01132d444016c1df58db8ccff5bc5 | e4bee190274181341b8b17a5e256faf3 | inicia la conexion a la base de datos activando las restricciones de foreign keys | database = dbHelper.getWritableDatabase();
if (!database.isReadOnly()) {
database.execSQL("PRAGMA foreign_keys = ON;");
}
} | 1 |
fb28f5fa2f75f8e769543c71b31b7762 | bac9e407bd073cceac72fd7e2873c69a | Converts dict into bytes | data = ""
for key, val in dict.items():
if isinstance(val,dict):
for kkey, vval in iter(val.items()):
if kkey is None:
data += str(key) + NULL + str(vval) + NULL
else:
data += ''.join([str(key), '\x1c', str(kkey), NULL, str(... | 0 |
df1df707239e9b566f1b35d9246e9dbb | cf60919c718cb369ffdc83acd17447a1 | Test case for patch_extensions_v1beta1_namespaced_network_policy | class TestExtensionsV1beta1Api(unittest.TestCase):
def test_patch_namespaced_ingress(self):
pass | 0 |
5300ac41335357512093e142302b5bcd | b59b2f91b995f4cfdc8d4015562b9445 | Gets the URI-snippet without locale. | {
if($this->pathNoLocale === FALSE)
{ $locales = array_keys(Open_Config::getInstance()->get('locales'));
$this->pathNoLocale = preg_replace('#^/('. implode('|', $locales) .')#i', '', $this->path());
}
return $this->pathNoLocale;
} | 1 |
b35f11160def1aeb1d869cd94ff74fc8 | 77b2a9e1207a6873a98321838ff06005 | Opens a new DRM session. A session ID is returned. | SessionId sessionId;
int attmpt = 0;
while (attmpt++ < MAX_OPEN_SESSION_ATTEMPTS) {
auto ret = drmPlugin->openSession(SecurityLevel::DEFAULT, &sessionId);
if(DrmErr(ret) == Status::ERROR_DRM_NOT_PROVISIONED) {
provision();
} else {
EXPECT_OK(ret);
... | 1 |
c75aa62225894099807296d0538f947e | 94744b68414f95c67e72abddd3c24097 | Returns the meta object for class '{@link action_artifact.CreateParticipant <em>Create Participant</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EClass getCreate(); | 0 |
6afcf2b64eb86e4d13ab9ffd1fdced00 | dc66948c6ea46372e76ee41dbfd11281 | 异步获取章列表。 | public class Request
public static void getChapterList(String comicName,JsonCallback callback){
get(CHAPTER).addParams(COMIC_NAME,comicName).build().execute(callback);
} | 1 |
9edeefddb0a04c18e6a895e2d327f515 | 73cdc6f999fe9982fc0e048901ec94b2 | Get received from device data size | LDD_I2C_TSize IntI2cLdd1_MasterGetSentDataNum(LDD_TDeviceData *DeviceDataPtr)
{
return (LDD_I2C_TSize)(((IntI2cLdd1_TDeviceData *)DeviceDataPtr)->OutByteMNum);
} | 0 |
39d8f82fc005796f7e3b038b784422cc | 00e78ee01b99388ec123d91f1ce514be | Sets the ingredients card. | {
var ingredientForm = new FormIngredient(this);
var result = ingredientForm.ShowDialog();
if (result == DialogResult.OK)
_ingredients = ingredientForm.GetIngredients;
} | 0 |
229c14256039a7eb4b35c705329bdd10 | 3de6ce9da3b7e0fa38781309d36e9b46 | Genera un camino desde la posicion actual hasta las coordenadas indicadas. | {
if (camino.Count > 0)
{
Vector2Int vector = camino.Pop();
if (vector!= from&&mapa.getOccupied (vector.y, vector.x)) {
while (camino.Count > 0) {
vector = camino.Pop();
}
Destroy (_cross);
Destroy(line.gameObject);
GameManager.instance.setCurrentU... | 0 |
995bc834f8af3c0585982049ba3d72b5 | 158321869fa1242f6fcdb1b0de4c59f2 | 是否是真人 | public Result forRealPerson(@PathVariable("id") String id) {
Boolean flag = false;
String patientstr = "from Patient where id = ? and status='1'";
Patient patient = this.patientManager.findOne(patientstr, id);
if (patient != null && patient.getPersonId() != null) {
flag = true;
}
return ResultUtils.rend... | 1 |
cb05cd27cf45b8b83f23889bfa4dfa88 | adfaaa87f9451c46e9beebf40dafb497 | 设置每个字的颜色信息 | public class ObjectInfoLookView extends LinearLayout
private void setColors() {
yanseFlow.removeAllViews();
if (TextUtils.isEmpty(bean.getColor())) {
yanseLayout.setVisibility(View.GONE);
return;
} else {
yanseLayout.setVisibility(View.VISIBLE);
}
... | 0 |
ca3982150a05c4eaf4addfa8cf5b9800 | de15a048f79074f41963196f83ebc2ec | Returns HTML representation of the assets collection required to be included at HTML body top position. | class AssetsCollection
public function getHeadAssetsHtml()
{
return $this->getAssetsHtml(AssetInterface::POSITION_HEAD);
} | 1 |
725dea88ec3a71828d167d027b866339 | 9c8b9b88f155f97c3140edef94f1dfef | Change relative paths to absolute one for urls | for (let key in paths) {
paths[key] = upath.normalize(paths[key])
}
} | 0 |
d2e6260d381515de963c76200ca83c5f | c6c97d51c20c013cf0d94d8f282409c3 | 测试:数组作为形参,数组的大小是否要定义 | public class client
private static void test3() {
List<String>[] listArray;
} | 0 |
ba8386780173c45fe8c145dc95d7fa0d | 2c01fca0f77d9fd595d0041057cfc020 | ++++++++++++++++++++++ Remove Outcome Event +++++++++++++++++++++++++ | class outcomeController extends Controller
public function destroy($id)
{
Outcome::find($id)->delete();
return redirect('outcome');
} | 1 |
d95e5de25a3b0e03a6377cc82f7c1668 | 659cd24671ae4fbcdc6a40962fec3072 | In this implementation it returns always null as we don't have any output table.
{@inheritDoc} | public class ZipExporter implements Exporter
@Override
public void writeTableHeader(final ExportTableHeader exportTableHeader) throws IOException, SQLException {
} | 0 |
b9f2fc51d50ae586831d77bc3470da33 | 649fc0410f9351839b7f1d3d993e816d | Совпадает ли *примерно* точка с другой? — для использования в тестах | namespace GadzhiMicrostation.Models.Implementations.Coordinates
public static bool CompareCoordinate(double first, double second) => Math.Abs(first - second) < TOLERANCE; | 1 |
29265d00468265471f3b96a3f5e2efbd | ae926e2b7b062c42d75e1421b010e430 | Mutates polygon by swapping two verices. | {
if (indexOne == indexTwo)
return;
var tempVertexA = _verticesA[indexOne];
var tempVertexB = _verticesB[indexOne];
var tempEdgeDistance = _edgeWeights[indexOne];
_verticesA[indexOne] = _verticesA[indexTwo];
_verticesB[indexOne] = _verticesB[indexTwo];
_edgeWeights[indexOne] = _edgeWeights[in... | 1 |
b6a829ff68f9f1ad18f0dba9e311461b | d6c6288e4723cd12bfe3a098e9940c2f | Computes Fresnel reflectance for conducting materials | namespace Impact namespace RayImpact
imp_float fresnelReflectance(imp_float cos_incident_angle,
imp_float refractive_index_outside,
imp_float refractive_index_inside)
{
cos_incident_angle = clamp(cos_incident_angle, -1.0f, 1.0f);
imp_float refractive_ind... | 0 |
22e8427bdd62c4819c5184328f192244 | 1f9b6de05074b61d76eaca045af75659 | Check forwarding of request to absent destination | request = self.req_factory.request(HTTP_HOST="www.cantfindme.com")
match = self.test.test(request)
assert match is None | 1 |
481b4513764f5acd0116719c1e064489 | 8db50ded458cfbe9ee5914b85e16e253 | Is executed once all of the assets have loaded and the game is ready to be 'created'. | function onPreloadComplete()
{
trace("Application ready");
ssAvatar = new createjs.SpriteSheet({
images: [loadQueue.getResult("ssAvatar")],
frames: {width: 30, height: 68, regX: 15, regY: 66},
animations: {
avatarE: [0, 19, "avatarE"],
avatarN: [20, 38,... | 1 |
6e5f108d98fe5ebf1a35616afb379b80 | 02e3e7fffd7db82f41669654cad809d5 | Get Count All Lead Calls by DidPhone[], StartDateTime, EndDateTime | public class CallModel2
public int getCount(Set<String> phoneNos, Date startTime, Date endTime, int type){
return getCount(phoneNos,startTime,endTime,type,true);
} | 1 |
eb65f253320b35bd67a84039f6c462c2 | ac08679b9fac566f02cd12167ed1f1a5 | GetProductAction constructor. | \Magento\Framework\App\Action\Context $context,
\Magento\Framework\View\Result\PageFactory $resultPageFactory,
\Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory,
\Magento\Catalog\Model\Product $catalogProduct,
\Skybox\Checkout\Block\Product\AfterPrice $afterPric... | 1 |
7c394f876a60db7bcc29ab47d565ed23 | a36de8e05c190bf1c0600e52fcfed902 | For testing: Performs operation on two randomly generated numbers of specified sizes | double[][] a = generateRandomMatrix(MATRIX_SIZE, MATRIX_SIZE);
double[][] b = generateRandomMatrix(MATRIX_SIZE, MATRIX_SIZE);
sequentialMultiplyMatrix(a, b);
parallelMultiplyMatrix(a, b);
} | 1 |
364574a0987b6dd18abab20c8eae9631 | c3d180fc428ebdbbf12293e7aee21312 | Synchronously creates a <see cref="ComplianceClient"/> using the default credentials, endpoint and settings.
To specify custom credentials or other settings, use <see cref="ComplianceClientBuilder"/>. | namespace Google.Cloud.Talent.V4Beta1
public abstract partial class ApplicationServiceClient
public static stt::Task<ApplicationServiceClient> CreateAsync(st::CancellationToken cancellationToken = default) =>
new ApplicationServiceClientBuilder().BuildAsync(cancellationToken); | 0 |
85fa81319c0477337a0dca9b43a73e7e | 5e5c2f954c3937abb9a0c68dfa52b986 | 新建PGSQL命令; | namespace X3Platform.Connect.DAL.IBatis
[DataObject]
public class ConnectAccessTokenProvider : IConnectAccessTokenProvider
public GenericSqlCommand CreateGenericSqlCommand()
{
return this.ibatisMapper.CreateGenericSqlCommand();
} | 0 |
5fe733d0af961ceaaf5a3c2766f4c856 | 83c7aff46227a303f0a315d47fee122c | Obtain the percent energy data for a sessionId | public ConsumptionTimesAndAmount getConsumforService(String sessionId) throws Exception; | 0 |
03b50e0616b0d5aa3310f41b35cd74d2 | 1e200fff194748242b73d7c4c2bc604d | 產生會計憑證 | namespace AccountingServer.Shell.Plugins.Utilities
internal class Utilities : PluginBase
private static Voucher MakeVoucher(Voucher template, double num, DateTime? time)
{
var lst =
template.Details
.Select(
d =>
... | 1 |
7e2554ef2b0570ddcad41fbd5f67747b | 1fcc60f83f151fb8828633c65e9ce9be | Create a new Ethereum account (aka. wallet). | class API
createWallet() {
let wallet = web3.eth.accounts.create();
return wallet;
} | 1 |
1b4f51a5a953b307c54327cb3c25301b | 8365f4dbf7cc46a1da3512de3e8e81ba | Add bone node to our bone nodes array | {
int end = AddBoneIndex(node.ID);
if (end != -1)
bones.Add(node);
return end;
} | 1 |
9293488cab2a36a7c2c812e2bf428c70 | 659a6086a95d3674a1b1014086112a6b | 返回距离当天之前最近的一个交易日的日期. 如果当天是交易日,则返回当天 | if '-' in date:
date = rmDateDash(date)
tradeCal = self.getTradeCal()
preDays = tradeCal[tradeCal < int(date)]
if len(preDays) == 0:
return date
try:
pre = str(preDays[-nDays])
except IndexError:
pre = str(preDays[0])
... | 0 |
2a23c2e214190d305b36b6049084726e | a731b6f7594a5af6db77f21945f8c604 | SQLの実行計画を記録する際の閾値を更新する | switch (type){
case SELECT:
case JOIN:
timeOptimization = 0.1;
break;
case UPDATE:
case DDL:
timeOptimization = 0.25;
break;
}
} | 0 |
0d84179b169ec65db7c5d4c7b3d58f08 | 4c58f2c3ba1dd5784077811da4f3c404 | Mock function gettimeofday | int mygettimeofday(const struct timeval *tv, const struct timezone *tz)
{
struct timeval timev;
if (tv != NULL)
{
if(read_memory_byte( CUSTOM_TRACEE_DESCRIPTOR->trace_PID , (void*)tv, (void*)&timev, sizeof(struct timeval)) == 0)
{
timev.tv_sec=STATIC_DATE_SECS;
write_memory_byte( CUSTOM_TRACEE_DESCRIPTO... | 1 |
4dcfa6b245870d7a0f0da040d4c7ed59 | 93d9dccb8106511aac17c2d198ce0ea7 | It Verifies the following things a) name has to be specified in named
query array b) QueryString of named query can not be overriden by XML c)
ResultType of named query can not be overriden by XML d) EjbInterfaceType
of named query can not be overriden by XML | abstract public class QueryContextImpl implements QueryContext
abstract public boolean isRemoteInterfaceOfEjb(Object typeInfo, String ejbName); | 0 |
3941f72c52818b0ea1746a29e0e8e09b | affb6bd7d51ae4ef88426941f3c269c2 | Retorna a lista com todos os cursos livres cadastrados | $query = $this->system->sql->select('*', 'cursos_aulas', "excluido=0" . $sql, '', 'aula_id ASC');
return $this->system->sql->fetchrowset($query);
} | 0 |
615f4cc966b0ad8651cbde3749e266ae | edf12058105bc4c482748f43526b0a93 | Loads the product reviews of the shop system's database and passes them to the buffer.
Use ShopgatePlugin::buildDefaultReviewRow() to get the correct indices for the field names in a Shopgate reviews
csv and use ShopgatePlugin::addReviewRow() to add it to the output buffer. | $generate_type = 'reviews';
$product_array = Datasets\fetch_site_content( 'product' );
if ( empty( $product_array ) ) {
Helpers\get_action_redirect( array( Core\QUERY_BASE . 'error' => 'no_available_products', Core\QUERY_BASE . 'type' => $generate_type ) );
}
$generate_count = ! empty( $count ) && absint( $cou... | 0 |
03281875082179bd24e0037347342fef | 2b6c29d24791b79b831a8462c2f02838 | ==========删除所有已建渲染层=============================================== | if ( ( (SurfaceRender) renderBase ).getObjZYPlaneBG().isLive() ) {
( (SurfaceRender) renderBase ).getObjZYPlaneBG().detach();
}
if ( ( (SurfaceRender) renderBase ).getObjXZPlaneBG().isLive() ) {
( (SurfaceRender) renderBase ).getObjXZPlaneBG().detach();
}
... | 1 |
76d8a2a0bddd7686e6a8a8139372cf87 | 853c527bdb28bd5a4d95933e7f15b65c | Extracts diagonal from matrix or transforms array to square matrix. | {
int n = a.ndim;
npy_intp[] newaxes = new npy_intp[n];
if (n < 2)
{
throw new ArgumentException("array.ndim must be >= 2");
}
if (axis1 < 0)
{
axis1 += n;
}
if (axis2 < 0)... | 1 |
dc8ff6684fac49d5e4873ccba7dc94bb | 763740d6340f72ba9d3808628d4b90db | Returns a file-like object with a read() method,
from the given file path or string. | class DocumentParser(object):
def _open(self, path):
if isinstance(path, basestring) and os.path.exists(path):
return open(path, "rb")
if hasattr(path, "read"):
return path
return StringIO.StringIO(path) | 1 |
cc12a73bc7815c0db8ef1c952fc7b956 | 2caa449067aa910890263d43bb81b682 | Quicksort Randomizado | {
srand(time(NULL));
int i, j, pivo;
unsigned long int aux;
unsigned long int *v = (unsigned long int*) malloc(sizeof(unsigned long int)*3);
v[0]= (esq + rand()%((dir+1)-esq));
v[1]= (esq + rand()%((dir+1)-esq));
v[2]= (esq + rand()%((dir+1)-esq));
for(i = 1; i < 3; i++)
{
j = i;
while(j > 0 && v[j-1] >... | 0 |
029ced66f50796ce2d843a380c47ca66 | 1a6e594771c33bc98047224143128de0 | This appends a collection of ValidationResults to the Errors collection | namespace OpenRiaServices.Client
internal abstract class ValidationResultCollection : ICollection<ValidationResult>, IReadOnlyCollection<ValidationResult>
internal void ReplaceErrors(IEnumerable<ValidationResult> newResults)
{
if (this.Count > 0 || newResults.Any())
{
... | 0 |
6cc1bc8182c515fd14fc34dced44b395 | d7a027d6c644edc1ebead4fde290070b | Configuración PIC | void config_PIC(void)
{
set_tris_a(0xFF);
set_tris_c(0x93);
output_high(CSneg);
setup_spi(SPI_MASTER|SPI_H_TO_L|SPI_CLK_DIV_4|SPI_SAMPLE_AT_END);
} | 1 |
d925535ec59e4a60b1e22c9c88824c95 | ac52c92d80adf6378a9636ecc57c54cb | Create a StoredSequence from its ID. | namespace Silverback.Messaging.Sequences
public abstract class SequenceReaderBase : ISequenceReader
protected virtual Task<ISequence?> GetExistingSequenceAsync(
ConsumerPipelineContext context,
string sequenceId)
{
Check.NotNull(context, nameof(context));
retu... | 0 |
a9718812197550627a728360b2797776 | 7b234c548e25d98a90413a2b4678861d | Lists all Correo entities. | class CorreoController extends Controller
public function index()
{
$correos = Correo::with('empresa')->orderBy('id', 'desc')->get();
$empresas = Empresa::orderBy('id')->pluck('nombre', 'id')->toArray();
return view('admin.correo.index', compact('correos', 'empresas'));
... | 1 |
aa2fccd9a9440f6d3eb1366e37666053 | 44fb9c843e136d2373f513b6767adcaf | Show users cart with completely localized info about each item | {
global $db, $domain;
if(!$order_id) $order_id = self::getOrderId();
$user_id = Auth::check();
$stmt_pu = $db->prepare("SELECT u.price_type_id, t.name FROM com_shop_price_user u JOIN com_shop_price_type t ON t.id = u.price_type_id WHERE user_id = :user_id LIMIT 1");
$stmt_pu->execute(array('user_id' => $us... | 1 |
7fc8fb045eefb202814724fc84d08d72 | 5d69b90455f16783a68ce78e177cd5a1 | Shows a dialog about chatroom change. | public class ChatActivity extends AppCompatActivity
public void changeChannel(View view){
LayoutInflater li = LayoutInflater.from(this);
View promptsView = li.inflate(R.layout.channel_change, null);
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
alertDialogBuilde... | 1 |
98520bdaae9770299cbfd9ca8a1c355c | 9fdbc35eafcfa840722cd494089abefe | Metoda, dodaje podany model jachtu do bazy danych. | class VehicleModel extends \core\BaseModel
public function addVehicle(VehicleDTO $dto)
{
$query = "INSERT INTO Pojazd (przebieg, stan_techniczny, nr_rejestracyjny, rodzaj_paliwa, waga, liczba_osob, wysokosc, szerokosc, marka, rok_produkcji)
VALUES (:przebieg, :stan_techniczny, :nr_rejestra... | 0 |
84926f07b5400b138ec77ed41bb4124f | 3cfd049f8dd1f3c6ffad909e6dd42de5 | Utilizes the boto3 library to register a task definition
with AWS. | export class RegisterTaskDefinitionCommand extends $Command<
RegisterTaskDefinitionCommandInput,
RegisterTaskDefinitionCommandOutput,
ECSClientResolvedConfig
>
constructor(readonly input: RegisterTaskDefinitionCommandInput) {
super();
} | 0 |
1369ab9457b67343f157b07eeb3b9980 | bae859e7d0ecec10c9e137327ca8ec44 | Obsługa zdarzenia wciśnięcia klawisza podczas edycji pola tekstowego na miejscowość. | namespace MedicalCenter.GUI.Registrar
public class PatientDetailsPresenter
public void CityChanged()
{
if (editMode)
{
bool change = false;
foreach (char c in view.City.Text)
{
if (!char.IsDigit(c) && !char.IsLetter(... | 0 |
1bc2aaa05d817b1d4d28a23a5a0ff3fe | 6061867b03e172b341a0a2ac226e76fb | Symmetric difference of a series.
Forward and backward difference used for endpoints.
... notation makes it work with 1d time series, or a stack of time series. | def BoundToDiff(a,dim=-1):
from numpy import diff
return diff(zf, axis = dim) | 0 |
10c72c57232bbd21f3cd257547e008ca | b2bb51eacf109d7f4b21299fd1433e48 | Negative log-liklihood average across predicted tokens. Lower values are better. | log_pred_samples = y_pred
ll_samples = torch.stack([-self.cross_entropy(logit, y) for logit in log_pred_samples])
return torch.sum(torch.mean(ll_samples, dim=0), dim=0) | 1 |
5e0078a95806238e6956032c74072179 | f7a229e549c13d7e784b100560690a4d | 查询所有有效商品列表 | @PostMapping("/list")
@ResponseBody
public TableDataInfo list(Goods goods)
{
startPage();
goods.setStatus(Constants.STATUS_ACTIVE);
List<Goods> list = goodsService.selectGoodsList(goods);
return getDataTable(list);
} | 1 |
aa61e238181bd55bedc976534a0aded1 | 1989206e062461b72bfa4d1083826d14 | Calculates all Coordinates between two places on the board. Works for both diagonal and horizontal movements.
Includes endpoint. | class newScore(object):
def calc_all_coordinates(self, y_coordinate, x_coordinate, house):
return {"y1": y_coordinate, "x1": x_coordinate, "y2": y_coordinate + house.length, "x2": x_coordinate + house.width} | 0 |
dcea5e0c83f6d25dd5de55727bcadbcd | f3f0e1550991edf6034f73af570986bd | 클립 저장 테스트 | class ClipDaoTest extends AbstractDaoTest
public function editClipTest()
{
$clip = $this->clipDao->getClip(self::FIRST_ID);
$clip->setName('first clip is edited');
$this->assertTrue($this->clipDao->saveClip($clip));
$this->assertEquals(self::FIRST_ID, $clip->getId());
$clipFr... | 1 |
1a00b54e3ef70fe6ca74380f7fe4284c | a95de7f548ca1677651f367be6a60d30 | Adds the proper classes for positioning the docs to the side or below | export class PopoverDirective implements AfterViewInit, OnDestroy
private getPositionClass(fallback?: boolean): string[] {
if (fallback) {
if (/^left/.test(this._fallbackPosition)) {
this._fallbackPosition = this._fallbackPosition.replace('left', 'right') as PopoverPosition;
} else if (/^right/.... | 1 |
623f0444632c0f08deca22b56ee34b59 | 52bc9b281b055245ba6f31163f790f47 | Set the interaction mode like upgrade mode, special attack mode. | public class Lily4 extends TajimaLabAI
public void setMode(int mode) {
this.mode = mode;
this.modeChange(mode);
} | 1 |
e09e4c1e21459006f3fbb00e66789fe0 | c86903fda3a9e06a3ed305e7efbc1b0e | Método que lista Computadores na rede que não possuem aplicação | class SoftwareRepository extends EntityRepository
public function listarNaoUsados()
{
$qb = $this->createQueryBuilder('sw')
->select('sw.nmSoftware, sw.idSoftware')
->leftJoin( 'sw.estacoes ','se')
->where('se is null')
->groupBy('sw.nmSoftware,sw.idSoftware')... | 0 |
fdf4a48d06663ba0583d551098d737aa | 86d8f7b85c1bc6c519372ae4f7dc2081 | <summary>Destroys present value factors array.</summary> | static void ResamplerClear(ResamplerT *rs)
{
DestroyArray(rs->mF);
rs->mF = NULL;
} | 1 |
8fe39063ff777f1846776b0854bf5578 | e546a2d7154d6c71c52828dc59ba87a5 | Creates or updates an analytic export service using the supplied export definition. | {
using (var _result = await operations.BeginExportWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
} | 0 |
2419f18b00e5fb089e44b11f8485255a | 2049e68c3307ee69dd76695882b05f84 | Gets rider 2 position 2 coefficient. | public class Event
public double getRider2Position2Coefficient() {
return rider2Position2Coefficient;
} | 1 |
95ef58a383282e13778d1b13f9a4c43c | 1c14e15bd926d0d17e8ef1104401944c | Calculates the determinant of a mat2d
Returns determinant of a | public class Matrix2f extends Matrix2
@Override
public double determinant() {
return matrix[0][0] * matrix[1][1] - matrix[0][1] * matrix[1][0];
} | 1 |
c8e6187f90be3068bac84632c2ea408f | 92de1b9e62f8eaca52551c2d05b8cb94 | This method Updates Knee Questionnaire information against the Contact Matter. | namespace ProductDefectsFedExTracking.Controller
public class FedexTrackingController : ControllerBase
public bool UpdateContactMatterfedExTracking(ContactMatterDto contactMatterDto)
{
ContactMatterServiceClient contactMatterServiceClient = new ContactMatterServiceClient();
contactMa... | 0 |
7937951b68491fe9803fcdee4d411b91 | 0531296c08440da3cdac8c046335da4c | Elimina dall'SPGM per la singola commodity gli archi secondo
la Proposizione 6. | Arc arc;
Iterator<Arc> arcsFrom = connectFrom.iterator();
while(arcsFrom.hasNext()) {
arc = arcsFrom.next();
arc.fromPetri.removeToArc(arc);
arcsFrom.remove();
arc.delete();
}
Iterator<Arc> arcsTo = connectTo.iterator();
while(arcsTo.hasNext()) {
arc = arcsTo.next();
arc.toPetri.re... | 1 |
8baac6371d51129465918ee7c96793c9 | cc7bbe9dfd2bd3bd10ff5fa096ca0f9b | Cleanup inconsistent song lyrics file names. | folder_path = os.path.join(Path(__file__).parents[1], 'dataset', 'raw')
unicode_clean_up(os.path.join(folder_path, 'twitter-2013train-A.txt'),
os.path.join(folder_path, 'twitter-2013train-A.txt-fixed'))
unicode_clean_up(os.path.join(folder_path, 'twitter-2013dev-A.txt'),
... | 0 |
6ee3f4da68cb7e9a5e4e61488a994e54 | 7ce8308d2425d9ea2aef761be00e5f6e | 获取总成交量 | public long getTotInVolume(); | 1 |
9eac10d199fb8b85f5f2606d096675da | 7b4e53c705244dcf434223383bf4cde8 | Setting the parameters for the boosted estimator
Valid parameter keys can be listed with get_params(). | class BaseCATEEstimatorWrapper:
def set_params(self, params):
pass | 1 |
08ec8c457d53d78e16c2b314cecfd8c9 | 79394e72c0aa29a1afd7d33fecf90d9c | Using bits to store the occurrence of a character | occurrences = {}
for character in lowlet:
if character in occurrences:
occurrences[character] += 1
else:
occurrences[character] = 0
return occurrences | 0 |
0c54b21f4eec9fb40ba4bc7e5a041d51 | 83a8af3f1873a9824f71e2f8c5367bf7 | 根据角色ID、菜单ID,获取 SYS_Role_Menu对象集合 | public Object getRoleIdAndMenuId(String roleId,String menuId) {
String errorTip = ValidationHelper.build()
.addGroup(GroupBuilder.build(roleId).notEmpty().maxLength(32), "角色ID必须提供且长度最大32位")
.addGroup(GroupBuilder.build(menuId).notEmpty().maxLength(32), "菜单ID必须提供且最大长度32位")
.validate();
if (StringUtils.i... | 1 |
a39601e9f441d6934189ef0b77677667 | 194cc5301aff61b2be4e82c68a28ac50 | Select all GameObjects within the screen space rectangle. | {
var ray1 = Camera.main.ScreenPointToRay(Input.mousePosition);
var ray = new Ray(ray1.origin, ray1.direction * 100000);
return Physics.RaycastAll(ray).Select(x => x.collider.gameObject);
} | 0 |
757b5be82c0feea83fcd1a13bc5bcf4a | 9cb7c26f51fef5f63c377c896b1d5907 | 判断指定 <see cref="long"/> 是否是 <c>2</c> 的幂。 | public static class Algebra
public static bool IsTwoPow(in byte value) => value.BitCount() == 1; | 0 |
688f0be9c6f6850df860cc4f957302a3 | d0fbb8726087b44ad623f7ee0bd27721 | Gets the value of the refs property. | @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ActorObjectType")
@XmlSeeAlso({
PartnerCoreRepType.class,
IntermediaryCoreRepType.class,
SupplierCoreRepType.class,
SellerCoreRepType.class
})
public class ActorObjectType
public String getRefs() {
return refs;
} | 1 |
6e4a7a2d0092f6d00f8a7de0f3eb65ec | 017f2453276d2064e75a5f9645015a48 | 파티참여인원의 수를 반환해준다. | public class Depute implements Serializable{
public int getNumParti(){
return this.numParti;
} | 0 |
ee9d2e73d2d096cf66dfd1bc23872c84 | 211288a9b56d5384925e23a40df57c77 | Returns the absolute value of a <see cref="System.Int32"/>. | public static class IntExtensions
[DST]
public static int GetAbs(this int x) => Math.Abs(x); | 1 |
bacaa358edb00d51f1edb7640a5f14c5 | 0397d9bd6b1f8f05c10b38ef5f37b254 | getArgs gets command-line arguments. | getargs(int argc, char* argv[])
{
ArgParse ap;
ap.intro("ustring_test\n" OIIO_INTRO_STRING)
.usage("ustring_test [options]");
ap.arg("-v", &verbose)
.help("Verbose mode");
ap.arg("--threads %d", &numthreads)
.help(Strutil::sprintf("Number of threads (default: %d)", numthreads));
ap... | 1 |
169e5628777e6a76855465623f925fa0 | 8d4bb080e425a783dfe491c2c7b39646 | 获取量房的信息 | class Api extends Api_Controller
public function quan_get()
{
$this->load->model('page/detail_model');
$res = $this->detail_model->get_quan_info($this->get());
$this->response($res);
} | 1 |
af29a6b403a4b99d28567dcc691573f4 | 0a44ac51c41bf961a8f8a50e8791e535 | 按照本地时间设置年份值,并以毫秒为单位返回新时间。 Date | public class DateUtil
public static long getMillisecond_year(String date, Integer year){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String newDate = "";
if ("".equals(date)) {
newDate = sdf.format(DateUtil.getDate());
} else {
newDate = getDateTime(Long.parseLong(date));
}
... | 1 |
18129cdd5569131881cee3015d9a1912 | 3769bdd0ff9f8f05647af9e99e16d2bd | Number of databytes and pointer bytes written in this file. | public function writtenLen(): int; | 0 |
7ae38eeed88de67b9287aaa6c840833c | dbc45a7a0d4d4359f9a0dcd302ed505f | u'''フロント用:ログイン顧客IDを取得 | def get_login_user_id():
return request.session.get('uid', 0) | 1 |
99fba56a07695f6ee010877bb066d16e | 6708b3aea13c801c7622ee30524b920e | a receive with a timer to wait looping through recv and buffering the received data | infds,outfds,errfds = select.select([sock.s],[],[sock.s],0.05)
if len(infds):
sock.recvfromdata()
if len(errfds):
print("\rProblem occurred;exiting.")
sys.exit(0)
root.after(1000,recvdata) | 1 |
736427910cb325f3c9230d45045c00fd | c5e0b638ee781eadca0a3df45524eb75 | Список доноров. | donor_list = []
with driver.session() as session:
cyph = """MATCH (p:Donor)
RETURN p.donor_name as donor
"""
result = session.run(cyph)
for record in result:
donor_list.append(record['donor'])
return donor_list | 1 |
c92edb66ba5d5e85a533f20a1c3e697a | f34b2bb4844edc35eea1efbaa3ecac7f | 将Excel转换为PDF | class DocConverter
public function ExceltPdf($srcfilename,$destfilename = '') {
if($destfilename == '') $destfilename = __DIR__ . '\EXcelConverter.pdf';
$srcfilename = str_replace('/', DIRECTORY_SEPARATOR , $srcfilename);
try {
if(!file_exists($srcfilename)){
echo $sr... | 1 |
b010f605f49fb71e0ae564037639581f | 5cf45d645bc073aea4760e7546863321 | Creates a Dynamic Link from the parameters. | namespace RestHelpers.Services
public class LinkService<TResourceParameters> : ILinkService<TResourceParameters>
where TResourceParameters : BaseResourceParametersFormultipleReturns
public LinkDto CreateLink(string routeName, string rel, HttpMethod method)
{
return CreateLink(routeName, ... | 1 |
311d6e4741a6381ee134c99b98d02490 | cc6e0a6099aebc7f49f6b7bffade5702 | Insert the whole object in the Cassandra database
The object is serialized and inserted as a Byte array in the database | public void addToDatabase(); | 0 |
347033ba75a833227ea9ee2ab05922e2 | e6ef8601938dc94d51236f81531c09a2 | https://stackoverflow.com/a/5865594/9295513 | var textArea = document.createElement("textarea");
textArea.style.position = 'fixed';
textArea.style.top = 0;
textArea.style.left = 0;
textArea.style.width = '2em';
textArea.style.height = '2em';
textArea.style.padding = 0;
textArea.style.border = 'none';
... | 1 |
ef246c792e2f2837a59a7c655924e793 | 4efd642095d2123dadb2a6f55772845d | criando as imagens que compõe o email | function create_image($name, $sert, $text, $name_pos, $filename){
$image = imagecreatetruecolor(800, 600);
$backColor = imagecolorallocate($image, 255, 255, 255);
$textColor = imagecolorallocate($image, 134, 87, 59);
$fontFile = './font/arial.ttf';
$imgBox = imagecreatefrompng('./img/sert.png');
... | 1 |
3a3fecd46aa614eac82ac6253d3fd719 | 12d8c55915412e7b05af180d722971be | 'Mr. Karate' becomes 'mr_karate' | def make_klass( name )
klass = name.gsub(/(?:^|_)([a-z])/) { $1.upcase }
klass
end | 0 |
63221deba6247c708382e3b95eb3d924 | 6c80e6b72bd620be36a987a2e82558fd | This function calculates the sha1 hexdigest for a given file | try:
blocksize = 65536
hasher = hashlib.sha1()
file_in = self.expand_path(file_in)
with open(file_in, 'rb') as f:
buf = f.read(blocksize)
while len(buf) > 0:
hasher.update(buf)
buf = f.read(bl... | 1 |
c397dfcd68976a82539ec6fa9b5fc3f9 | f4dfc7b48f40a8f1229a0d1740094781 | MessageBox是与各按钮绑定的消息提示框函数,当Dialog中没有加载图片时,
会弹出提示框,否则会正确地开始图像处理 | {
CRect Rect;
(this->GetDlgItem(IDC_PIC))->GetClientRect(&Rect);
GetDC()->FillSolidRect(&Rect, RGB(240, 240, 240));
int len = WideCharToMultiByte(CP_ACP, 0, m_file_path, -1, NULL, 0, NULL, NULL);
char *pfilePath = new char[len + 1];
WideCharToMultiByte(CP_ACP, 0,m_file_path , -1, pfilePath, len, NULL, NULL);
I... | 0 |
be36259613adbcd7383b437fe029eb13 | b087c35788ec075ccc1d191139d0c448 | Показать диалог выдачи прав на вложения. | thread = threading.Thread(target=attachment.dialog_attachment_thread,
kwargs={"base_url": base_url, "data": payload})
thread.start()
return make_response("", 200) | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.