seed stringlengths 1 14k | source stringclasses 2
values |
|---|---|
@register.simple_tag
def settings_value(name):
return getattr(settings, name, "")
| ise-uiuc/Magicoder-OSS-Instruct-75K |
for f in list(set([x.rsplit('.',1)[0] for x in files])):
found=False
for ext in ('.pyc', '.so', '.pyo', '.py'):
if ext == '.py' and found:
continue
if os.path.exists(os.path.join(root,f+ex... | ise-uiuc/Magicoder-OSS-Instruct-75K |
Project location: https://github.com/romainx/panorama
"""
__version__ = "0.2.0"
__author__ = "romainx"
from .panorama import *
| ise-uiuc/Magicoder-OSS-Instruct-75K |
sockets_list = []
# system sync socket
socket_system_sync = context.socket(zmq.REQ)
socket_system_sync.connect("tcp://localhost:{}".format(port_config["system_sync_port"]))
sockets_list.append(socket_system_sync)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
res = (v1 / -1);
Assert.assertEquals("test52", -34546890089234576L, res);
v1 = -34546890089234576L;
res = (v1 / -1);
Assert.assertEquals("test53", 34546890089234576L, res);
v1 = 34546890089234576L;
res = (v1 / 32);
Assert.assertEquals("test60", 1079590315288580L, res);
v1 = -345468900892... | ise-uiuc/Magicoder-OSS-Instruct-75K |
m = __import__(component_name, globals(), locals(), list_of_modules, -1)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
}
if ($search['status_search']!=""){
$sql.=" AND `status`=".$search['status_search'];
}
$sql.=" ORDER BY alias DESC ";
return $db->fetchAll($sql);
}
function addNewTab($data){
$db = $this->getAdapter();
$db->beginTransaction();
try{
$dbglobal = new A... | ise-uiuc/Magicoder-OSS-Instruct-75K |
<div class="pull-left image">
| ise-uiuc/Magicoder-OSS-Instruct-75K |
list_display = ['pk', 'name', 'radiant_ra', 'radiant_dec', 'start_date', 'peak_date', 'end_date', 'zhr']
search_fields = ['name']
| ise-uiuc/Magicoder-OSS-Instruct-75K |
},
#[Msg]
message => room, data{
let state = room.get_mut_state();
let message = data.unwrap();
| ise-uiuc/Magicoder-OSS-Instruct-75K |
*/
public ArrayList<Session> getClasses() { return classes; }
/**
* @return a string that represents the data of the object
*/
public String toString(){
StringBuilder str = new StringBuilder(super.toString());
for(Session s: classes){
str.append("\n").append(s.toS... | ise-uiuc/Magicoder-OSS-Instruct-75K |
# from monitoring.adapters.mock import TimeBasedMockMCP3008 as MCP3008
from monitoring.adapters.mock.MCP3008 import DoubleAlertMCP3008 as MCP3008
class SensorAdapter(object):
"""
Load sensor values.
"""
SPI_CS = [12, 1]
# number of channels on MCP3008
CHANNEL_COUNT = 8
| ise-uiuc/Magicoder-OSS-Instruct-75K |
((GMeasurement)recordable).eraseSelectionUndone(action);
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
entry_s4 = {
'switch' : 'fc00:db20:35b:7399::5',
| ise-uiuc/Magicoder-OSS-Instruct-75K |
) as $file) {
$this->assertFileNotExists($this->target . '/translations/' . $file);
}
$this->assertEquals(self::JSON_EN_MESSAGES_TRANSLATIONS, file_get_contents($this->target . '/translations/messages/en.json'));
$this->assertEquals(self::JSON_FR_MESSAGES_TRANSLATI... | ise-uiuc/Magicoder-OSS-Instruct-75K |
oid sha256:1b58a95ecc3639df7d047ebe59acc7b69cab6f5f0932e6b4aac935cc6ae5624d
size 1355480
| ise-uiuc/Magicoder-OSS-Instruct-75K |
});
});
| ise-uiuc/Magicoder-OSS-Instruct-75K |
}, headers=headers)
resp = json.loads(rv.data)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
# Either use the LOCAL_USER_ID if passed in at runtime or
# fallback
echo "Starting with UID : $LOCAL_USER_ID"
useradd --shell /bin/bash -u "$LOCAL_USER_ID" -o -c "" -m user
export HOME=/home/user
echo "Executing $*"
exec /usr/local/bin/gosu user "$@"
}
function main () {
| ise-uiuc/Magicoder-OSS-Instruct-75K |
return self._get_settings_for_lesson(lesson)
return {}
def _settings_template_path_for_lesson(self, lesson):
"""Gets a settings_template for a given lesson"""
lesson_settings_name = lesson.settings_name
return os.path.join(self.lessons_path, lesson_settings_name,... | ise-uiuc/Magicoder-OSS-Instruct-75K |
batch_size = tf.shape(input_var)[0]
input_var = tf.one_hot(input_var, self.input_dim, axis=-1)
input_var = tf.reduce_sum(input_var, axis=1)
self.input_var = input_var
with tf.variable_scope(self.scope, reuse=None) as training_scope:
| ise-uiuc/Magicoder-OSS-Instruct-75K |
import Foundation
import CoreData
| ise-uiuc/Magicoder-OSS-Instruct-75K |
if result == True:
print "Message was sent successfully"
print "Clickatell returned %s" % uid
else:
print "Message was not sent"
"""
| ise-uiuc/Magicoder-OSS-Instruct-75K |
public MedianFinder() {
maxQueue = new PriorityQueue<>((o1, o2) -> o2 - o1);
minQueue = new PriorityQueue<>();
}
public void addNum(int num) {
maxQueue.add(num);
minQueue.add(maxQueue.poll());
System.out.println("maxQueue.size() = " + maxQueue.size());
Syste... | ise-uiuc/Magicoder-OSS-Instruct-75K |
this.Label_11_30AM.Name = "Label_11_30AM";
this.Label_11_30AM.Size = new System.Drawing.Size(120, 20);
| ise-uiuc/Magicoder-OSS-Instruct-75K |
if np.random.rand()<0.5:
dx+=np.random.randint(3)-1
if np.random.rand() < 0.5:
dy += np.random.randint(3) - 1
| ise-uiuc/Magicoder-OSS-Instruct-75K |
auto elemSize = typeSet.getDataLayout().getTypeAllocSize(elemType);
auto arraySize = numElems * elemSize;
ArrayLayout::ArrayTripleList arrayTripleList = {{0, arraySize, elemSize}};
| ise-uiuc/Magicoder-OSS-Instruct-75K |
from rs_datasets.data_loader import download_dataset
from rs_datasets.generic_dataset import Dataset, safe
class YooChoose(Dataset):
| ise-uiuc/Magicoder-OSS-Instruct-75K |
elif len1 < len2:
l1 += [0] * (len2 - len1)
return (l1 > l2) - (l1 < l2)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
return frappe.get_list("Feed", fields=["name", "feed_type", "doc_type",
"subject", "owner", "modified", "doc_name", "creation"],
limit_start = limit_start, limit_page_length = limit_page_length,
order_by="creation desc")
@frappe.whitelist()
def get_months_activity():
| ise-uiuc/Magicoder-OSS-Instruct-75K |
import dmscreen.data.creature.feature.Action;
public class ActionTemplate extends Template<Action> {
public final String nameFormat, noteFormat, descFormat;
| ise-uiuc/Magicoder-OSS-Instruct-75K |
let count = up[i][j] + right[i][j] + down[i][j] + left[i][j] - 3;
if ans < count {
| ise-uiuc/Magicoder-OSS-Instruct-75K |
import chainer.links as L
| ise-uiuc/Magicoder-OSS-Instruct-75K |
byte[] data = null;
lock (syncObj)
{
var dataList = GetOrCreateDataQueue(size);
if (dataList.Count > 0)
{
data = dataList.Dequeue();
}
}
return data ?? new byte[size];
... | ise-uiuc/Magicoder-OSS-Instruct-75K |
{
let binary_search_tree = self.binary_search_tree_for(binary_search_tree_index);
let (first_block_memory_address, last_block_memory_address) = binary_search_tree.blocks_to_coalesce(inserted_node_pointer, difference.non_zero(), block_size, furthest_back_contiguous_with_inserted_node_pointer_memory_address, fur... | ise-uiuc/Magicoder-OSS-Instruct-75K |
pass
else:
print na<ref>me | ise-uiuc/Magicoder-OSS-Instruct-75K |
for _ in range(self.tries):
time.sleep(random.random() * sleep * 2)
try:
req = requests.get(url)
if req.status_code == 200:
return {
| ise-uiuc/Magicoder-OSS-Instruct-75K |
import pandas as pd
perf = pd.read_pickle('buyapple_out.pickle') # read in perf DataFrame
print(perf.head()) | ise-uiuc/Magicoder-OSS-Instruct-75K |
};
app = Application.Launch(startInfo);
using (var automation = new UIA2Automation())
{
var window = app.GetMainWindow(automation);
Assert.AreEqual("Legacy Weather", window.Title);
Assert.AreEqual(DEFAULT_RESULT... | ise-uiuc/Magicoder-OSS-Instruct-75K |
//std::string hwid = GenerateHWID();
//if (hwid.compare("SF Heavy Equipment-1284220259") != 0)
//{
// __asm
// {
// mov eax, ptrToNothing
// call dword ptr [eax+10]
| ise-uiuc/Magicoder-OSS-Instruct-75K |
echo "/usr/sbin/logrotate $LOGROTATE_CONF_FILE" >> $CRON_DAILY_LOGROTATE_FILE
| ise-uiuc/Magicoder-OSS-Instruct-75K |
/**
* Print the variable $data and exit if exit = true
*
* Debug::dump($data);
*
| ise-uiuc/Magicoder-OSS-Instruct-75K |
break;
}
llvm::Value* newConst = llvm::ConstantInt::get(val1->getType(), res);
| ise-uiuc/Magicoder-OSS-Instruct-75K |
return total/ntrials
if __name__ == '__main__':
print('{:.6f}s for statistics.mean'.format(time_stat(statistics.mean, 10**5, 10)))
print('{:.6f}s for np.mean'.format(time_stat(np.mean, 10**5, 1000)))
| ise-uiuc/Magicoder-OSS-Instruct-75K |
"""Application entrypoint."""
from twitoff.app import create_app
app = create_app() | ise-uiuc/Magicoder-OSS-Instruct-75K |
#-----------------------------------------#
| ise-uiuc/Magicoder-OSS-Instruct-75K |
extension TranslateOptions: TomlCodable {
static func make(toml: Toml) throws -> TranslateOptions {
let update: String = "update"
let translate: String = "translate"
if let secret: String = toml.string(update, translate, "secret") {
let path = toml.string(update, translate, "pat... | ise-uiuc/Magicoder-OSS-Instruct-75K |
void LoanHoliday::annualReset() {
if (_pParams->nMonthsPerYear <= _pParams->nMonthsTermRemaining) {
_pParams->nMonthsYearRemaining = _pParams->nMonthsPerYear;
} else {
| ise-uiuc/Magicoder-OSS-Instruct-75K |
# Define datapoints for each class.
inps = torch.stack([
torch.randn(num_samples_per_class, inp_dimensions)/10 + torch.tensor([1, 0, 1, 1, 0, 0, 1, 0, 0, 1]),
torch.randn(num_samples_per_class, inp_dimensions)/10 + torch.tensor([0, 0, 1, 0, 0, 1, 0, 1, 0, 1]),
tor... | ise-uiuc/Magicoder-OSS-Instruct-75K |
print(h.decode(errors='ignore'))
| ise-uiuc/Magicoder-OSS-Instruct-75K |
}
var modelName = bindingContext.ModelName;
// Try to fetch the value of the argument by name q=
var valueProviderResult = bindingContext.ValueProvider.GetValue(modelName);
if (valueProviderResult == ValueProviderResult.None)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
if args:
args = shlex.split(self.tox_args)
tox.cmdline(args=args)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
one_gt_losses = self.loss(cls_scores, bbox_preds, gt_bboxes, gt_labels,
img_metas, gt_bboxes_ignore)
onegt_cls_loss = one_gt_losses['loss_cls']
onegt_box_loss = one_gt_losses['loss_bbox']
assert sum(onegt_cls_loss).item() > 0, 'cls loss should be non-zero'
assert sum(on... | ise-uiuc/Magicoder-OSS-Instruct-75K |
from functools import lru_cache
class Solution:
DIRS = [(-1, 0), (1, 0), (0, -1), (0, 1)]
def longestIncreasingPath(self, matrix: List[List[int]]) -> int:
if not matrix:
return 0
@lru_cache(None)
def dfs(row: int, col: int) -> int:
best = 1
for dx,... | ise-uiuc/Magicoder-OSS-Instruct-75K |
return permissions_names
def get_request_body_from_user(user: User):
res = user.to_dict()
for k, v in res.items():
| ise-uiuc/Magicoder-OSS-Instruct-75K |
std::string getStringOrEmpty(Local<Object> target, std::string key) {
Local<String> lkey = New(key).ToLocalChecked();
MaybeLocal<Value> mvalue = Nan::Get(target, lkey);
if (mvalue.IsEmpty() || mvalue.ToLocalChecked()->IsUndefined()) {
return "";
} else {
| ise-uiuc/Magicoder-OSS-Instruct-75K |
let value = data.withUnsafeBytes { (pointer: UnsafePointer<Int32>) in
return pointer.pointee
}
return Int(Int32(bigEndian: value))
default:
fatalError()
}
}
/// Converts the byte array to a big endian unsigned integer. Note that by... | ise-uiuc/Magicoder-OSS-Instruct-75K |
<reponame>danielricci/Snake
/**
* MIT License
*
* Copyright (c) 2020 <NAME> {@literal <<EMAIL>>}
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limit... | ise-uiuc/Magicoder-OSS-Instruct-75K |
//=-------------- SR-5154 --------------=/
protocol sr5154_Scheduler {
func inBackground(run task: @escaping () -> Void)
}
extension sr5154_Scheduler {
func inBackground(run task: @escaping () -> [Count], completedBy resultHandler: @escaping ([Count]) -> Void) {}
}
struct Count { // expected-note {{'init(title:)'... | ise-uiuc/Magicoder-OSS-Instruct-75K |
parser.add_argument('-p', metavar='password', help='ssh password', required=True)
args = parser.parse_args()
host = args.server.split('@')[1]
user = args.server.split('@')[0]
if '' == args.n:
args.n = args.file_url.split('/')[-1]
| ise-uiuc/Magicoder-OSS-Instruct-75K |
# Iterate and create one database per spec
for i in $(seq $startPort $lastPort)
do
newDatabase="${databaseName}_${i}"
# Create the database with specific owner and template
createdb -U $dbAdmin -O "postgres" -T "carto_db_test" $newDatabase
| ise-uiuc/Magicoder-OSS-Instruct-75K |
Widget asWidget();
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
@classmethod
def init_from_json( cls, dict_from_json ):
metric = cls( dict_from_json )
return metric
| ise-uiuc/Magicoder-OSS-Instruct-75K |
if ya-yb > 0:
angle = math.pi / 2
elif ya-yb <0:
angle = -math.pi / 2
else:
angle = 0.0
if angle < 0:
angle = angle + 2 * math.pi # 0 to 2pi
return angle
def VectNorm3(self, Pt1, Pt2):
norm = m... | ise-uiuc/Magicoder-OSS-Instruct-75K |
return $"Appender type: {this.GetType().Name}, Layout type: {this.layout.GetType().Name}, Report level: {this.ReportLevel}, Messages appended: {this.MessagesCount}";
| ise-uiuc/Magicoder-OSS-Instruct-75K |
<?php
namespace Metaregistrar\EPP;
class eppCreateRequest extends eppRequest {
function __construct() {
parent::__construct();
}
function __destruct() {
parent::__destruct();
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
public override func invoke(build build: LRBuild, completionBlock: dispatch_block_t) {
build.markAsConsumedByCompiler(sourceFile)
if !sourceFile.exists {
rule.handleDeletionOfFile(sourceFile)
completionBlock()
} else {
let result = newResult()
... | ise-uiuc/Magicoder-OSS-Instruct-75K |
class Trie:
| ise-uiuc/Magicoder-OSS-Instruct-75K |
--run 'chown -R neuro /home/neuro' \
--user=neuro \
--workdir /home/neuro \
--cmd "jupyter-notebook" > Dockerfile
| ise-uiuc/Magicoder-OSS-Instruct-75K |
@classmethod
def can_send(cls, notification):
return notification.user is not None
@classmethod
def user_prefers_sending(cls, notification):
if notification.notification_type.unsubscribe_allowed and notification.user is not None:
if not notification.user.is_active:
... | ise-uiuc/Magicoder-OSS-Instruct-75K |
continue
elif direction < 0 and position == 3 * HEIGHT / 4:
output.write("Tested: " + str(test) + " for player shooting to enemy\n")
update = True
continue
elif direction == 0:
output.write("Tested: " + str(test) + "... | ise-uiuc/Magicoder-OSS-Instruct-75K |
.scaledToFit()
.frame(width: geo.size.width * 0.8)
.frame(width: geo.size.width, height: geo.size.height)
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
buf: &mut ReadBuf<'_>,
) -> Poll<io::Result<()>> {
Pin::new(&mut self.recv_stream).poll_read(cx, buf)
}
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
let key = match header.meta.get_data_key() {
Some(key) => key,
None => {
return;
}
};
| ise-uiuc/Magicoder-OSS-Instruct-75K |
rm -fR Documents/workspace/microting/eform-angular-frontend/eform-client/src/app/plugins/modules/greate-belt-pn
cp -a Documents/workspace/microting/eform-angular-greate-belt-plugin/eform-client/src/app/plugins/modules/greate-belt-pn Documents/workspace/microting/eform-angular-frontend/eform-client/src/app/plugins/mod... | ise-uiuc/Magicoder-OSS-Instruct-75K |
<filename>src/hooks/index.ts
| ise-uiuc/Magicoder-OSS-Instruct-75K |
* This source file is subject to the MIT license and the version 3 of the GPL3
* license that are bundled with this package in the folder licences
| ise-uiuc/Magicoder-OSS-Instruct-75K |
public void setConverter(Function<T, String> converter){
| ise-uiuc/Magicoder-OSS-Instruct-75K |
import amulet
import re
class TestDeploy(unittest.TestCase):
| ise-uiuc/Magicoder-OSS-Instruct-75K |
doc_requires = [
'doc8',
'sphinx',
'sphinx_rtd_theme',
| ise-uiuc/Magicoder-OSS-Instruct-75K |
fn config_commit(&self) -> ReturnCode;
fn set_config_client(&self, client: &'static ConfigClient);
| ise-uiuc/Magicoder-OSS-Instruct-75K |
}
export function userHasAccess(requiredPrivilege: string, user: any) {
return userHasPrivilege(requiredPrivilege, user) || isSuperUser(user);
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
# If we have a group we fetch the wall from the group
if group:
posts = group.content_objects(Post)
else:
posts = Post.objects.all()
# check on user authentication or if user is member of a group
if not request.user.is_authenticated():
is_member = False
else:
... | ise-uiuc/Magicoder-OSS-Instruct-75K |
for call in json_data:
# read JSON file to update records with Return information
urlReturn = json_data[call]['pageRedirectEndURL'].strip().lower()
fileName = json_data[call]['filename'].strip()
| ise-uiuc/Magicoder-OSS-Instruct-75K |
def keyword_deco(self, arg1, arg2):
"""lib keyword with emmedded args"""
print arg1, arg2
| ise-uiuc/Magicoder-OSS-Instruct-75K |
<reponame>felixarntz/dotfiles<filename>wp-cli/install.sh
if [ ! -x "$(command -v wp)" ]; then
curl https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -o /tmp/wp-cli.phar
chmod +x /tmp/wp-cli.phar
mv /tmp/wp-cli.phar /usr/local/bin/wp
fi
| ise-uiuc/Magicoder-OSS-Instruct-75K |
public class PayTest {
public static void main(String[] args) {
// 业务需要微信支付时:
PayBase payBase = PayUtil.pay("WeChat");
payBase.pay("张三", new BigDecimal("1000"));
// 想要调用 queryPayInfo 必须强转
String payInfo = ((WeChatPay)payBase).queryPayInfo("张三");
| ise-uiuc/Magicoder-OSS-Instruct-75K |
/**
* @author dengyuhan
* created 2018/6/5 23:14
*/
public class CustomLoggerListener extends SimpleFFmpegLoggerListener{
public CustomLoggerListener(boolean loggerEnable) {
super(loggerEnable);
}
@Override
| ise-uiuc/Magicoder-OSS-Instruct-75K |
# train_by_config(os.path.join('settings', 'training_settings_7.ini'))
#
test_by_config(os.path.join('test_settings', 'test_settings.ini'))
| ise-uiuc/Magicoder-OSS-Instruct-75K |
namespace SciChart.UI.Reactive.Traits
{
/// <summary>
/// A collection of <see cref="IViewModelTrait"/> - traits or viewmodel behaviours which are added to <see cref="ViewModelWithTraitsBase"/>
| ise-uiuc/Magicoder-OSS-Instruct-75K |
/**
* @throws Throwable
| ise-uiuc/Magicoder-OSS-Instruct-75K |
export class DocViewerModule { }
| ise-uiuc/Magicoder-OSS-Instruct-75K |
return $this;
}
/**
* Retrieve the name of this suggestion.
*
* @return string
*/
| ise-uiuc/Magicoder-OSS-Instruct-75K |
if (!string.IsNullOrWhiteSpace(paragraph.Text))
paragraph.RemoveText(0);
paragraph.InsertText(columns[column_i].uiName ?? " ");
var contentCell = templateRow.Cells[table.ColumnCount - column_i - 2];
... | ise-uiuc/Magicoder-OSS-Instruct-75K |
return tableView
}()
| ise-uiuc/Magicoder-OSS-Instruct-75K |
#include "Sound.hpp" | ise-uiuc/Magicoder-OSS-Instruct-75K |
just,
lists,
| ise-uiuc/Magicoder-OSS-Instruct-75K |
from frozendict import frozendict
| ise-uiuc/Magicoder-OSS-Instruct-75K |
def __init__(self, apikey):
self._todist_api = todoist.api.TodoistAPI(apikey)
self._todist_api.sync()
self._projects_by_id = {project['id']: project for project in self._todist_api.state['projects']}
def get_completed(self, projects, subprojects=True):
seen = set()
proje... | ise-uiuc/Magicoder-OSS-Instruct-75K |
{
return $this->belongsToMany(Skill::class,'skill_social_auth','id','skill_id');
}
/**
* Get all levels in the pivot table
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
*/
public function levels()
{
return $this->belongsToMany(LevelSkill::class,'ski... | 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.