seed
stringlengths
1
14k
source
stringclasses
2 values
got = client.get("/example/42/", expected_statuses=[400]) assert got == "Invalid id" def test_raises_with_default_client_for_cors_api(make_client, cors_api):
ise-uiuc/Magicoder-OSS-Instruct-75K
echo "alter table ui_bookmark alter column current set default 0;" | mysql -h127.0.0.1 -u root -p123123qa m2_core_std
ise-uiuc/Magicoder-OSS-Instruct-75K
{ this->m_handler = std::exchange(o.m_handler, EMPTY); this->m_libpath = std::move(o.m_libpath); return *this; } dll::Handler::Handler(Path libpath) :
ise-uiuc/Magicoder-OSS-Instruct-75K
*/ /* * Which headers should be forwarded to/from remote HTTP servers? */ #pragma once #include "http/Status.h" #include <beng-proxy/Headers.hxx>
ise-uiuc/Magicoder-OSS-Instruct-75K
required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } override func loadView() {
ise-uiuc/Magicoder-OSS-Instruct-75K
from cloudmesh.management.configuration.SSHkey import SSHkey from cloudmesh.mongo.DataBaseDecorator import DatabaseUpdate from cloudmesh.common.debug import VERBOSE
ise-uiuc/Magicoder-OSS-Instruct-75K
impl Drop for FileBackedMemoryDropWrapper { #[inline(always)] fn drop(&mut self) { self.address.unmap(self.mapped_length) } } impl FileBackedMemoryDropWrapper { #[inline(always)]
ise-uiuc/Magicoder-OSS-Instruct-75K
# {'write_url': write_url, 'size': None, 'schema': schema} try: result_dict = controller.provision_writable_segment(segment_id, schema_id=schema_id) result_json = ujson.dumps(result_dict) return flask.Response(result_json, mimetype='application/json') except t...
ise-uiuc/Magicoder-OSS-Instruct-75K
import tushare as ts from utils.netease import * read_dir = 'data/netease/hist' write_dir = 'data/netease/hist_ma'
ise-uiuc/Magicoder-OSS-Instruct-75K
#include "debug.h" #include <QApplication> #include <QDateTime> #include <QUuid> #include <QIcon> #include <QSqlQuery> #include <QSqlRecord>
ise-uiuc/Magicoder-OSS-Instruct-75K
return "?"
ise-uiuc/Magicoder-OSS-Instruct-75K
a: self.a.pressed(input_state), b: self.b.pressed(input_state), start: self.start.pressed(input_state), select: self.select.pressed(input_state), }, } } } pub fn gameboy_input_system( config: Res<Config>, input_keycode: Res...
ise-uiuc/Magicoder-OSS-Instruct-75K
NODE_INT_URL = "http://localhost:8081" NODE_EXT_URL = "http://localhost:8080"
ise-uiuc/Magicoder-OSS-Instruct-75K
): if not isinstance(hp, SigCnnHp): raise ValueError("wrong hyper-parameter class: {hp}") wandb.init(project="g2net-" + __name__, entity="wisdom", config=asdict(hp)) self._train( SigCnn(device, hp), device, data_dir, n, [filter_sig_meta], hp, submission )
ise-uiuc/Magicoder-OSS-Instruct-75K
y_g.append(green_result) y_b.append(blue_result) # print(red_result)
ise-uiuc/Magicoder-OSS-Instruct-75K
def refresh(self): debug("REFRESH") def read_input(self): user_input = input("Input: ")
ise-uiuc/Magicoder-OSS-Instruct-75K
// Method Parameters private readonly string _name = "TestProvider"; private readonly bool _isExactMatch = true; public override void Setup() { _tokenServiceClient = Substitute.For<ITokenServiceClient>();
ise-uiuc/Magicoder-OSS-Instruct-75K
<!--[if lt IE 9]>
ise-uiuc/Magicoder-OSS-Instruct-75K
sudo service nginx restart # Navigate to the app folder cd ../.../app/ # Ensure dependancies are installed npm install # Run the app.js pm2 start app.js --update-env
ise-uiuc/Magicoder-OSS-Instruct-75K
<filename>src/main/java/designpattern/behavioral/iterator/IteratorPatternDemo.java package designpattern.behavioral.iterator; public class IteratorPatternDemo { public static void main(String[] args) { Obj obj = new Obj();
ise-uiuc/Magicoder-OSS-Instruct-75K
query.addGraphURI(uri); } } private void setVars(Map<Var, Node> values, String fieldName) { if (values.isEmpty()) { return; } try { Field f = Query.class.getDeclaredField(fieldName); f.setAccessible(true); List<String> orig = (List<String>) f.get(query); List<String> lst = null; if (orig...
ise-uiuc/Magicoder-OSS-Instruct-75K
,"One team will be permanently on the day shift and the other will be on the night shift."]) self.workSchedule = WorkSchedule("2 Team Fixed 12 Plan", description) # Day shift, starts at 07:00 for 12 hours day = self.workSchedule.createShift("Day", "Day shift", time(7, 0, 0), timedelta(...
ise-uiuc/Magicoder-OSS-Instruct-75K
public class LibraryNumberTest { @Test public void testParser_Valid_1() throws LibraryNumber.InvalidFormat { LibraryNumber libraryNumber = LibraryNumber.parse("555-1234"); assertNotNull("parse(String) Should return non-null LibraryNumber!", libraryNumber); assertEquals("555", libraryNum...
ise-uiuc/Magicoder-OSS-Instruct-75K
for i in range(maxiter): # Assign all points to the nearest centroid for i, c in enumerate(centroids): distances[:, i] = get_distances(c, X) # Determine class membership of each point # by picking the closest centroid classes = np.argmin(distances, axis=1) print(distances) print(cl...
ise-uiuc/Magicoder-OSS-Instruct-75K
#Imprimindo no console
ise-uiuc/Magicoder-OSS-Instruct-75K
title: { text: 'User By Access by day', x: -20 //center
ise-uiuc/Magicoder-OSS-Instruct-75K
with FileObject(fname, mode='w', compression=compress_with) as fobj: self.to_fp(fobj.fp, comments) def to_fp(self, file_pointer, comments=None): """
ise-uiuc/Magicoder-OSS-Instruct-75K
pub fn conv_settling_time(&mut self, ch: Channel) -> Result<u16, Error<BE>> { self.read_reg(0x10 + ch as u8) }
ise-uiuc/Magicoder-OSS-Instruct-75K
}; ResponseTemplate::new(200).set_body_json(body) })
ise-uiuc/Magicoder-OSS-Instruct-75K
size=20, ), paper_bgcolor="rgba(0, 0, 0, 0)", )
ise-uiuc/Magicoder-OSS-Instruct-75K
], cmdclass={ 'build_ext': BuildExtension })
ise-uiuc/Magicoder-OSS-Instruct-75K
let label = UILabel(frame: CGRect(x: UIScreen.main.bounds.width / 2.0 - 20, y: 44 + 200 / 2.0 - 20, width: 40, height: 40)) label.text = "至" label.textAlignment = .center return label }() /// 视图的父视图 lazy var bgView: UIView = { let view = UIView(frame: CGRect(x: 0, y: ...
ise-uiuc/Magicoder-OSS-Instruct-75K
/** * <p> * Consumer can use this constructor to choose a different lineLength * when encoding (lineSeparator is still CRLF). All forms of data can * be decoded. * </p><p> * Note: lineLengths that aren't multiples of 4 will still essentially * end up being multiples of ...
ise-uiuc/Magicoder-OSS-Instruct-75K
print(f"Ignoring path {file}.") continue build_cmd = [sys.executable, build_path, addon_path, generated_path] if args.qtpath: build_cmd.append("-q") build_cmd.append(args.qtpath) subprocess.call(build_cmd) generated_addon_path = os.path.join(generated_path, file + ".rcc")...
ise-uiuc/Magicoder-OSS-Instruct-75K
entity.context = { 'role_id': role_id, 'created_at': now, 'updated_at': now, } writer.put(entity, origin='bulk') if index and len(entity_ids) < MAX_PAGE: entity_ids.add(entity.id) writer.flush() if index: if len(entity_ids) ...
ise-uiuc/Magicoder-OSS-Instruct-75K
stringify!(get) ) ); }
ise-uiuc/Magicoder-OSS-Instruct-75K
import { permKeys, roleKeys } from './keys' import { PermKey, RoleKey } from './types' export const isPermKey = (value: any): value is PermKey => permKeys.includes(value)
ise-uiuc/Magicoder-OSS-Instruct-75K
private static let _statusBarHeight = _sharedApplication.statusBarFrame.size.height
ise-uiuc/Magicoder-OSS-Instruct-75K
/// <summary> /// Returns a shared <see cref="LittleDifferenceFilter"/>. /// </summary> [NotNull] public LittleDifferenceFilter sharedLittleDifferenceFilter { get { if (m_sharedFilter == null) { m_sharedFilter = littleDifferenceFilter; }
ise-uiuc/Magicoder-OSS-Instruct-75K
} } func fiatValueAttributedString(currencyAmount: String?) -> NSAttributedString { return NSAttributedString(string: amountAccordingRPCServer(currencyAmount: currencyAmount) ?? "-", attributes: [ .foregroundColor: Screen.TokenCard.Color.title, .font: Screen.TokenCard.Fo...
ise-uiuc/Magicoder-OSS-Instruct-75K
data_std : numpy.ndarry データを標準化したデータ """ data, data_std = input_data(
ise-uiuc/Magicoder-OSS-Instruct-75K
fh.close() output.close() CreatePalette()
ise-uiuc/Magicoder-OSS-Instruct-75K
# Send Acknowledgment to Client ack_message = 'Ack' + seq send_sock.sendto(ack_message.encode(), dest) # if the received sequence number is the expected sequence number # besara7a el 7eta de msh mgama3ha awy fa 7awel tefhamha enta if seq == str(expecting_seq): ...
ise-uiuc/Magicoder-OSS-Instruct-75K
struct VecReader(Vec<u8>); impl io::Read for VecReader { fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> { let len = buf.len().min(self.0.len());
ise-uiuc/Magicoder-OSS-Instruct-75K
// >>>>这就是网页授权登录了,login是登录点击,callback是登录成功后的运行 public function login() { if(Session("?name")){ echo "you have login"; }else{ return $this->oauth->redirect(); } } public function login_on() { $user = $this->oauth->user();
ise-uiuc/Magicoder-OSS-Instruct-75K
def _create_shingle(self, doc): shinglesInDoc = set() for index in range(0, len(doc) - (self.shinglesize - 1)): shingle = " ".join(doc[index:(index + self.shinglesize)]) # ... return shinglesInDoc
ise-uiuc/Magicoder-OSS-Instruct-75K
return Err(IndexError::SQLiteError(err).into()); }
ise-uiuc/Magicoder-OSS-Instruct-75K
type Output = True; } impl<N,D> TrialDivisionTreeLeaf<D,True> for N where N: Reduce<D>, ReduceOut<N,D>: IsNonZero { type Output = IsNonZeroOut<ReduceOut<N,D>>; }
ise-uiuc/Magicoder-OSS-Instruct-75K
extension NewTestResults.Result: AddRequestJSON { }
ise-uiuc/Magicoder-OSS-Instruct-75K
except Exception as exc: raise exc else: return data def write(self, query: str) -> int: written_row_id = None try:
ise-uiuc/Magicoder-OSS-Instruct-75K
refractive_interface_with_collimated_beam(do_plot=True)
ise-uiuc/Magicoder-OSS-Instruct-75K
} } public void armLift(int pos, Double pow) { armMotor.setTargetPosition(pos); armMotor.setMode(DcMotor.RunMode.RUN_TO_POSITION); armMotor.setPower(pow); while(armMotor.isBusy()) { } armMotor.setPower(0); }
ise-uiuc/Magicoder-OSS-Instruct-75K
<filename>build.sh #!/bin/bash docker build --no-cache --squash --tag docker-spark-create .
ise-uiuc/Magicoder-OSS-Instruct-75K
namespace Keygen\License\Traits; use Keygen\License\License; use Keygen\Util\Debug; trait GetLicenseTrait { /** * Returns a License object that was retrieved from the Keygen.sh API.
ise-uiuc/Magicoder-OSS-Instruct-75K
def test_ensure_failure(self): class _CustomError(Exception): pass def publish(): raise _CustomError('bar') ensured = self.conn.ensure(None, publish) with self.assertRaises(_CustomError): ensured() def test_ensure_connection_failure(self): ...
ise-uiuc/Magicoder-OSS-Instruct-75K
def action(scheduler: abc.SchedulerBase, state: Any) -> None:
ise-uiuc/Magicoder-OSS-Instruct-75K
import java.util.Optional; import java.util.stream.Stream; public interface TicketBusRepository extends MongoRepository<TicketBusEntity, String> { Optional<TicketBusEntity> findByReference(String reference);
ise-uiuc/Magicoder-OSS-Instruct-75K
cd libjxl mkdir build && cd build cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF ..
ise-uiuc/Magicoder-OSS-Instruct-75K
/// @param expr Integer arithmetic expression e.g. "1000", "10^22" /// @pre expr <= get_max_x() /// std::string pi(const std::string& x); /// Enable/disable printing status information during computation. void set_print(bool is_print); /// Set the number of threads. void set_num_threads(int num_threads);
ise-uiuc/Magicoder-OSS-Instruct-75K
public interface WebApiDevicesCallback { void onFinish(WebApiResultStatus status, List<ACDevice> list); }
ise-uiuc/Magicoder-OSS-Instruct-75K
{ mnCurButtonId = pItem->mnId; Click(); break; } pItem = mpItemList->Next(); } return 0; }
ise-uiuc/Magicoder-OSS-Instruct-75K
createSs58, CUSTOM_ENDPOINT_KEY };
ise-uiuc/Magicoder-OSS-Instruct-75K
return gold_tokens while True: if state == SEARCHING: print("Searching for gold tokens...") tokens = get_gold_tokens() print(tokens) if len(tokens) > 0: m = tokens[0]
ise-uiuc/Magicoder-OSS-Instruct-75K
SQLALCHEMY_TRACK_MODIFICATIONS = False # jwt configuarations for the user auth api JWT_SECRET_KEY = environ.get('SECRET_KEY') JWT_ACCESS_TOKEN_EXPIRES = timedelta(days=1) # pagination NUM_OF_ITEMS_PER_PAGE = 18 class DevelopmentConfig(Config): """ app development configuration class """ ...
ise-uiuc/Magicoder-OSS-Instruct-75K
"n_layers_out_t": 2,
ise-uiuc/Magicoder-OSS-Instruct-75K
// Update is called once per frame void Update() { if (!gameManager.isAudioOn || !gameManager.isGameActive) { audioSource.mute = true; } else { audioSource.mute = false; } }
ise-uiuc/Magicoder-OSS-Instruct-75K
#include "CommonErrorRespSource.h" namespace HTTP { namespace RespSource { Combiner::RedirectResponse::RedirectResponse(const std::string &Target, bool IsPermanent) : RespCode(IsPermanent ? RC_MOVEPERMANENT : RC_TEMP_REDIRECT), TargetLocation(Target) { }
ise-uiuc/Magicoder-OSS-Instruct-75K
self.message_id = result.get('message_id', None)
ise-uiuc/Magicoder-OSS-Instruct-75K
if args.chainname: chainname = args.chainname else: chainname = 'logchain' #print 'connecting Savoir(%s,%s,%s,%s,%s)' % (rpcuser,rpcpasswd,rpchost,rpcport,chainname) savoirapi = Savoir(rpcuser,rpcpasswd,rpchost,rpcport,chainname) insert(savoirapi,args.targetrecordspersecond)
ise-uiuc/Magicoder-OSS-Instruct-75K
license=about["__license__"], classifiers=[
ise-uiuc/Magicoder-OSS-Instruct-75K
rust_pong::run(); }
ise-uiuc/Magicoder-OSS-Instruct-75K
# print(kcsClient.describe_security_group(**{'AvailableZone': 'az', 'SecurityGroupId': 'securityGroupId'})) # 实例绑定安全组 # print(kcsClient.allocate_security_group(**{'AvailableZone': 'az', 'CacheId.1': 'cacheId', 'SecurityGroupId.1': 'securityGroupId'})) # 实例解绑安全组 # print(kcsClient.deallocate_securit...
ise-uiuc/Magicoder-OSS-Instruct-75K
def test_build_cpu_instruction_brk(setup): "Test the BRK instruction" computer = setup # BRK instructions computer.memory.write(0x00, 0x00) computer.memory.write(0x01, 0xEA) # The interrupt vector pointer computer.memory.write(0xFFFE, 0x10) computer.memory.write(0xFFFF, 0x20) compu...
ise-uiuc/Magicoder-OSS-Instruct-75K
"commit", models.CharField( blank=True, help_text="Commit hash for the repo (if this commit came from a Github starter repo).", max_length=40, null=True, ), ...
ise-uiuc/Magicoder-OSS-Instruct-75K
public class MessageEntityTable implements SQLiteTable { /** * Costant represents typeName of table message */ public static final String TABLE_NAME = "message";
ise-uiuc/Magicoder-OSS-Instruct-75K
// redirect for OAuth proxy redirect : string; kind : string; //[key : string] : unknown; } } export {};
ise-uiuc/Magicoder-OSS-Instruct-75K
INSYNC = "INSYNC"
ise-uiuc/Magicoder-OSS-Instruct-75K
) op.create_table('user', sa.Column('id', sa.Integer(), autoincrement=True, nullable=False), sa.Column('username', sa.String(length=100), nullable=False), sa.Column('olx_user_slug', sa.String(length=100), nullable=True), sa.Column('on_olx_since', sa.DateTime(), nullable=True), sa.Column('pho...
ise-uiuc/Magicoder-OSS-Instruct-75K
def delete_png(): list = os.listdir() images = [x for x in list if ".png" in x] for x in images: os.remove(x)
ise-uiuc/Magicoder-OSS-Instruct-75K
* Process Search Request * * @param RequestInterface $request * @return QueryResponse */ public function query(RequestInterface $request); }
ise-uiuc/Magicoder-OSS-Instruct-75K
readed_num = models.IntegerField(default=0)
ise-uiuc/Magicoder-OSS-Instruct-75K
d_loss_real = criterion(outputs, real_labels) real_score = outputs class_label = one_hot_embedding(label, 10) z = torch.randn(BATCH_SIZE, 64)#.to(DEVICE) generator_input = torch.cat([z, class_label], 1) fake_images= G(generator_input)
ise-uiuc/Magicoder-OSS-Instruct-75K
} self._test_call('/checkout/modify', args, kwargs)
ise-uiuc/Magicoder-OSS-Instruct-75K
use std::path::Path; use wasm_raytracer::*; fn main() { let mut r = Renderer::new(800); r.scene(LightSpheres {}); r.render(100); r.write_image(Path::new(r"out.png")); }
ise-uiuc/Magicoder-OSS-Instruct-75K
} /// See [redis::Pipeline::arg](https://docs.rs/redis/latest/redis/struct.Pipeline.html#method.arg)
ise-uiuc/Magicoder-OSS-Instruct-75K
Comp: <FileZipOutlined />, }, ]
ise-uiuc/Magicoder-OSS-Instruct-75K
) -> Result<(), DkgVerifyReshareDealingError> { // The dealer should be resharing their own threshold key: { let reshared_individual_public_key: PublicKeyBytes = { individual_public_key(&resharing_public_coefficients, dealer_index) .map_err(|error| { ...
ise-uiuc/Magicoder-OSS-Instruct-75K
expected_srs = [] loss_list = [] # X_to_test = [[] for i in range(K)] # y_to_test = [[] for i in range(K)] # Run algorithm for T time steps for t in range(T): # Feb 22: We do not care about mean expected loss anymore
ise-uiuc/Magicoder-OSS-Instruct-75K
print(selectedIndex) }
ise-uiuc/Magicoder-OSS-Instruct-75K
enum TraitType { case boldness static var all: [TraitType] { return [.boldness] }
ise-uiuc/Magicoder-OSS-Instruct-75K
template = cv2.imread('images/hazard.png',0) w, h = template.shape[::-1] while True: if cv2.waitKey(100) & 0xFF == ord('q'): #q to quit cv2.destroyAllWindows() break ret, frame = capture.read() if ret==False: print "Error !"
ise-uiuc/Magicoder-OSS-Instruct-75K
tag_and_push () { local source=$1 local target=$2 # Base image echo "Pushing ${target} image ..." docker tag ${source} ${target} docker push ${target} }
ise-uiuc/Magicoder-OSS-Instruct-75K
extension ID3v1 { /// Serialize a single field, checking for maximum length and padding if necessary. /// /// This can be used for serializing both ID3v1 and ID3v1.1 fields. static func serialize(tag: String, using encoding: String.Encoding, length: Int) -> Data? { // Verify conversion and that...
ise-uiuc/Magicoder-OSS-Instruct-75K
</languagepack> <languagepack version="2.2.3" language="fr_FR"> <md5>f39b898bf9efedfbbf8b670e7ce7bb88</md5> </languagepack> <languagepack version="2.3.0" language="default"> <md5>d4f85ecaf4f6a0c83cfcf5e68dcd7a0f</md5> </languagepack> <languagepack version="2.3.0" language="fr_FR"> <md5>37428948f560...
ise-uiuc/Magicoder-OSS-Instruct-75K
set_name(0x800A2F5C, "Words", SN_NOWARN) set_name(0x800A3134, "MonDays", SN_NOWARN)
ise-uiuc/Magicoder-OSS-Instruct-75K
# minx = newpx # if (newpx > maxx): # maxx = newpx # if (newpy < miny): # miny = newpy # if (newpy > maxy): # maxy = newpy # thisarea = (maxx - minx) * (maxy - miny) # print(i, minx, maxx, miny, maxy) # minarea.append(thisarea) mintime...
ise-uiuc/Magicoder-OSS-Instruct-75K
return 1; } fprintf(stderr, "Enter command\n"); char str[16384]; while (fgets(str, sizeof str, stdin)) { char* arg_list[128]; if (execute_mono_cmd(get_args_list(str, &arg_list[0]), arg_list) < 0) { break; } }
ise-uiuc/Magicoder-OSS-Instruct-75K
TEST_FAUCET_ADDR, owner, TokenAmount::from(10_000u32), METHOD_SEND, RawBytes::default(),
ise-uiuc/Magicoder-OSS-Instruct-75K
[Fact] public void Should_not_throw() { var transportExtensions = new TransportExtensions<AzureStorageQueueTransport>(new SettingsHolder()); AzureStorageQueuesTransportExtensions.EnableSupportForEventGridEvents(transportExtensions); AzureStorageQueuesTransport...
ise-uiuc/Magicoder-OSS-Instruct-75K
/** * 通过{@link #getSupportFragmentManager()}将布局替换成{@link Fragment},如在{@link #switchFragment(Intent)}方法中使用 * @param fragment */
ise-uiuc/Magicoder-OSS-Instruct-75K