seed stringlengths 1 14k | source stringclasses 2
values |
|---|---|
}
public static T GetWindow<T>(string title, bool isUtility) where T : UnityEditor.EditorWindow
{
var window = UnityEditor.EditorWindow.GetWindow<T>(isUtility, title);
Container.Injector.Inject(window);
return window;
}
public static void FindAndBootstrap()
{
foreach(var assembly in AppDomain.CurrentDomain.GetAssemblies())
| ise-uiuc/Magicoder-OSS-Instruct-75K |
from .order import Order
from .user import User
| ise-uiuc/Magicoder-OSS-Instruct-75K |
maior=0
menor=0
for i in range(0,7):
x=int(input('Digite o ano de nascimento: '))
if atual-x>18:
maior+=1
else:
menor+=1
print('Há {} maiores de idade'.format(maior))
print('Há {} menores de idade'.format(menor)) | ise-uiuc/Magicoder-OSS-Instruct-75K |
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
| ise-uiuc/Magicoder-OSS-Instruct-75K |
#y = np.array([1])
#TOOLS = 'pan,box_zoom,wheel_zoom,box_select,crosshair,resize,reset,save,hover'
#ampPlot = figure(plot_width=600, plot_height=800, tools=TOOLS, x_range=Range1d(0, 140))
#ampPlot.legend.location = "top_left"
#ampPlot.legend.click_policy = "hide"
#ampPlot.xaxis[0].axis_label="dB"
#ampPlot.yaxis[0].axis_label = "Bin"
#ampB0 = ampPlot.line(x=x, y=y, line_width=2, alpha=.85, color='red', legend="B0")
#ampB1 = ampPlot.line(x=x, y=y, line_width=2, alpha=.85, color='green', legend="B1")
#ampB2 = ampPlot.line(x=x, y=y, line_width=2, alpha=.85, color='blue', legend="B2")
#ampB3 = ampPlot.line(x=x, y=y, line_width=2, alpha=.85, color='orange', legend="B3")
| ise-uiuc/Magicoder-OSS-Instruct-75K |
class Rccl(CMakePackage):
"""RCCL (pronounced "Rickle") is a stand-alone library of standard collective communication routines for GPUs, implementing all-reduce, all-gather, reduce, broadcast, and reduce-scatter."""
| ise-uiuc/Magicoder-OSS-Instruct-75K |
from sqlalchemy import DateTime, Column, String
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.orm import relationship, validates
| ise-uiuc/Magicoder-OSS-Instruct-75K |
use crazyradio::{Channel, Crazyradio, Datarate};
use std::str;
fn main() -> Result<(), crazyradio::Error> {
let mut cr = Crazyradio::open_first()?;
| ise-uiuc/Magicoder-OSS-Instruct-75K |
Mat4 Camera::lookAt()const{
Vec3 up = Vec3(0.0,1.0,0.0);
Mat4 rot = Mat4::lookAt(*(this->getPosition()), *(this->target),up);
return rot;
}
} | ise-uiuc/Magicoder-OSS-Instruct-75K |
* Copyright (c) 2010-2021, <NAME> <<EMAIL>>
* This file is part of Styx <https://www.github.com/Vanaheimr/Styx>
*
* Licensed under the Apache License, Version 2.0 (the "License");
| ise-uiuc/Magicoder-OSS-Instruct-75K |
def make_alignment_gif(log_dir):
save_dir = log_dir.split(os.sep)[-2] + '-alignmets'
gif_fp = os.path.join(save_dir, 'alignments.gif')
os.makedirs(save_dir, exist_ok=True)
plot_alignment(log_dir, save_dir)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
// static field const value: static public Microsoft.Win32.RegistryHive DynData
static constexpr const int DynData = -2147483642;
// Get static field: static public Microsoft.Win32.RegistryHive DynData
static Microsoft::Win32::RegistryHive _get_DynData();
// Set static field: static public Microsoft.Win32.RegistryHive DynData
static void _set_DynData(Microsoft::Win32::RegistryHive value);
// static field const value: static public Microsoft.Win32.RegistryHive LocalMachine
| ise-uiuc/Magicoder-OSS-Instruct-75K |
/// <param name="lastName">Last name of the user.</param>
/// <param name="title">Title of the user.</param>
/// <param name="officePhone">Office phone number of the user.</param>
/// <param name="mobilePhone">Mobile phone number of the user.</param>
/// <param name="language">Language of the user. For example: 'en_US' for English (US).</param>
/// <param name="timezoneId">ID of the timezone of the user. UTC (id 542) is the default value.</param>
/// <param name="clientId">ID of the client.</param>
/// <param name="cancellationToken">The cancellation token.</param>
| ise-uiuc/Magicoder-OSS-Instruct-75K |
Vector<double> Gn = solvePositiveDefinite(Lff, rhs);
// Cs = Ks + Gn^T Kn
coneAngles[iC] += Gn.dot(omegaFlat);
}
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
operations = [
migrations.DeleteModel(
name='River',
),
]
| ise-uiuc/Magicoder-OSS-Instruct-75K |
setup(
name='RL-EmsPy',
version='0.0.1',
packages=['emspy'],
url='https://github.com/mechyai/RL-EmsPy',
license='Apache License 2.0',
author='<NAME>',
)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
DOTNET_SCRIPT="$SCRIPT_DIR/build/dotnet-script"
if [ ! -d "$DOTNET_SCRIPT" ]; then
currentVersion=$(curl https://api.github.com/repos/filipw/dotnet-script/releases/latest?access_token=<KEY> | grep -Eo "\"tag_name\":\s*\"(.*)\"" | cut -d'"' -f4)
echo "Downloading dotnet-script version $currentVersion..."
curl -L https://github.com/filipw/dotnet-script/releases/download/$currentVersion/dotnet-script.$currentVersion.zip > "$SCRIPT_DIR/build/dotnet-script.zip"
unzip -o "$SCRIPT_DIR/build/dotnet-script.zip" -d "$SCRIPT_DIR/build/"
if [ $? -ne 0 ]; then
echo "An error occured while downloading dotnet-script"
| ise-uiuc/Magicoder-OSS-Instruct-75K |
serialize,
deserialize,
read,
write,
};
};
/**
* User: <NAME> <<EMAIL>>
* Date: 25.09.2020
* Time: 19:55
*/
export const file = factory;
| ise-uiuc/Magicoder-OSS-Instruct-75K |
import numpy as np
import torch
from core.utils.logging import initialize_logging
from omegaconf import DictConfig
| ise-uiuc/Magicoder-OSS-Instruct-75K |
fi
done
# --------------------------------------------------------
echo
done
echo
| ise-uiuc/Magicoder-OSS-Instruct-75K |
#!/bin/bash
list_file=$1
autobox_file='autobox.txt'
echo "" > $autobox_file
| ise-uiuc/Magicoder-OSS-Instruct-75K |
Assert.IsTrue(new Price(1, 100, CurrencyUnit.EUR) == p.Div(3M));
}
[TestMethod]
public void DivModifierLong()
{
// do not use Assert.AreEqual to test if Prices are equal
var p = new Price(3, 100, CurrencyUnit.EUR);
Assert.IsTrue(new Price(1, 100, CurrencyUnit.EUR) == p.Div(3L));
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
using Lens.entity;
namespace BurningKnight.entity.events {
public class ItemTakenEvent : Event {
public Item Item;
public Entity Who;
public ItemStand Stand;
}
} | ise-uiuc/Magicoder-OSS-Instruct-75K |
<reponame>davidesalerno/rhpam-7-openshift-image<gh_stars>10-100
#!/bin/bash
SOURCES_DIR="/tmp/artifacts"
| ise-uiuc/Magicoder-OSS-Instruct-75K |
hashlib.sha256).hexdigest()
self.assertEqual(2, len(auth_info))
self.assertEqual(3, len(auth_info.get('args')))
self.assertEqual('login', auth_info.get('op'))
self.assertEqual(['test_api_key', '1589793795969', expected_signature], auth_info.get('args'))
| ise-uiuc/Magicoder-OSS-Instruct-75K |
# ---------------------------------------------------------
# Logic
# ---------------------------------------------------------
class And(Task):
"""
Evaluates `x and y.`
Args:
- *args (Any): positional arguments for the `Task` class
- **kwargs (Any): keyword arguments for the `Task` class
| ise-uiuc/Magicoder-OSS-Instruct-75K |
)
.await
}
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
public TypeNotSupportedForInjectionException(String msg, Throwable cause) {
super(msg, cause);
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
* @var yii\web\View $this
* @var yii\data\ActiveDataProvider $dataProvider
* @var app\models\search\Report $searchModel
*/
?>
<?php Pjax::begin(['id'=>'report-pjax-grid']); ?>
<?php echo GridView::widget([
'id' => 'report-grid-view',
| ise-uiuc/Magicoder-OSS-Instruct-75K |
class Backend(BaseBackend):
u""" A backend to support markdown output. It implements the same
features as the HTML backend.
In addition to that, you can use the keyword php_extra=True to enable
the definition list extension of php-markdown. The default is not to use
it, since we cannot be sure that this feature is implemented on all
systems.
More information:
http://www.michelf.com/projects/php-markdown/extra/#def-list
| ise-uiuc/Magicoder-OSS-Instruct-75K |
rle = rle - 1
rle[1::2] = rle[1::2] - rle[:-1:2]
return rle
def rle_decode(rle_str, mask_shape):
s = rle_str.split()
starts, lengths = [np.asarray(x, dtype=int) for x in (s[0:][::2], s[1:][::2])]
starts -= 1
ends = starts + lengths
mask = np.zeros(np.prod(mask_shape), dtype=np.bool)
for lo, hi in zip(starts, ends):
| ise-uiuc/Magicoder-OSS-Instruct-75K |
if (node.left is None) ^ (node.right is None):
is_lonely = True
else:
is_lonely = False
dfs(node.left, is_lonely)
dfs(node.right, is_lonely)
dfs(root, False)
return lonely_nodes | ise-uiuc/Magicoder-OSS-Instruct-75K |
try container.encode(isFavorite, forKey: .isFavorite)
try container.encode(dateAddedToFavorites, forKey: .dateAddedToFavorites)
}
}
extension Movie {
static func ==(lhs: Movie, rhs: Movie) -> Bool {
return lhs.id == rhs.id
}
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
import os
import subprocess
import sys
import unittest
from test import support
from test.test_tools import scriptsdir, skip_if_missing
| ise-uiuc/Magicoder-OSS-Instruct-75K |
from RGBMatrixEmulator.graphics.color import Color
from RGBMatrixEmulator.graphics.font import Font
| ise-uiuc/Magicoder-OSS-Instruct-75K |
let multiplexing_config = {
let mut mplex_config = mplex::MplexConfig::new();
| ise-uiuc/Magicoder-OSS-Instruct-75K |
with open("{}/plots.log".format(graph_path), 'w') as f:
f.write("time: {}\n\n".format(end_time_str))
f.write("loss:\n[{}]\n\n".format(', '.join([str(i) for i in losses_plot])))
f.write("acc1:\n[{}]\n\n".format(', '.join([str(i) for i in accuracies_plots[0]])))
f.write("acc2:\n[{}]\n\n".format(', '.join([str(i) for i in accuracies_plots[1]])))
f.write("f1:\n[{}]\n\n".format(', '.join([str(i) for i in f1scores_plots[0]])))
| ise-uiuc/Magicoder-OSS-Instruct-75K |
<!-- Navigation -->
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="navbar-header">
| ise-uiuc/Magicoder-OSS-Instruct-75K |
/usr/share/elasticsearch/bin/elasticsearch-certutil ca --pass "" --out /shared/cert/elastic-stack-ca.p12
/usr/share/elasticsearch/bin/elasticsearch-certutil cert --ca-pass "" --pass "" --ca /shared/cert/elastic-stack-ca.p12 --out /shared/cert/elastic-certificates.p12 | ise-uiuc/Magicoder-OSS-Instruct-75K |
time.sleep(0.001) | ise-uiuc/Magicoder-OSS-Instruct-75K |
self.handleError(error)
return
}
/// Get documents from `get` call result.
let resultItems = result.documents
if (result.documents.isEmpty == false) {
/// Save next page documents provider for future use.
self.nextPage = result.nextPage()
/// Add newly downloaded documents to the table view.
self.items.append(contentsOf: resultItems)
self.tableView.reloadData()
| ise-uiuc/Magicoder-OSS-Instruct-75K |
__author__ = 'Rio'
| ise-uiuc/Magicoder-OSS-Instruct-75K |
phone: "input.form__control[name='phone']",
};
const init = (I) => {
const timeout = 30;
I.amOnPage("/");
I.waitForElement(contactLink, timeout);
I.waitForVisible(contactLink, timeout);
I.click(contactLink);
I.wait(1);
I.waitForVisible(submitButton, timeout);
};
| ise-uiuc/Magicoder-OSS-Instruct-75K |
stdout = redirected_output.getvalue()
stderr = redirected_error.getvalue()
| ise-uiuc/Magicoder-OSS-Instruct-75K |
set -o nounset
## 或者使用下面的 set -u 命令
# set -u
# 导入 base.sh 脚本
source /learning/base.sh
green "打印未设置的变量a之前"
## 由于不允许使用未设置的变量,因此下面这里报错并退出脚本了。
## 如果没有 set -o nounset 命令,那么下面将打印空行
echo $a
| ise-uiuc/Magicoder-OSS-Instruct-75K |
// Offset: 0x40
::Array<uint8_t>* preamble;
// private System.Int32 charPos
// Offset: 0x48
int charPos;
// private System.Int32 charLen
| ise-uiuc/Magicoder-OSS-Instruct-75K |
* You should have received a copy of the GNU General Public License along with Dolphin,
* see license.txt file; if not, write to <EMAIL>
***************************************************************************/
require_once(BX_DIRECTORY_PATH_CLASSES . 'BxDolRequest.php');
require_once(BX_DIRECTORY_PATH_CLASSES . 'BxDolModuleDb.php');
/**
* Service calls to modules' methods.
*
* The class has one static method is needed to make service calls
* to module's methods from the Dolphin's core or the other modules.
| ise-uiuc/Magicoder-OSS-Instruct-75K |
audioSource.Stop();
}
void TriggerGameStart() {
if (null == FisticuffsController.Instance) {
Debug.LogError("AnimationBehviors::TriggerGameStart - FisticuffsController.Instance not set. Is there one in the scene?");
return;
}
FisticuffsController.Instance.GameStart();
}
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
namespace kTest::utility
{
class ProfilerTester : public TesterBase
{
public:
ProfilerTester();
~ProfilerTester() override;
protected:
void Prepare() noexcept override;
| ise-uiuc/Magicoder-OSS-Instruct-75K |
public class CreateBucketConfiguration {
private String _location;
public CreateBucketConfiguration() {
}
public CreateBucketConfiguration(String location) {
_location = location;
}
@XmlElement(name = "LocationConstraint")
| ise-uiuc/Magicoder-OSS-Instruct-75K |
from graphscope.nx.utils.compat import import_as_graphscope_nx
import_as_graphscope_nx(networkx.algorithms.traversal.tests.test_bfs,
decorators=pytest.mark.usefixtures("graphscope_session"))
| ise-uiuc/Magicoder-OSS-Instruct-75K |
def kloeden_4_20(a=1):
"""Returns a function implementing the explicit solution to the SDE
dX_t = -0.5*a^2 X_t dt - a*sqrt(1 - (X_t)^2) dW_t
Taken from (Kloden & Platen, 1992), page 121.
"""
drift = lambda x, t : -0.5*a*a*x
diffusion = lambda x, t : -a*np.sqrt(1 - x**2)
true_sol = lambda x0, t, wt : np.cos(a*wt + np.arccos(x0))
return StochDiffEq(drift=drift, diffusion=diffusion, true_sol=true_sol, eqn="dX_t = -0.5*a^2 X_t dt - a*sqrt(1 - (X_t)^2) dW_t")
def double_well():
"""Returns a SDE object implementing the drift and diffusion functions for SDE
| ise-uiuc/Magicoder-OSS-Instruct-75K |
2. 向右 -> 向下 -> 向右
3. 向下 -> 向右 -> 向右
示例 2:
输入: m = 7, n = 3
输出: 28
来源:力扣(LeetCode)
链接:https://leetcode-cn.com/problems/unique-paths
'''
class Solution:
| ise-uiuc/Magicoder-OSS-Instruct-75K |
@Test
public void testDefaultConstructedCachedTableValuesReturnsNull() {
Map<String, Object> config = Collections.singletonMap("k", (Object) "v");
CachedRecommenderValues cached = new CachedRecommenderValues();
assertNull(cached.cachedValue(config, 20L));
}
@Test
public void testCachedTableValuesReturnsCachedResultWithinExpiryTime() {
Map<String, Object> config1 = Collections.singletonMap("k", (Object) "v");
Map<String, Object> config2 = Collections.singletonMap("k", (Object) "v");
List<Object> results = Collections.singletonList((Object) "xyz");
long expiry = 20L;
CachedRecommenderValues cached = new CachedRecommenderValues(config1, results, expiry);
assertSame(results, cached.cachedValue(config2, expiry - 1L));
| ise-uiuc/Magicoder-OSS-Instruct-75K |
SECRET_KEY='<KEY>' | ise-uiuc/Magicoder-OSS-Instruct-75K |
Examples
--------
>>> disk = DiskElement(0, 32.58972765, 0.17808928, 0.32956362)
>>> disk.M()
array([[ 32.58972765, 0. , 0. , 0. ],
[ 0. , 32.58972765, 0. , 0. ],
[ 0. , 0. , 0.17808928, 0. ],
[ 0. , 0. , 0. , 0.17808928]])
"""
| ise-uiuc/Magicoder-OSS-Instruct-75K |
# Read the other channel.
samples = niUsb6211.read_samples(1, channels=1)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
from nighres.filtering.filter_ridge_structures import filter_ridge_structures
from nighres.filtering.recursive_ridge_diffusion import recursive_ridge_diffusion
from nighres.filtering.total_variation_filtering import total_variation_filtering | ise-uiuc/Magicoder-OSS-Instruct-75K |
DecodedImageCallback* callback) {
callback_ = callback;
return WEBRTC_VIDEO_CODEC_OK;
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
if #available(iOS 13.0, *) {
v.backgroundColor = .systemGray5
} else {
// Fallback on earlier versions
v.backgroundColor = UIColor(red: 237 / 255.0, green: 239 / 255.0, blue: 242 / 255.0, alpha: 1)
}
navBarView.addSubview(v)
return v
}()
lazy var headTitleLabel: UILabel = {
let l = UILabel(frame: CGRect(x: CGFloat.width / 4, y: CGFloat.safe_top, width: CGFloat.width / 2, height: 44))
l.textColor = LGDeployData.shared.titleColor
l.font = .fontBold(18)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
interface PropType$Intersect {
name: 'intersect';
raw: string;
elements: PropType[];
| ise-uiuc/Magicoder-OSS-Instruct-75K |
indexable[11:]
indexable[:]
indexable[3:8]
indexable[slice(1,2)]
indexable[slice(1,12,2)]
indexable[0] = 32
indexable[:] = xrange(2)
indexable[3:8] = xrange(2)
indexable[slice(1,12,2)] = xrange(2)
del indexable[0]
del indexable[:]
del indexable[3:8]
| ise-uiuc/Magicoder-OSS-Instruct-75K |
def test_inactive_user(self):
self.user.is_active = False
self.user.save()
self._setup_provider_response(success=True)
self._assert_success(self.data, expected_scopes=[])
def test_invalid_acess_token(self):
self._setup_provider_response(success=False)
self._assert_error(self.data, "invalid_grant", "access_token is not valid") # lint-amnesty, pylint: disable=no-value-for-parameter
| ise-uiuc/Magicoder-OSS-Instruct-75K |
AllocatedSpace = collections.namedtuple("AllocatedSpace", ["x", "y", "width", "height"])
Row = collections.namedtuple("Row", ["top", "height", "free_width"])
| ise-uiuc/Magicoder-OSS-Instruct-75K |
else:
email = "%s%i@%s" % (self.gen_word(), random.randint(1, 999), self.gen_domain())
return email
def gen_phone(self):
return "%i-%i-%s" % (random.randint(200,999), random.randint(111,999), str(random.randint(0,9999)).zfill(4))
| ise-uiuc/Magicoder-OSS-Instruct-75K |
from spn.structure.StatisticalTypes import MetaType
| ise-uiuc/Magicoder-OSS-Instruct-75K |
class Conj:
# func为pytorch自动求导定义下的函数
# 线搜索最大迭代次数
# self.func可能需要实现两套:输入为torch.tensor 与输入为 numpy.ndarray
def __init__(self, func, dim = 2, max_ls_iter = 16):
self.func = func
self.max_ls_iter = max_ls_iter
self.n = dim
self.pos = [] # 保存迭代点位置
# pytorch 自动求导不熟练。grad这种可以求出一个梯度向量的函数,其输入grad(y, x)中,并不表示当位置为x时的梯度
# 而y.backward()这种,x.data只要发生变化,y重新backward,则x.grad也会改变,但是grad(y, x)只要不重新求y
# 不管x.data如何变,y记录的都是原来的x位置
def solve(self, initial, criteria = 1e-3):
x = Var(initial, requires_grad = True)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
for (i, ch) in text.char_indices() {
if i == 0 && text.starts_with(|c| ('a'..='z').contains(&c)) {
new_string.insert(i, ch.to_ascii_uppercase());
} else {
new_string.insert(i, ch);
}
}
new_string
} else {
String::new()
}
}
#[cfg(test)]
| ise-uiuc/Magicoder-OSS-Instruct-75K |
steps2, avg_lengths2, avg_returns2 = sarsa_softmax(map_file=map, learning_rate=lr2,
discount=d2, train_episodes=500, q0=0,
final_show=False)
lr3 = 0.4
d3 = 0.99
steps3, avg_lengths3, avg_returns3 = sarsa_softmax(map_file=map, learning_rate=lr3,
discount=d3, train_episodes=500, q0=0,
final_show=False)
lr4 = 0.8
d4 = 0.99
steps4, avg_lengths4, avg_returns4 = sarsa_softmax(map_file=map, learning_rate=lr4,
discount=d4, train_episodes=500, q0=0,
final_show=False)
_fig, (ax1, ax2) = plt.subplots(ncols=2)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
* http://example.com/index.php/welcome/index
* - or -
* Since this controller is set as the default controller in
* config/routes.php, it's displayed at http://example.com/
*
* So any other public methods not prefixed with an underscore will
| ise-uiuc/Magicoder-OSS-Instruct-75K |
let position = Int(objectOffset) + propOffset
do {
return try scalar(at: position) as T
} catch {
return nil
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
assert_text!(label, "");
enter_keys(entry, "test");
assert_text!(label, "tset (4)");
enter_key(entry, key::BackSpace);
assert_text!(label, "set (3)");
enter_key(entry, key::Home);
//enter_key(entry, key::Delete); // TODO: when supported by enigo.
enter_keys(entry, "a");
| ise-uiuc/Magicoder-OSS-Instruct-75K |
x_i = genomes[0].getSolution()
mutant = genomes[1].getSolution()
trial = x_i + self.K * (mutant - x_i)
return Genome(trial, self.f_fitnes(trial))
pass
| ise-uiuc/Magicoder-OSS-Instruct-75K |
int pMR::Backend::getLocalProcessID()
{
int rank;
if(MPI_Comm_rank(getLocalCommunicator(), &rank) != MPI_SUCCESS)
{
throw std::runtime_error(
"pMR: Unable to get local communicator rank ID");
}
return {rank};
}
int pMR::Backend::getLocalNumProcesses()
| ise-uiuc/Magicoder-OSS-Instruct-75K |
# on each batch, we find the maximum value in every channel
def max_in_channel(batch):
"""Add one to every element in the batch
"""
return np.max(batch, axis=0)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
base app folder.
conf_dir : str
base configuration folder.
suffix_conf : str
suffix for configuration folder.
output_dir : str
base output folder.
suffix_out : str
suffix for output folder (only the string after the last "/" is taken).
v : int
verbose if 1.
file_log : file handler
handler for log file.
| ise-uiuc/Magicoder-OSS-Instruct-75K |
pub enum Presence {
/// `Online` presence.
Online,
/// `Idle` presence.
Idle,
/// `Busy` presence.
Busy,
/// `Invisible` presence.
Invisible,
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
print(msg)
sys.stdout.flush()
if handlers.csv_logger: handlers.csv_logger.flush()
# Increment iteration counter
handlers.iteration +=1
handlers.csv_logger.close()
| ise-uiuc/Magicoder-OSS-Instruct-75K |
def test_version():
"""Test if the versions of littlefs can be imported"""
assert littlefs.__LFS_VERSION__ == (2, 4)
assert littlefs.__LFS_DISK_VERSION__ == (2, 0)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
/// Intializer.
///
/// - Parameter fileURL: The file path to write the logs to.
public init(fileURL: URL) {
if !FileManager.default.fileExists(atPath: fileURL.path) {
if !FileManager.default.createFile(atPath: fileURL.path, contents: nil) {
os_log("File for logging could not be created: %@", log: .default, type: .error, fileURL.path)
}
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
#!/bin/sh
# `/sbin/setuser node` runs the given command as the user `node`.
# If you omit that part, the command will be run as root. https://gist.github.com/scr1p7ed/ee0d96c3795e59244063
cd /var/www/node
pm2 start npm --max-memory-restart 200M --name "tsoa-seed" -l /var/log/nodejs/pm2.log --no-daemon -u node -- start
| ise-uiuc/Magicoder-OSS-Instruct-75K |
if request.method == 'POST':
| ise-uiuc/Magicoder-OSS-Instruct-75K |
err(0)
{
Initialise();
}
bool FTLibrary::Initialise()
{
if( library != 0)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
print("Folder does already exits!")
| ise-uiuc/Magicoder-OSS-Instruct-75K |
# an 'almost certain' primality check
def is_prime(n):
| ise-uiuc/Magicoder-OSS-Instruct-75K |
extern void *ipv6_route_lookup_get_cuda_kernel();
}
#endif
| ise-uiuc/Magicoder-OSS-Instruct-75K |
if self.class_weights_index != -1:
sample_weight = valid_tuple[self.class_weights_index]
self.metrics_validation.update_state(tf.reshape(tf.one_hot(tf.cast(labels, tf.int32), self.num_classes), tf.shape(x_c)), x_c, sample_weight=sample_weight)
prediction = tf.argmax(x_c, axis=1)
self.metrics_acc_validation.update_state(labels, prediction, sample_weight=sample_weight)
validation_result = self.metrics_validation.result()
acc_result = self.metrics_acc_validation.result()
tf.summary.scalar('validation_loss', validation_result, step=self.global_validation_step)
tf.summary.scalar('validation_acc', acc_result, step=self.global_validation_step)
self.global_validation_step += 1
| ise-uiuc/Magicoder-OSS-Instruct-75K |
Route::get('/', function () {
return view('welcome');
});
Route::get('/test-queues', function () {
Mail::to('<EMAIL>')->queue(new UserRegistered);
return view('welcome');
| ise-uiuc/Magicoder-OSS-Instruct-75K |
import lzma
from glob import glob
from pprint import pprint
import pandas as pd
import smart_open
import typer
from tqdm import tqdm
ORDERED_VAR = ["table", "name", "description", "type"]
TEXTTT_VAR = ["table", "name"]
app = typer.Typer()
| ise-uiuc/Magicoder-OSS-Instruct-75K |
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
| ise-uiuc/Magicoder-OSS-Instruct-75K |
def __init__(self, provided_labels: int, needed_labels: int):
super().__init__(f"{needed_labels} labels are needed to represent the selected method. "
f"Only {provided_labels} are provided.")
| ise-uiuc/Magicoder-OSS-Instruct-75K |
'rlbench.assets',
| ise-uiuc/Magicoder-OSS-Instruct-75K |
kw, nsamples = [s.strip()
for s in fd.readline().strip().split('=')]
assert kw == 'numberOfSamples'
nsamples = int(nsamples)
channel_idx = 0
for line in fd.readlines():
| ise-uiuc/Magicoder-OSS-Instruct-75K |
);
let output = runtime.invoke(b"test".to_vec(), context::tests::test_context(10));
assert_eq!(
output.is_err(),
false,
"Handler threw an unexpected error: {}",
output.err().unwrap()
);
| ise-uiuc/Magicoder-OSS-Instruct-75K |
class PitchForm(FlaskForm):
title = StringField('Pitch title',validators=[Required()])
category = SelectField('Pitch category', choices=[('Motivational', 'Motivational'), ('Famous', 'Famous'), ('Despair', 'Despair')], validators=[Required()])
description = TextAreaField('Pitch description', validators=[Required()])
submit = SubmitField('Submit')
class UpdateProfile(FlaskForm):
bio = TextAreaField('Tell us about you.',validators = [Required()])
submit = SubmitField('Submit')
class Commentform(FlaskForm):
description = TextAreaField('Comment description', validators=[Required()])
| ise-uiuc/Magicoder-OSS-Instruct-75K |
keymap = dict(zip(moves, callbacks))
return EventListener(keymap=keymap)
def select(self):
| ise-uiuc/Magicoder-OSS-Instruct-75K |
infracost_cmd="$infracost_cmd --usage-file $usage_file"
fi
echo "$infracost_cmd" > infracost_cmd
echo "Running infracost on current branch using:"
echo " $ $(cat infracost_cmd)"
current_branch_output=$(cat infracost_cmd | sh)
# The sed is needed to cause the header line to be different between current_branch_infracost and
| ise-uiuc/Magicoder-OSS-Instruct-75K |
class HealthCheckSchema(Schema):
name = fields.String()
status = fields.String(attribute="status.name")
node = fields.String()
seconds_ago = fields.Integer()
timestamp = fields.Integer()
info = fields.String()
| ise-uiuc/Magicoder-OSS-Instruct-75K |
# print(k, v.shape)
if k.startswith('backbone') or k.startswith('neck'):
state_dict[k] = v
for k, v in state_dict.items():
print(k)
torch.save(state_dict, '/home/dingyangyang/SOLO/work_dirs/solov2_attention_label_align2_assim/0.399_rm_head.pth')
| ise-uiuc/Magicoder-OSS-Instruct-75K |
array = ['Yellow Duck'] #Желтой уточки нет в продаже, мы ее покупать не будем)))
for i in range(1,4):
driver.find_element_by_css_selector('li.product a[title $="Duck"]').click()
while driver.find_element_by_css_selector('h1').text in array: #Если такую уточку покупали, то выберем другую.
driver.back() #И будем выбирать, пока не попадется новая
driver.find_element_by_css_selector('li.product a[title $="Duck"]').click()
array.append(driver.find_element_by_css_selector('h1').text)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.