seed stringlengths 1 14k | source stringclasses 2
values |
|---|---|
binary_search(io, c, n - 1)
print(io.recvline(False))
io.recvline()
print(io.recvline())
io.close()
| ise-uiuc/Magicoder-OSS-Instruct-75K |
// Copyright © 2017年 tanhaipeng. All rights reserved.
| ise-uiuc/Magicoder-OSS-Instruct-75K |
request.append(self.card.to_etree_element())
request.append(self.__pares_to_etree_element())
request.append(self.__sh1_hash_to_etree_element())
| ise-uiuc/Magicoder-OSS-Instruct-75K |
TEST(InsertValueTest, JSONColumn)
{
string expected("\"c1\" : {\"hello\":\"world\"}");
Document doc;
doc.Parse("{\"hello\":\"world\"}");
InsertValue value("c1", doc);
ASSERT_EQ(expected.compare(value.toJSON()), 0);
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
from ...lo.beans.x_multi_property_states import XMultiPropertyStates as XMultiPropertyStates
from ...lo.beans.x_properties_change_listener import XPropertiesChangeListener as XPropertiesChangeListener
from ...lo.beans.x_properties_change_notifier import XPropertiesChangeNotifier as XPropertiesChangeNotifier
from ...lo.... | ise-uiuc/Magicoder-OSS-Instruct-75K |
handler400 = 'site_utils.views.handle_400'
handler403 = 'site_utils.views.handle_403'
handler404 = 'site_utils.views.handle_404'
| ise-uiuc/Magicoder-OSS-Instruct-75K |
'view_subscription',
'view_subscriptiontype'
],
'books': [
'view_publisher',
'view_publisherplace',
'view_creator',
'view_creatortype',
'view_work',
'view_edition',
'view_editioncreator',
],
'footnotes': [
| ise-uiuc/Magicoder-OSS-Instruct-75K |
vec.append(num)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
ENTERED_IN_ERROR = 'entered-in-error',
RETIRED = 'retired',
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
return T.switch(T.lt(x, 0), -T.log(1. - x), x) + 1.
| ise-uiuc/Magicoder-OSS-Instruct-75K |
string etaRegion = iConfig.getParameter<string>("EtaRegion");
if (etaRegion=="Central") myEtaRegion = FixedGridEnergyDensity::Central;
else if (etaRegion=="Forward") myEtaRegion = FixedGridEnergyDensity::Forward;
else if (etaRegion=="All") myEtaRegion = FixedGridEnergyDensity::All;
else {
edm::LogWarning(... | ise-uiuc/Magicoder-OSS-Instruct-75K |
void showLoading();
void hideLoading();
| ise-uiuc/Magicoder-OSS-Instruct-75K |
* GNU General Public License for more details. *
* *
| ise-uiuc/Magicoder-OSS-Instruct-75K |
{
int optind = parseOptions(argc,argv);
oneOrStdin(optind,argc,argv);
return EXIT_SUCCESS;
}
};
int main(int argc,char** argv)
{
GroupBy app;
return app.main(argc,argv);
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
return true;
}
void POCatalog::FixupCommonIssues()
{
if (m_header.Project == "PACKAGE VERSION")
m_header.Project.clear();
// All the following fixups are specific to POs and should *not* be done in POTs:
if (m_fileType == Type::POT)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
<meta charset="UTF-8">
| ise-uiuc/Magicoder-OSS-Instruct-75K |
def PitchTimeAmdf(x, iBlockLength, iHopLength, f_s):
# initialize
| ise-uiuc/Magicoder-OSS-Instruct-75K |
<filename>apps/teacheres/adminx.py
# _*_ coding:utf-8 _*_
import xadmin
from .models import Teacheres
from courses.models import Courses
class AddCourses(object):
model = Courses
extra = 0
| ise-uiuc/Magicoder-OSS-Instruct-75K |
StFpdMaker::StFpdMaker(const char *name):StMaker(name) {}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
# bonus
print('question 2 bonus')
temp_vgg_model = models.vgg16(pretrained=True).double().to(device)
temp_vgg_model.classifier[-1] = nn.Linear(
temp_vgg_model.classifier[-1].in_features, 16)
loss_fun = nn.CrossEntropyLoss()
temp_optimizer = torch.optim.SGD(
temp_vgg_model.parameters(), lr=0.001, momentum=0.9)
... | ise-uiuc/Magicoder-OSS-Instruct-75K |
best_score = test["score"]
best_idx = idx
best_test = test_list[best_idx]
print("best test results:\n score: {} \t process: {} \t path: {}".format(best_test["score"], best_test["process"],
best_test["path"]))
pd.DataFrame(test_lis... | ise-uiuc/Magicoder-OSS-Instruct-75K |
if (!this.X5SafeAndSound) {
TbsLog.e("X5CoreEngine", "mCanUseX5 is false --> report");
if (sdkEng.isInitialized() && var5 != null && e == null) {
try {
DexLoader var6 = var5.getDexLoader();
Object var7 = null;
if (var6 != null) {
... | ise-uiuc/Magicoder-OSS-Instruct-75K |
public ClassSuffix.Inner<String>.Bar.Fuz<Integer> suffix;
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
version='1.0.0',
description='cape-open thermo python package.',
license="MIT Licence",
author="bshao",
author_email="<EMAIL>",
| ise-uiuc/Magicoder-OSS-Instruct-75K |
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL UNBOUNDED ROBOTICS INC. BE LIABLE FOR ANY DIRECT, I... | ise-uiuc/Magicoder-OSS-Instruct-75K |
# Create your models here.
def user_directory_path(instance, filename):
| ise-uiuc/Magicoder-OSS-Instruct-75K |
def __init__(self, name: str, user_id: int, project_id: int, description=""):
self.creator_id = user_id
self.project_id = project_id
self.name = name
self.description = description
| ise-uiuc/Magicoder-OSS-Instruct-75K |
Animation.cancel_all(self, "ripple_color")
anim = Animation(
| ise-uiuc/Magicoder-OSS-Instruct-75K |
void print( )
{
if(front == -1) // No elements
{
| ise-uiuc/Magicoder-OSS-Instruct-75K |
path(
"<str:id>/",
views.GroupViewSet.as_view({"get": "retrieve", "put": "update", "delete": "destroy"}),
| ise-uiuc/Magicoder-OSS-Instruct-75K |
int max = 7;
while ((value >> max) > 0x7FU) max += 7;
while (max > 0)
{
stream.put((char)(((value >> max) & 0x7FU) | 0x80));
max -= 7;
| ise-uiuc/Magicoder-OSS-Instruct-75K |
audio_lens: (B)
text : (B, Umax)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
unique_together=set([('user', 'ticket')]),
),
]
| ise-uiuc/Magicoder-OSS-Instruct-75K |
pub(super) stream: S,
pub(super) trailers: Option<Bytes>,
_phantom_buffer: PhantomData<B>,
_phantom_side: PhantomData<T>,
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
export default CodeChef
| ise-uiuc/Magicoder-OSS-Instruct-75K |
response = self.client.get(url_followers, HTTP_AUTHORIZATION=self.auth_header)
self.assertEqual(response.status_code, status.HTTP_200_OK)
def test_list_user_is_following(self):
"""Test list users the user is following"""
url_following = reverse('getfollowing', kwargs={'username': 't... | ise-uiuc/Magicoder-OSS-Instruct-75K |
public function convertToResponse(?EndpointResponse $endpointResponse): ResponseInterface;
} | ise-uiuc/Magicoder-OSS-Instruct-75K |
<th>name: </th>
<td><input type="text" name="name" value="{{ old('name') }}"></td>
</tr>
<br>
@error('mail')
<tr>
| ise-uiuc/Magicoder-OSS-Instruct-75K |
$username = "cperoot";
$password = "<PASSWORD>";
$server = "localhost";
$connect = mysqli_connect($server, $username, $password);
| ise-uiuc/Magicoder-OSS-Instruct-75K |
if last_image_id and last_image_id.isdigit():
| ise-uiuc/Magicoder-OSS-Instruct-75K |
} else if dependency2 != nil {
return // Back pressure - already processing another progressive image
}
_process(response, isCompleted: isCompleted, processors: processors)
}
/// - parameter processors: Remaining processors to by applied
private func _process(_ respons... | ise-uiuc/Magicoder-OSS-Instruct-75K |
{
( {
{
{
{
{
| ise-uiuc/Magicoder-OSS-Instruct-75K |
class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
"""Handle a config flow for gs_alarm."""
VERSION = 1
| ise-uiuc/Magicoder-OSS-Instruct-75K |
}
auto ret = input_x->Broaden();
ret->set_shape(std::make_shared<abstract::Shape>(out_shape));
return ret;
}
REGISTER_PRIMITIVE_EVAL_IMPL(DepthToSpace, prim::kPrimDepthToSpace, DepthToSpaceInfer);
| ise-uiuc/Magicoder-OSS-Instruct-75K |
"ň": "n3",
"ǹ": "n4",
"m̄": "m1", # len('m̄') == 2
"ḿ": "m2",
"m̀": "m4", # len("m̀") == 2
"ê̄": "ê1", # len('ê̄') == 2
| ise-uiuc/Magicoder-OSS-Instruct-75K |
train_loader = torch.utils.data.DataLoader(dataset=train_dataset,
| ise-uiuc/Magicoder-OSS-Instruct-75K |
test -f scripts/env.sh && source scripts/env.sh
# Check dependencies
source scripts/depcheck.sh
depcheck jq
depcheck aws
prefix="pjournal-$DEPLOY_ENV"
| ise-uiuc/Magicoder-OSS-Instruct-75K |
mk=mj-mk;
if (mk < int(MZ)) mk += MBIG;
mj=ma[ii];
| ise-uiuc/Magicoder-OSS-Instruct-75K |
slug_field='name',
)
crm_project = CRMProjectSerializer(read_only=True)
links = serializers.JSONField(required=False, allow_null=True)
past_deadline = serializers.BooleanField(read_only=True)
warn_deadline = serializers.BooleanField(read_only=True)
deadline_extensions = DeadlineExtension... | ise-uiuc/Magicoder-OSS-Instruct-75K |
import tensorflow_datasets as tfds
from keras.models import Sequential
from keras.layers import Dense
# Construct a tf.data.Dataset
iris_ds = tfds.load('iris', split='train', shuffle_files=True, as_supervised=True).repeat()
iris_model = Sequential([
Dense(40, input_shape=(4,), activation='relu'),
Dense(80, ac... | ise-uiuc/Magicoder-OSS-Instruct-75K |
TESTED_NAMESPACE::list<TESTED_TYPE>::const_iterator ite = lst.begin();
| ise-uiuc/Magicoder-OSS-Instruct-75K |
yellow10: '#f9f1a5',
yellowGreen70: '#8cbd18',
yellowGreen60: '#a4cf0c',
yellowGreen50: '#bad80a',
yellowGreen40: '#d1ec3c',
yellowGreen30: '#e4f577',
yellowGreen20: '#d5e5ae',
| ise-uiuc/Magicoder-OSS-Instruct-75K |
HANDLE ConnectToDevice(PDWORD pLastError)
{
int fd;
fd = open_device();
if (fd < 0){
*pLastError = fd;
return NULL;
}
return (HANDLE)fd;
}
bool CloseLinuxHandle(HANDLE driver)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
for row in response.css('table.tracklist')[0].css('tr')[1:]:
if len(row.css('td::text')) > 1:
name = row.css('td::text')[1].get() \
.replace("\\", '').replace("\"", '')
if name != "":
song_names.append(name)
yield {... | ise-uiuc/Magicoder-OSS-Instruct-75K |
/* -----------------------------------------------------------------------------
* Copyright 2021 <NAME>
* SPDX-License-Identifier: MIT
* ---------------------------------------------------------------------------*/
| ise-uiuc/Magicoder-OSS-Instruct-75K |
ax.plot(time, radius, color=biotite.colors["dimorange"])
ax.set_xlim(time[0], time[-1])
| ise-uiuc/Magicoder-OSS-Instruct-75K |
except KeyboardInterrupt:
logging.shutdown()
| ise-uiuc/Magicoder-OSS-Instruct-75K |
urlpatterns+= static(settings.MEDIA_URL, document_root = settings.MEDIA_ROOT)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
export PITHOS_CASSANDRA_HOST=${PITHOS_CASSANDRA_HOST:-cassandra}
export PITHOS_SERVICE_URI=${PITHOS_SERVICE_URI:-s3.example.com}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
"""
classdocs
"""
__TIMEOUT = 4.0 # seconds
__BUFFER_SIZE = 1024 # bytes
| ise-uiuc/Magicoder-OSS-Instruct-75K |
from rllab.rllab.misc import tensor_utils
import time
def rollout(env, agent, max_path_length=np.inf, animated=False, speedup=1,
always_return_paths=False):
observations = []
actions = []
rewards = []
agent_infos = []
env_infos = []
o = env.reset()
| ise-uiuc/Magicoder-OSS-Instruct-75K |
def ordinal_loss(input, target):
N, C = input.shape
ranges = torch.arange(C, dtype=torch.int32).cuda()
mask = ranges[None, :] < target[:, None]
| ise-uiuc/Magicoder-OSS-Instruct-75K |
# have to do
| ise-uiuc/Magicoder-OSS-Instruct-75K |
<filename>src/taskpane/components/submissions/SubmissionsView.tsx
import UploadSubmissionsButton from "./UploadSubmissionsButton";
import AddSubmissionButton from "./AddSubmissionButton";
| ise-uiuc/Magicoder-OSS-Instruct-75K |
self.addresses = addresses
self.isFatal = isFatal
self.retry = retry
def __str__(self):
if self.code > 0:
res = ["%.3d %s" % (self.code, self.resp)]
else:
res = [self.resp]
if self.log:
res.append(self.log)
res.append(... | ise-uiuc/Magicoder-OSS-Instruct-75K |
#GPIO.setmode(GPIO.BOARD)
#Remove warnings
GPIO.setwarnings(False)
#Create loop variable
#loop = 1
#BCM
| ise-uiuc/Magicoder-OSS-Instruct-75K |
@pure @dispatch=WORKER
(float o) my_log (float x, float base) "turbine" "0.7.0" [
"set <<o>> [ expr {log(<<x>>)/log(<<base>>)} ]"
];
printf("log10(100) = " + my_log(100, 10));
| ise-uiuc/Magicoder-OSS-Instruct-75K |
});
});
describe('validateOptions', function() {
it('should not return anything for valid options', async function() {
const reasons = await validateOptions({
someOption: 10,
}, {
someOption: validateTime,
});
assert.equal(typeof reasons, 'undefined');
});
| ise-uiuc/Magicoder-OSS-Instruct-75K |
* Markdown
* Copyright (c) John Sundell 2019
* MIT license, see LICENSE file for details
| ise-uiuc/Magicoder-OSS-Instruct-75K |
import org.apache.lucene.spatial.query.SpatialOperation;
import org.apache.lucene.spatial.vector.PointVectorStrategy;
import com.spatial4j.core.context.SpatialContext;
import com.spatial4j.core.shape.Point;
public class SpatialPointVectorStrategyFieldTypeDefinition extends BaseSpatialFieldTypeDefinition {
| ise-uiuc/Magicoder-OSS-Instruct-75K |
MockData(imageName: "hhhhh", description:"I have no idea, bitch"),
]
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
# Last updated: 11 Feb 2022
# how to run: ./chk-wavefile-duration-for-unicode-filename.sh
# Reference
# https://askubuntu.com/questions/343727/filenames-with-spaces-breaking-for-loop-find-command
# https://stackoverflow.com/questions/3001177/how-do-i-grep-for-all-non-ascii-characters
# https://www.baeldung.com/linux/f... | ise-uiuc/Magicoder-OSS-Instruct-75K |
y = y >> 1;
x = (x * x) % p;
}
return res;
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
print('\nDatabase connection closed.') | ise-uiuc/Magicoder-OSS-Instruct-75K |
centerPanelFrame.origin = CGPoint.zero
}
var duration = hidden ? _preferences.animating.hideDuration : _preferences.animating.reavealDuration
if abs(flickVelocity) > 0 {
let newDuration = TimeInterval(sidePanel.frame.size.width / abs(flickVelocity))
... | ise-uiuc/Magicoder-OSS-Instruct-75K |
const mainPackagePath = path.join(packagesPath, 'main-templates')
const packageName: any = {
none: 'unknown',
// put in fixtures parent folder (package.json and node_modules)
parent: 'parent-templates',
// put in fixtures sibling folder (same package.json and node_modules)
sister: 'sister-templ... | ise-uiuc/Magicoder-OSS-Instruct-75K |
lazy var registerButton: LoadingButton = {
let button = LoadingButton(type: .system)
button.setTitle("Register", for: UIControl.State())
button.translatesAutoresizingMaskIntoConstraints = false
button.setTitleColor(UIColor(red: 245.0/255.0, green: 237.0/255.0, blue: 251.0/255.0, alph... | ise-uiuc/Magicoder-OSS-Instruct-75K |
# $1 Path to the new version.
# $2 Path to the old version.
# Copies trove4j_src.jar for GPL compliance.
cp -a -n $2/lib/trove4j_src.jar $1/lib/
| ise-uiuc/Magicoder-OSS-Instruct-75K |
from ray.tune.result import EXPR_PROGRESS_FILE
class PathmindCSVLogger(CSVLogger):
def _init(self):
"""CSV outputted with Headers as first set of results."""
progress_file = os.path.join(self.logdir, EXPR_PROGRESS_FILE)
self._continuing = (
os.path.exists(progress_file) and os.... | ise-uiuc/Magicoder-OSS-Instruct-75K |
guard let data = data, error == nil else {
return completition(.failure(.noData))
}
let accounts = try? JSONDecoder().decode([Account].self, from: data)
if accounts == nil {
completition(.failure(.decodingError))
} ... | ise-uiuc/Magicoder-OSS-Instruct-75K |
from sklearn import metrics
from sklearn import svm
from sklearn.naive_bayes import GaussianNB
from sklearn.ensemble import RandomForestClassifier
from sklearn.linear_model import LogisticRegression
from src.datasets import data_utils
from src.datasets.data_utils import timed, TextTooShortException, DataSampler, WordV... | ise-uiuc/Magicoder-OSS-Instruct-75K |
import torch
from torch import nn
| ise-uiuc/Magicoder-OSS-Instruct-75K |
}
for key, prop, group_type, group_by_name in self._translate_properties(scope, read_schema()):
if not hasattr(user.user, prop.key):
continue
value = getattr(user.user, prop.key, None)
if prop.type == UserPropertyType.picture:
if value ... | ise-uiuc/Magicoder-OSS-Instruct-75K |
upload = Table("upload", meta, autoload=True)
uploader_id = Column("uploader_id", Integer)
uploader_id.create(upload)
idx_upload_uploader_id = Index("idx_upload_uploader_id", upload.c.uploader_id)
idx_upload_uploader_id.create(migrate_engine)
def downgrade(migrate_engine):
meta = MetaData(bi... | ise-uiuc/Magicoder-OSS-Instruct-75K |
self.side_task=self.add_task_func('sidetask',sidetask)
self.set_task('sidetask')
self.tasks.remove(self.side_task)
task = next((t for t in self.tasks if t.name == 'init'), None)
if not task:
def run_this(): pass
self.add_task_func('init', run_this)
def set_next_task(self, name):
self._next_task = na... | ise-uiuc/Magicoder-OSS-Instruct-75K |
def get_columns_test(client, module):
"""Gets columns."""
columns = get_columns(client, module)
assert len(columns) > 0
def get_test_model(columns, value):
return utils.format_model({ key: value for key in columns })
def get_test_id(module):
return globals()[module]['id']
def set_test_id(module, ... | ise-uiuc/Magicoder-OSS-Instruct-75K |
tipo = (ord(data[2]) >> 3) & 15 # Opcode bits
if tipo == 0: # Standard query
ini=12
| ise-uiuc/Magicoder-OSS-Instruct-75K |
<reponame>ndepal/bokeh
from pytest import raises
from bokeh.models import CustomJS, Slider
def test_js_callback():
| ise-uiuc/Magicoder-OSS-Instruct-75K |
ret = longpoll[pack['userid']]['object']['attachments'][0]['photo']['sizes']
num = 0
for size in ret:
if size['width'] > num:
num = size['width']
url = size['url']
index = requests.get('https://yandex.ru/images/search?url='+url+'&rpt=imageview').text
index = html.fromstring(index)
tags = index.xpath('//di... | ise-uiuc/Magicoder-OSS-Instruct-75K |
# Unauthorized copying of this file, via any medium is strictly prohibited
# Proprietary and confidential
| ise-uiuc/Magicoder-OSS-Instruct-75K |
let x = pool.install(|| octillion_flat().find_last(|_| true));
assert_eq!(x, Some(OCTILLION - 1));
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
// UVa10392 Factoring Large Numbers
// <NAME>
// 棰 | ise-uiuc/Magicoder-OSS-Instruct-75K |
//
// Item.cs
//
// Copyright (c) <NAME>. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using NosSmooth.Data.Abstractions.Infos;
namespace NosSmooth.Game.Data.Items;
/// <summary>
/// A NosTale item.
/// </summary>
/// <param name="Item... | ise-uiuc/Magicoder-OSS-Instruct-75K |
<?php
echo readfile("CurrentUsers.txt");
?>
| ise-uiuc/Magicoder-OSS-Instruct-75K |
import os
from pathlib import Path
import typer
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
app_dir = Path(typer.get_app_dir('pacu'))
profile_path = app_dir/'profile'
| ise-uiuc/Magicoder-OSS-Instruct-75K |
} catch ( Error error ) {
System.out.println( "ERROR:" + error.mDescription );
System.out.println( "LOCATION:" + error.mLocation );
System.out.println( "String:" + error.toString() );
}
}
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
addressPrefix = "DBD";
type = "Dword";
break;
case DataType.INT:
addressPrefix = "DBW";
type = "Short";
| ise-uiuc/Magicoder-OSS-Instruct-75K |
from .segment import Segment
from .serve import Serve
from .serving_rule import ServingRule
from .tag import Tag
from .variation import Variation
from .variation_map import VariationMap
| ise-uiuc/Magicoder-OSS-Instruct-75K |
with pytest.raises(ValueError):
BondType(bond_type.bond_type_index, label, bond_type.spring_coeff_1, bond_type.spring_coeff_2)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
'default_purchase_costs' => $row['default_purchase_costs']
]);
}
}
| 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.