seed
stringlengths
1
14k
source
stringclasses
2 values
// Zip two number iterators, the second one is shifted half the size let mut iterator = input .chars() .zip( input.chars() .cycle()
ise-uiuc/Magicoder-OSS-Instruct-75K
shuffle=False, collate_fn=user_scattered_collate, num_workers=5, drop_last=True ) return loader def generateSky(img, model): img = [os.path.join(cwd, img)] loader = getLoader(img) gpu = 0
ise-uiuc/Magicoder-OSS-Instruct-75K
class User(AbstractUser): phone_number: 'str' = models.CharField(max_length=255, null=True, blank=True) class HelloSMSMessage(NamedTuple): phone_number: 'str' username: 'str' def send_hello_sms(self): if not self.phone_number:
ise-uiuc/Magicoder-OSS-Instruct-75K
for batch in splitted_data: normalized_batch = batch / 255 feature_vectors.append(self.sess.run(self.graph['feature_vector'], { self.graph['is_training']: False, self.graph['state']: normalized_batch })) feature_vectors = np.concatenate(feature_vectors)
ise-uiuc/Magicoder-OSS-Instruct-75K
assert process("~(Q && P) <=> (~P || Z)") == "Formula is satisfiable"
ise-uiuc/Magicoder-OSS-Instruct-75K
assert product_kernel.nus[0] == kernel.nu
ise-uiuc/Magicoder-OSS-Instruct-75K
* @package app\modules\order\modules\v1\jobs
ise-uiuc/Magicoder-OSS-Instruct-75K
# sleep 1 # # get b--hotcode.dork | grep 'This is a test.' # rm html/index.html && echo "This is a hotcode test." >> html/index.html # get b--hotcode.dork | grep 'This is a test.' # rm html/index.html && echo "This is a test." >> html/index.html # # dork-compose down -v --rmi local # # # Test if the http service has been removed. # ! docker ps -a | grep 'hotcode_b_1'
ise-uiuc/Magicoder-OSS-Instruct-75K
from .random_primitive import RandomPrimitive from .plane import Plane
ise-uiuc/Magicoder-OSS-Instruct-75K
f = codecs.open('data/osm_data.xml', encoding='utf-8' , mode='w+') f.write(r1.text) query2 = """<union> <query type="way"> <has-kv k="addr:street"/> <has-kv k="addr:street:name"/> <has-kv k="addr:street:prefix"/> <has-kv k="addr:street:type"/> <bbox-query e="%s" n="%s" s="%s" w="%s"/> </query> <query type="node">
ise-uiuc/Magicoder-OSS-Instruct-75K
for (i = 0, j = 0; i < g.size(); i++, j++) { while (j < s.size() && g[i] > s[j]) j += 1; if (j < s.size()) result += 1; } return result; } }; int main() { return 0;
ise-uiuc/Magicoder-OSS-Instruct-75K
use Illuminate\Database\Eloquent\Model; use Carbon\Carbon; use Illuminate\Database\Eloquent\SoftDeletes; class Leadsdata extends Model { protected $fillable = ['member_id' , 'member_relation', 'member_relation_name', 'member_relation_mobile', 'member_relation_dob']; }
ise-uiuc/Magicoder-OSS-Instruct-75K
--overwrite_cache \ --overwrite_output_dir \ --eval_all_checkpoints \ --evaluate_during_training \ --logging_steps 400 \ --save_steps 3000 \ --output_dir $GLUE_DIR/tmp/portuguese-bert/
ise-uiuc/Magicoder-OSS-Instruct-75K
XCTAssert(ThemeContainer.currentTheme === otherTheme) } @available(iOS 13.0, *) func test__current_theme__cant_be_switched__for_dark_mode() {
ise-uiuc/Magicoder-OSS-Instruct-75K
for n in range(1,21): t *= n s += t print s
ise-uiuc/Magicoder-OSS-Instruct-75K
} public override float WeightGrammsPerUnit { get { return 1615; } } public override int WaterResistance { get { return 10; } } public override int ColdResistance {
ise-uiuc/Magicoder-OSS-Instruct-75K
if os.path.exists(os.path.join(THIS_DIR, 'project')):
ise-uiuc/Magicoder-OSS-Instruct-75K
@Override public void onClick(View v) { switch (v.getId()) { case R.id.switch_city: Intent intent=new Intent(this,ChooseAreaActivity.class); intent.putExtra("from_weather_activity", true);
ise-uiuc/Magicoder-OSS-Instruct-75K
<div> <input class="btn btn-primary" type="submit" value="Force Roll"> </div> </form> </div>
ise-uiuc/Magicoder-OSS-Instruct-75K
This class builds out the payload from config files of multiple types. It handles various
ise-uiuc/Magicoder-OSS-Instruct-75K
return $metadataSet; } private function generateDynamicHostedEntityID($set) { // get the configuration $baseurl = \SimpleSAML\Utils\HTTP::getBaseURL(); if ($set === 'saml20-idp-hosted') { return $baseurl.'saml2/idp/metadata.php'; } elseif ($set === 'shib13-idp-hosted') { return $baseurl.'shib13/idp/metadata.php'; } elseif ($set === 'wsfed-sp-hosted') {
ise-uiuc/Magicoder-OSS-Instruct-75K
#if DEBUG // swiftlint:disable unused_declaration struct AmountViewPreviews: PreviewProvider { static var previews: some View { AmountView(viewModel: AmountViewModel(value: 12.34)) .previewLayout(.sizeThatFits) } } #endif
ise-uiuc/Magicoder-OSS-Instruct-75K
) return val def getPls(forecastHours): val = LSTM_LoadStationSystem.LSTM_RUN("data/dummy/LoadStationSystem.csv") return val # Example and Dummy def example(forecastHours): return LSTM.LSTM_RUN("data/example/pollution.csv")
ise-uiuc/Magicoder-OSS-Instruct-75K
// CAW 2021-02-26 : I used to test 1776 here, but there was an odd off-by-8 seconds problem testing dates that // far in the past. No doubt some kind of weird leap second thing. Not fighting that today
ise-uiuc/Magicoder-OSS-Instruct-75K
use rand::{rngs::SmallRng, thread_rng, Rng, SeedableRng}; let mut rng = SmallRng::from_rng(thread_rng()).unwrap(); std::iter::repeat(()).map(move |_| { rng.sample_iter(&Alphanumeric) .take(size) .collect::<String>() }) }
ise-uiuc/Magicoder-OSS-Instruct-75K
<filename>scripts/portal/map915020100_PT.py<gh_stars>1-10 # Ariant Treasure Vault Entrance (915020100) => Ariant Treasure Vault if 2400 <= chr.getJob() <= 2412 and not sm.hasMobsInField(): sm.warp(915020101, 1) elif sm.hasMobsInField():
ise-uiuc/Magicoder-OSS-Instruct-75K
print(f'block {block+1:03d} [epoch: {epoch:03d}] train loss: {loss:.4f} | validate: {validate_acc:.4f} (acc), {validate_AUC:.4f} (AUC) | learning_rate = {scheduler[ID].get_last_lr()}') ## Save args["modeldir"] = f'./checkpoint/eid/{args["config"]}/'; os.makedirs(args["modeldir"], exist_ok = True) checkpoint = {'model': model[ID], 'state_dict': model[ID].state_dict()} torch.save(checkpoint, args['modeldir'] + f'/{param[ID]["label"]}_checkpoint' + '.pth')
ise-uiuc/Magicoder-OSS-Instruct-75K
edges: store.getState().graph.edges }; }
ise-uiuc/Magicoder-OSS-Instruct-75K
return np.fft.ifft(fft_array).real def psd_from_fft2(fft2, fs, weight=None): """ Same as psd, except with fft**2. Return freq_array and psd_array.
ise-uiuc/Magicoder-OSS-Instruct-75K
auto ptr = cast(mat); if (ptr->mat == nullptr) return kPD_NULLPTR; paddle::real* buf = ptr->mat->getRowBuf(0); size_t width = ptr->mat->getWidth(); size_t height = ptr->mat->getHeight();
ise-uiuc/Magicoder-OSS-Instruct-75K
Simple.template_path = path def test_basic_method_calls(self): view = Simple() self.assertEquals(view.render(), "Hi pizza!") def test_non_callable_attributes(self): view = Simple() view.thing = 'Chris' self.assertEquals(view.render(), "Hi Chris!") def test_view_instances_as_attributes(self):
ise-uiuc/Magicoder-OSS-Instruct-75K
{ return !_objects.TryTake(out T item) ? _objectGenerator() : item; } public void Put(T item) { item.OnRecycle(); _objects.Add(item); } public int Count => _objects.Count; } public static partial class Mixpanel {
ise-uiuc/Magicoder-OSS-Instruct-75K
# mask if mask is None: mask = tensor.alloc(1., state_below.shape[0], 1) dim = tparams[prfx(prefix, 'Wcx')].shape[1] # initial/previous state if init_state is None: init_state = tensor.alloc(0., n_samples, dim) # projected context assert context.ndim == 3, 'Context must be 3-d: #annotation x #sample x dim' pctx_ = dot(context, tparams[prfx(prefix, 'Wc_att')]) + tparams[prfx(prefix, 'b_att')]
ise-uiuc/Magicoder-OSS-Instruct-75K
class Sqlite(object): def __init__(self, db_path): self.db_path = db_path def __enter__(self): self.connect = sqlite3.connect(self.db_path) return self def __exit__(self, exc_type, exc_val, exc_tb): self.connect.close()
ise-uiuc/Magicoder-OSS-Instruct-75K
from leetcodepy.permutation_sequence import * SOLUTION1 = Solution1() N1, K1 = 3, 3 EXPECTED1 = "213" N2, K2 = 4, 9 EXPECTED2 = "2314" N3, K3 = 3, 1 EXPECTED3 = "123"
ise-uiuc/Magicoder-OSS-Instruct-75K
# Use f"string to create a set and dict f_string_square_set = {f"The square of {num} is {num * num}" for num in range(5)} for x in f_string_square_set:
ise-uiuc/Magicoder-OSS-Instruct-75K
#PATH='${PATH}:/home/Jasper/anaconda/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games' #source ~/.bashrc # Install python packages ~/anaconda/bin/pip install -r requirements.txt
ise-uiuc/Magicoder-OSS-Instruct-75K
distance = 0 while True: distance += 1 if search_lim is not None and distance > search_lim: return False
ise-uiuc/Magicoder-OSS-Instruct-75K
* @return 422 * @throws Exception */ public ResponseEntity validate(BaseParam param, OperationType operationType) throws Exception { Field[] fields = param.getClass().getDeclaredFields(); for (Field field : fields) { if (field == null || !field.isAnnotationPresent(NotNullField.class) || !field.isAnnotationPresent(SizeField.class)) { continue; // Ignore field without ParamField annotation. } field.setAccessible(true); NotNullField notNullField = field.getAnnotation(NotNullField.class); if (ArrayUtils.contains(notNullField.value(), operationType) && field.get(param) == null) { return resultHelper.infoResp(ErrorType.SYS0002, notNullField.message(), HttpStatus.UNPROCESSABLE_ENTITY);
ise-uiuc/Magicoder-OSS-Instruct-75K
do
ise-uiuc/Magicoder-OSS-Instruct-75K
if (text.substr(0, 5) == "void*") { CLD_ASSERT(!result); result = Types::VoidStar; text.remove_prefix(5); } else if (text.substr(0, 4) == "void") { CLD_ASSERT(!result); result = Types::Void; text.remove_prefix(4); } else if (text.substr(0, 4) == "bool") { CLD_ASSERT(!result);
ise-uiuc/Magicoder-OSS-Instruct-75K
./scripts/downsample.sh "$TRACKER_DOWNSAMPLE_RATE" "$TRACKER_DATA_JSONL_FILE" > \ "$OUTPUT_DIR"/tracker_downsampled.jsonl # Make tracker data start from t = 0 FIRST_TIME=`head -n1 "$OUTPUT_DIR"/tracker_downsampled.jsonl | jq -c ".time"` echo "Removing $FIRST_TIME from tracker timestamps" jq -c ".time = .time - $FIRST_TIME" "$OUTPUT_DIR"/tracker_downsampled.jsonl \ > "$OUTPUT_DIR"/tracker_downsampled.jsonl.tmp
ise-uiuc/Magicoder-OSS-Instruct-75K
public static <T> HttpResponse<T> create(Response response, Class<T> className) { T entity = response.hasEntity() ? response.readEntity(className) : null; return new HttpResponse<>(response, entity);
ise-uiuc/Magicoder-OSS-Instruct-75K
def get_bot(token: str): bot = Bot(token, router=router, globals_class=munch.Munch, context_data_class=munch.Munch) bot.middleware(DefaultValuesMiddleware(parse_mode=ParseModeType.html)) return bot
ise-uiuc/Magicoder-OSS-Instruct-75K
/** The contr req manager. */ @Autowired private GenericManager<ContributorRequest, Long> contrReqManager;
ise-uiuc/Magicoder-OSS-Instruct-75K
up_patches = net(patches) #denormalize and merge patches up_patches[:, :, 0:3] = up_patches[:, :, 0:3] * torch.unsqueeze(furthest_distance, dim=-1) + centroid
ise-uiuc/Magicoder-OSS-Instruct-75K
let tip_date = tip.block_date(); let slot = tip .epoch_leadership_schedule() .era()
ise-uiuc/Magicoder-OSS-Instruct-75K
<thead> <tr class="header"> <? $aCols = array( 'id' => array('t'=>'ID', 'w'=>40, 'order'=>'desc'),
ise-uiuc/Magicoder-OSS-Instruct-75K
data.map(operations=vision.Resize(100, 100), input_columns=["image"]) assert "Argument interpolation with value 100 is not of type [<enum 'Inter'>]" in str(info.value) def test_exception_02(): """ Test exceptions with invalid input, and test valid input
ise-uiuc/Magicoder-OSS-Instruct-75K
from ..serializers.repository import RepositorySerializer class RepositoryViewSet(ModelViewSet): queryset = Repository.objects.order_by('created_date').all() serializer_class = RepositorySerializer permission_classes = [IsStaffOrReadOnly]
ise-uiuc/Magicoder-OSS-Instruct-75K
await ctx.send(embed=embed)
ise-uiuc/Magicoder-OSS-Instruct-75K
r = self.rc.get('/restapi/v1.0/account/~/extension/~') self.assertEqual(200, r.status_code) def test_post(self): r = self.rc.post('/restapi/v1.0/account/~/extension/~/sms', { 'to': [{'phoneNumber': self.receiver}], 'from': {'phoneNumber': self.username}, 'text': 'Hello world' }) self.assertEqual(200, r.status_code) def test_put(self): r = self.rc.get('/restapi/v1.0/account/~/extension/~/message-store', { 'direction': 'Outbound' })
ise-uiuc/Magicoder-OSS-Instruct-75K
// func testPerformanceExample() { // // This is an example of a performance test case.
ise-uiuc/Magicoder-OSS-Instruct-75K
attr::init(&mut rules); pseudo::init(&mut rules); all::init(&mut rules); add_rules(rules); }
ise-uiuc/Magicoder-OSS-Instruct-75K
/// The lowercase character for the color. `White` is "w", `Black` is "b". public var character: Character {
ise-uiuc/Magicoder-OSS-Instruct-75K
/// <summary> /// Gets the class handler for a class type and a routed event. /// </summary> /// <param name="classType">The type of the class that is handling the event.</param> /// <param name="routedEvent">The routed event to handle.</param> /// <returns>The <see cref="RoutedEventHandlerInfo"/> representing the class handler.</returns>
ise-uiuc/Magicoder-OSS-Instruct-75K
ht.insert("abc", 1) ht.insert("acb", 2) ht.insert("bac", 3)
ise-uiuc/Magicoder-OSS-Instruct-75K
[Column("birth_date", TypeName = "date")] [DataType(DataType.Date)] [Required(ErrorMessage = "The Birth Date field is required.")] public DateTime? BirthDate { get; set; } [Column("address_line_1")] [StringLength(50)]
ise-uiuc/Magicoder-OSS-Instruct-75K
} }else{ echo "<script>"; echo "alert('Không đúng kiểu file ảnh');"; echo "window.location.href='index.php?ql=ad&ac=add';"; echo "exit();";
ise-uiuc/Magicoder-OSS-Instruct-75K
while True: position = string.find(str, last_position+1)
ise-uiuc/Magicoder-OSS-Instruct-75K
import redis import time import json redis_host = 'localhost' redis_port = '6379' channel = "hello-channel" publisher = redis.Redis(host=redis_host, port=redis_port) count = 0 while True: count += 1 message = {
ise-uiuc/Magicoder-OSS-Instruct-75K
neighborhood: string; city: string; state: string; zipCode: string; }
ise-uiuc/Magicoder-OSS-Instruct-75K
include 'koneksi_db.php'; $id = $_GET['id_admin']; mysqli_query($koneksi, "delete from tb_servis where id = '$id'"); header("location:tampil.php") ?>
ise-uiuc/Magicoder-OSS-Instruct-75K
set -e SCRIPT_PATH=$(dirname "$0") echo "Dumping minio files" cd $SCRIPT_PATH/.. minio-cli cp --recursive myminio ./.devcontainer/minio-dump
ise-uiuc/Magicoder-OSS-Instruct-75K
pub fn from_index(i: usize) -> Char { assert!((i as usize) < Self::_MAX); Char(i as u8) } }
ise-uiuc/Magicoder-OSS-Instruct-75K
ErrorClass<HbmvMetod<FloatComplex> > ec; ec.error(CL_INVALID_COMMAND_QUEUE); }
ise-uiuc/Magicoder-OSS-Instruct-75K
from tests import join_xml_data_path from tests.aspects import ScriptMainTestCase, TestCase from tests.utils import empty_sites class TestXMLPageGenerator(TestCase): """Test XML Page generator.""" family = 'wikipedia' code = 'en' dry = True
ise-uiuc/Magicoder-OSS-Instruct-75K
from deliravision.models.gans.munit.munit import MUNIT
ise-uiuc/Magicoder-OSS-Instruct-75K
from typing import Union from app.util import has_attributes class SampleClass: pass
ise-uiuc/Magicoder-OSS-Instruct-75K
""" weakref should be valid. """ import gc import importlib
ise-uiuc/Magicoder-OSS-Instruct-75K
Not really a part of the Canvas Indexer code base. """ import json import random import requests import time from celery import Celery from flask import (abort, Flask, request, Response) from flask_cors import CORS def get_tags(img_url):
ise-uiuc/Magicoder-OSS-Instruct-75K
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), ), migrations.AlterField( model_name='ttbdjsubscriber',
ise-uiuc/Magicoder-OSS-Instruct-75K
return lines_str
ise-uiuc/Magicoder-OSS-Instruct-75K
def __init__(self, host, dictionary, *args, **kwargs): super().__init__(*args, **kwargs)
ise-uiuc/Magicoder-OSS-Instruct-75K
if (obj[prop] && typeof obj[prop] == 'function') { let fn = obj[prop]; let fnName = fn.name; let ratesPropName = `_methodRates__${fnName}`; if (!obj[ratesPropName]) {
ise-uiuc/Magicoder-OSS-Instruct-75K
print('Would you like to play again? Y/N') response = input().upper() if not response.startswith('Y'): print('Thanks for playing!') sys.exit()
ise-uiuc/Magicoder-OSS-Instruct-75K
def parse(): parser= argparse.ArgumentParser(description='Preparation of XML files'+
ise-uiuc/Magicoder-OSS-Instruct-75K
!/tmp
ise-uiuc/Magicoder-OSS-Instruct-75K
enum b { class A { protocol e { class case ,
ise-uiuc/Magicoder-OSS-Instruct-75K
class LogisticsRegression(MLModelInterface): pass # Imput to the classifier features = [ (5.1, 3.5, 1.4, 0.2), (4.9, 3.0, 1.4, 0.2), (4.7, 3.2, 1.3, 0.2), (7.0, 3.2, 4.7, 1.4),
ise-uiuc/Magicoder-OSS-Instruct-75K
total_score = 0; #max_score = starts.shape[0] max_score = 500 test_starts = starts.to_numpy() test_stops = stops.to_numpy() test_deltas = deltas.to_numpy() for i in tqdm(range(max_score)): if(checkStart(test_starts[i], test_stops[i], test_deltas[i][0])): total_score += 1 ''' '''############# Create auto encoder model #################'''
ise-uiuc/Magicoder-OSS-Instruct-75K
EOF # -- execute docker script -- #
ise-uiuc/Magicoder-OSS-Instruct-75K
session = Streamlink() parser = build_parser()
ise-uiuc/Magicoder-OSS-Instruct-75K
self.isFileType = true
ise-uiuc/Magicoder-OSS-Instruct-75K
"CT652": "Database Management System", "CT653": "Artificial Intelligence", "CT655": "Embedded System", "CT656": "Operating System", "CT654": "Minor Project", "ME708": "Organization and Management", "EX701": "Energy Environment and Society",
ise-uiuc/Magicoder-OSS-Instruct-75K
using namespace std; namespace ariel { class Board{ public : Board(); ~Board(); void post(unsigned int row, unsigned int column, Direction d, std::string message);
ise-uiuc/Magicoder-OSS-Instruct-75K
test_applicant_id = '6<PASSWORD>' live_videos = api.list_live_videos(test_applicant_id).live_videos print(live_videos) download = api.download_live_video(live_videos[0].id)
ise-uiuc/Magicoder-OSS-Instruct-75K
getcontext().rounding = ROUND_HALF_UP holding_cost = self.__holding_cost step = float(0.2) previous_eoq_variable_cost = Decimal(0) Decimal(reorder_cost) order_factor = float(0.002)
ise-uiuc/Magicoder-OSS-Instruct-75K
self.logger.debug(f"WSServer: Send to : {websocket}" + json.dumps(message_dict)) await websocket.send(json.dumps(message_dict)) except websockets.ConnectionClosed:
ise-uiuc/Magicoder-OSS-Instruct-75K
from function_baseline.model_pos_preparation import model_pos_preparation from function_poseaug.model_pos_eval import evaluate
ise-uiuc/Magicoder-OSS-Instruct-75K
h.await_text('replace [yes, no, all]?') h.press('a') h.await_text_missing('line_1') h.await_text('li\nne\n1\n\nline_2')
ise-uiuc/Magicoder-OSS-Instruct-75K
cube_val_lines, min_val, max_val = get_cube_lines(nx, ny, nz, coords, min_carts, charges, vox_size)
ise-uiuc/Magicoder-OSS-Instruct-75K
#necessary env source activate ebm python $cmd " # srun -p gpu --mem=16G --gres=gpu:1 \
ise-uiuc/Magicoder-OSS-Instruct-75K
from collections import defaultdict
ise-uiuc/Magicoder-OSS-Instruct-75K
php -f /var/www/run_update.php >> /var/www/logs/update.log
ise-uiuc/Magicoder-OSS-Instruct-75K
offset = (0.5, 0, 0.38) speedChatBg = self.attachNewNode('speedChatBg') skullbg.find('**/pPlane11').reparentTo(speedChatBg)
ise-uiuc/Magicoder-OSS-Instruct-75K
echo "[4/4] Unmount and detatch..." umount "${mnt_path}" hdiutil detach $disk > /dev/null rm -rf "${mnt_path}"
ise-uiuc/Magicoder-OSS-Instruct-75K
_games.Add(GameEnum.IceWindDale2, new GameConfig(GameEnum.IceWindDale2, "Icewind Dale 2", "icewind2.ini", _bgdirs)); _games.Add(GameEnum.NewerwinterNights, new GameConfig( GameEnum.NewerwinterNights, "Neverwinter Nights", "nwn.ini", new[] { "Ambient", "DMVault", "Hak", "LocalVault", "Modules", "Music", "NWM", "Saves", "ServerVault", "Source", "TexturePacks" })); _games.Add(GameEnum.Kotor, new GameConfig( GameEnum.Kotor, "Star Wars: Knights of the Old Republic", "swkotor.ini", new[] { "Lips", "Modules", "Rims", "Saves", "StreamMusic", "StreamSounds", "TexturePacks" }));
ise-uiuc/Magicoder-OSS-Instruct-75K
.observeOn(AndroidSchedulers.mainThread()) .subscribe(new Observer<Boolean>() { @Override public void onSubscribe(Disposable d) { RxSubscriptions.add(String.valueOf(EmmageeService.this), d); } @Override public void onNext(Boolean enableFloat) {
ise-uiuc/Magicoder-OSS-Instruct-75K
source _variables.sh $PYTHON_EXEC -Wd $PROJECT_ROOT/manage.py runserver $*
ise-uiuc/Magicoder-OSS-Instruct-75K