text
string
size
int64
token_count
int64
import sys print("Hello world, I am",sys.executable, sys.version) x=input("Dame un numero mayor que cero: ") x = int(x) if x < 0: print('Negative changed to zero') x = 0 print(f"El valor final de x es: {x}")
218
85
def convertToHEXForChar(charList): convertedCharList = [] for message in charList: convertedCharList.append(ord(message)) return convertedCharList def displayChar(line, *args): concatedList = [] for argItem in args: concatedList.extend(argItem) print(len(concatedList)) for message in c...
436
146
import os as _os from enum import Enum as _Enum from datetime import datetime as _datetime import time as _time from Acquire.Service import call_function as _call_function from Acquire.Service import Service as _Service from Acquire.ObjectStore import bytes_to_string as _bytes_to_string from Acquire.ObjectStore im...
17,670
4,658
#! /usr/bin/python2.7 # -*- coding: utf-8 -*- """ Created on 2017-4-06 @module: MyMAIL @used: send mail """ import smtplib import mimetypes from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from email.mime.image import MIMEImage from MyLOG import MyLog from bot...
8,007
2,413
import json import traceback from db_adapter.exceptions import DatabaseAdapterError from db_adapter.logger import logger """ Source JSON Object would looks like this e.g.: { 'model' : 'wrfSE', 'version' : 'v3', 'parameters': { } } { 'model' : 'OBS_WATER_LEVEL', ...
7,694
2,111
import unittest from katas.kyu_7.binary_addition import add_binary class AddBinaryTestCase(unittest.TestCase): def test_equals(self): self.assertEqual(add_binary(1, 1), '10') def test_equals_2(self): self.assertEqual(add_binary(0, 1), '1') def test_equals_3(self): self.assertEqu...
511
201
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Netdata(AutotoolsPackage): """Real-time performance monitoring, done right!""" homepa...
739
301
import flask import flask.ext.sqlalchemy import flask.ext.restless # Create the Flask application and the Flask-SQLAlchemy object. app = flask.Flask(__name__) app.config['DEBUG'] = True app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test.db' db = flask.ext.sqlalchemy.SQLAlchemy(app) # Create your Flask-SQLAL...
1,727
555
""" This is a script that takes a calculates the value of a cryptocurrency portfolio It uses JSON in the with quantities of different cryptocurrencies in the form { "ticker" : volume, "ticker" : volume } gets the live price from an API endpoint and returns the price of each item in the portfolio and the total...
4,687
1,450
#np43.py #43. 名詞を含む文節が動詞を含む文節に係るものを抽出 """名詞を含む文節が,動詞を含む文節に係るとき, これらをタブ区切り形式で抽出せよ.ただし,句読点などの記号は出力しないようにせよ. """ import re # 区切り文字 separator = re.compile('\t|,') # かかりうけ kakari = re.compile(r'''(?:\*\s\d+\s) # キャプチャ対象外 (-?\d+) # 数字(係り先) ''', re.VERBOSE) class M...
1,685
865
from presentation.models import Author, Follower, Post, Comment from django.shortcuts import get_object_or_404 from presentation.Serializers.comment_serializer import CommentSerializer from rest_framework import viewsets, status from django.http import JsonResponse from rest_framework.response import Response import uu...
4,026
1,142
# encoding=utf-8 import vim import re import sys import os.path import argparse import shlex from subprocess import Popen, PIPE from itertools import chain from vim_pandoc.utils import plugin_enabled_modules, ensure_string from vim_pandoc.bib.vim_completer import find_bibfiles from vim_pandoc.helpparser import PandocI...
11,520
3,403
# # Copyright (C) 2019 Databricks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
10,955
2,850
import pytest import six from turbodbc import connect from query_fixture import query_fixture from helpers import for_one_database, open_cursor @for_one_database def test_many_batches_with_async_io(dsn, configuration): with open_cursor(configuration, use_async_io=True) as cursor: with query_fixture(curs...
807
225
""" URL's for the LList Game Board app. """ from django.urls import path from llist_gameboard.api import llist_api from . import views urlpatterns = [ # Views path('', views.llist_game_board, name='llist-game-board'), #Game Play API Calls For Linked List path('llist_api', llist_api.api_overview,...
1,491
611
from src import most_invoices EXPECTED_RESULT = (14, 'Berlin') def test_most_invoices() -> None: tested_result = most_invoices.get_city_with_most_invoices() assert tested_result == EXPECTED_RESULT
208
81
import random import numpy as np import operator from scipy import optimize from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg from matplotlib.figure import Figure as MatplotlibFigure from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm as color_map from matplotlib.ticker import Lin...
8,223
2,788
#!/usr/bin/env python # Given weighted graph, perform kruskal-based clustering from common import * from cluster_common import * import argparse import csv import pickle as pickle from collections import defaultdict class unionfind: mp = {} blacklisted_edges = set() # blacklisted_e_nodes = set() # bla...
4,538
2,125
# Copyright 2011 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
4,019
1,394
# -*- coding: utf-8 -*- # Python script to manage automatically generated dependents # Author: Rintze M. Zelle # Version: 2014-04-17 # * Requires lxml library (http://lxml.de/) import os, glob, re, inspect, shutil from lxml import etree # http://stackoverflow.com/questions/50499 folderPath = os.path.dirname(os.path....
5,311
1,618
# ------------------------------------------------------- class: Constants ------------------------------------------------------- # class Constants: # --------------------------------------------------- Public properties -------------------------------------------------- # USER_AGENT_FILE_NAME = 'ua....
642
150
class Game: def __init__(self, *args, **kwargs): self.player_0 = 'white' self.player_1 = 'black' self._new_pieces_game() self.current_player_turn = self.player_0 def _new_pieces_game(self): self.board = { 0: { 0: Piece(self.player_0, "rook", ...
2,893
1,080
from __future__ import annotations import csv import pathlib import textwrap from operator import itemgetter from typing import Any from typing import Callable from typing import Dict from typing import IO from typing import Iterable from typing import Iterator from typing import List from typing import NamedTuple fro...
50,976
15,256
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
8,080
2,509
# theory MPD client # Copyright (C) 2008 Ryan Roemmich <ralfonso@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ve...
3,422
972
"""Test `iotanbo_py_utils.error.py`.""" from iotanbo_py_utils.error import Error from iotanbo_py_utils.error import ErrorKind def test_error_one_of_arithmetic_errors() -> None: errs = ( Error(ErrorKind.ArithmeticError), Error(ErrorKind.FloatingPointError), Error(ErrorKind.OverflowError), ...
5,055
1,559
from setuptools import setup, find_packages from os import path from io import open here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.md'), encoding='utf-8') as f: long_description = f.read() setup( name='orvibo', version='1.5.0...
651
218
import glob, os import subprocess from difflib import context_diff class TestRunner(object): def __init__(self, context): self.context = context self.error_count = 0 self.test_count = 0 self.success_count = 0 def run(self): os.getcwd() os.chdir(self.context.repo...
3,053
864
from amazon.model import db def __search_by_admin_name(username): query={'username': username} matching_user = db['users'].find(query) if matching_user.count() > 0: return matching_user.next() else: return None
245
76
expected = [ { "abstract_type": None, "content": "RET can be activated in cis or trans by its co-receptors and ligands in vitro, but the physiological roles of trans signaling are unclear. Rapidly adapting (RA) mechanoreceptors in dorsal root ganglia (DRGs) express Ret and the co-receptor Gfr\u03b12...
2,429
739
# coding=utf-8 import optparse import torch import time import pickle from torch.autograd import Variable from loader import * from utils import * # python -m visdom.server optparser = optparse.OptionParser() optparser.add_option( "-t", "--test", default="data/eng.testb", help="Test set location" ) optparse...
5,059
1,825
from openbiolink.graph_creation.metadata_db_file.edge.dbMetadataEdge import DbMetadataEdge from openbiolink.graph_creation.types.dbType import DbType class DbMetaEdgeSiderInd(DbMetadataEdge): NAME = 'Edge - Sider - Indications' URL = "http://sideeffects.embl.de/media/download/meddra_all_indications.tsv.gz" ...
789
292
import mahotas as mh import glob import os # rename files from 0 to number of files. files = glob.glob("/path/*") files.sort() if not os.path.isdir("/path/renamed/"): os.mkdir("/path/renamed/") for i in range(len(files)): print("Processing " + files[i]) renamedFile = mh.imread(files[i]) mh.imsave("...
377
144
import os import re from base64 import b64decode from pathlib import Path import requests username = os.environ["GITHUB_USERNAME"] password = os.environ["GITHUB_PERSONAL_ACCESS_TOKEN"] auth = requests.auth.HTTPBasicAuth(username, password) directory = Path(__file__).resolve().parent.parent / "github" directory.mkdir...
1,749
512
import os import sys sys.path.insert(0, os.path.abspath('..')) def get_version(filename): from re import findall with open(filename) as f: metadata = dict(findall(r"__([a-z]+)__ = '([^']+)'", f.read())) return metadata['version'] project = 'carreralib' copyright = '2015-2017 Thomas Kemmer' vers...
579
230
def lcs(x, y): """ Longest Common Subsequence """ n = len(x) + 1 m = len(y) + 1 table = [ [0]*m for i in range(n) ] for i in range(n): for j in range(m): # If either string is empty, then lcs = 0 if i == 0 or j == 0: table[i][j] = 0 elif x[i - 1] == y[j - 1]: table[i][j] = 1 + table[i-1]...
503
276
from models.methods import method from typing import Any class SetDeviceInfoMethod(method.Method): def __init__(self, params: Any): super().__init__("set_device_info", params) def set_request_time_milis(self, t: float): self.requestTimeMils = t def set_terminal_uuid(self, uuid: str): ...
350
112
#!/usr/bin/env python # encoding: utf-8 """ @author: sherlock @contact: sherlockliao01@gmail.com """ import logging import os import sys sys.path.append('.') from fastreid.config import get_cfg from projects.InterpretationReID.interpretationreid.engine import DefaultTrainer, default_argument_parser, default_setup, ...
3,077
1,039
from collections import deque from asynciomeasures.events import Event class Collector(deque): """Caped list of metrics """ def flush(self, rate=None, formatter=None): while True: try: metric = self.popleft() if isinstance(metric, Event): ...
826
178
# Copyright 2021, Peter Birch, mailto:peter@lightlogic.co.uk # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
1,576
447
# Prim's Algorithm in Python INF = 9999999 # number of vertices in graph V = 5 # create a 2d array of size 5x5 # for adjacency matrix to represent graph G = [ [0, 9, 75, 0, 0], [9, 0, 95, 19, 42], [75, 95, 0, 51, 66], [0, 19, 51, 0, 31], [0, 42, 66, 31, 0], ] # create a array to track...
1,463
553
#!/usr/bin/env python '''Tests for the likelihood.py module''' from time import perf_counter_ns import pytest import numpy as np from numpy.testing import assert_array_equal, assert_almost_equal from scipy.stats import gamma import likelihood SMALL_FIT_PARAMS = { 'baseline_intensities': np.asarray([1, 2, np.na...
13,449
5,009
from django.db import models class Url(models.Model): long_url = models.CharField(max_length=200) short_url = models.CharField(max_length=100) visit_time = models.DateTimeField(auto_now_add=True) def __unicode__(self): return self.long_url
266
91
import unittest class Queue: """Simple Queue implementation - First in First Out""" def __init__(self): self.__data = [] def enqueue(self, text): """Add new element to queue Arguments: text {string} -- An element which needs to be added to an end of a queue "...
2,411
724
import logging from iemit_plugin import IEmitter from plugins.emitters.base_http_emitter import BaseHttpEmitter logger = logging.getLogger('crawlutils') class HttpEmitter(BaseHttpEmitter, IEmitter): def get_emitter_protocol(self): return 'http'
262
86
import torch import torch.nn as nn import numpy as np import torch.nn.functional as F import pywt class DWTForward(nn.Module): def __init__(self, wave_name="haar"): super(DWTForward, self).__init__() wavelet = pywt.Wavelet(wave_name) ll = np.outer(wavelet.dec_lo, wavelet.dec_lo) lh...
1,946
730
import sys import numpy as np import json import matplotlib.pyplot as plt from matplotlib.dates import DateFormatter from matplotlib.backends.backend_pdf import PdfPages from datetime import datetime, timedelta import matplotlib.dates as mdates import emoji class FacebookMessengerConversation(): """Module for get...
7,973
2,411
""" Setup file """ import os import sys from setuptools import setup, find_packages HERE = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(HERE, 'README.rst')).read() CHANGES = open(os.path.join(HERE, 'CHANGES.rst')).read() REQUIREMENTS = [ 'pyramid', 'six', ] TEST_REQUIREMENTS = [ ...
1,758
572
import requests, os from dotenv import load_dotenv load_dotenv() API_TOKEN = os.getenv('API_TOKEN') def sendMessage(user_id: str, text: str, max_retries: int = 1): url = f'https://api.telegram.org/bot{API_TOKEN}/sendMessage' payload = { "chat_id": user_id, "text": text } for i in rang...
555
192
from unittest import TestCase from mock import patch, MagicMock from mangrove.datastore.database import DatabaseManager from datawinners.questionnaire.library import QuestionnaireLibrary class TestQuestionnaireTemplate(TestCase): def test_get_category_to_doc_mappings(self): with patch('datawinners.quest...
1,880
572
import chainer from chainer import functions from chainer import links import chainer_chemistry from chainer_chemistry.links.connection.graph_linear import GraphLinear from chainer_chemistry.utils import is_sparse class GGNNUpdate(chainer.Chain): """GGNN submodule for update part. Args: in_channels ...
2,826
906
def func(a, b): return a + b def func2(a): print(a) print("Hello")
78
36
from numpy.testing import assert_array_almost_equal as array_assert from badboids.boids import SimulationParameters def test_simulation_parameters_init(): """Tests Simulation Parameters constructor""" # Arrange formation_flying_distance = 800 formation_flying_strength = 0.10 alert_distance = 8 ...
1,621
511
#-*- coding: utf-8 -*- from django_town.core.settings import OAUTH2_SETTINGS try: if not OAUTH2_SETTINGS.ACCESS_TOKEN_SECRET_KEY: raise ImportError except KeyError: # import traceback # traceback.print_exc() raise ImportError from django.db import models from django.conf import settings from ...
3,247
1,117
# List files in a directory. Useful for testing the path from local_tools import * from image_renamer import ImageRenamer if confirm_config('path'): img_path = get_config('path') fl = ImageRenamer(img_path) for ff in fl.image_files(): print(ff)
265
83
import os def deepmedic_config(config_files_path, niftis_path, test_flair_file_name, test_t1c_file_name, mask, prediction_file_name, output_path): with open(os.path.join(config_files_path, 'model', 'modelConfig.cfg'), 'r') as f: lines = f.readlines() lines[8] = 'folderForOutput = "%s"\n'...
1,394
536
import os from .default import DefaultModelConfig class ModelConfig(DefaultModelConfig): def __init__(self): super().__init__() self.MODEL_NAME = 'AOTT'
174
52
from __future__ import print_function import time import tensorflow as tf from data import DataGenerator def define_net(input_batch): return input_batch + 20 # simplest network I could think of. def main(): batch_size = 1 coord = tf.train.Coordinator() with tf.name_scope('create_inputs'): ...
1,125
354
# Dimmer Switch class class DimmerSwitch(): def __init__(self, label): self.label = label self.isOn = False self.brightness = 0 def turnOn(self): self.isOn = True # turn the light on at self.brightness def turnOff(self): self.isOn = False # ...
1,285
430
#!/usr/bin/env python3 import logging import argparse from pathlib import Path from vosk import list_models, list_languages from vosk.transcriber.transcriber import Transcriber parser = argparse.ArgumentParser( description = 'Transcribe audio file and save result in selected format') parser.add_argument( ...
2,101
632
import numpy as np import cv2 from imutils.object_detection import non_max_suppression import pytesseract from matplotlib import pyplot as plt def ocr(images): results = [] for image in images: args = {"image": image, "east": "frozen_east_text_detection.pb", "min_confidence": 0.5, "width": 320, ...
2,923
1,021
# Generated by Django 2.0 on 2018-01-28 21:44 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('bug', '0002_auto_20180110_1107'), ] operations = [ migrations.AlterField( model_name='bug', name='buglevel', ...
727
291
""" Tests for validators """ from decimal import Decimal from unittest.mock import Mock import random import string from styler_validation import validators as va from styler_validation import messages as msg class MyModel: pass class TestIsRequired: def test_is_required(self): val = va.is_require...
17,439
5,626
from django.core.files.storage import FileSystemStorage from django.db import models # Create your models here. from datetime import date from django.urls import reverse #Used to generate URLs by reversing the URL patterns from django.contrib.auth.models import User #Blog author or commenter def attachment_path(ins...
3,305
1,093
print(list(range(10, 0, -2))) # if start > end and step > 0: # a list generated from start to no more than end with step as constant increment # if start > end and step < 0: # an empty list generated # if start < end and step > 0: # an empty list generated # if start < end and step < 0 # a list generated from start to ...
369
111
""" github : https://github.com/amingolnari/Deep-Learning-Course Author : Amin Golnari Keras Version : 2.2.4 Date : 4/12/2018 Keras CNN Classification on MNIST Data Code 301 """ ## If your GPU is AMD , you can use PlaidML Backend # import os # os.environ["KERAS_BACKEND"] = "plaidml.keras.backend" from keras.models i...
3,141
1,185
start = 104200 end = 702648265 for arm1 in range(start, end + 1): exp = len(str(arm1)) num_sum = 0 c = arm1 while c > 0: num = c % 10 num_sum += num ** exp c //= 10 if arm1 != num_sum: continue else: if arm1 == num_sum: ...
526
214
import requests import json def Neji_version(): # import neji # print(neji.Neji_version()) # output: Hydrogen-0.0.0.1 return "Hydrogen-0.0.0.1" def Neji_upload(put_file_directory_in_string_format): # import neji # print(neji.Neji_upload(r"C:\...\Pictures\trial\black1 - Copy (5).png")) ...
787
359
#!/bin/env python3 """Handling events as tickets The goal here is, provided a maintenance event, create an event if not a duplicate. To determine if not duplicate, use some combination of values to form a key. Methods to delete, update, and otherwise transform the ticket should be available A base class, Ticket, is ...
9,731
2,611
def _do_set(env, name, value): if env.contains(name): env.set(name, value) elif env.parent is not None: _do_set(env.parent, name, value) else: raise Exception( "Attempted to set name '%s' but it does not exist." % name ) def set_(env, symbol_name, va...
554
177
from cicdctl.commands.types.flag import FlagParamType def test_flag(): flag = '-no-color' parsed = FlagParamType().convert(value=flag, param=None, context={}) assert flag == parsed
195
60
class PostgresQueryPart: """ Object representing Postgres query part """ def get_query(self) -> str: """ Get query Returns: str """ pass
194
51
#!/usr/bin/env python # Copyright 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
7,957
2,345
# derwin.py - testing a window within a window import curses def main(stdscr): # Create container window from stdscr sh, sw = stdscr.getmaxyx() container_win = curses.newwin(sh-1, sw-1, 1, 1) # Create inner window from container win bh, bw = container_win.getmaxyx() box_win = container_win.de...
621
240
import sys import logging from unicorn import * from unicorn.arm_const import * from androidemu.emulator import Emulator from UnicornTraceDebugger import udbg logging.basicConfig(stream=sys.stdout, level=logging.DEBUG, format="%(asctime)s %(levelname)7s %(name)34s | %(message)s") logger = logging.getLogger(__n...
1,110
479
#!/usr/bin/python # -*- coding: utf-8 -*- """ This package implements several community detection. Originally based on community aka python-louvain library from Thomas Aynaud (https://github.com/taynaud/python-louvain) """ from .community_ext import ( partition_at_level, modularity, best_partition, ge...
816
305
#!/usr/bin/env python import rospy from std_msgs.msg import String from nav_msgs.msg import Odometry from trajectory_msgs.msg import JointTrajectory from control_msgs.msg import JointTrajectoryControllerState def callback_odom(data): print("odom\n" + str(data)) def callback_JointTrajectory(data): print("gri...
895
323
#Botpic:https://upload.wikimedia.org/wikipedia/commons/thumb/b/b8/Red_Rose_Photography.jpg/800px-Red_Rose_Photography.jpg #Botpic:https://commons.wikimedia.org/wiki/File:Red_Rose_Photography.jpg #reference:https://www.youtube.com/watch?v=SPTfmiYiuok import discord import os import requests import json import math, ra...
75,699
23,773
# Code Taken from https://github.com/LYH-YF/MWPToolkit # -*- encoding: utf-8 -*- # @Author: Yihuai Lan # @Time: 2021/08/29 22:05:03 # @File: transformer_layer.py import torch import math from torch import nn from torch.nn import functional as F from transformers.activations import gelu_new as gelu_bert from module...
9,862
3,196
import math from seal import * from seal_helper import * def example_ckks_basics(): print_example_banner("Example: CKKS Basics") parms = EncryptionParameters(scheme_type.CKKS) poly_modulus_degree = 8192 parms.set_poly_modulus_degree(poly_modulus_degree) parms.set_coeff_modulus(CoeffModulus.Creat...
6,564
2,471
from correlate import * import matplotlib import matplotlib.pyplot as plt import seaborn as sns from matplotlib import rc, rcParams rc('axes', linewidth=1) rc('font', weight='bold', size=10) def barplots(prefixes, regions, stains, corre, error, name, folder, ylim): for stain in stains: barplot(prefixes, r...
2,422
935
""" An example of running autofaiss by pyspark to produce N indices. You need to install pyspark before using the following example. """ from typing import Dict import faiss import numpy as np from autofaiss import build_index # You'd better create a spark session before calling build_index, # otherwise, a spark se...
4,549
1,546
"""Callback module for rbkcli.""" import json from rbkcli.core.handlers.inputs import InputHandler from rbkcli.base.essentials import DotDict, RbkcliException from rbkcli.core.handlers import ApiTargetTools from rbkcli.core.handlers.outputs import OutputHandler class CallBack(ApiTargetTools): """Class ...
4,170
1,291
# Generated by Django 2.2.1 on 2019-05-16 23:28 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] ope...
1,001
303
from rest_framework import serializers, exceptions from greenbudget.lib.rest_framework_utils.serializers import ( EnhancedModelSerializer) from greenbudget.app.account.models import BudgetAccount, TemplateAccount from greenbudget.app.tagging.serializers import ColorField from greenbudget.app.subaccount.models imp...
9,950
2,553
def email_subject(center_name): return f"[Urgent Reminder] Vaccine slot is now available at {center_name}" def email_body(email_data): return f"Hi, \n" \ f"Vaccine slot is available for below centers \n " \ f"Center name and available data \n {email_data} \n" \ f"Please regis...
570
198
# -*- coding: utf-8 -*- """ INTRO @author: Yi Zhang. Created on Tue May 21 11:57:52 2019 Department of Aerodynamics Faculty of Aerospace Engineering TU Delft, Delft, the Netherlands """ import inspect from screws.freeze.main import FrozenOnly from typing import Dict, Union import ...
12,103
3,563
""" Vectors over the symbolic ring. Implements vectors over the symbolic ring. AUTHORS: - Robert Bradshaw (2011-05-25): Added more element-wise simplification methods - Joris Vankerschaver (2011-05-15): Initial version EXAMPLES:: sage: x, y = var('x, y') sage: u = vector([sin(x)^2 + cos(x)^2, log(2*y) + l...
4,098
1,510
from app import db from app.models.serializer import Serializer class Weather(db.Model, Serializer): id = db.Column(db.Integer, primary_key=True) ip = db.Column(db.String(15), index=True, unique=True) country = db.Column(db.String(80)) flag = db.Column(db.String(512)) town = db.Column(db.String(80...
784
283
# -*- coding: utf-8 -*- # # Copyright Contributors to the Conu project. # SPDX-License-Identifier: MIT # # TODO: move this line to some generic constants, instead of same in # docker and nspawn CONU_ARTIFACT_TAG = 'CONU.' CONU_IMAGES_STORE = "/opt/conu-nspawn-images/" CONU_NSPAWN_BASEPACKAGES = [ "dnf", "ipro...
894
356
import itertools from ..quant_utils import QuantizedValue, QuantizedValueType, attribute_to_kwarg, quantize_nparray from .base_operator import QuantOperatorBase class QDQOperatorBase: def __init__(self, onnx_quantizer, onnx_node): self.quantizer = onnx_quantizer self.node = onnx_node self...
805
256
from django.db import models # Create your models here. class Blag(models.Model): name = models.CharField(max_length=128) class BlagEntry(models.Model): blag = models.ForeignKey(Blag) title = models.CharField(max_length=255) body = models.TextField() class Meta: verbose_name_plural = "...
495
166
import bottleneck as bn import numpy as np from scipy import sparse """ All the data should be in the shape of (n_users, n_items) All the latent factors should in the shape of (n_users/n_items, n_components) 1. train_data refers to the data that was used to train the model 2. heldout_data refers to the data that wa...
7,598
2,788
from pgdrive.component.blocks.curve import Curve from pgdrive.component.blocks.first_block import FirstPGBlock from pgdrive.component.blocks.std_t_intersection import StdTInterSection from pgdrive.component.blocks.straight import Straight from pgdrive.component.road.road_network import RoadNetwork from pgdrive.tests.vi...
1,295
420
from selenium import webdriver BASE_URL = 'http://news.163.com/' # 首页ajax内容,无人机ajax,其实后面?callback=data_callback'可以省略 # 如何快速找到json链接?现在只能手工完成..添加每一个json文档 JSON_INDEX_URLS = [ 'http://temp.163.com/special/00804KVA/cm_yaowen.js?callback=data_callback', 'http://house.163.com/special/00078GU7/guangzhou_xw_news_v1.j...
6,241
2,992
#!/usr/bin/env python3 """ Author : Brian Scott <brianscott@email.arizona.edu> Date : 2021-11-09 Purpose: FInd the similarities between sequences. """ import argparse # -------------------------------------------------- def get_args(): """Get command-line arguments""" parser = argparse.ArgumentParser( ...
2,044
597
#!/usr/bin/env python # -*- coding: utf8 -*- # Loading a few python packages import os import glob import warnings from astropy import log from astropy.io import fits as pyfits import json # Loading iraf packages from pyraf import iraf from pyraf.iraf import onedspec from pyraf.iraf import twodspec, apextract class ...
13,999
4,379
from ..models import Job from engine.scripts.mirmachine_args import run_mirmachine from .socket_helper import announce_status_change, announce_queue_position, announce_initiation, announce_completed from .maintainer import clean_up_temporary_files from django.utils import timezone from MirMachineWebapp import user_conf...
1,667
541
""" 33 - Faca um programa que leia um vetor de 15 posicoes e o compacte, ou seja, elimine as posicoes com valor zero. Para isso, todos os elementos a frente do valor zero, devem ser movidos uma posicao para tras no vetor. """ """ vetor = [] count = 0 for x in range(1, 16): vetor.append(int(input(f'Digite o {x}/15...
836
384
import pygame import my_colors as color pygame.init() screen_width = 800 screen_height = 600 screen_size = (screen_width, screen_height) screen = pygame.display.set_mode(screen_size) pygame.display.set_caption("Search the green pixel at the coordinates (x=10, y=100)") running = True while running: screen.set_at((...
533
189