code
stringlengths
3
6.57k
range(n)
torch.from_numpy(self.dat[start:end, :])
torch.from_numpy(self.dat[idx_set[i], :])
get_batches(self, inputs, targets, batch_size, shuffle=True)
len(inputs)
torch.randperm(length)
torch.LongTensor(range(length)
while (start_idx < length)
min(length, start_idx + batch_size)
if (self.cuda)
X.cuda()
Y.cuda()
Variable(X)
Variable(Y)
Copyright (c)
Campos (@racampos)
Copyright (c)
Copyright (c)
CompoundNumericNode( Gaffer.Node )
__init__( self, name="CompoundNumericNode" )
Gaffer.Node.__init__( self, name )
self.addChild( Gaffer.V3fPlug( "p", Gaffer.Plug.Direction.In )
IECore.registerRunTimeTyped( CompoundNumericNode, typeName = "GafferTest::CompoundNumericNode" )
load("@rules_foreign_cc//tools/build_defs/shell_toolchain/toolchains:function_and_call.bzl", "FunctionAndCall")
os_name()
pwd()
echo(text)
format(text = text)
export_var(name, value)
format(name = name, value = value)
local_var(name, value)
format(name = name, value = value)
use_var(name)
env()
path(expression)
format(expression = expression)
touch(path)
mkdirs(path)
if_else(condition, if_text, else_text)
format(condition = condition, if_text = if_text, else_text = else_text)
define_function(name, text)
lines.append("function " + name + "()
text.splitlines()
lines.append(" " + line_)
lines.append("}")
join(lines)
replace_in_files(dir, from_, to_)
copy_dir_contents_to_dir(source, target)
format(source, target)
symlink_contents_to_dir(source, target)
FunctionAndCall(text = text)
symlink_to_dir(source, target)
FunctionAndCall(text = text)
script_prelude()
increment_pkg_config_path(source)
FunctionAndCall(text = text)
cat(filepath)
format(filepath)
redirect_out_err(from_process, to_file)
assert_script_errors()
cleanup_function(on_success, on_failure)
FunctionAndCall(text = text, call = "trap \"cleanup_function\" EXIT")
children_to_path(dir_)
format(dir_ = dir_)
FunctionAndCall(text = text)
define_absolute_paths(dir_, abs_path)
replace_absolute_paths(dir_, abs_path)
get_user_model()
BaseService(object)
__init__(self, data, **kwargs)
execute(self, request=None)
self.process(request=request)
generate_unique_secret_address(user)
generate_secret_address(user)
FoiRequest.objects.get(secret_address=address)
CreateRequestService(BaseService)
process(self, request=None)
AccountService.create_user(**self.data)
self.create_token_draft(user)
data.update(extra)
len(self.data["publicbodies"])
self.create_project()
self.create_request(self.data["publicbodies"][0])
AccountService(user)
self.data.get("redirect_url")
self.post_creation(foi_object)
create_token_draft(self, user)
data.get("subject", "")
data.get("body", "")
data.get("full_text", False)
data.get("reference", "")
data.get("law_type", "")
set(MakeRequestView.FORM_CONFIG_PARAMS)
data.items()
uuid.uuid4()
draft.publicbodies.set(data["publicbodies"])
reverse("foirequest-claim_draft", kwargs={"token": draft.token})
AccountService(user)
self.data.get("redirect_url")
create_project(self)