seed stringlengths 1 14k | source stringclasses 2
values |
|---|---|
*
* @return type of the node {@type ThetaJoinType}
* @public
*/
public getType(): ThetaJoinType {
return this.type;
}
} | ise-uiuc/Magicoder-OSS-Instruct-75K |
<reponame>Sayar1106/OTTPlatformRecommender
python3 train.py --model "knn" --neighbors 20 | ise-uiuc/Magicoder-OSS-Instruct-75K |
DB::table('puestos')->insert(['nombre'=>'cajero', 'mas_de_uno' => '1']);
DB::table('puestos')->insert(['nombre'=>'almacenista', 'mas_de_uno' => '1']);
DB::table('puestos')->insert(['nombre'=>'gerente', 'mas_de_uno' => '0', 'tomado' => '0']);
DB::table('clientes')->insert(['nombre'=>'publico', 'numero_celular' => '9874561230']);
DB::table('cupons')->insert(['cliente_id'=>'9874561230', 'monto_acumulado' => '0', 'disponible' => false]);
}
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
CHAT_LOG_FILENAME = 'chat-log.tsv' | ise-uiuc/Magicoder-OSS-Instruct-75K |
return false;
}
try {
AssessmentItemRef itemRef = getResolvedAssessmentTest().getItemRefsByIdentifierMap()
.get(itemNode.getKey().getIdentifier());
if(itemRef == null) {
return false;
}
ResolvedAssessmentItem resolvedAssessmentItem = getResolvedAssessmentTest()
.getResolvedAssessmentItem(itemRef);
if(resolvedAssessmentItem == null) {
return false;
| ise-uiuc/Magicoder-OSS-Instruct-75K |
def on_dcc_disconnect(self, connection, event):
self.file.close()
print("Received file %s (%d bytes)." % (self.filename,
self.received_bytes))
self.connection.quit()
| ise-uiuc/Magicoder-OSS-Instruct-75K |
)
data = {int(k): v for k, v in data}
with open(save_dir / f"{folder}/data.pkl", "wb") as f:
pickle.dump(data, f)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
'Aron',
'Lairon',
'Aggron',
'Meditite',
| ise-uiuc/Magicoder-OSS-Instruct-75K |
if os.path.exists(subpath) and subpath not in template_dirs:
template_dirs.append(subpath)
# FIXME: not exactly sure how to test for this so not covering
except AttributeError: # pragma: nocover
msg = 'unable to load template module' + \
'%s from %s' % (mod, '.'.join(mod_parts)) # pragma: nocover
app.log.debug(msg) # pragma: nocover
for path in template_dirs:
for item in os.listdir(path):
if item not in template_items:
template_items.append(item)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
// Act
async.Progressed((x) => returnedProgress = x);
async.Complete();
// Assert
Assert.AreEqual(ExpectedReturnedProgress, returnedProgress);
| ise-uiuc/Magicoder-OSS-Instruct-75K |
ac_dir = "dont have windows machine now to test"
# define config file path
if chain == 'KMD':
coin_config_file = str(ac_dir + '/komodo.conf')
else:
coin_config_file = str(ac_dir + '/' + chain + '/' + chain + '.conf')
#define rpc creds
with open(coin_config_file, 'r') as f:
| ise-uiuc/Magicoder-OSS-Instruct-75K |
self.convT2d_128_66 = nn.ConvTranspose2d(in_channels = self.in_channels[2],
out_channels = self.out_channels[3],
kernel_size = self.kernel_size,
stride = self.stride,
padding_mode = self.padding_mode,)
self.convT2d_66_66 = nn.ConvTranspose2d(in_channels = self.in_channels[3],
out_channels = self.out_channels[3],
kernel_size = self.kernel_size,
stride = self.stride,
padding_mode = self.padding_mode,)
self.activation = nn.CELU(inplace = True)
self.output_activation = nn.Sigmoid()
| ise-uiuc/Magicoder-OSS-Instruct-75K |
return False
class MoonshotUnitTestCase(TestCase, MoonshotTestCase):
pass
class MoonshotFunctionalTestCase(APITestCase, MoonshotTestCase):
pass
| ise-uiuc/Magicoder-OSS-Instruct-75K |
open('yolov3_t.weights', 'wb').write(r.content)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
is_paid = models.BooleanField(db_column="isPaid", default=False)
user_id = models.ForeignKey('Users', models.DO_NOTHING, db_column='userId', default=1) # Field name made lowercase.
storeid = models.ForeignKey('Storeunion', models.DO_NOTHING, db_column='storeId') # Field name made lowercase.
| ise-uiuc/Magicoder-OSS-Instruct-75K |
long lastSend = sender.getLastSendTime(fullStats);
sender.sendStatistics(fullStats);
fullStats = storage.read();
long newSend = sender.getLastSendTime(fullStats);
Assert.assertTrue("Send time should be updated",
newSend > lastSend);
Assert.assertTrue("Status should be 200",
sender.getLastSendStatus(fullStats).contains("200"));
Assert.assertEquals("Default interval should be 24H in seconds",
| ise-uiuc/Magicoder-OSS-Instruct-75K |
};
fn scan_req() -> fidl_mlme::ScanRequest {
fidl_mlme::ScanRequest {
txn_id: 1337,
bss_type: fidl_internal::BssTypes::Infrastructure,
bssid: BSSID.0,
ssid: b"ssid".to_vec(),
scan_type: fidl_mlme::ScanTypes::Passive,
probe_delay: 0,
| ise-uiuc/Magicoder-OSS-Instruct-75K |
# Now check for collisions
for already_placed in objects_to_check_against:
# First check if bounding boxes collides
intersection = check_bb_intersection(obj, already_placed)
# if they do
if intersection:
skip_inside_check = already_placed in list_of_objects_with_no_inside_check
# then check for more refined collisions
intersection, bvh_cache = check_intersection(obj, already_placed, bvh_cache=bvh_cache,
skip_inside_check=skip_inside_check)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
private static final int kMod = (int) 1e9 + 7;
private Long[] dp;
private long find(int i) {
if (i == 0)
return 1;
if (i == 1)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
json = await getJson(fetchFromJisho(query, page)) as JishoJSON;
}
return result;
}
interface JishoJSON {
data: Array<Entry>;
}
export interface Entry {
jlpt: Record<string, unknown>;
| ise-uiuc/Magicoder-OSS-Instruct-75K |
// .package(url: /* package url */, from: "1.0.0"),
.package(url: "https://github.com/IBM-Swift/Kitura.git", .upToNextMinor(from: "2.0.0")),
//.package(url: "https://github.com/IBM-Swift/HeliumLogger.git", .upToNextMinor(from: "1.2.0"))
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
| ise-uiuc/Magicoder-OSS-Instruct-75K |
Codec.tinyTolong[shortUrl] = longUrl
Codec.longTotiny[longUrl] = shortUrl
return shortUrl
def decode(self, shortUrl):
"""Decodes a shortened URL to its original URL.
| ise-uiuc/Magicoder-OSS-Instruct-75K |
"""Convert image into a binary representation of black/white."""
| ise-uiuc/Magicoder-OSS-Instruct-75K |
class ClientController extends Controller
{
public function index(){
return view('client.pages.home');
}
public function showLoginForm(){
| ise-uiuc/Magicoder-OSS-Instruct-75K |
'License :: OSI Approved :: BSD License',
'Programming Language :: Python',
'Programming Language :: Python :: 3.5',
],
packages=find_packages(),
package_data={'pagination': ['pagination/*']}
)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
"password": " "
}
info = json.dumps(info)
client.send(info.encode())
start = time.time()
response = client.recv(1024)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
}
// 记录得分,首先记录先拿第一个能得到的分
int scoreStart = nums[start] * turn + helper(nums, start + 1, end, -turn);
// 再记录第二个去拿的时候能得到的分
int endStart = nums[end] * turn + helper(nums, start, end - 1, -turn);
// 综合起来看看,拿第一个好呢,还是第二个好
return max(scoreStart * turn, endStart * turn) * turn;
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
}
// create sql server
SqlServerEntity entity = this.fromConfig(this.config);
return Azure.az(AzureSqlServer.class).sqlServer(entity).create().withAdministratorLoginPassword(String.valueOf(config.getPassword())).commit();
} catch (final RuntimeException e) {
EventUtil.logError(operation, ErrorType.systemError, e, null, null);
| ise-uiuc/Magicoder-OSS-Instruct-75K |
from django.db import migrations
import json
| ise-uiuc/Magicoder-OSS-Instruct-75K |
# Set "points": 10 to 1000 to not agressively rate limit commits
sed 's/\"points\": 10/\"points\": 1000/g' settings.json.rateLimit > settings.json
# start Etherpad, assuming all dependencies are already installed.
#
# This is possible because the "install" section of .travis.yml already contains
# a call to bin/installDeps.sh
echo "Running Etherpad directly, assuming bin/installDeps.sh has already been run"
node node_modules/ep_etherpad-lite/node/server.js "${@}" > /dev/null &
| ise-uiuc/Magicoder-OSS-Instruct-75K |
'scipy==1.1.0',
'tqdm==4.26.0',
],
python_requires='>=3.6',
extras_require={
'rdkit': ['rdkit>=2018.09.1.0'],
},
zip_safe=True,
)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
for i in range(0, 11):
print('{} x {} = A[{}]'.format(tabuada, i, A[i])) | ise-uiuc/Magicoder-OSS-Instruct-75K |
/**
* @author liuxin
* 2020-09-03 22:37
*/
public class BusinessServerHandlerException extends RuntimeException {
| ise-uiuc/Magicoder-OSS-Instruct-75K |
if n == 0:
return False
while n > 1:
if n % 3 != 0:
return False
n = n / 3
| ise-uiuc/Magicoder-OSS-Instruct-75K |
challenge, please do not see below and ask yourself what are the
possible input cases.
Notes: It is intended for this problem to be specified vaguely
(ie, no given input specs). You are responsible to gather all the
input requirements up front.
"""
class Solution:
| ise-uiuc/Magicoder-OSS-Instruct-75K |
weightFactor = addWeightPercentForm.WeightPercentToAdd;
}
}
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
self.base.reserve(self.element_bits, additional);
}
/// Reserves capacity for at least `additional` blocks of values to be
| ise-uiuc/Magicoder-OSS-Instruct-75K |
# Set to 0 to pause after each frame
PAUSE_VAL=0
VIDEOS_FOLDER=$1
DEPLOY=nets/tracker.prototxt
CAFFE_MODEL=nets/solverstate/GOTURN1/caffenet_train_iter_500000.caffemodel
build/show_tracker_vot $DEPLOY $CAFFE_MODEL $VIDEOS_FOLDER $GPU_ID $START_VIDEO_NUM $PAUSE_VAL
| ise-uiuc/Magicoder-OSS-Instruct-75K |
return "CH0C0LA71N3 !!!!!"
cadeau = (Chocolatine(), "Nicolas", "Julian")
#déplier un tuple
objet, destinataire, expediteur = cadeau
#afficher un tuple
print(cadeau)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
raise NotImplementedError
| ise-uiuc/Magicoder-OSS-Instruct-75K |
}
swapped = false;
}
public void takeLaneValuesFromMap(long timestamp, IPose3D carPose, StreetMap map)
{
valid = true;
confidence = .5;
Vector2D[] lines = SegmentUtils.getLinePositionsForTargetSegment(carPose, LaneMiddle.SCANLINE, map);
Vector2D rightLineMap = lines[0];
Vector2D middleLineMap = lines[1];
Vector2D leftLineMap = lines[2];
| ise-uiuc/Magicoder-OSS-Instruct-75K |
"if (typeof(chrome) == 'undefined') {"
" chrome = {};"
"};"
"if (typeof(chrome.benchmarking) == 'undefined') {"
| ise-uiuc/Magicoder-OSS-Instruct-75K |
public static void main(String[] args) {
Door alexander = new Door();
| ise-uiuc/Magicoder-OSS-Instruct-75K |
'''
if antigen_ID == 'her2':
wt_str = 'WGGDGFYAMK'
LD_arr = []
| ise-uiuc/Magicoder-OSS-Instruct-75K |
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc.Testing;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using SampleApp.Data;
namespace AspNetCoreModules.Tests;
// ReSharper disable once ClassNeverInstantiated.Global
public class CustomWebApplicationFactory<TStartup> : WebApplicationFactory<TStartup> where TStartup: class
{
| ise-uiuc/Magicoder-OSS-Instruct-75K |
torch.save(online.state_dict(), f"vt-{epoch + 1:03d}.pth")
| ise-uiuc/Magicoder-OSS-Instruct-75K |
expected_output = 15
self.assertEqual(expected_output, Solution.minCostClimbingStairs(stairs))
def test_case_2(self):
stairs = [1, 100, 1, 1, 1, 100, 1, 1, 100, 1]
expected_output = 6
self.assertEqual(expected_output, Solution.minCostClimbingStairs(stairs))
| ise-uiuc/Magicoder-OSS-Instruct-75K |
func appendTail(_ value: Int) {
// 进栈时, 直接把元素放到1号栈即可
self.stack1.push(value)
}
func deleteHead() -> Int {
// 如果2号栈没元素, 就把1号栈倒进2号, 这样1号的元素就颠倒存进2号了, 2号栈顶元素就是队头元素.
// 如果2好没有元素, 1号也没有元素, 那么表示栈空.
| ise-uiuc/Magicoder-OSS-Instruct-75K |
args, r, *merge_results[:, r].tolist()
)
for r in range(args.num_reducers)
]
reducer_results = ray.get(reducer_results)
if not args.skip_output:
with open(constants.OUTPUT_MANIFEST_FILE, "w") as fout:
| ise-uiuc/Magicoder-OSS-Instruct-75K |
<h2>Please add a machine.</h2>
}
else
{
<h2>List of machines:</h2>
<ul>
@foreach(var machine in Model.Machines)
{
<li>@Html.ActionLink($"{machine.MachineDescription}", "Details", "Machines", new { id = machine.MachineId}, null)</li>
}
</ul>
| ise-uiuc/Magicoder-OSS-Instruct-75K |
auto ndets = dets.size(0);
at::Tensor suppressed_t = at::zeros({ndets}, dets.options().dtype(at::kByte).device(at::kCPU));
auto suppressed = suppressed_t.data<uint8_t>();
auto order = order_t.data<int64_t>();
auto xc = xc_t.data<scalar_t>();
| ise-uiuc/Magicoder-OSS-Instruct-75K |
self.id = id
self.invalidationBatch = invalidationBatch
self.status = status
}
private enum CodingKeys: String, CodingKey {
case createTime = "CreateTime"
case id = "Id"
case invalidationBatch = "InvalidationBatch"
case status = "Status"
}
}
public struct InvalidationBatch: AWSEncodableShape & AWSDecodableShape {
/// A value that you specify to uniquely identify an invalidation request. CloudFront uses the
| ise-uiuc/Magicoder-OSS-Instruct-75K |
.serviceInstanceSchema(this.serviceInstance == null ? null : this.serviceInstance.toModel())
.serviceBindingSchema(this.serviceBinding == null ? null : this.serviceBinding.toModel())
.build();
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
cache=cache,
io_stats_before=io_stats_before_io,
io_size=io_size,
blocksize=blocksize,
skip_size=skip_size)
# Methods used in tests:
def check_io_stats(cache_disk, cache, io_stats_before, io_size, blocksize, skip_size):
io_stats_after = cache_disk.get_io_stats()
logical_block_size = int(TestRun.executor.run(
f"cat /sys/block/{cache_disk.device_name}/queue/logical_block_size").stdout)
diff = io_stats_after.sectors_written - io_stats_before.sectors_written
written_sector_size = Size(logical_block_size) * diff
TestRun.LOGGER.info(f"Sectors written: "
| ise-uiuc/Magicoder-OSS-Instruct-75K |
# read the contents of your README file
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
__doc__ = ast.get_docstring(mod)
print(__doc__)
assignments = [node for node in mod.body if isinstance(node, ast.Assign)]
__version__ = [node.value.s for node in assignments
if node.targets[0].id == '__version__'][0]
| ise-uiuc/Magicoder-OSS-Instruct-75K |
private:
char *str;
int maxlen=INT_MAX-1;
int len=0;
int countLength();
int countLength(char*);
public:
Str(char *);
~Str();
void printStr();
int length();
char at(int pos);
| ise-uiuc/Magicoder-OSS-Instruct-75K |
/// Gets or sets a value indicating whether this <see cref="RestlerOperationException"/> is timedout.
/// </summary>
/// <value><c>true</c> if timedout; otherwise, <c>false</c>.</value>
public bool Timedout { get; set; }
}
} | ise-uiuc/Magicoder-OSS-Instruct-75K |
{
ILogger<HttpRequestHandler> _logger;
public HttpRequestHandler(ILogger<HttpRequestHandler> logger)
{
_logger = logger;
}
public void HandlerMsg(FastTunnelClient cleint, Message<JObject> Msg)
{
var request = Msg.Content.ToObject<NewCustomerMassage>();
var interval = long.Parse(DateTime.Now.GetChinaTicks()) - long.Parse(request.MsgId.Split('_')[0]);
| ise-uiuc/Magicoder-OSS-Instruct-75K |
apiUrl`matchmakingPreferences/${matchmakingType}`,
{
method: 'POST',
body: JSON.stringify(prefs),
| ise-uiuc/Magicoder-OSS-Instruct-75K |
{
var umaDna = umaData.GetDna(dnaTypeHash);
var masterWeightCalc = masterWeight.GetWeight(umaDna);
for (int i = 0; i < _blendshapeDNAConverters.Count; i++)
{
_blendshapeDNAConverters[i].ApplyDNA(umaData, skeleton, umaDna, masterWeightCalc);
}
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
let v: Vec<i32> = Vec::new();
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
use std::ffi::OsStr;
use std::fs::{self, Permissions};
use std::os::unix::fs::PermissionsExt;
use std::path::{Path, PathBuf};
use std::process;
use anyhow::{anyhow, Result};
use console::Style;
use derive_getters::Getters;
use serde::Serialize;
use tempdir::TempDir;
| ise-uiuc/Magicoder-OSS-Instruct-75K |
@patch('builtins.input', lambda *args: '34,67,55,33,12,98')
def test_listpicle(self):
d = listpicle()
| ise-uiuc/Magicoder-OSS-Instruct-75K |
@author: <NAME>
| ise-uiuc/Magicoder-OSS-Instruct-75K |
}
?>
<div class="row">
<?php foreach($All_Cetalogues as $single_catelog)
{
?>
<div class="col-sm-3">
<a href="<?php echo site_url('deletecatelog?id='.$single_catelog['id']);?>"><i class="fa fa-times-circle" aria-hidden="true"></i></a>
<iframe class="pdfshow" src="<?php echo $single_catelog['url'];?>" height="200px" width="100%" frameborder="0"></iframe>
</div>
<?php } ?>
| ise-uiuc/Magicoder-OSS-Instruct-75K |
import logging
logger = logging.getLogger(__name__)
from .forms import RemoteForm
from .widgets import RemoteWidget
| ise-uiuc/Magicoder-OSS-Instruct-75K |
struct ErrorModuleInputData {
let errorTitle: String
}
protocol ErrorModuleOutput: class {
func didPressPlaceholderButton(on module: ErrorModuleInput)
}
protocol ErrorModuleInput {}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
model_str = ppretty(self.model, indent=' ', show_protected=True, show_static=True,
show_address=False, str_length=50)
outf.write(model_str)
outf.write("\n\n############ The End of Metadata ###########\n\n")
return out_filename
| ise-uiuc/Magicoder-OSS-Instruct-75K |
<reponame>Krystian19/cactus-fake-video-cdn-service
version https://git-lfs.github.com/spec/v1
oid sha256:ccc7539a45e5f743e69ffb7b94ec22a6fb345fca3a3960e6e2060c5eeff93712
size 1466024
| ise-uiuc/Magicoder-OSS-Instruct-75K |
export FLASK_APP=msimb/app.py
export FLASK_DEBUG=1
export SQLALCHEMY_DATABASE_URI='sqlite:////tmp/test.db'
flask run --host=0.0.0.0
| ise-uiuc/Magicoder-OSS-Instruct-75K |
class TempClass:
pass
class TerminalHaveTest(TestCase):
| ise-uiuc/Magicoder-OSS-Instruct-75K |
/**
* Package contains plugin for registration strategies for database tasks
*/
package info.smart_tools.smartactors.database_postgresql_plugins.postgres_db_tasks_plugin; | ise-uiuc/Magicoder-OSS-Instruct-75K |
}
public NotFoundException(string message)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
async def handle_keyboard_interrupt(self):
pass
async def handle_eof(self):
pass
| ise-uiuc/Magicoder-OSS-Instruct-75K |
###########################
| ise-uiuc/Magicoder-OSS-Instruct-75K |
}
public GreaterPoisonPotion(Serial serial) : base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
| ise-uiuc/Magicoder-OSS-Instruct-75K |
"""
roll, pitch, yaw = carla_rotation_to_RPY(carla_rotation)
quat = tf.transformations.quaternion_from_euler(roll, pitch, yaw)
return quat
def carla_rotation_to_ros_quaternion(carla_rotation):
"""
Convert a carla rotation to a ROS quaternion
Considers the conversion from left-handed system (unreal) to right-handed
system (ROS).
Considers the conversion from degrees (carla) to radians (ROS).
| ise-uiuc/Magicoder-OSS-Instruct-75K |
<>
<Toast />
<FormWrapper
children={
<>
<SetFormTypeComponent
forms={forms}
setCurForm={setCurForm}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
private let kItemMargin:CGFloat = 10
private let kItemWidth:CGFloat = (WIDTH - 3 * kItemMargin ) / 2
private let kItemHeight:CGFloat = kItemWidth * 4 / 3 + 18
private let kCoverImageHeight:CGFloat = 145
private let collectionViewId = "LeeHotCell"
class LeeHotCategoryViewController: UIViewController {
| ise-uiuc/Magicoder-OSS-Instruct-75K |
{
return $this->db->select('*')
->from($this->table)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
# message = MIMEMultipart("alternative")
# message["Subject"] = "multipart test"
# message["From"] = sender_email
# message["To"] = receiver_email
# # Create the plain-text and HTML version of your message
# text = """\
# Hi,
# How are you?
# Real Python has many great tutorials:
# www.realpython.com"""
| ise-uiuc/Magicoder-OSS-Instruct-75K |
logger = logging.getLogger(program)
logging.basicConfig(format='%(asctime)s: %(levelname)s: %(message)s')
logging.root.setLevel(level=logging.INFO)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
fh.write(ip_port+'\n')
print('第{num}条ip记录成功'.format(num=i+1))
except Exception as e:
print('一不意外:{error}'.format(error=e))
def verif_ip(ip_port):
proxy = {'http':'%s:%s' %(ip_port.split(':')[0],ip_port.split(':')[1][:-2])}
print('正在测试的ip是:{ip}'.format(ip=proxy))
support = ur.ProxyHandler(proxy)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
assert not encoded.startswith("simpleflow+s3://jumbo-bucket/with/subdir//")
| ise-uiuc/Magicoder-OSS-Instruct-75K |
public DefaultLogBuilder append(String key, final float value) {
dataMap.put(key, value);
return this;
}
public DefaultLogBuilder append(String key, final double value) {
| ise-uiuc/Magicoder-OSS-Instruct-75K |
constructors=(addMemCacheProxyForm,
addMemCacheProxy),
icon='www/proxy.gif')
from .sessiondata import MemCacheSessionDataContainer
from .sessiondata import addMemCacheSessionDataContainer
from .sessiondata import addMemCacheSessionDataContainerForm
context.registerClass(MemCacheSessionDataContainer,
constructors=(addMemCacheSessionDataContainerForm,
addMemCacheSessionDataContainer),
| ise-uiuc/Magicoder-OSS-Instruct-75K |
<reponame>HighSchoolHacking/GLS-Draft<filename>test/end-to-end/Statics/TypeScript/index.ts
class Utilities {
public static getLongest(words: string[]): string {
let longest: string = "";
for (let word of words) {
if (word.length > longest.length) {
longest = word;
| ise-uiuc/Magicoder-OSS-Instruct-75K |
if any([glob.fnmatch.fnmatch(file, mod_pattern)
for mod_pattern in no_compiles])]
| ise-uiuc/Magicoder-OSS-Instruct-75K |
plt.close('all') | ise-uiuc/Magicoder-OSS-Instruct-75K |
torch.save(state, checkpoint_path)
print('model saved to %s' % checkpoint_path)
def load_checkpoint(checkpoint_path, model, optimizer):
state = torch.load(checkpoint_path)
model.load_state_dict(state['state_dict'])
optimizer.load_state_dict(state['optimizer'])
print('model loaded from %s' % checkpoint_path)
return state['epoch'], state['iteration']
| ise-uiuc/Magicoder-OSS-Instruct-75K |
@optapy.value_range_provider('value_range')
def get_values(self):
return self.values
@optapy.planning_score(optapy.score.SimpleScore)
def get_score(self):
return self.score
def set_score(self, score):
self.score = score
@optapy.constraint_provider
def inverse_relation_constraints(constraint_factory):
return [
| ise-uiuc/Magicoder-OSS-Instruct-75K |
def connect(self):
try:
netmikoses = ConnectHandler(**self.connection_args)
return netmikoses
except Exception as e:
return str(e)
def sendcommand(self, session=False, command=False):
try:
result = {}
for commands in command:
| ise-uiuc/Magicoder-OSS-Instruct-75K |
last_fix = cmds
else:
print(' ' + str(e) + ': ' + ' && '.join(cmds) + '\n')
| ise-uiuc/Magicoder-OSS-Instruct-75K |
# Need to rely on the manual insertion of pathnames to all files in do_all.py
# NOTE sys.path.insert(0, os.path.abspath(tables_dir)), etc. may need to be
# copied from do_all.py to here
# Import files first:
from EstimationParameters import initial_age, empirical_cohort_age_groups
# The following libraries are part of the standard python distribution
import numpy as np # Numerical Python
import csv # Comma-separated variable reader
| ise-uiuc/Magicoder-OSS-Instruct-75K |
Parameters
----------
source : str
A source name from the benchmarks source store.
language : str, optional
Valid values: "Python", "R".
| ise-uiuc/Magicoder-OSS-Instruct-75K |
// Container mock object
$mockContainer = $this->getMock('Container', ['get', 'getParameter']);
$mockOrganizationRepository = $this->getMock('OrganizationRepository', ['find']);
$mockEbiConfigRepository = $this->getMock('EbiConfigRepository', ['findOneBy']);
$mockRepositoryResolver->method('getRepository')
->willReturnMap([
['SynapseCoreBundle:EbiConfig', $mockEbiConfigRepository],
['SynapseCoreBundle:Organization', $mockOrganizationRepository]
]);
$mockContainer->method('getParameter')
| ise-uiuc/Magicoder-OSS-Instruct-75K |
# search on project path
project_command_path = os.path.join(proj_path)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
import com.yammer.dropwizard.servlets.ThreadNameFilter;
import com.yammer.dropwizard.tasks.TaskServlet;
import com.yammer.dropwizard.util.Duration;
| ise-uiuc/Magicoder-OSS-Instruct-75K |
{
uint64_t sumpos = 0;
uint64_t cnt = 0;
double sum_x_weighted = 0.0;
double sum_y_weighted = 0.0;
int num_lines = 10;
int line_counter_weighted = 0;
double weight_sum = 0.0;
int point_diff = ceil((double) h / (double) (num_lines+ 1.0));
for (int y = 0; y < morph.rows; y++)
{
//if(y % 64 == 0)
if (y % config_.avg_block_size == 0)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.