seed stringlengths 1 14k | source stringclasses 2
values |
|---|---|
<reponame>tremaru/pyiArduinoI2Cmatrix
# Данный пример выводит символы.
#
from pyiArduinoI2Cmatrix import * # Подключаем библиотеку (модуль python) для работы с LED матрицей 8x8.
from time import sleep # Импортируем функцию ожидания
disp = pyiArduino... | ise-uiuc/Magicoder-OSS-Instruct-75K |
return "%s - %s" % (self.organization, self.event)
class OrganizationMetrics(TimeStampedModel):
organization = models.ForeignKey(Organization)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
analyzer = ReadmeAnalyzer('src/readme_analyzer_config.cfg')
analyzer.runAll() | ise-uiuc/Magicoder-OSS-Instruct-75K |
self.N += n
if self.WF is None:
self.WF = open(self.file_path, 'wb', buffering=1024*1024*100)
self.WF.write(struct.pack('<QQQQ', n, c, h, w))
for ii in range(n):
self.WF.write(packed[ii])
def read(self, n):
"""
re... | ise-uiuc/Magicoder-OSS-Instruct-75K |
import Amplify
public extension AWSAPIPlugin {
func query<R: Decodable>(request: GraphQLRequest<R>,
listener: GraphQLOperation<R>.ResultListener?) -> GraphQLOperation<R> {
| ise-uiuc/Magicoder-OSS-Instruct-75K |
hello_str = "Привет %s тебе %d лет" % (name, age) # s - str , d - digit
print(hello_str)
hello_str = "Привет {} тебе {} лет".format(name, age)
print(hello_str)
result = f'{name} {age}'
print(result)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
self.FOV_LIGHT_WALLS = bool(config["FOV_LIGHT_WALLS"])
self.HP_BAR_WIDTH = int(config["HP_BAR_WIDTH"])
| ise-uiuc/Magicoder-OSS-Instruct-75K |
output = [];
for interval in intervals:
if not output or output[-1][1] < interval[0]:
output.append(interval)
else:
output[-1][1] = max(output[-1][1], interval[1])
| ise-uiuc/Magicoder-OSS-Instruct-75K |
parser.add_argument('--batch_size', type=int, default=64)
parser.add_argument('--model_path', type=str)
args = parser.parse_args()
model = tf.saved_model.load(args.model_path)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
p[0] = [p_list[1]]
else:
p[0] = p_list[1]
| ise-uiuc/Magicoder-OSS-Instruct-75K |
from tasks import *
| ise-uiuc/Magicoder-OSS-Instruct-75K |
# (C) Cloudera, Inc. 2021
# All rights reserved.
#
# Applicable Open Source License: Apache 2.0
#
| ise-uiuc/Magicoder-OSS-Instruct-75K |
// BEGIN player_avfoundation_import
import AVFoundation
// END player_avfoundation_import
class ViewController: UIViewController {
var audioPlayer : AVAudioPlayer?
| ise-uiuc/Magicoder-OSS-Instruct-75K |
trainer_metrics.start_experience_collection_timer()
trainer_metrics.end_experience_collection_timer()
trainer_metrics.start_policy_update_timer(number_experiences=fake_buffer_length,
mean_return=fake_mean_return)
trainer_metrics.end_polic... | ise-uiuc/Magicoder-OSS-Instruct-75K |
import cv2
def tesseract_ocr(image_path, ocr_path):
image = cv2.imread(image_path.as_posix())
with open(ocr_path, 'r') as f:
ocr_data = json.load(f)
empty_index = [i for i, ele in enumerate(ocr_data['text']) if ele == ""]
| ise-uiuc/Magicoder-OSS-Instruct-75K |
public $active = 1; // default is active(1)
public function __construct()
{
parent::__construct();
$this->db = & get_instance()->db_mgr;
$this->load->config('db_constants');
$this->table = TBL_ACADEMIC_SUBJECTS;
}
public function save()
{
$ins... | ise-uiuc/Magicoder-OSS-Instruct-75K |
self.row_data = data_arr
# 所有特征对应的块集合
self.sorted_pages = []
# 不同特征中出现过特征缺失值的行的集合
# self.missing_value_pages = []
for i in range(self.m): # 遍历所有的特征
feature = data_arr[:, i] # 特征 i 拎出来 shape:(N,)
feature_index = []
for rid in rang... | ise-uiuc/Magicoder-OSS-Instruct-75K |
mkdir -p /var/www/html/storage
chown -R www-data:www-data /var/www/html/storage
/usr/local/bin/php /var/www/html/scripts/migrate.php
exec "$@"
| ise-uiuc/Magicoder-OSS-Instruct-75K |
</div>
</div>
</div> | ise-uiuc/Magicoder-OSS-Instruct-75K |
class BaseAAEntity(object):
TYPENAME = "" # type: str
"""The name of the graphql type in the schema.
Used for disambiguation when there's more than one possible type being
| ise-uiuc/Magicoder-OSS-Instruct-75K |
from skl2onnx.algebra.onnx_ops import OnnxIdentity, OnnxAdd
from test_utils import TARGET_OPSET
class DummyTransformer(BaseEstimator, TransformerMixin):
def __init__(self):
TransformerMixin.__init__(self)
BaseEstimator.__init__(self)
def fit(self, X, y, sample_weight=None):
| ise-uiuc/Magicoder-OSS-Instruct-75K |
class Ssh(utilities.ExtensionTestCase):
# disabled until persistent + SSH_AUTH_SOCK solution sis found
def do_not_ssh_auth_sock(self):
mock_cli_args = {}
# with SSH_AUTH_SOCK set
os.environ['SSH_AUTH_SOCK'] = 'foo'
args = self.extension.get_docker_args(mock_cli_args)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
CHECK_EQ(Fxypxy.N, 4, "need 4 intrinsic parameters");
depthData2point(pt.p, Fxypxy.p);
| ise-uiuc/Magicoder-OSS-Instruct-75K |
class SpellbookWrapper():
def __init__(self, url='http://bitcoinspellbook.appspot.com'):
self.url = url
def blockdata(self):
return BlockDataWrapper(self.url)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
next(e);
}
};
export const getMayLayer1Polygons = (req: Request, rsp: Response, next: NextFunction): any => {
try {
rsp.send(MapService.getMayLayer1Polygons(req.params.hierarchicalName));
| ise-uiuc/Magicoder-OSS-Instruct-75K |
/// Subscribes subscriber to the newsletter.
/// </summary>
/// <param name="subscriber">Subscriber object</param>
/// <param name="newsletter">Newsletter which the subscriber will be subscribed to</param>
/// <returns>True if subscription was successful.</returns>
privat... | ise-uiuc/Magicoder-OSS-Instruct-75K |
def test_gradient_descent_for_function_with_one_variable():
f = lambda x: x**4 - 3*(x**3)+2
x_true = 9.0 / 4.0
min_true = f(x_true)
gd_calc = gradient_descent.gradient_descent_for_function(f, x0=6.0, step_size=0.01)
assert max(abs(gd_calc["f"] - min_true), abs(gd_calc["x"] - x_true)) <= EPSILON | ise-uiuc/Magicoder-OSS-Instruct-75K |
// std::vector type conversion
euclidean_vector::operator std::vector<double>() const noexcept {
| ise-uiuc/Magicoder-OSS-Instruct-75K |
def select(self, population, fitness):
return self._select(population, fitness), self._select(population, fitness)
def getparameters(self):
return {
'tournament_size': self.tournament_size
| ise-uiuc/Magicoder-OSS-Instruct-75K |
pub fn create_default_processing() -> ProcessingConfig<RefinementContext, ProblemObjective, InsertionContext> {
ProcessingConfig {
context: vec![Box::new(VicinityClustering::default())],
solution: vec![
| ise-uiuc/Magicoder-OSS-Instruct-75K |
ss.close();
}
} | ise-uiuc/Magicoder-OSS-Instruct-75K |
}
}
}
}
}
ValidatorRangeOption::NotLimited => quote! {},
}
};
let handle_nan = {
... | ise-uiuc/Magicoder-OSS-Instruct-75K |
let elements: [Float] = [0.1, 0.5, 1, 1.5]
let a = NDArray(shape: [2, 2], elements: elements)
XCTAssertEqualWithAccuracy(log(a),
NDArray(shape: [2, 2], elements: elements.map(log)))
}
do {
let elements: [Double] = [0.... | ise-uiuc/Magicoder-OSS-Instruct-75K |
[(base_raster_path, 1), (base_nodata, 'raw'),
(mask_value_list, 'raw'), (inverse, 'raw'),
(MASK_NODATA, 'raw')], _mask_vals_op,
target_raster_path, gdal.GDT_Byte, MASK_NODATA)
def download_and_clip(file_uri, download_dir, bounding_box, target_file_path):
"""Download file uri, the... | ise-uiuc/Magicoder-OSS-Instruct-75K |
#define OPENLOG
#if OPENLOG
#if XIHSERVER
using XIHServer;
#else
using UnityEngine;
#endif
#endif
namespace XiHNet
{
public static class Debugger
{
| ise-uiuc/Magicoder-OSS-Instruct-75K |
IceRayC_TypeCoordScalar4D I_that;
I_that.value[0] = P_this[0];
| ise-uiuc/Magicoder-OSS-Instruct-75K |
print(points2D_sorted)
points2D_sorted = sorted(points2D, key = lambda x:x[1])
print(points2D_sorted)
def sort_function_with_second_param(x):
| ise-uiuc/Magicoder-OSS-Instruct-75K |
x_in = x
x_in = x_in.view(b, c, h * w)
x_in = x_in.unsqueeze(1)
x_attn = self.conv_attn(x)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
requests = arg_to_iter(self.get_media_requests(item, info))
dlist = [self._process_request(r, info) for r in requests]
dfd = DeferredList(dlist, consumeErrors=1)
return dfd.addCallback(self.item_completed, item, info)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
try:
from smbus2 import SMBus
except ImportError:
from smbus import SMBus
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
xs = []
ys =[]
bus = SMBus(1)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
urlpatterns = patterns('',
url(r'^$', views.index, name='index'),
url(r'^search', views.search, name='search'),
url(r'^submit/$', views.submit, name='submit'),
url(r'^show/(?P<area_id>\d+)/', views.show, name='show'),
)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
<div class="modal-footer">
<button type="button" class="btn btn-default btn-flat" data-dismiss="modal" aria-label="Close">关闭</button>
</div>
</div>
</div>
-->
</div>
<script type="text/javascript">
| ise-uiuc/Magicoder-OSS-Instruct-75K |
Resource.created_at >= uaDate,
Resource.last_updated >= uaDate
)
)
# Filter on paid
if isinstance(paid, str) and paid.lower() in ['true', 'false']:
paidAsBool = paid.lower() == 'true'
q = q.filter(Resource.paid == paidAsBool)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
System.out.println("Parameters of string: length: " + str.length() + "; memory: " + size);
System.gc();
memoryBefore = runtime.totalMemory() - runtime.freeMemory();
String str1 = "a";
System.gc();
memoryAfter = runtime.totalMemory() - runtime.freeMemory();
size =... | ise-uiuc/Magicoder-OSS-Instruct-75K |
int main()
{
try {
cout << "test0. Input + output\n";
vector<CFabricVektor*> fabric;
vector<CVektor*> v;
//HERE WERE LEAKAGE
fabric.push_back(new CFabricVektor0);
fabric.push_back(new CFabricVektor1);
CVektor::Input("input.txt", v, fabric);
CVektor::ParallelTest(v);
| ise-uiuc/Magicoder-OSS-Instruct-75K |
tar xvzf Eagle_v2.4.1.tar.gz
docker build -t quay.io/cmarkello/eagle .
#rm -fr Eagle_v2.4.1 Eagle_v2.4.1.tar.gz
| ise-uiuc/Magicoder-OSS-Instruct-75K |
/**
* OAuth constructor.
* @param \Aikidesk\SDK\WWW\Contracts\RequestInterface $request
*/
public function __construct(RequestInterface $request)
{
| ise-uiuc/Magicoder-OSS-Instruct-75K |
name = params.get('name')
title = params.get('title')
| ise-uiuc/Magicoder-OSS-Instruct-75K |
r.save()
class HistoricalScreenshotTest(BaseSiteTest):
"""
Generates historical screenshots of each url
| ise-uiuc/Magicoder-OSS-Instruct-75K |
from app.models import User
| ise-uiuc/Magicoder-OSS-Instruct-75K |
if (AnimNavigationDrawer.class.getSimpleName().equals(name)) {
return new AnimNavigationDrawer(context, attrs);
}
//Not one of ours; let the system handle it
return null;
}
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
"""
Data model module.
In this module the data types used in CGnal framework are defined.
"""
| ise-uiuc/Magicoder-OSS-Instruct-75K |
# testnet
# Url = "https://testnet.binancefuture.com"
| ise-uiuc/Magicoder-OSS-Instruct-75K |
test_dataset = (test_dataset
.cache()
.batch(config.BATCH_SIZE)
.map(lambda x, y: (test_aug(x), y), num_parallel_calls=AUTOTUNE)
.prefetch(AUTOTUNE)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
gzip cat.fasta
rm cat.fasta
echo 'Job is done.'
| ise-uiuc/Magicoder-OSS-Instruct-75K |
*
* Copyright (c) Open Connectivity Foundation and Contributors to AllSeen
* Alliance. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
| ise-uiuc/Magicoder-OSS-Instruct-75K |
var batchSize: Int?
@Option(name: "limit", short: "l")
var limit: Int?
@Option(name: "id")
var id: UUID?
@Option(name: "before")
| ise-uiuc/Magicoder-OSS-Instruct-75K |
}
@Autowired
@Qualifier("articles-entity-manager-factory")
public void setEntities(EntityManager entities) {
this.entities = entities;
}
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
weight?: number;
axlesNum?: number;
extensions?: string;
map?: Map;
panel?: any;
hideMarkers?: boolean;
showTraffic?: boolean;
isOutline?: boolean;
outlineColor?: string;
autoFitView?: boolean;
province?: string;
number?: string;
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
@copyright: (c) 2016 SynergyLabs
@license: UCSD License. See License file for details.
"""
from flask import request, jsonify
| ise-uiuc/Magicoder-OSS-Instruct-75K |
print("FPS :",1/(t2-t1))
key = cv2.waitKey(1)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
ENV = {}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
//untuk update nilai prioritas pada database
for($x=0; $x<$jumlah_nf; $x++){
$this->daftarNonfungsional->d_updatePrioritas($id_nf[$x], $prioritas_nf[$x]);
}
//load view untuk menampilkan hasil prioritas
$nf['nonfungsionals'] = d_getAllDesc();
$this->load->vi... | ise-uiuc/Magicoder-OSS-Instruct-75K |
class Solution:
def hammingDistance(self, x: int, y: int) -> int:
return bin(x ^ y).count('1') | ise-uiuc/Magicoder-OSS-Instruct-75K |
version='1.0',
inputs=inputs,
outputs=outputs,
store_supported=True,
status_supported=True
)
def _handler(self, request, response):
variable = request.inputs['variable'][0].data
output = simple_plot(
resource=request.in... | ise-uiuc/Magicoder-OSS-Instruct-75K |
$context = Timber::context();
$theme = $context['site']->theme;
$output = Timber::compile_string('{{site.theme.path}}', $context);
$this->assertEquals('/wp-content/themes/'.$theme->slug, $output);
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
args.text.split(args.sep), engine=args.engine, corpus=args.corpus
)
result_str = map(lambda x: "%s/%s" % x, result)
print(" ".join(result_str))
class POSTaggingApp(SubAppBase):
def __init__(self, *args, **kwargs):
self.default_engine = "perceptron"
self.defau... | ise-uiuc/Magicoder-OSS-Instruct-75K |
...defaultArgs,
};
Default.parameters = {
jest: ['StyledTextbox.test.js', 'Textbox.test.js'],
| ise-uiuc/Magicoder-OSS-Instruct-75K |
from Parser import *
import random
class MemoryHierarchy(object):
"""docstring for Memory-hierarchy : cache_l1 is the level 1 cache , line is the 16 bit address"""
| ise-uiuc/Magicoder-OSS-Instruct-75K |
}
public static void Init(in Entity entity) {
entity.ValidateData<ME.ECS.Name.Name>();
}
}
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
public get onLevelUp(): ISimpleEvent<AbstractExpLevel> {
return this._onLevelUp.asEvent();
}
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
mColorView.setColor(color);
dialog.dismiss();
| ise-uiuc/Magicoder-OSS-Instruct-75K |
* @since Exchange 2010
*
* @var string
| ise-uiuc/Magicoder-OSS-Instruct-75K |
);
}
}; | ise-uiuc/Magicoder-OSS-Instruct-75K |
./stop-it.sh
nohup python manage.py runserver 0.0.0.0:8000 --insecure &
| ise-uiuc/Magicoder-OSS-Instruct-75K |
type Item = &'a Box<usize>;
fn next(&mut self) -> Option<&Box<usize>> {
self.0.as_ref()
}
}
fn main() { }
| ise-uiuc/Magicoder-OSS-Instruct-75K |
Specifies the behavior of the power supply when the output current is
equal to or greater than the value of the Current Limit attribute.
Values
* 'trip' - The power supply di... | ise-uiuc/Magicoder-OSS-Instruct-75K |
"profileForm": [
{"id": self.questions[0].id, "value": "20"},
{"id": self.questions[2].id, "value": "Some text"},
]
}
response = self.client.post(url, data)
self.assertEqual(status.HTTP_200_OK, response.status_code)
self.assertEqua... | ise-uiuc/Magicoder-OSS-Instruct-75K |
print(r.content) | ise-uiuc/Magicoder-OSS-Instruct-75K |
f[uv] = nval;
select[uv] = i;
} else if nval == f[uv] {
select[uv] = i;
}
}
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
]);
}
public function pictureStore(Request $request)
{
$this->validate($request, [
'foto.*' => 'required|image|mimes:jpeg,png,jpg,gif,svg',
]);
if ($request->hasfile('foto')) {
foreach ($request->file('foto') as $file) {
$name_file = "L... | ise-uiuc/Magicoder-OSS-Instruct-75K |
# flake8: noqa
| ise-uiuc/Magicoder-OSS-Instruct-75K |
print 'easy_install '
print 'pip install '
config['PythonInstaller'] = raw_input('Enter Python Install Command: ')
# config['Salt'] = raw_input('Enter Password Salt: ')
config['Images'] = OrderedDict()
config['Bundles'] = OrderedDict()
config['PythonBundles'] = OrderedDict()
config['Grou... | ise-uiuc/Magicoder-OSS-Instruct-75K |
<div class="col">
<h5 style="font-size: 1em;" class="card-title text-uppercase text-muted mb-0">{{ $box['title'] }}</h5>
<a href="{{ $box['url'] }}">
... | ise-uiuc/Magicoder-OSS-Instruct-75K |
def __init__(self):
self.products = ["Orange Ball", "Chew Toy 1", "Cat Bowl", "Dog Bed", "Cat Food", "Dog Food"]
def seed(self):
for x in range(20):
title = choice(self.products) + " {0}".format(randint(1, 10000))
price = float(format(Decimal(str(random())), '.2f'))
... | ise-uiuc/Magicoder-OSS-Instruct-75K |
if __name__ == "__main__":
# command line entry point
main()
# END #
| ise-uiuc/Magicoder-OSS-Instruct-75K |
`;
| ise-uiuc/Magicoder-OSS-Instruct-75K |
{ name: 'OcurrenceRecord', schema: OcurrenceRecordSchema },
]),
],
providers: [OcurrenceRecordService, OcurrenceRecordResolver],
exports: [OcurrenceRecordService, OcurrenceRecordResolver],
})
export class OcurrenceRecordModule {}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
import os
def main():
img = Image(os.path.join('..', 'img', 'paras_prf_pic.jpeg'))
aray = np.array(img)
r, g, b = np.split(aray, 3, axis = 2)
r = r.reshape(-1)
g = g.reshape(-1)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
static let ticketContractAddressRopsten = AlphaWallet.Address(string: "0xD8e5F58DE3933E1E35f9c65eb72cb188674624F3")!
| ise-uiuc/Magicoder-OSS-Instruct-75K |
from collections import deque
import numpy as np
class ROARManiaPlanner(Module):
| ise-uiuc/Magicoder-OSS-Instruct-75K |
await rm(join(__dirname, '..', 'test.sqlite'));
| ise-uiuc/Magicoder-OSS-Instruct-75K |
@require_superuser
def default(request):
from ..reports import UserListReport
return HttpResponseRedirect(UserListReport.get_url())
| ise-uiuc/Magicoder-OSS-Instruct-75K |
<reponame>hleejr/hofAI
from django.urls import path
from . import views
urlpatterns = [
path('nba/', views.PlayerListView.as_view(), name='nba-list-page'),
path('nba/<int:id>/', views.PlayerDetailView.as_view(), name='nba-detail-page'),
path('nba/search/', views.PlayerSearch.as_view(), name='nba-search-pag... | ise-uiuc/Magicoder-OSS-Instruct-75K |
using System.Linq;
namespace EksSimple
{
sealed class Program
{
public static void Main(string[] args)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
def get_random_clientId():
characters = string.digits
return ''.join(random.choices(characters, k=8))
def get_random_ssid():
characters = string.digits + string.ascii_letters
return ''.join(random.choices(characters, k=15))+'='
| ise-uiuc/Magicoder-OSS-Instruct-75K |
}
impl AuthenticationHandler for SimpleAckAuthenticationHandler {
type Error = std::convert::Infallible;
fn authenticate<'a>(
&'a self,
channel: Box<dyn TunnelStream + Send + Unpin + 'a>,
tunnel_info: TunnelInfo,
shutdown_notifier: &'a CancellationListener,
) -> BoxFuture<'a, Result<TunnelName, ... | ise-uiuc/Magicoder-OSS-Instruct-75K |
client.onError ( on_error )
print ( "Try to lock resource='resid:main'" )
lock = Lock ( "resid:main" )
lock.acquire()
| ise-uiuc/Magicoder-OSS-Instruct-75K |
/// <summary>
/// Returns true if the given integer is a power of two.
/// </summary>
/// <param name="value">The integer value.</param>
/// <returns>True, if the given integer is a power of two.</returns>
[CLSCompliant(false)]
| ise-uiuc/Magicoder-OSS-Instruct-75K |
);
}
);
// todo add react memo where reasonable
export default React.memo(FormFieldText);
| 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.