seed
stringlengths
1
14k
source
stringclasses
2 values
""" import puzzler from puzzler.puzzles.tetratwigs import OneSidedTetratwigsTriangle_3 puzzler.run(OneSidedTetratwigsTriangle_3)
ise-uiuc/Magicoder-OSS-Instruct-75K
for _, elem in elems.iterrows(): elem_vert = [] for nx in ['N1', 'N2', 'N3', 'N4']: n = int(elem[nx]) elem_vert += [(nodes_idx.loc[n, 'x'], nodes_idx.loc[n, 'y'])] verts += [elem_vert] verts_elems += [elem] return(verts, verts_elems)
ise-uiuc/Magicoder-OSS-Instruct-75K
#write the updated gamelist.xml to disk file = io.open(".//"+directory+"gamelist.xml", "w",encoding='utf-8') print("writing updated gamelist.xml") while index<len(entries): file.write(entries[index]+"\n")
ise-uiuc/Magicoder-OSS-Instruct-75K
# Add a "test factory" User so that all factory-generated comments have a # proper author, if it doesn't already exist (the user may already be in # there if running the test server and running tests individually) if not DBSession.query(User).filter(User.username == "test factory").scalar(): DBSession.add(User(user...
ise-uiuc/Magicoder-OSS-Instruct-75K
class afoiTests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() {
ise-uiuc/Magicoder-OSS-Instruct-75K
return wrapper class TwistedScheduler(BaseScheduler): """ A scheduler that runs on a Twisted reactor. Extra options: =========== ======================================================== ``reactor`` Reactor instance to use (defaults to the global reactor) =========== =====================...
ise-uiuc/Magicoder-OSS-Instruct-75K
count = count + 1 temp = input("Sorry,It's fault, Please enter another number:") guess = int(temp) print('------------------GAME OVER-------------------------------')
ise-uiuc/Magicoder-OSS-Instruct-75K
{ case PX_KEY_LEFT: { // Rotate Texture #ifdef JOHNS pxMatrix m; m.identity(); m.rotate(gTextureRotate+=gRotateDelta);
ise-uiuc/Magicoder-OSS-Instruct-75K
_Listeners.Remove(listener); } #endregion } }
ise-uiuc/Magicoder-OSS-Instruct-75K
# a workaround for https://github.com/matomo-org/matomo/issues/9549. # Run this after initially setting up Matomo through the UI. docker-compose exec matomo sed -i 's/"localhost"/"localhost:3000"/g' /var/www/html/config/config.ini.php
ise-uiuc/Magicoder-OSS-Instruct-75K
Dispose(); } public void Dispose() { CAPI.ovr_Packet_Free(packetHandle); GC.SuppressFinalize(this);
ise-uiuc/Magicoder-OSS-Instruct-75K
log.debug("timeout: %s", seconds) timer = Timer(seconds, interval) timer.setDaemon(True) timer.start() def dispose(): timer.cancel()
ise-uiuc/Magicoder-OSS-Instruct-75K
void initTestCase() { }
ise-uiuc/Magicoder-OSS-Instruct-75K
} self.checklist["Functionality"][functionality_name]["tests"][test_name]["bugs"].append(bug) def set_notes(self, functionality_name, test_name, notes): self.checklist["Functionality"][functionality_name]["tests"][test_name]["notes"] = notes
ise-uiuc/Magicoder-OSS-Instruct-75K
'sphinx.html_themes': [ 'sphinx-bootstrap-basic = sphinx-bootstrap-basic', ] }, classifiers=[ 'Framework :: Sphinx',
ise-uiuc/Magicoder-OSS-Instruct-75K
plotter.plot(OO.qual_xresid,OO.qual_yresid/10.,"m.") print(OO.sumsq_signal,OO.sumsq_residual, OO.quality_factor, math.sqrt(OO.sumsq_signal)) def chi_squared(OO):
ise-uiuc/Magicoder-OSS-Instruct-75K
('emails', '0001_initial'), ] operations = [ migrations.AlterField( model_name='mailoutuser', name='category', field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='emails.MailoutCategory'), ), ]
ise-uiuc/Magicoder-OSS-Instruct-75K
keys: &Keys, ) -> IndyResult<WalletRecord> { let decrypted_name = decrypt_merged(&record.id, &keys.name_key)?; let decrypted_name = String::from_utf8(decrypted_name).to_indy( IndyErrorKind::WalletEncryptionError,
ise-uiuc/Magicoder-OSS-Instruct-75K
<filename>followers/serializers.py from .models import Followers
ise-uiuc/Magicoder-OSS-Instruct-75K
/* Enable attributes and output message. */ addstr("\nKey pressed: "); attron(A_BOLD() | A_BLINK()); addstr(format!("{}\n", char::from_u32(c as u32).expect("Invalid char")).as_ref()); attroff(A_BOLD() | A_BLINK()); }
ise-uiuc/Magicoder-OSS-Instruct-75K
# From https://stackoverflow.com/a/49375740/827927 # import os, sys
ise-uiuc/Magicoder-OSS-Instruct-75K
git clone https://github.com/uiuc-arc/sbi.git sbi fi source ~/anaconda3/etc/profile.d/conda.sh conda create -n sbi_after_fa705c02d473a291f05aa8db840287ee5d6ba794 -y cd sbi git checkout after_fa705c02d473a291f05aa8db840287ee5d6ba794 conda activate sbi_after_fa705c02d473a291f05aa8db840287ee5d6ba794 conda install -y ...
ise-uiuc/Magicoder-OSS-Instruct-75K
def callPopUpWindow(self, detection): dialog = detectionWindow.DetectionWindow(self) dialog.setImage(detection) dialog.show() if dialog.exec_() == QtWidgets.QDialog.Accepted: return dialog.returnValue
ise-uiuc/Magicoder-OSS-Instruct-75K
).rejects.toBeInstanceOf(AppError); }); it('should not be able to create an appointment before 8am and after 6pm', async () => { jest.spyOn(Date, 'now').mockImplementationOnce(() => { return new Date(2020, 6, 10, 12).getTime(); }); await expect( createAppointment.run({ date: ne...
ise-uiuc/Magicoder-OSS-Instruct-75K
for n in range(num_rows): if metatdata_key is None: metatdata_key, = uuid.uuid4().hex path = [ PERFSONAR_NAMESPACE, key_prefix, metatdata_key ] if summary_type and summary_type != 'base': path = path + [ summary_type, str(time_int) ] ...
ise-uiuc/Magicoder-OSS-Instruct-75K
using System.Collections.Immutable; class Program
ise-uiuc/Magicoder-OSS-Instruct-75K
self._source = source def _distance_deviation(self, strokes): delayed_strokes = strokes[1:] distances = [] for i in range(len(delayed_strokes)): next_stroke = delayed_strokes[i] stroke = strokes[i] distances.append(next_stroke.horizontal_distance...
ise-uiuc/Magicoder-OSS-Instruct-75K
{ if (agent.Unit.UnitType == UnitTypes.FACTORY
ise-uiuc/Magicoder-OSS-Instruct-75K
let pool = task::block_on(sqlx::MySqlPool::new(database_url.as_str())) .expect("Failed to create pool"); Self { pool } } }
ise-uiuc/Magicoder-OSS-Instruct-75K
# Create your views here. def landing(request): title = "Home" context = {"title": title} return render(request, 'landing.html', context)
ise-uiuc/Magicoder-OSS-Instruct-75K
.dateComponents() } func twitter() { Today() .at(hour: 20, minute: 15) .dateComponents() // year: 2021, month: 1, day: 31, hour: 20, minute: 15 NextWeek() .weekday(.saturday) .at(hour: 18, minute: 50) .dateComponents() // DateComponents
ise-uiuc/Magicoder-OSS-Instruct-75K
"""Initialize test package."""
ise-uiuc/Magicoder-OSS-Instruct-75K
Diffusionlimitedevaporation_model_diffusionlimitedevaporation = Factory(name='DiffusionLimitedEvaporation', authors='OpenAlea Consortium (wralea authors)', description='the evaporation from the diffusion limited soil ', category='', nodemodule='Diffusio...
ise-uiuc/Magicoder-OSS-Instruct-75K
# Copyright (c) 2020 VMware, Inc. All Rights Reserved. # SPDX-License-Identifier: BSD-2-Clause import unittest from tern.load import docker_api from tern.utils import rootfs from test_fixtures import create_working_dir from test_fixtures import remove_working_dir class TestLoadDockerAPI(unittest.TestCase):
ise-uiuc/Magicoder-OSS-Instruct-75K
.heap() get a view of the current reachable heap .iso(obj..) get information about specific objects The optional argument, useful for debugging heapy itself, is: ht an alternative hiding tag """ r = Root() if ht is not None:
ise-uiuc/Magicoder-OSS-Instruct-75K
"""Root package for anstoss tools."""
ise-uiuc/Magicoder-OSS-Instruct-75K
model.add(keras.layers.LSTM(10)) model.add(keras.layers.Dense(1, activation='sigmoid')) return model def _createNestedSequentialModel(self): model = keras.Sequential() model.add(keras.layers.Dense(6, input_shape=[10], activation='relu')) model.add(self._createSimpleSequentialModel()) retu...
ise-uiuc/Magicoder-OSS-Instruct-75K
r = Rekord.objects.all()[0] assert "NOWAK" not in r.opis_bibliograficzny_cache assert "KOWALSKI" not in r.opis_bibliograficzny_cache @pytest.mark.django_db def test_caching_kasowanie_zrodla( denorms, wydawnictwo_ciagle_z_dwoma_autorami, ): assert Zrodlo.objects.all().count() == 1
ise-uiuc/Magicoder-OSS-Instruct-75K
class Bleno: def __init__(self):
ise-uiuc/Magicoder-OSS-Instruct-75K
expectValidationFailure(t, input, PasswordValidator, PasswordValidationError.TOO_SHORT); }); test('rejects characters repeated more than twice with too much repetition error', async (t) => { const input = 'aaa12345678'; expectValidationFailure(t, input, PasswordValidator, PasswordValidationError.TOO_MUCH_R...
ise-uiuc/Magicoder-OSS-Instruct-75K
class Settings(): def __init__(self): for k, v in dotenv_values(".settings").items():
ise-uiuc/Magicoder-OSS-Instruct-75K
{ id_categoria?:number; descripcion:string; estado:number; }
ise-uiuc/Magicoder-OSS-Instruct-75K
image = data['img'] text_polys = data['text_polys'] ignore_tags = data['ignore_tags']
ise-uiuc/Magicoder-OSS-Instruct-75K
y = x*x*x + np.sin(x)*10.0 p = np.polyfit(x, y, 3) print(p)
ise-uiuc/Magicoder-OSS-Instruct-75K
<a href="{{ route('documents',$casedocuments->file_name) }}" class="list-group-item" target="_blank"> <i class="fa fa-file-pdf-o" style="font-size:16px;color:red"></i>{{ $casedocuments->supporting_doc_name }}</a> @elseif($ext == 'doc' || $ext == 'docx') ...
ise-uiuc/Magicoder-OSS-Instruct-75K
import torch from torch.nn.functional import one_hot class Flatten: def __call__(self, img: torch.FloatTensor): return img.reshape((-1)) class OneHot:
ise-uiuc/Magicoder-OSS-Instruct-75K
// Real developers ship. import UIKit enum BtnType { case Unkown case checking case sucess
ise-uiuc/Magicoder-OSS-Instruct-75K
mapDefault(); }); </script>
ise-uiuc/Magicoder-OSS-Instruct-75K
// Copyright © 2018 Alonso. All rights reserved. // import Foundation protocol RecentSearchCellViewModelProtocol { var searchText: String { get } } final class RecentSearchCellViewModel: RecentSearchCellViewModelProtocol {
ise-uiuc/Magicoder-OSS-Instruct-75K
const VALUE_IS_NOT_URL = 1;
ise-uiuc/Magicoder-OSS-Instruct-75K
* @date :Created in 2022/1/8 22:21 * @description: * @modified By: * @version: $ */ public class test02_Scanner { public static void main(String[] args) { Scanner scan=new Scanner(System.in);
ise-uiuc/Magicoder-OSS-Instruct-75K
elif target == 'state-action': derivative_data = np.zeros( [num_data, self._env_info['ob_size'], self._env_info['action_size']], dtype=np.float ) elif target == 'action-action': derivati...
ise-uiuc/Magicoder-OSS-Instruct-75K
TRIAL_LENGTH = 6.0 #Seconds RESET_TIME = 4.0 CALM_TIME = 4.0 MEASUREMENT_PERIOD = 0.02 data = dict( (mv,dict( (t,dict((v,[]) for v in pwm_values)) for t in thrusters )) for mv in measured_vars) if __name__ == '__main__': start = time() runs = [] for t in thrusters: for v in pwm_values: ...
ise-uiuc/Magicoder-OSS-Instruct-75K
imports: [ CommonModule, SamplesRoutingModule, FormsModule ], declarations: [SamplesComponent, AddEditSampleComponent], providers: [ SamplesService, UsersService ] }) export class SamplesModule { }
ise-uiuc/Magicoder-OSS-Instruct-75K
* distributed with this work for additional information
ise-uiuc/Magicoder-OSS-Instruct-75K
class MultiTaskDense(nn.Module): features: int n_tasks: int kernel_init: Callable = nn.initializers.lecun_normal()
ise-uiuc/Magicoder-OSS-Instruct-75K
class ES: """ Execution state constants
ise-uiuc/Magicoder-OSS-Instruct-75K
with torch.no_grad():
ise-uiuc/Magicoder-OSS-Instruct-75K
items_gen = spider.parse_wallpaper_page(scrapy_response) items = list(items_gen)
ise-uiuc/Magicoder-OSS-Instruct-75K
this.x = x; this.y = y; this.weight = weight; } } /** * Version of getPixelWeights which returns the weights as relative to the total area of the input geometry (i.e. * the weight at a pixel is the proportion of the input geometry that falls within that pix...
ise-uiuc/Magicoder-OSS-Instruct-75K
*/ trait ProcessesAbilities { public function abilities(string $ability, array $parameters = [], string $serializer = null): AbilityResource { return AbilityResource::create( $this->resource,
ise-uiuc/Magicoder-OSS-Instruct-75K
QMessageBox.critical(self, self.tr('生成失败'), stack_str, QMessageBox.StandardButton.Ok, QMessageBox.StandardButton.Ok)
ise-uiuc/Magicoder-OSS-Instruct-75K
visible?: boolean; renderFooter?: () => void; format?: string; direction?: 'left' | 'right'; enableNext?: boolean; enablePrev?: boolean;
ise-uiuc/Magicoder-OSS-Instruct-75K
rem = str(input()) print("In how many minutes?") local_time = float(input()) local_time *= 60 print('I will remind you for ' + rem + ' in ' + str(local_time) + ' seconds ') time.sleep(local_time) toaster = ToastNotifier() toaster.show_toast(rem, "Here is your reminder!", duration=10)
ise-uiuc/Magicoder-OSS-Instruct-75K
from email.policy import default from flask import current_app
ise-uiuc/Magicoder-OSS-Instruct-75K
conn.commit()
ise-uiuc/Magicoder-OSS-Instruct-75K
def GoBack(self): if self.CanGoBack(): return self.ctrl.GoBack() def GoForward(self): if self.CanGoForward(): return self.ctrl.GoForward() def CanGoBack(self): return self._canGoBack def CanGoForward(self): return self._canGoForward
ise-uiuc/Magicoder-OSS-Instruct-75K
for epoch in tqdm(range(epoches)): for data_index in range(len(contig_fastas)): seed = cal_num_bins( contig_fastas[data_index], binned_length=binned_lengths[data_index],
ise-uiuc/Magicoder-OSS-Instruct-75K
ENVIRONMENT_PARAMS_PER_UNIVERSE_DOMAIN_TASK_VISION = { 'gym': { 'DClaw': {}, }, } """ Helper methods for retrieving universe/domain/task specific params. """
ise-uiuc/Magicoder-OSS-Instruct-75K
//} // Time Is Money
ise-uiuc/Magicoder-OSS-Instruct-75K
size 11960
ise-uiuc/Magicoder-OSS-Instruct-75K
for row in matrix: column_sum += row[i] column_sums.append(column_sum) # the total sum could be calculated from either the rows or the columns # coerce to float to make subsequent division generate float results grand_total = float(sum(row_sums))
ise-uiuc/Magicoder-OSS-Instruct-75K
private static function makeOne($data, $user) { $question = Question::find($data['question_id']); $answer = new self; $answer->user()->associate($user); $answer->question()->associate($question); $answer->text = $data['text']; $answer->is_real = $data['is_real'];...
ise-uiuc/Magicoder-OSS-Instruct-75K
fmt.callback = MixAudioCbk; fmt.userdata = this;
ise-uiuc/Magicoder-OSS-Instruct-75K
new MenuItemInfo("Teacher | Group Master", "la la-globe", TeacherGroupMaster.class), new MenuItemInfo("Teacher | About", "la la-globe", About.class), };
ise-uiuc/Magicoder-OSS-Instruct-75K
count = 0; gen("", n); return count; } private static void gen(String str, int num) {
ise-uiuc/Magicoder-OSS-Instruct-75K
} var icons = [ AltIcon(displayName: "Stock", author: "Dennis Bednarz", key: nil, image: altImage("AppIcon60x60")), AltIcon(displayName: "OG", author: "Dennis Bednarz", key: "OG", image: altImage("OG")), AltIcon(displayName: "Taurine", author: "Alpha_Stream", key: "Taurine", image: ...
ise-uiuc/Magicoder-OSS-Instruct-75K
name='is_read', field=models.BooleanField(default=False, verbose_name='Запись прочитана пользователем'), ), ]
ise-uiuc/Magicoder-OSS-Instruct-75K
from abc import ABC, abstractmethod def string_to_datetime(date: str, format_: str = None) -> datetime: if format_ is None: format_ = "%Y/%m/%d %H:%M:%S.%f" dt = datetime.strptime(date.replace('-', '/').replace('T', ' ').replace('Z', ''), format_) return dt
ise-uiuc/Magicoder-OSS-Instruct-75K
break except sr.UnknownValueError as e: continue return result.lower().strip()
ise-uiuc/Magicoder-OSS-Instruct-75K
/// <summary> /// Creates another metro window instance with the given (default) parameters. /// </summary> /// <param name="showInTaskbar"></param> /// <param name="showActivated"></param> /// <param name="topmost"></param> /// <param name="resizeMode"></param> ...
ise-uiuc/Magicoder-OSS-Instruct-75K
# from fit import FitCLI, fit, fit_sat # from . import fit # works weirdly from .fit import FitCLI, fit, fit_sat __all__ = ["FitCLI", "fit", "fit_sat"]
ise-uiuc/Magicoder-OSS-Instruct-75K
"""Delete the bookmark of the current server. See https://app.yuleak.com/apidoc#delete-bookmark for endpoint details. Returns: (bool) True if the bookmark have been deleted """ if not self.bookmark: logger.warning('The server is not bookmarked.') ...
ise-uiuc/Magicoder-OSS-Instruct-75K
class PlayerScoresResponse(messages.Message): """For returning multiple PlayerScoreResponse(s)""" items = messages.MessageField(PlayerScoreResponse, 1, repeated=True)
ise-uiuc/Magicoder-OSS-Instruct-75K
references = fin.read().replace("<t> ", "").replace( "</t> ", "").split("\n")[:-1] assert all([len(x) > 0 for x in predictions]) scores = Rouge().get_scores(predictions, references, avg=True) pprint(scores) if __name__ == "__main__": parser = argparse.ArgumentPa...
ise-uiuc/Magicoder-OSS-Instruct-75K
return self._info == other._info def __ne__(self, other): # Using not of '==' implementation because the not of # __eq__, when it returns NotImplemented, is returning False. return not self == other def set_info(self, key, value): """Set an objects information with key,...
ise-uiuc/Magicoder-OSS-Instruct-75K
class TreeNode(object): def __init__(self, val, children): self.val = val self.children = children
ise-uiuc/Magicoder-OSS-Instruct-75K
// CHECK: } // end sil function '$S4weak2CCC{{[_0-9a-zA-Z]*}}fc' init() { var foo = x } }
ise-uiuc/Magicoder-OSS-Instruct-75K
if 'ec2' in host_name: session = getAWSSession(profile='AWS') else: session = getAWSSession(profile=config['PRCONFIG']['AWS']['PROFILE'])
ise-uiuc/Magicoder-OSS-Instruct-75K
static var picImage :UIImage? override func viewDidLoad() { super.viewDidLoad() setConfig() if isIPhone6 { pivH.constant = 130 btnCons.constant = -10 }
ise-uiuc/Magicoder-OSS-Instruct-75K
class CohortsConfig(AppConfig): name = 'scuole.cohorts'
ise-uiuc/Magicoder-OSS-Instruct-75K
main() { set -eux local -r JUPYTERLAB_DIR=$(jupyter lab path|sed -En 's/Application directory: *(.*)/\1/p') local -r PLUGIN_CONFIG="${JUPYTERLAB_DIR:-}/schemas/@renku/jupyterlab-vnc/plugin.json" if [[ -e "${PLUGIN_CONFIG:-}" && -n "${JUPYTERHUB_SERVICE_PREFIX:-}" ]]; then
ise-uiuc/Magicoder-OSS-Instruct-75K
__repr__ = property_repr def __init__(self, benchmark_provider, units): self._provider = benchmark_provider self._units = units @property def units(self): return self._units @property def daily_returns(self): return self._provider.daily_returns @property
ise-uiuc/Magicoder-OSS-Instruct-75K
} fn set_cancelled(mut self) { self.scheduler.execute(TransferJob::done(self.next)); }
ise-uiuc/Magicoder-OSS-Instruct-75K
c = calendar.TextCalendar(calendar.SUNDAY) c.prmonth(2017, 7)
ise-uiuc/Magicoder-OSS-Instruct-75K
if (geofenceBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureGeofenceIsMutable(); geofence_.add(index, value); onChanged(); } else {
ise-uiuc/Magicoder-OSS-Instruct-75K
curl -H "Content-Type: application/json" -X POST http://$COUCHDB_USER:$COUCHDB_PASSWORD@localhost:$DB_PORT/_cluster_setup -d '{"action": "finish_cluster"}' fi else # single node, directly create the couchdb system databases curl -X PUT http://$COUCHDB_USER:$COUCHDB_PASSWORD@localhost:$DB_PORT/_users...
ise-uiuc/Magicoder-OSS-Instruct-75K
# {'claim': {'con_addr': 'test', 'token_id': 'test'}, # 'context': 'https://github.com/WeBankFinTech/WeIdentity/blob/master/context/v1', # 'cptId': 2000003, # 'expirationDate': 1650287553, # 'id': 'c5cb3828-5d94-4e5b-afdd-f965125fd3e8', # ...
ise-uiuc/Magicoder-OSS-Instruct-75K
class InvalidErrorView(object):
ise-uiuc/Magicoder-OSS-Instruct-75K
upgrade()
ise-uiuc/Magicoder-OSS-Instruct-75K