seed
stringlengths
1
14k
source
stringclasses
2 values
loss = criterion(pred, label) optimizer.zero_grad() loss.backward() optimizer.step() total_loss += loss.item() print(total_loss) if i % 10 == 0: # torch.save(model, args.save_file) torch.save({'state_dict': model.state_dict()}, 'stock.pkl') print('...
ise-uiuc/Magicoder-OSS-Instruct-75K
def test_product_returns(): """test if return is a single product """ assert largest_product.largest([[2, 2]]) is 4 def test_returns_largest(): """ test if return is the largest of longer array """ assert largest_product.largest([[1, 3], [6, 10], [4, 5]]) is 60 def test_empty_list():
ise-uiuc/Magicoder-OSS-Instruct-75K
for i in range(len(nums)): if helper(i, i, 0, set()): return True return False
ise-uiuc/Magicoder-OSS-Instruct-75K
@Override public void handleRequest( InputStream inputStream, OutputStream outputStream, Context context) throws IOException { OSSClient client = new OSSClient( "http://oss-cn-shanghai.aliyuncs.com", context.getExecutionCredentials().getAccessKeyId(),
ise-uiuc/Magicoder-OSS-Instruct-75K
using namespace maolan::audio; int main(int argc, char **argv) { if (argc < 2) {
ise-uiuc/Magicoder-OSS-Instruct-75K
CertificationAuthorityCustomAuthToken, CertifierRegisterView, \ RecipientRegisterView, CertifierCustomAuthToken, RecipientCustomAuthToken, \ CertificateRegisterView, CertifierDependencyView, SignatureRegisterView, \ CertifiersView, GetCertificateView
ise-uiuc/Magicoder-OSS-Instruct-75K
config: GlobalConfig = _load_config("src/config/config.yaml", GlobalConfig) camera_config: tp.List[CameraConfigSection] = _load_config("src/config/camera_config.yaml", tp.List[CameraConfigSection])
ise-uiuc/Magicoder-OSS-Instruct-75K
public interface SampleApplication { public String getName(); public String getDescription();
ise-uiuc/Magicoder-OSS-Instruct-75K
def main(): ## we define a request object that is equal to requests.get('API') req = requests.get('http://10.132.16.56:8000/sendjson') 'http://192.168.1.61:8080/api/call' ## we then print out the http status_code that was returned on making this request ## you should see a successfull '200' code be...
ise-uiuc/Magicoder-OSS-Instruct-75K
// MARK: Entity struct SampleItemResponse: Codable { let data: [SampleItem] } struct SampleItem: Codable, Hashable { let id: Int
ise-uiuc/Magicoder-OSS-Instruct-75K
sys.path.append('.') import mdldictionary as disk # read which disk this is about target = str(np.loadtxt('whichdisk.txt', dtype='str')) # load model and residual visibilities into MS format ImportMS('data/'+target+'.ms',
ise-uiuc/Magicoder-OSS-Instruct-75K
conv_count , kernel_size=(3,14) , strides=(2,1) , padding='valid' , activation='relu' , data_format="channels_last" , kernel_initializer='he_normal' , trainable=decoder_trainable ) res = conf(res) ...
ise-uiuc/Magicoder-OSS-Instruct-75K
application_state = attrib(type=dict) version = attrib(type=str)
ise-uiuc/Magicoder-OSS-Instruct-75K
static _normalize(vec: IVector2, type: TypedArrayConstructor) { const length = vec.length(); return this._divide(vec, length, type); } /** * add value(static version) */ static _add(l_vec: IVector2, r_vec: IVector2, type: TypedArrayConstructor) { const x = l_vec.v[0] + r_vec.v[0];
ise-uiuc/Magicoder-OSS-Instruct-75K
op.drop_table("dummytable") # ### end Alembic commands ###
ise-uiuc/Magicoder-OSS-Instruct-75K
#include "backends/gpu/fvm.hpp" #endif #include "fvm_lowered_cell_impl.hpp" namespace arb { fvm_lowered_cell_ptr make_fvm_lowered_cell(backend_kind p, const execution_context& ctx) { switch (p) { case backend_kind::multicore: return fvm_lowered_cell_ptr(new fvm_lowered_cell_impl<multicore::backend>(ct...
ise-uiuc/Magicoder-OSS-Instruct-75K
pd.set_option('display.max_rows', None) store = get_store(store_type) def get_equity_value(exsymbols, date): closes = [] for exsymbol in exsymbols: df = store.get(exsymbol) if date in df.index: closes.append(df.loc[date].close) else: close = df.loc[:date].iloc[-1]...
ise-uiuc/Magicoder-OSS-Instruct-75K
clear_timeout(&self.id); } }
ise-uiuc/Magicoder-OSS-Instruct-75K
with open(output_path + "/" + manga_title + "/index.html", "w") as f: f.write(html)
ise-uiuc/Magicoder-OSS-Instruct-75K
prior_rules.append(drs) results.append((drs, prior_w * w * rule_weight, prior_rules)) return results def compute(self): results = [] to_process = [(self.data, 1, [self.data])] for i in range(self._max_depth): new_results = [] f...
ise-uiuc/Magicoder-OSS-Instruct-75K
graph.edge[i].weight = r; } int res = graph.KruskalMST(); out.println(res); }
ise-uiuc/Magicoder-OSS-Instruct-75K
}) }) // creating view for component. return ( <ControlledStringInput ref={dropRef}
ise-uiuc/Magicoder-OSS-Instruct-75K
final String mpmName = mpList[i]; if (mpmName == null) { continue; } final SnmpOid mpIndex = poolIndexMap.get(mpmName); if (mpIndex == null) { continue; } // The MemoryPool index is an int, so it's the first // and only sub...
ise-uiuc/Magicoder-OSS-Instruct-75K
float DeltaTime::elapsed() const { return timer.elapsed(); }
ise-uiuc/Magicoder-OSS-Instruct-75K
pass @abstractmethod def onTrade(self, trade): """收到成交推送(必须由用户继承实现)""" pass
ise-uiuc/Magicoder-OSS-Instruct-75K
} { var path = Filepath.Parse(".svn");
ise-uiuc/Magicoder-OSS-Instruct-75K
# features for all templates (240) template_list = [] template_global_list = [] template_ratios_list = [] batch_size = 10 temp_batch_local = [] temp_batch_global = [] temp_batch_ratios = [] iteration = 0
ise-uiuc/Magicoder-OSS-Instruct-75K
self.dataSourceIndex = 1 def newDataSource(self, number, name): self.dataSources[number] = DataSource(number, name) self.setCurrentDataSource(number) self.dataSourceIndex += 1 def setCurrentDataSource(self, number): self.currentDataSource = self.dataSources[number]
ise-uiuc/Magicoder-OSS-Instruct-75K
sel = random.randint(0, len(empty_cells)-1) # select one randomly empty_cells[sel].change_digit(self.tur, random.randint(1, 2) * 2) del empty_cells if self.is_game_over(): showwarning("Thank you", "Game Over!\n") return True def is_game_over(self): """ C...
ise-uiuc/Magicoder-OSS-Instruct-75K
# Respect AWS_DEFAULT_REGION if specified [ -n "$AWS_DEFAULT_REGION" ] || export AWS_DEFAULT_REGION=us-east-1 # Respect AWS_DEFAULT_OUTPUT if specified [ -n "$AWS_DEFAULT_OUTPUT" ] || export AWS_DEFAULT_OUTPUT=json # Capture output output=$( sh -c "aws ecr $*" ) $( sh -c "aws ecr $*" )
ise-uiuc/Magicoder-OSS-Instruct-75K
('blog', '0012_remove_tag_image'), ] operations = [ migrations.RemoveField( model_name='post', name='tags',
ise-uiuc/Magicoder-OSS-Instruct-75K
public Queue Texts { get; private set; } public static GUIComponent GetComponent(int left, int top, int width) { return new GUIComponent(){ Left=left, Top=top, Width=width, Texts = new Queue(), }; } public void Enqueue(string text) {
ise-uiuc/Magicoder-OSS-Instruct-75K
var origin: CGPoint = .zero origin.y = messageContainerPadding.top switch position { case .leading: break case .trailing: origin.x = itemWidth - avatarSize.width - messageContainerPadding.right - messageContainerSize.width - attachmentLay...
ise-uiuc/Magicoder-OSS-Instruct-75K
extension ConstraintItem: ConstraintRelatableTarget { } extension ConstraintView: ConstraintRelatableTarget {
ise-uiuc/Magicoder-OSS-Instruct-75K
return redirect('/account') context = {'form':form} return render(request, 'forum/account.html', context) #import ipdb; ipdb.set_trace() def log(request): #define a next url caso exista next_url = request.GET.get("next") if request.method == 'POST': #peg...
ise-uiuc/Magicoder-OSS-Instruct-75K
"description:": "This is an item" } }
ise-uiuc/Magicoder-OSS-Instruct-75K
sym_check bar.o ^bar2 sym_check foo.o main2 sym_check prog.exe main bar1 eotup
ise-uiuc/Magicoder-OSS-Instruct-75K
sipDir = "/media/Masters/Archives/SIP" colID = args.package.split("_")[0].split("-")[0] sipPackage = os.path.join(sipDir, colID, args.package) SIP = SubmissionInformationPackage() SIP.load(sipPackage) SIP.safeRemove() sipParent = os.path.join(sipDir, colID) if len(os.listdir(sipParent)) == 0: os.rmd...
ise-uiuc/Magicoder-OSS-Instruct-75K
def test_label_model_data(): num_samples = 5 num_rules = 6 rule_matches_z = np.ones((num_samples, num_rules)) rule_matches_z[[1, 4]] = 0
ise-uiuc/Magicoder-OSS-Instruct-75K
@Test public void filterData() { LOG.debug("Starting filtering streaming ..."); // parsing lines2dto
ise-uiuc/Magicoder-OSS-Instruct-75K
export default function init() { langs(); nav(); }
ise-uiuc/Magicoder-OSS-Instruct-75K
namespace CodenameGenerator
ise-uiuc/Magicoder-OSS-Instruct-75K
if self.partition=='train': self._process_train(class_lists) elif self.partition=='valid': self._process_valid() elif self.partition=='test': self._process_test() else:
ise-uiuc/Magicoder-OSS-Instruct-75K
# allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) install_requires = [ 'requests >= 0.8.8', ] setup( name='iyzipay', version='1.0.38', use_scm_version=True, setup_requires=['setuptools_scm', 'future'],
ise-uiuc/Magicoder-OSS-Instruct-75K
} public var code: Int? { switch self {
ise-uiuc/Magicoder-OSS-Instruct-75K
import textwrap def DALS(s): "dedent and left-strip" return textwrap.dedent(s).lstrip()
ise-uiuc/Magicoder-OSS-Instruct-75K
Console::error('Theme ' . $theme . ' is not valid.'); Console::br(); Console::info('Avaiable themes: ' . Theme::allAsString()); } Config::load()->setTheme($theme)->save(); Console::info('Theme ' . $theme . ' set.'); } }
ise-uiuc/Magicoder-OSS-Instruct-75K
class ConnectionError(Exception): pass class ApiKeyMissing(Exception): def __init__(self): Exception.__init__(self, 'Meraki API Key missing.')
ise-uiuc/Magicoder-OSS-Instruct-75K
ibinstream m; m << client_id; m << target_engine_id; zmq::message_t msg(m.size()); memcpy((void *)msg.data(), m.get_buf(), m.size()); socket_->send(msg); } }
ise-uiuc/Magicoder-OSS-Instruct-75K
length: number; tags: string[]; }
ise-uiuc/Magicoder-OSS-Instruct-75K
def __init__(self, cid, sec): self.cid = cid
ise-uiuc/Magicoder-OSS-Instruct-75K
def __init__(self, arg, **kwargs): kwargs.setdefault('loaded', False) super(ProxyImage, self).__init__(arg, **kwargs) self.loaded = kwargs.get('loaded') def on_load(self): pass class LoaderBase(object): '''Common base for Loader and specific implementation. By default...
ise-uiuc/Magicoder-OSS-Instruct-75K
} func sceneDidBecomeActive(_ scene: UIScene) { // Called when the scene has moved from an inactive state to an active state. // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. } func sceneWillResignActive(_ scene: UIScene) {
ise-uiuc/Magicoder-OSS-Instruct-75K
mve::TriangleMesh::ColorList& colors(mesh->get_vertex_colors());
ise-uiuc/Magicoder-OSS-Instruct-75K
{number++;} else {special++;} } if(lower>0 && upper>0 && special>0 && number>0) { cout<<"Valid Password"; } else {
ise-uiuc/Magicoder-OSS-Instruct-75K
#include <stan/math/rev/core.hpp> #include <stan/math/prim/err.hpp> #include <stan/math/prim/fun/squared_distance.hpp> #include <stan/math/prim/fun/Eigen.hpp> #include <stan/math/prim/fun/typedefs.hpp> #include <vector> namespace stan { namespace math { class scal_squared_distance_vv_vari : public op_vv_vari {
ise-uiuc/Magicoder-OSS-Instruct-75K
def __init__(self, objects): OOMDPState.__init__(self, objects=objects) def get_agent_x(self): return self.objects["agent"][0]["x"] def get_agent_y(self): return self.objects["agent"][0]["y"] def __hash__(self): state_hash = str(self.get_agent_x()) + str(self.get_agen...
ise-uiuc/Magicoder-OSS-Instruct-75K
#if (_SIZEOF_UINTMAX_T + 0) && \\ !((_SIZEOF_UINTMAX_T + 0) == (_SIZEOF_UINT8_T + 0) || (_SIZEOF_UINTMAX_T + 0) == (_SIZEOF_UINT16_T + 0) || \\ (_SIZEOF_UINTMAX_T + 0) == (_SIZEOF_UINT32_T + 0) || (_SIZEOF_UINTMAX_T + 0) == (_SIZEOF_UINT64_T + 0)) EOF GetProperty_CPP std::uintmax_t asLargestUInt >> ${FILENAME} cat...
ise-uiuc/Magicoder-OSS-Instruct-75K
/** * Namespace for collection of a `Suite`'s "before all" hooks */ HOOK_TYPE_BEFORE_EACH: "beforeEach", // the following events are all deprecated /** * Emitted after an "after all" `Hook` has been added to a `Suite`. Deprecated */ EVENT_SUITE_ADD_HOOK_AFTER_ALL: "afterAll", ...
ise-uiuc/Magicoder-OSS-Instruct-75K
import java.util.Date; import java.util.Objects; /** * Groovy wrapper over a {@link CommitStatus}
ise-uiuc/Magicoder-OSS-Instruct-75K
if [ ! -f ~/.m2/repository/org/eluder/coveralls/coveralls-maven-plugin/3.1.1-munge-hack/coveralls-maven-plugin-3.1.1-munge-hack.jar ] then mkdir mcp; cd mcp; git clone --branch=maven-munge-hack git://github.com/chrisbennight/coveralls-maven-plugin.git; cd coveralls-maven-plugin; git submodule init;...
ise-uiuc/Magicoder-OSS-Instruct-75K
static func dataSource() -> RxTableViewSectionedReloadDataSource<EventDetailSectionModel> { return RxTableViewSectionedReloadDataSource<EventDetailSectionModel>( configureCell: { (dataSource, tableView, indexPath, _) -> UITableViewCell in switch dataSource[indexPath] { ...
ise-uiuc/Magicoder-OSS-Instruct-75K
name = 'fabricanno'
ise-uiuc/Magicoder-OSS-Instruct-75K
let mut batch = w.batch(keychain_mask)?; // Participant id 0 for mwc713 compatibility batch.delete_private_context(sl.id.as_bytes(), 0)?; batch.commit()?; } Ok(sl) } /// Process the incoming swap message received from TOR pub fn receive_swap_message<'a, L, C, K>( wallet_inst: Arc<Mutex<Box<dyn WalletInst<'a...
ise-uiuc/Magicoder-OSS-Instruct-75K
import UIKit class TabMenuContainerViewController: BaseViewController, TabMenuContainerViewInput { func select(tab: TabMenuContainerTabs) { }
ise-uiuc/Magicoder-OSS-Instruct-75K
packages = ["numpy", "opencv-python"]
ise-uiuc/Magicoder-OSS-Instruct-75K
impl ParserRecog for ReferenceToATNParserExt {} impl Recognizer for ReferenceToATNParserExt { fn get_grammar_file_name(&self) -> &str { "ReferenceToATN.g4" } fn get_rule_names(&self) -> &[&str] { &ruleNames }
ise-uiuc/Magicoder-OSS-Instruct-75K
./script/changePBConfig.sh "$AllNodes" $FileName $2 #sudo ./basho_bench "$LoadFile"
ise-uiuc/Magicoder-OSS-Instruct-75K
80, ) url = requests.get(f"https://api.ipdata.co/{check}?api-key={API}") r = url.json()
ise-uiuc/Magicoder-OSS-Instruct-75K
Unauthorized {}, // Add any other custom errors you like here. // Look at https://docs.rs/thiserror/1.0.21/thiserror/ for details. #[error("Insufficient funds")] InsufficientFunds {}, #[error("Invalid zero amount")]
ise-uiuc/Magicoder-OSS-Instruct-75K
{ indicount = "2"; subfldcodecount = "2"; lenoffld = "4"; // 目次区中字段长度部分 startposoffld = "5"; // 目次区中字段起始位置部分 } /// <summary>
ise-uiuc/Magicoder-OSS-Instruct-75K
# Based on the results, output the 'good' ASR results results = open("wer_test.text") no_ho = 0 no_test = 0 ingood = True file = open("../../../simple_rnn_disf/rnn_disf_detection/data/disfluency_detection/swda_divisions_disfluency_detection/SWDisfHeldoutASRgood_ranges.text", "w") for l in results: # print l
ise-uiuc/Magicoder-OSS-Instruct-75K
bool zeigen; public Form1() { InitializeComponent(); panelbreite = pnl_dropmenu.Width; zeigen = false; } private void Form1_Load(object sender, EventArgs e) { }
ise-uiuc/Magicoder-OSS-Instruct-75K
pnet_tune=opt.train_trunk, version=opt.version, ) if opt.model in ["net-lin", "net"]:
ise-uiuc/Magicoder-OSS-Instruct-75K
visible = !visible; } } }
ise-uiuc/Magicoder-OSS-Instruct-75K
def verify_bhl_api(api_key): r = requests.get('http://words.bighugelabs.com/api/2/' + api_key + '/affect/json') if(r.raise_for_status()): return 'error' else:
ise-uiuc/Magicoder-OSS-Instruct-75K
item.height = 8; item.maxStack = 999; item.toolTip = "This is a modded bullet ammo."; item.consumable = true; //You need to set the item consumable so that the ammo would automatically consumed item.knockBack = 1.5f; item.value = 10; item.rare = 2; item.shoot = mod.ProjectileType("Ex...
ise-uiuc/Magicoder-OSS-Instruct-75K
// Project: https://github.com/ckeditor/ckeditor5/tree/master/packages/ckeditor5-engine // Definitions by: <NAME> <https://github.com/fedemp> // denisname <https://github.com/denisname> // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 4.2
ise-uiuc/Magicoder-OSS-Instruct-75K
print(texto) texto = "marca d' agua" print(texto) texto = ''' texto ... texto ''' print(texto) texto = ' texto\n\t ...texto' print(texto) print(str.__add__('a', 'b')) nome = '<NAME>' print(nome)
ise-uiuc/Magicoder-OSS-Instruct-75K
const createImage = new CreateImageService(); const images = await createImage.execute({ userId, nome: userId+'.'+req.file.originalname, local: diretorio+req.file.path, })
ise-uiuc/Magicoder-OSS-Instruct-75K
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: # Copyright (c) 2016, Battelle Memorial Institute # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must ...
ise-uiuc/Magicoder-OSS-Instruct-75K
def global_random_state(_: NPDType): return np.random.random.__self__
ise-uiuc/Magicoder-OSS-Instruct-75K
import datetime t1 = datetime.datetime(2019, 3, 9, 10, 55, 30, 991882) t2 = datetime.datetime(2019, 3, 10, 10, 55, 30, 991882) print((t2-t1).total_seconds())
ise-uiuc/Magicoder-OSS-Instruct-75K
""" def __init__(self, encoder, decoder, src_embed, tgt_embed, generator):
ise-uiuc/Magicoder-OSS-Instruct-75K
None } else { Some(*self) } } pub fn union(&self, box3: &Box3) -> Box3 { Box3::new(&self.min.min(&box3.min), &self.max.max(&box3.max)) }
ise-uiuc/Magicoder-OSS-Instruct-75K
} } // namespace
ise-uiuc/Magicoder-OSS-Instruct-75K
setup_requires=['pytest-runner==2.8'], entry_points={ 'console_scripts': [ 'shub-cli=shub_cli.cli:main', ], } )
ise-uiuc/Magicoder-OSS-Instruct-75K
embed.description = "chime is a versatile, yet intuitive music bot for discord. It aims to be as user-friendly as possible while still boasting many features. \n\n" \ "**More info and invite link [here](https://chime.realmayus.xyz)** \n\n" \ "Chime has a *...
ise-uiuc/Magicoder-OSS-Instruct-75K
migrations.RemoveField( model_name='friend_request', name='accepted', ), migrations.AddField( model_name='friend_request', name='status', field=models.CharField(default=b'PEN', max_length=3, choices=[(b'PEN', b'Pending'), (b'ACC', b'Acc...
ise-uiuc/Magicoder-OSS-Instruct-75K
} } } /// A signature for a function in a wasm module. /// /// Note that this does not explicitly name VMContext as a parameter! It is assumed that all wasm /// functions take VMContext as their first parameter.
ise-uiuc/Magicoder-OSS-Instruct-75K
this._databaseConnectionStringLabel.Name = "_databaseConnectionStringLabel"; this._databaseConnectionStringLabel.Size = new System.Drawing.Size(635, 13); this._databaseConnectionStringLabel.TabIndex = 3;
ise-uiuc/Magicoder-OSS-Instruct-75K
MapPtr mPtr = MapPtr::dynamicCast(pPtr->getTypePtr());
ise-uiuc/Magicoder-OSS-Instruct-75K
import { UserModel } from "../../models/user-model"; import { chatRepository } from "../../repositories/chat-repository"; import { messageRepository } from "../../repositories/message-repository"; import { userRepository } from "../../repositories/user-repository";
ise-uiuc/Magicoder-OSS-Instruct-75K
//first name lenght check;
ise-uiuc/Magicoder-OSS-Instruct-75K
if ans < 18: print("痩せ気味") elif 18 <= ans < 25: print("普通") elif ans >= 25:
ise-uiuc/Magicoder-OSS-Instruct-75K
REGDATE TIMESTAMP DEFAULT CURRENT_TIMESTAMP ) ''' insert_itemdb = '''
ise-uiuc/Magicoder-OSS-Instruct-75K
mkdir -p test-output USERDIR=$(pwd) SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" # Run from the root dir of data_processing so the test paths exist cd "$SCRIPT_DIR" || exit docker run --rm \
ise-uiuc/Magicoder-OSS-Instruct-75K
self->_mutex.release(); return 1; } self->_status = S_running; self->_cv.notify(); self->_mutex.release(); } self->_parent_obj->thread_main();
ise-uiuc/Magicoder-OSS-Instruct-75K
FILENAME=$1 NAME=$(echo "$FILENAME" | cut -f 1 -d '.') OUTPUT="${NAME}.mgfx" echo "Recived file ${FILENAME}" echo "Compiling Effect ${FILENAME} to ${OUTPUT}" MGFXC_WINE_PATH=/home/wine/.winemonogame /home/wine/.dotnet/tools/mgfxc $FILENAME $OUTPUT
ise-uiuc/Magicoder-OSS-Instruct-75K
fill(); unsigned int modulo = 100000000; unsigned long long limit = 1000000000000; std::cin >> limit;
ise-uiuc/Magicoder-OSS-Instruct-75K