code
stringlengths
10
2.58M
original_code
stringlengths
3
3.18M
original_language
stringclasses
1 value
source
stringclasses
7 values
import numpy as np import cv2 import sys import os import pickle set directory = string ./cds_pics set samples = list for filename in list directory directory begin if ends with filename string .jpg begin print join path directory filename set source_img = join path directory filename set target_img = join path direct...
import numpy as np import cv2 import sys import os import pickle directory = './cds_pics' samples = [] for filename in os.listdir(directory): if filename.endswith(".jpg"): print(os.path.join(directory, filename)) source_img = os.path.join(directory, filename) target_img = os.path.join(di...
Python
zaydzuhri_stack_edu_python
function test_set_defaults_from_file_without_root tmp_path begin set parser = call ArgumentParser nested_mode=WITHOUT_ROOT call add_arguments Foo dest=string foo set save_path = tmp_path / string temp.json save dictionary a=456 b=string BYE BYE path=save_path call set_defaults save_path set args = call parse_args strin...
def test_set_defaults_from_file_without_root(tmp_path: Path): parser = ArgumentParser(nested_mode=NestedMode.WITHOUT_ROOT) parser.add_arguments(Foo, dest="foo") save_path = tmp_path / "temp.json" save(dict(a=456, b="BYE BYE"), path=save_path) parser.set_defaults(save_path) args = parser.parse...
Python
nomic_cornstack_python_v1
import numpy as np import random class GenList extends object begin function __init__ self index begin string Args: index: True or False, indicates presence or absence of index-specific item(s) in the generated list. set index = index end function function gen_length self begin string Generate a length for the generate...
import numpy as np import random class GenList(object): def __init__(self, index): """ Args: index: True or False, indicates presence or absence of index-specific item(s) in the generated list. """ self.index = index def gen_length(self): """ ...
Python
zaydzuhri_stack_edu_python
comment ======================================================================== comment DSICOGS METHODS comment ======================================================================== from __future__ import unicode_literals from pymongo import MongoClient set DO_CLIENT = call MongoClient string localhost:27017 set DI...
# ======================================================================== # DSICOGS METHODS # ======================================================================== from __future__ import unicode_literals from pymongo import MongoClient DO_CLIENT = MongoClient('localhost:27017') DISCOGS = DO_CLIENT['discogs'] ...
Python
zaydzuhri_stack_edu_python
comment coding: utf-8 from django.core.management import BaseCommand from tasks.models import TodoItem class Command extends BaseCommand begin set help = string Read tasks from file (one line = one task) and save them to db function add_arguments self parser begin call add_argument string --file dest=string input_file ...
# coding: utf-8 from django.core.management import BaseCommand from tasks.models import TodoItem class Command(BaseCommand): help = u'Read tasks from file (one line = one task) and save them to db' def add_arguments(self, parser): parser.add_argument('--file', dest='input_file', type=str) def...
Python
zaydzuhri_stack_edu_python
function status self begin return get pulumi self string status end function
def status(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "status")
Python
nomic_cornstack_python_v1
function unet input_shape n_classes begin set input = input input_shape set conv_block1 = call conv 2d 64 tuple 3 3 padding=string same activation=string relu name=string conv1 input set conv_block1 = call conv 2d 64 tuple 3 3 padding=string same activation=string relu name=string conv2 conv_block1 set pool1 = call max...
def unet(input_shape, n_classes): input = Input(input_shape) conv_block1 = Conv2D(64, (3, 3), padding='same', activation='relu', name='conv1')(input) conv_block1 = Conv2D(64, (3, 3), padding='same', activation='relu', name='conv2')(conv_block1) pool1 = MaxPooling2D((2, 2), name='pool1')(conv_block1) ...
Python
nomic_cornstack_python_v1
from engine.Widget import MenuActionHandler , TextBox from engine.Utility import get_path , read_directories , DEFAULT_IMAGE_DIR , DEFAULT_FONT_DIR , import_module from engine.conf import IMG_BACKGROUND , GAME_MENU_ITEMS , DEFAULT_FONT import db string loading products to be render in the menu.store set db_product = pr...
from engine.Widget import MenuActionHandler, TextBox from engine.Utility import get_path, read_directories, DEFAULT_IMAGE_DIR, DEFAULT_FONT_DIR, \ import_module from engine.conf import IMG_BACKGROUND, GAME_MENU_ITEMS, DEFAULT_FONT import db ''' loading products to be render in the menu.store ''' db_product = db.P...
Python
zaydzuhri_stack_edu_python
function __exit__ self type value trace begin for future in _futures begin remove _after_all_futures future end return false end function
def __exit__(self, type, value, trace): for future in self._futures: After._local._after_all_futures.remove(future) return False
Python
nomic_cornstack_python_v1
function server port=8000 begin set cwd = get current directory change directory config at string local at string results at string path import http.server import socketserver set Handler = SimpleHTTPRequestHandler set httpd = call TCPServer tuple string port Handler print string serving at port port call serve_foreve...
def server(port=8000): cwd = os.getcwd() os.chdir(config['local']['results']['path']) import http.server import socketserver Handler = http.server.SimpleHTTPRequestHandler httpd = socketserver.TCPServer(("", port), Handler) print("serving at port", port) httpd.serve_forever() os.chdi...
Python
nomic_cornstack_python_v1
import os from typing import List , Dict set ORIGINAL_DATA_FOLDER = join path string data string original set RAW_DATA_FOLDER = join path string data string raw set SAMPLE_RAW_DATA_FOLDER = join path string data string sample_raw set CLEAN_DATA_FOLDER = join path string data string clean set PEACEFUL_COUNTRIES = list s...
import os from typing import List, Dict ORIGINAL_DATA_FOLDER = os.path.join("data", "original") RAW_DATA_FOLDER = os.path.join("data", "raw") SAMPLE_RAW_DATA_FOLDER = os.path.join("data", "sample_raw") CLEAN_DATA_FOLDER = os.path.join("data", "clean") PEACEFUL_COUNTRIES = ["AU", "CA", "IE", "NZ", "SG", "GB"] NONPEAC...
Python
zaydzuhri_stack_edu_python
function is_autoupdate_enabled self begin return _is_autoupdate_enabled end function
def is_autoupdate_enabled(self): return self._is_autoupdate_enabled
Python
nomic_cornstack_python_v1
comment !/usr/bin/env python comment -*- coding: utf-8 -*- comment @Author : Rock Wayne comment @Created : 2020-06-19 08:00:00 comment @Last Modified : 2020-06-19 08:00:00 comment @Mail : lostlorder@gmail.com comment @Version : alpha-1.0 string # 我们将石头放置在二维平面中的一些整数坐标点上。每个坐标点上最多只能有一块石头。 # # 每次 move 操作都会移除一块所在行或者列上有其他石头存...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Author : Rock Wayne # @Created : 2020-06-19 08:00:00 # @Last Modified : 2020-06-19 08:00:00 # @Mail : lostlorder@gmail.com # @Version : alpha-1.0 """ # 我们将石头放置在二维平面中的一些整数坐标点上。每个坐标点上最多只能有一块石头。 # # 每次 move 操作都会移除一块所在行或者列上有其他石头存在的石头。 # # ...
Python
zaydzuhri_stack_edu_python
function rotatedView img angle enlarge=true extend=extendBorder begin set cx = call dimension 0 / 2.0 set cy = call dimension 1 / 2.0 set toCenter = call AffineTransform2D call translate - cx - cy set rotation = call AffineTransform2D comment Step 1: place origin of rotation at the center of the image call preConcatena...
def rotatedView(img, angle, enlarge=True, extend=Views.extendBorder): cx = img.dimension(0) / 2.0 cy = img.dimension(1) / 2.0 toCenter = AffineTransform2D() toCenter.translate(-cx, -cy) rotation = AffineTransform2D() # Step 1: place origin of rotation at the center of the image rotation.preConcatenate(toC...
Python
nomic_cornstack_python_v1
from letter import * from letter_string import * from alphabet import * from alphabet_union import * import pytest set alpha = call alphabet list string A string B string C set alpha2 = call alphabet list string X string Y string Z set strA = call alpha str=string A set strB = call alpha str=string B set strC = call al...
from letter import * from letter_string import * from alphabet import * from alphabet_union import * import pytest alpha = alphabet(["A", "B", "C"]) alpha2 = alphabet(["X", "Y", "Z"]) strA = alpha(str="A") strB = alpha(str="B") strC = alpha(str="C") str1 = LetterString(letter_cls=alpha, str="ABC") def test_equality(...
Python
zaydzuhri_stack_edu_python
function _cmd_abrt self begin comment abort command, interrupts execution of the main thread. call interrupt_main end function
def _cmd_abrt(self): # abort command, interrupts execution of the main thread. self.interrupt_main()
Python
nomic_cornstack_python_v1
function get_by_username username begin return first filter by query username=username end function
def get_by_username(username): return User.query.filter_by(username=username).first()
Python
nomic_cornstack_python_v1
function remove_port node iface_key begin try begin pop node at string interfaces iface_key end except KeyError begin pass end end function
def remove_port(node, iface_key): try: node[u"interfaces"].pop(iface_key) except KeyError: pass
Python
nomic_cornstack_python_v1
function run_cmd cmd output_mode=string wt **kwargs begin function cmding cmd begin set cmd = list comprehension string c for c in cmd if string < in cmd begin raise call ValueError string Invalid cmd, standard input via "<" not supported yet. end set message = replace replace join string cmd string - string \ - strin...
def run_cmd(cmd, output_mode='wt', **kwargs): def cmding(cmd): cmd = [str(c) for c in cmd] if '<' in cmd: raise ValueError('Invalid cmd, standard input via "<" not supported yet.') message = ' '.join(cmd).replace(' -', ' \\\n -').replace(' >', ' \\\n >') if '>' in ...
Python
nomic_cornstack_python_v1
import requests from bs4 import BeautifulSoup set url = string https://www.qiushibaike.com set header = dict string User-Agent string Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36 for tuple index page in enumerate range 1 5 begin set req = get reques...
import requests from bs4 import BeautifulSoup url = 'https://www.qiushibaike.com' header ={ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36' } for index, page in enumerate(range(1, 5)): req = requests.get(url + '/text/page/{...
Python
zaydzuhri_stack_edu_python
function Leonardo cls addr handler=none baud=9600 initialcmd=HELP begin return call cls addr handler=handler baud=baud waitfirst=0 initialcmd=initialcmd end function
def Leonardo(cls, addr, handler=None, baud=9600, initialcmd=protocol.HELP): return cls(addr, handler=handler, baud=baud, waitfirst=0, initialcmd=initialcmd)
Python
nomic_cornstack_python_v1
import os import praw import re import time from redis_queue import RedisQueue comment Gather Redis credentials set by env file (see docker-compose) set REDIS_HOST = environ at string REDIS_HOST set REDIS_PORT = environ at string REDIS_PORT set REDIS_DB = environ at string REDIS_DB set REDIS_QUEUE_NAME = environ at str...
import os import praw import re import time from redis_queue import RedisQueue # Gather Redis credentials set by env file (see docker-compose) REDIS_HOST = os.environ['REDIS_HOST'] REDIS_PORT = os.environ['REDIS_PORT'] REDIS_DB = os.environ['REDIS_DB'] REDIS_QUEUE_NAME = os.environ['REDIS_QUEUE_NAME'] REDIS_QUEUE_NAME...
Python
zaydzuhri_stack_edu_python
from django.test import TestCase from bagtrekkin.models.luggage import Luggage class LuggageTestCase extends TestCase begin set fixtures = list string passengers string luggages function test_luggage_unicode self begin string Luggage should be printed as expected set luggage = first objects assert equal call unicode lu...
from django.test import TestCase from bagtrekkin.models.luggage import Luggage class LuggageTestCase(TestCase): fixtures = ['passengers', 'luggages'] def test_luggage_unicode(self): '''Luggage should be printed as expected''' luggage = Luggage.objects.first() self.assertEqual(unicode...
Python
zaydzuhri_stack_edu_python
function set_billing_cycle_template self billing_cycle_template begin call single_selection_from_kendo_dropdown billing_cycle_template_kendo_dropdown_locator billing_cycle_template call wait_for_ajax_spinner_load end function
def set_billing_cycle_template(self, billing_cycle_template): self.single_selection_from_kendo_dropdown(self.billing_cycle_template_kendo_dropdown_locator, billing_cycle_template) self.wait_for_ajax_spinner_load()
Python
nomic_cornstack_python_v1
function _serialize_context_list self begin set context = list for each_item in _model begin append context each_item for each_tree_path in call _walk_tree _model at each_item begin set path = list each_item + list each_tree_path append context join string . path end end return context end function
def _serialize_context_list(self): context = [] for each_item in self._model: context.append(each_item) for each_tree_path in self._walk_tree(self._model[each_item]): path = [each_item] + [each_tree_path] context.append(".".join(path)) retu...
Python
nomic_cornstack_python_v1
from collections import deque comment File parsing # function parse_file file_name begin with open file_name as f begin set data = split read f string end set data at 1 = data at 1 at slice : - 1 : return list comprehension deque list comprehension integer x for x in split d string at slice 1 : : for d in data end f...
from collections import deque # File parsing # def parse_file(file_name): with open(file_name) as f: data = f.read().split('\n\n') data[1] = data[1][:-1] return [deque([int(x) for x in d.split('\n')[1:]]) for d in data] # Standard Combat (AKA War) # game_number = 0 round_numbers = [0] def ...
Python
zaydzuhri_stack_edu_python
import re import numpy as np from keras.models import Sequential from keras.layers import Dense , Activation set paper1 = string In President Donald Trump's world view, currency manipulation is bad, except when he's the one calling the shots. Usurping the Treasury Department's imminent report on global foreign exchange...
import re import numpy as np from keras.models import Sequential from keras.layers import Dense, Activation paper1 = ''' In President Donald Trump's world view, currency manipulation is bad, except when he's the one calling the shots. Usurping the Treasury Department's imminent report on global foreign exchange poli...
Python
zaydzuhri_stack_edu_python
from config import TELEMETRY , TIMESTAMPS , TRAJECTORY , OUTPUT function fileToArray file divider begin string Преобразует содержимое файла в массив set tempArr = list for line in file begin set point = list for prop in split line at slice : - 1 : divider begin append point prop end append tempArr point end return ...
from config import TELEMETRY, TIMESTAMPS, TRAJECTORY, OUTPUT def fileToArray(file: str, divider: str): """ Преобразует содержимое файла в массив """ tempArr = [] for line in file: point = [] for prop in line[:-1].split(divider): point.append(prop) tempArr.append(...
Python
zaydzuhri_stack_edu_python
from collections import Counter function most_frequent sentence begin set words = split sentence set counter = counter words return call most_common 1 at 0 at 0 end function set sentence = string this is a sentence with several words in it print call most_frequent sentence
from collections import Counter def most_frequent(sentence): words = sentence.split() counter = Counter(words) return counter.most_common(1)[0][0] sentence = "this is a sentence with several words in it" print(most_frequent(sentence))
Python
flytech_python_25k
comment -*- coding:utf-8 -*- import url_manager import html_downloader import html_parser import html_outputer class SpiderMain extends object begin function __init__ self begin set urls = call UrlManeger set downloader = call HtmlDownloader set parser = call HtmlParser set outputer = call HtmlOutputer end function fun...
# -*- coding:utf-8 -*- import url_manager import html_downloader import html_parser import html_outputer class SpiderMain(object): def __init__(self): self.urls = url_manager.UrlManeger() self.downloader = html_downloader.HtmlDownloader() self.parser = html_parser.HtmlParser() self.outputer = html_...
Python
zaydzuhri_stack_edu_python
import ssl import socket import datetime function validate_certificate domain_name begin comment Connect to the website using SSL/TLS protocol set context = call create_default_context with call create_connection tuple domain_name 443 as sock begin with call wrap_socket sock server_hostname=domain_name as sslsock begin...
import ssl import socket import datetime def validate_certificate(domain_name): # Connect to the website using SSL/TLS protocol context = ssl.create_default_context() with socket.create_connection((domain_name, 443)) as sock: with context.wrap_socket(sock, server_hostname=domain_name) as ...
Python
jtatman_500k
class Solution extends object begin function reconstructQueue self people begin string :type people: List[List[int]] :rtype: List[List[int]] if people == list begin return list end set d = dict for person in people begin if person at 0 in d begin append d at person at 0 person at 1 end else begin set d at person at ...
class Solution(object): def reconstructQueue(self, people): """ :type people: List[List[int]] :rtype: List[List[int]] """ if people == []: return [] d = {} for person in people: if person[0] in d: d[person[0]].append(per...
Python
zaydzuhri_stack_edu_python
function crosstrack_error p A B radius=6371000 begin set dAp = call distance_haversine A p radius=1 set brngAp = call bearing A p set brngAB = call bearing A B set dXt = call asin sin dAp * sin brngAp - brngAB return call fabs dXt * radius end function
def crosstrack_error(p,A,B, radius=6371000): dAp = distance_haversine(A, p, radius=1) brngAp = bearing(A,p) brngAB = bearing(A,B) dXt = asin(sin(dAp)*sin(brngAp-brngAB)) return fabs(dXt) * radius
Python
nomic_cornstack_python_v1
function __init__ self width height x=0 y=0 id=none begin call __init__ id set width = width set height = height set x = x set y = y end function
def __init__(self, width, height, x=0, y=0, id=None): super().__init__(id) self.width = width self.height = height self.x = x self.y = y
Python
nomic_cornstack_python_v1
function _apply_D_loss scores_fake scores_real loss_func begin set loss = 0 set real_loss = 0 set fake_loss = 0 if is instance scores_fake list begin for tuple score_fake score_real in zip scores_fake scores_real begin set tuple total_loss real_loss fake_loss = call loss_func score_fake=score_fake score_real=score_real...
def _apply_D_loss(scores_fake, scores_real, loss_func): loss = 0 real_loss = 0 fake_loss = 0 if isinstance(scores_fake, list): for score_fake, score_real in zip(scores_fake, scores_real): total_loss, real_loss, fake_loss = loss_func(score_fake=score_fake, score_real=score_real) ...
Python
nomic_cornstack_python_v1
function acquire self begin return call PortReaderBufferBase_acquire self end function
def acquire(self): return _yarp.PortReaderBufferBase_acquire(self)
Python
nomic_cornstack_python_v1
function get self id begin comment logic to assign a lat long already present in the database for demo purpose hardcoded try begin set value = call find_one dict string _id integer id set active_ticket = sort find ticket_collection dict string user_id integer id list tuple string currentDate - 1 if is instance active_t...
def get(self,id): #logic to assign a lat long already present in the database for demo purpose hardcoded try: value = collection.find_one({'_id':int(id)}) active_ticket = ticket_collection.find({'user_id':int(id)}).sort([('currentDate',-1)]) if isinstance(ac...
Python
nomic_cornstack_python_v1
function six_hundred_cell self begin set verts = list set q12 = call QQ 1 / 2 set base = list q12 q12 q12 q12 for i in range 2 begin for j in range 2 begin for k in range 2 begin for l in range 2 begin append verts list comprehension x for x in base set base at 3 = base at 3 * - 1 end set base at 2 = base at 2 * - 1 e...
def six_hundred_cell(self): verts = [] q12 = QQ(1)/2 base = [q12,q12,q12,q12] for i in range(2): for j in range(2): for k in range(2): for l in range(2): verts.append([x for x in base]) base[3...
Python
nomic_cornstack_python_v1
import csv comment headers = ['Transaction ID', 'Account Number', 'Account Name', 'Banke Name', 'Trans DateTime', 'Description', 'Amount','Type','Channel' ] with open string CHI2011.csv string r as infile ; open string CHI2011_coords.csv string w newline=string as outfile begin set reader = reader infile set writer = w...
import csv #headers = ['Transaction ID', 'Account Number', 'Account Name', 'Banke Name', 'Trans DateTime', 'Description', 'Amount','Type','Channel' ] with open("CHI2011.csv","r") as infile,open("CHI2011_coords.csv","w", newline='') as outfile: reader = csv.reader(infile) writer = csv.writer(outfile) for r...
Python
zaydzuhri_stack_edu_python
function EOF_or_raise f begin try begin next end except StopIteration begin return end try else begin raise exception string f end end function
def EOF_or_raise(f): try: f.next() except StopIteration: return else: raise Exception(str(f))
Python
nomic_cornstack_python_v1
import unittest from stock_profit import Stock_Profit from room_reserve_api import Room_Reserve_API from kth_highest_stock_price import kth_Highest_Stock_Price set test_cases = list list 1 2 3 4 5 6 7 8 9 10 list 10 9 8 7 6 5 4 3 2 1 list 3 3 99 100 3985 83 9 0 39 10 5 list 3 2 4 5 20 0 1000 10001 4 5 399 list 1 2 3 5 ...
import unittest from stock_profit import Stock_Profit from room_reserve_api import Room_Reserve_API from kth_highest_stock_price import kth_Highest_Stock_Price test_cases = [[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [10, 9, 8, 7, 6, 5, 4, 3, 2, 1], [3, 3, 99, 100, 3985, 83, 9, 0, 39, 10, 5], ...
Python
zaydzuhri_stack_edu_python
function catalogMain begin if string username in session begin set user = session at string username end else begin set user = none end set categories = all set items = call limit 10 return call render_template string catalog.html items=items categories=categories user=user end function
def catalogMain(): if 'username' in session: user = session['username'] else: user = None categories = cursor.query(Category).all() items = cursor.query(Item).order_by(Item.id.desc()).join(Category, Item.category_id == Category.id).add_columns(Item.id, Item.name, ...
Python
nomic_cornstack_python_v1
function action self begin comment Get the actions as SMILES set actions = call get_possible_actions comment Invoke the action network, which gives the "q" for each action set actions_features = call get_features actions set actions_features = call convert_to_tensor actions_features set action_scores = predict action_n...
def action(self) -> Tuple[Any, float, bool]: # Get the actions as SMILES actions = self.env.action_space.get_possible_actions() # Invoke the action network, which gives the "q" for each action actions_features = self.preprocessor.get_features(actions) actions_features = tf.conve...
Python
nomic_cornstack_python_v1
function get_filetype fpath begin return call from_file fpath mime=true end function
def get_filetype(fpath): return magic.from_file(fpath, mime=True)
Python
nomic_cornstack_python_v1
function fixed ds param begin return lambda x -> param end function function variable ds param begin return lambda x -> x at param at 0 end function set functions = list set literal string set literal string dict string fixed fixed ; string variable variable comment distances comment kernels comment windows if __name...
def fixed(ds, param): return lambda x: param def variable(ds, param): return lambda x: x[param][0] functions = [ # distances { '' }, # kernels { '' }, # windows { 'fixed': fixed, 'variable': variable } ] if __name__ == '__main__': n, m = map(int, input().split()) ds = [None for _ in range(n)] ...
Python
zaydzuhri_stack_edu_python
function addRect pic startX startY width height color=call Color 0 0 0 begin set leftX = max 0 startX set rightX = min call getWidth startX + width set topY = max 0 startY set bottomY = min call getHeight startY + height comment draw top and bottom lines for x in range leftX rightX + 1 begin set px1 = call getPixel pic...
def addRect(pic, startX, startY, width, height, color = Color(0, 0, 0)): leftX = max(0, startX) rightX = min(pic.getWidth(), startX + width) topY = max(0, startY) bottomY = min(pic.getHeight(), startY + height) # draw top and bottom lines for x in range(leftX, rightX + 1): px1 = getPixel(pic, x,...
Python
nomic_cornstack_python_v1
comment coding:utf-8 comment 做成一个继承的类,只是增加_get_new_urls()和_get_new_datas() from __future__ import print_function from html_parser import HtmlParser from bs4 import BeautifulSoup import datetime import mytools import re import traceback class AjkParser extends HtmlParser begin function _get_new_urls self soup begin set ...
#coding:utf-8 #做成一个继承的类,只是增加_get_new_urls()和_get_new_datas() from __future__ import print_function from html_parser import HtmlParser from bs4 import BeautifulSoup import datetime import mytools import re import traceback class AjkParser(HtmlParser): def _get_new_urls(self , soup): new_urls = set() ...
Python
zaydzuhri_stack_edu_python
comment lesson 1 task 7 comment tables set tuple x y z = tuple integer input integer input integer input print x // 2 + y // 2 + z // 2 + x % 2 + y % 2 + z % 2
# # lesson 1 task 7 # tables # x, y, z = int(input()), int(input()), int(input()) print(x//2+y//2+z//2+x%2+y%2+z%2)
Python
zaydzuhri_stack_edu_python
comment encoding: utf-8 string https://www.kaggle.com/gaussmake1994/word-character-n-grams-tfidf-regressions-lb-051 from __future__ import print_function import pandas as pd import numpy as np from nltk.tokenize import wordpunct_tokenize from nltk.stem.snowball import EnglishStemmer from sklearn.linear_model import Log...
# encoding: utf-8 """ https://www.kaggle.com/gaussmake1994/word-character-n-grams-tfidf-regressions-lb-051 """ from __future__ import print_function import pandas as pd import numpy as np from nltk.tokenize import wordpunct_tokenize from nltk.stem.snowball import EnglishStemmer from sklearn.linear_model import Logist...
Python
zaydzuhri_stack_edu_python
comment -*- coding: utf-8 -*- string Created on Sat May 6 16:13:31 2017 @author: hongming from flask import Flask comment virtualenv 的安装 comment sudo apt-get install python-virtualenv comment 激活 string 1. 建立文件夹 mkdir project_name 2. 进入相应的文件夹 cd project_name 3. 激活 . enve/bin/activate 4.然后可以在该系统安装所需第三方库 set app = call Fl...
# -*- coding: utf-8 -*- """ Created on Sat May 6 16:13:31 2017 @author: hongming """ from flask import Flask # virtualenv 的安装 # sudo apt-get install python-virtualenv # 激活 ''' 1. 建立文件夹 mkdir project_name 2. 进入相应的文件夹 cd project_name 3. 激活 . enve/bin/activate 4.然后可以在该系统安装所需第三方库 ''' app = Flask(__name__) @ap...
Python
zaydzuhri_stack_edu_python
function bind self begin return call _bind source sourceField end function
def bind( self ): return self._bind( self.source, self.sourceField )
Python
nomic_cornstack_python_v1
import random import numpy as np function sigmod z begin return 1.0 / 1.0 + exp - z end function class IrisClassification begin function __init__ self file_path=string ./iris.data cell_num=list 4 10 3 percent=0.8 begin comment cell_num的默认参数表示输入层有4个节点,隐层有10个节点,输出层有3个节点 set cell_num = cell_num at slice : : set data_se...
import random import numpy as np def sigmod(z): return 1.0 / (1.0 + np.exp(-z)) class IrisClassification: def __init__(self, file_path='./iris.data', cell_num=[4, 10, 3], percent=0.8): self.cell_num = cell_num[:] # cell_num的默认参数表示输入层有4个节点,隐层有10个节点,输出层有3个节点 self.data_set = [] file = ope...
Python
zaydzuhri_stack_edu_python
import time from waapi import EventHandler , connect from formula_data import formula_data as fdata from formula_config import formula_properties_dict as fpdict from formula_config import formula_expression as my_expression class formula_client extends object begin function __init__ self url=none begin set url = url se...
import time from waapi import EventHandler, connect from formula_data import formula_data as fdata from formula_config import formula_properties_dict as fpdict from formula_config import formula_expression as my_expression class formula_client(object): def __init__(self, url=None): self.url = url ...
Python
zaydzuhri_stack_edu_python
function C2Q self C begin return call euler2Q call C2euler C end function
def C2Q(self, C): return self.euler2Q(self.C2euler(C))
Python
nomic_cornstack_python_v1
from socket import * import json set num = 0 comment 创建socket while true begin set tcp_client_socket = call socket AF_INET SOCK_STREAM comment 目的信息 set server_ip = input string 请输入服务器ip: set server_port = integer input string 请输入服务器port: comment 链接服务器 call connect tuple server_ip server_port comment 提示用户输入数据 while true...
from socket import * import json num = 0 # 创建socket while True: tcp_client_socket = socket(AF_INET, SOCK_STREAM) # 目的信息 server_ip = input("请输入服务器ip:") server_port = int(input("请输入服务器port:")) # 链接服务器 tcp_client_socket.connect((server_ip, server_port)) # 提示用户输入数据 while True: ...
Python
zaydzuhri_stack_edu_python
function GetLineWidth self begin set callResult = call _Call string GetLineWidth if callResult is none begin return none end return callResult end function
def GetLineWidth(self): callResult = self._Call("GetLineWidth", ) if callResult is None: return None return callResult
Python
nomic_cornstack_python_v1
import numpy call set_printoptions legacy=string 1.13 set inp = input set inp = split inp string for x in range length inp begin set inp at x = integer inp at x end print call eye inp at 0 inp at 1
import numpy numpy.set_printoptions(legacy='1.13') inp = input() inp = inp.split(" ") for x in range(len(inp)): inp[x] = int(inp[x]) print(numpy.eye(inp[0],inp[1]))
Python
zaydzuhri_stack_edu_python
comment !/usr/bin/py function changes s begin set d = 0 for i in range length s // 2 begin set d = d + absolute ordinal s at i - ordinal s at - i - 1 end return d end function set c = integer call raw_input set lst = list for i in range c begin append lst call changes call raw_input end for i in lst begin print i end
#!/usr/bin/py def changes(s): d = 0 for i in range(len(s) // 2): d += abs(ord(s[i]) - ord(s[-i-1])) return d c = int(raw_input()) lst = [] for i in range(c): lst.append(changes(raw_input())) for i in lst: print(i)
Python
zaydzuhri_stack_edu_python
function addShipPositionsToSumGrid shipgrid sumgrid rows cols begin for i in range rows begin for j in range cols begin if shipgrid at i at j != 0 begin set sumgrid at i at j = sumgrid at i at j + 1 end end end end function
def addShipPositionsToSumGrid(shipgrid, sumgrid, rows, cols): for i in range(rows): for j in range(cols): if shipgrid[i][j] != 0: sumgrid[i][j] += 1
Python
nomic_cornstack_python_v1
function test_get_iam_private_key_spec_list self begin pass end function
def test_get_iam_private_key_spec_list(self): pass
Python
nomic_cornstack_python_v1
function __len__ self begin return length heap end function
def __len__(self): return len(self.heap)
Python
nomic_cornstack_python_v1
function maximum_swap2 self num begin set A = list comprehension integer d for d in string num comment d = {key: value for (value, key) in enumerate} set last = dictionary comprehension x : i for tuple i x in enumerate A print last comment print(last) comment print(enumerate(A)) for i in range length A begin for j in r...
def maximum_swap2(self, num): A = [int(d) for d in str(num)] last = {x: i for i, x in enumerate(A)} # d = {key: value for (value, key) in enumerate} print(last) #print(last) #print(enumerate(A)) for i in range(len(A)): for j in range(9, A[i], -1): ...
Python
nomic_cornstack_python_v1
function find_factors self interleaving=string none begin set factor_class = dict string none Factor ; string monotone FactorWithMonotoneInterleaving ; string any FactorWithInterleaving if interleaving in factor_class begin set factor = call self end else begin raise call InvalidOperationError string interleaving optio...
def find_factors(self, interleaving: str = "none") -> Tuple["Tiling", ...]: factor_class = { "none": Factor, "monotone": FactorWithMonotoneInterleaving, "any": FactorWithInterleaving, } if interleaving in factor_class: factor = factor_class[interle...
Python
nomic_cornstack_python_v1
function _prepare_linux_credentials self username password storage_service key_pair_service storage_client group_name storage_name begin set ssh_key = none if not username begin set username = DEFAULT_LINUX_USERNAME end if not password begin set ssh_key = call _get_ssh_key username=username storage_service=storage_serv...
def _prepare_linux_credentials(self, username, password, storage_service, key_pair_service, storage_client, group_name, storage_name): ssh_key = None if not username: username = self.DEFAULT_LINUX_USERNAME if not password: ssh_key = sel...
Python
nomic_cornstack_python_v1
function translate_collection self collection begin set all_phrase_uris = list comprehension taIdentRef for phrase in call _enumerate_phrases collection if taIdentRef set convertible_uris = set comprehension uri for uri in all_phrase_uris if call is_convertible uri set batches = call _batchify convertible_uris batch_si...
def translate_collection(self, collection): all_phrase_uris = [phrase.taIdentRef for phrase in self._enumerate_phrases(collection) if phrase.taIdentRef] convertible_uris = {uri for uri in all_phrase_uris if self.uri_converter.is_convertible(uri)} batches = self._batchify(convertible_uris, self....
Python
nomic_cornstack_python_v1
comment -*- coding: utf-8 -*- string Common graphs All graphs in Sage can be built through the ``graphs`` object : in order to build a complete graph on `15` elements, one can do:: sage: g = graphs.CompleteGraph(15) More interestingly, one can get the list of all graphs that Sage knows how to buid by typing ``graphs.``...
# -*- coding: utf-8 -*- r""" Common graphs All graphs in Sage can be built through the ``graphs`` object : in order to build a complete graph on `15` elements, one can do:: sage: g = graphs.CompleteGraph(15) More interestingly, one can get the list of all graphs that Sage knows how to buid by typing ``graphs.`` ...
Python
zaydzuhri_stack_edu_python
function ReadSerialByte ser Log begin set toBeRead = call inWaiting if toBeRead > 0 begin set data = read ser 1 log string Read data: + data + string , + call hexlify data return data end else begin comment Log.Log("No Data To Be Read") return string end end function
def ReadSerialByte(ser, Log): toBeRead = ser.inWaiting() if toBeRead > 0: data = ser.read(1) Log.Log("Read data: " + data + ", " + binascii.hexlify(data)) return data else: #Log.Log("No Data To Be Read") return ""
Python
nomic_cornstack_python_v1
import numpy as np function apk actual predicted k=10 begin string Computes the average precision at k. This function computes the average prescision at k between two lists of items. Parameters ---------- actual : list A list of elements that are to be predicted (order doesn't matter) predicted : list A list of predict...
import numpy as np def apk(actual, predicted, k=10): """ Computes the average precision at k. This function computes the average prescision at k between two lists of items. Parameters ---------- actual : list A list of elements that are to be predicted (order doesn't matter) ...
Python
zaydzuhri_stack_edu_python
function getElementBySId self *args begin return call KineticLaw_getElementBySId self *args end function
def getElementBySId(self, *args): return _libsbml.KineticLaw_getElementBySId(self, *args)
Python
nomic_cornstack_python_v1
import socket from scapy.all import ARP , Ether , srp function scan devices=list begin string returns devices = [{IP:XXX.XXX.XXX, MAC:ff:ff:ff:ff:ff:ff},....] This function will scan all devices on the local network, and send an ARP request. The devices will respond, and during their response the function will sniff th...
import socket from scapy.all import ARP, Ether, srp def scan(devices=[]): """returns devices = [{IP:XXX.XXX.XXX, MAC:ff:ff:ff:ff:ff:ff},....] This function will scan all devices on the local network, and send an ARP request. The devices will respond, and during their response the function will snif...
Python
zaydzuhri_stack_edu_python
import logging import string from rrg.models_api import employees , employees_active , employees_inactive from rrg.models import employees_active from rrg.models import employees_inactive call basicConfig filename=string testing.log level=DEBUG set logger = call getLogger string test call setLevel INFO function selecti...
import logging import string from rrg.models_api import employees, employees_active, employees_inactive from rrg.models import employees_active from rrg.models import employees_inactive logging.basicConfig(filename='testing.log', level=logging.DEBUG) logger = logging.getLogger('test') logging.getLogger('sqlalchemy....
Python
zaydzuhri_stack_edu_python
function has_foreground_thread begin return _fg_thread is not none end function
def has_foreground_thread() -> bool: return _fg_thread is not None
Python
nomic_cornstack_python_v1
function fish_sludge_management CH4_volume_sludge_and_manure share_fish_sludge_in_substrate CH4_LHV ratio_CO2_CH4_biogas_sludge N_in_sludge_dw P_in_sludge_dw N_manure P_manure fertilizer_substi_digest_N fertilizer_substi_digest_P fertilizer_substi_manure_field_N fertilizer_substi_manure_field_P begin set list MJ_substi...
def fish_sludge_management(CH4_volume_sludge_and_manure, share_fish_sludge_in_substrate, CH4_LHV, ratio_CO2_CH4_biogas_sludge, N_in_sludge_dw, P_in_sludge_dw, ...
Python
nomic_cornstack_python_v1
import math class Human extends object begin comment parameter function __init__ self name=none age=none weight=none height=none begin comment property set name = name comment property set age = age comment property set weight = weight comment property set height = height comment property set bmi = none end function co...
import math class Human(object): def __init__(self, name=None, age=None, weight=None, height=None): # parameter self.name = name # property self.age = age # property self.weight = weight # property self.height = height # property self.bmi = None # property # meth...
Python
zaydzuhri_stack_edu_python
function main begin comment Read the different configuration variables set config = config parser read config string dwh.cfg comment Connect to the Data Warehouse (DW) from the values stored in config variable set conn = call connect format string host={} dbname={} user={} password={} port={} *config['CLUSTER'].values(...
def main(): #Read the different configuration variables config = configparser.ConfigParser() config.read('dwh.cfg') #Connect to the Data Warehouse (DW) from the values stored in config variable conn = psycopg2.connect("host={} dbname={} user={} password={} port={}".format(*config['CLUSTER'...
Python
nomic_cornstack_python_v1
function rs_disaggregate regions base_yr curr_yr rs_national_fuel scenario_data assumptions reg_coord weather_stations temp_data enduses crit_limited_disagg_pop_hdd crit_limited_disagg_pop crit_full_disagg begin debug string ... disagreggate residential demand set rs_fuel_disagg = default dictionary dict comment ------...
def rs_disaggregate( regions, base_yr, curr_yr, rs_national_fuel, scenario_data, assumptions, reg_coord, weather_stations, temp_data, enduses, crit_limited_disagg_pop_hdd, crit_limited_disagg_pop, crit_full_disagg ...
Python
nomic_cornstack_python_v1
function set_simRunner self obj_simRunner begin if type obj_simRunner == AnimatLabSimulationRunner begin set simRunner = obj_simRunner end else begin raise call TypeError string obj_simRunner must be an AnimatLabSimulationRunner object! end end function
def set_simRunner(self, obj_simRunner): if type(obj_simRunner) == AnimatLabSimulationRunner: self.simRunner = obj_simRunner else: raise TypeError("obj_simRunner must be an AnimatLabSimulationRunner object!")
Python
nomic_cornstack_python_v1
function get_layer_vis_square data allow_heatmap=true normalize=true min_img_dim=100 max_width=1200 channel_order=string RGB colormap=string jet begin string Returns a vis_square for the given layer data Arguments: data -- a np.ndarray Keyword arguments: allow_heatmap -- if True, convert single channel images to heatma...
def get_layer_vis_square(data, allow_heatmap=True, normalize=True, min_img_dim=100, max_width=1200, channel_order='RGB', colormap='jet', ): "...
Python
jtatman_500k
function format_and_validate_phonenumber number begin if starts with number string + begin set number = replace number string + string 00 1 end set regex = compile string (\/|\+|-| ) set number = sub string number if starts with number COUNTRY_CODE_PHONE begin set number = replace number COUNTRY_CODE_PHONE string 0 1 ...
def format_and_validate_phonenumber(number): if number.startswith('+'): number = number.replace('+', '00', 1) regex = re.compile('(\/|\+|-| )') number = regex.sub('', number) if number.startswith(COUNTRY_CODE_PHONE): number = number.replace(COUNTRY_CODE_PHONE, '0', 1) ...
Python
nomic_cornstack_python_v1
function nextSF2 begin print string nextSF2 end function
def nextSF2(): print("nextSF2")
Python
nomic_cornstack_python_v1
function reverseList l begin set revList = list for i in range length l - 1 - 1 - 1 begin append revList l at i end return revList end function set lst = list 1 2 3 4 5 print call reverseList lst
def reverseList(l): revList = [] for i in range(len(l)-1,-1,-1): revList.append(l[i]) return revList lst = [1, 2, 3, 4, 5] print(reverseList(lst))
Python
iamtarun_python_18k_alpaca
function update self data begin string Update the chain object with the predefined data. if data is none begin for device in devices begin call clear_info end end else begin for tuple device device_info in zip devices data begin set device_info = device_info log format string Device information updated -> [{}] device e...
def update(self, data): """Update the chain object with the predefined data.""" if data is None: for device in self.devices: device.clear_info() else: for device, device_info in zip(self.devices, data): device.device_info = device_info ...
Python
jtatman_500k
function zeefVanEratosthenesMPI n begin set startTime = time set comm = COMM_WORLD set rank = call Get_rank set size = call Get_size set localPrimes = call functionality n rank size set totalPrimes = reduce localPrimes op=SUM root=0 if rank == 0 begin print string Number of primes: totalPrimes print string Total time: ...
def zeefVanEratosthenesMPI(n): startTime = time.time() comm = MPI.COMM_WORLD rank = comm.Get_rank() size = comm.Get_size() localPrimes = functionality(n, rank, size) totalPrimes = comm.reduce(localPrimes, op=MPI.SUM, root=0) if rank == 0: print("Number of primes:", totalPrimes) ...
Python
nomic_cornstack_python_v1
function compute_one_vs_rest_confusion_matrix labels outputs begin assert call shape labels == call shape outputs assert all generator expression value in tuple 0 1 true false for value in unique labels assert all generator expression value in tuple 0 1 true false for value in unique outputs set tuple num_patients num_...
def compute_one_vs_rest_confusion_matrix( labels: np.ndarray, outputs: np.ndarray ) -> np.ndarray: assert np.shape(labels) == np.shape(outputs) assert all(value in (0, 1, True, False) for value in np.unique(labels)) assert all(value in (0, 1, True, False) for value in np.unique(outputs)) num_patien...
Python
nomic_cornstack_python_v1
set name = string George print string My name is + name
name = "George" print("My name is " + name)
Python
zaydzuhri_stack_edu_python
comment !/usr/bin/env python comment Author: Geoffrey Golliher (brokenway@gmail.com) import string class HashBuilder extends object begin function __init__ self key_space begin set alphabet = lowercase + uppercase + string 1234567890 set key_space = key_space set mapping = range key_space end function function build_ha...
#!/usr/bin/env python # Author: Geoffrey Golliher (brokenway@gmail.com) import string class HashBuilder(object): def __init__(self, key_space): self.alphabet = string.lowercase + string.uppercase + '1234567890' self.key_space = key_space self.mapping = range(self.key_space) def build...
Python
zaydzuhri_stack_edu_python
function get_y_intercept x_dist y_dist r begin set ybar = call get_mean y_dist set xbar = call get_mean x_dist set sy = call bessel_correction y_dist at string Sample SD set sx = call bessel_correction x_dist at string Sample SD set m = call get_slope r sy sx return ybar - m * xbar end function
def get_y_intercept(x_dist, y_dist, r): ybar = get_mean(y_dist) xbar = get_mean(x_dist) sy = bessel_correction(y_dist)['Sample SD'] sx = bessel_correction(x_dist)['Sample SD'] m = get_slope(r, sy, sx) return ybar - m * xbar
Python
nomic_cornstack_python_v1
for linia in plik begin set linia = strip linia set linia = split linia set x = linia at 0 set y = linia at 1 if ends with x string A begin set w = w + 1 end if ends with y string A begin set w = w + 1 end end print w
for linia in plik: linia=linia.strip() linia=linia.split() x=linia[0] y=linia[1] if x.endswith('A'): w+=1 if y.endswith('A'): w+=1 print(w)
Python
zaydzuhri_stack_edu_python
from nio.command.params.base import Parameter from nio.command.params.string import StringParameter class InvalidCommandArg extends Exception begin pass end class class MissingCommandArg extends Exception begin pass end class class Command extends object begin string Command to be used in CommandHolders (Blocks and Ser...
from nio.command.params.base import Parameter from nio.command.params.string import StringParameter class InvalidCommandArg(Exception): pass class MissingCommandArg(Exception): pass class Command(object): """Command to be used in CommandHolders (Blocks and Services). Args: id (str): The ...
Python
zaydzuhri_stack_edu_python
for i in range n begin append c at f at i i + 1 end set a = list 0 * m set ans = string Possible for i in range m begin if length c at b at i == 0 begin print string Impossible exit end if length c at b at i > 1 begin set ans = string Ambiguity end if length c at b at i == 1 begin set a at i = c at b at i at 0 end end ...
for i in range(n): c[f[i]].append(i + 1) a = [0] * m ans = 'Possible' for i in range(m): if len(c[b[i]]) == 0: print('Impossible') exit() if len(c[b[i]]) > 1: ans = 'Ambiguity' if len(c[b[i]]) == 1: a[i] = c[b[i]][0] print(ans) if ans != 'Ambiguity': print(*a)
Python
jtatman_500k
class Influencer extends object begin function __init__ self username coin_code score begin set username = username set coin_code = coin_code set score = score end function function __str__ self begin return username + string + string score + string + coin_code end function end class
class Influencer(object): def __init__(self, username, coin_code, score): self.username = username self.coin_code = coin_code self.score = score def __str__(self): return self.username + " " + str(self.score) + " " + self.coin_code
Python
zaydzuhri_stack_edu_python
from requests import get , codes from re import search , MULTILINE from os.path import isfile from bs4 import BeautifulSoup from pickle import load , dump from const import URL , NAME_FILE_HASH , NAME_PICKLE_FILE , STUDENT from bs_iter import BeautifulSoupIterator from StudentsInfo import StudentInfo , get_rating_list ...
from requests import get, codes from re import search, MULTILINE from os.path import isfile from bs4 import BeautifulSoup from pickle import load, dump from const import URL, NAME_FILE_HASH, NAME_PICKLE_FILE, STUDENT from bs_iter import BeautifulSoupIterator from StudentsInfo import StudentInfo, get_rating_list, get_r...
Python
zaydzuhri_stack_edu_python
function compute_reference_wk data n_iters clustering_func begin set ref_wks = list comprehension call compute_log_wk call generate_null_reference data clustering_func for _ in range n_iters return tuple mean np ref_wks square root 1 + 1.0 / n_iters * standard deviation np ref_wks end function
def compute_reference_wk(data, n_iters, clustering_func): ref_wks = [ compute_log_wk(generate_null_reference(data), clustering_func) for _ in range(n_iters) ] return np.mean(ref_wks), np.sqrt(1 + 1.0 / n_iters) * np.std(ref_wks)
Python
nomic_cornstack_python_v1
comment !/usr/bin/python import itertools import argparse import os import database set parser = call ArgumentParser description=string Print database for heterostructure runs call add_argument string -d string --database default=string /users/stollenw/projects/euo/database/hetero.db help=string Database file name call...
#!/usr/bin/python import itertools import argparse import os import database parser = argparse.ArgumentParser(description='Print database for heterostructure runs') parser.add_argument('-d', '--database', default='/users/stollenw/projects/euo/database/hetero.db', help='Database file name') parser.add_argument('-p', '...
Python
zaydzuhri_stack_edu_python
function extract_musicnet_feature csv_path t_unit=0.01 begin set labels = call load_label csv_path return call extract_feature labels t_unit=t_unit end function
def extract_musicnet_feature(csv_path, t_unit=0.01): labels = MusicNetStructure.load_label(csv_path) return extract_feature(labels, t_unit=t_unit)
Python
nomic_cornstack_python_v1
function iteration self sample_lists begin print string Algorithm train functions %d % M print string Sampled functions %d % length sample_lists for m in range M begin set sample_list = sample_lists at m end if iteration_count == 0 begin print string Initial Trajectories call print_policy_cost list comprehension traj_d...
def iteration(self, sample_lists): print("Algorithm train functions %d" % self.M) print("Sampled functions %d" % len(sample_lists)) for m in range(self.M): self.cur[m].sample_list = sample_lists[m] if self.iteration_count == 0: print("Initial Trajectories") ...
Python
nomic_cornstack_python_v1
function download_video self url begin set progress_bar at string value = 0 delete string 1.0 END insert output END string [*] Download in progress... try begin set downloaded = call download quiet=true callback=handler end except IOError begin insert output END string [*] Sorry, but that video is not available set tot...
def download_video(self, url): self.progress_bar["value"] = 0 self.output.delete("1.0", tk.END) self.output.insert(tk.END, "[*] Download in progress...\n") try: downloaded = ( pafy.new(url).getbest().download(quiet=True, callback=self.handler) ) ...
Python
nomic_cornstack_python_v1
function format_sourcefile_name self fileName runSet begin string Formats the file name of a program for printing on console. if starts with fileName common_prefix begin set fileName = fileName at slice length common_prefix : : end return call ljust max_length_of_filename + 4 end function
def format_sourcefile_name(self, fileName, runSet): ''' Formats the file name of a program for printing on console. ''' if fileName.startswith(runSet.common_prefix): fileName = fileName[len(runSet.common_prefix):] return fileName.ljust(runSet.max_length_of_filename + ...
Python
jtatman_500k
function double_sha256 hexinput=string begin if hexinput == string begin return string string 5df6e0e2761359d30a8275058e299fcc0381534545f55cf43e41983f5d4c9456 end try begin set output = call hexlify_ call digest end except Exception as e begin raise exception string e end assert length output == 64 return string outpu...
def double_sha256(hexinput=""): if hexinput == "": return str("5df6e0e2761359d30a8275058e299fcc0381534545f55cf43e41983f5d4c9456") try: output = hexlify_(hashlib.sha256(hashlib.sha256(unhexlify_(hexinput)).digest()).digest()) except Exception as e: raise Exception(str(e)) assert l...
Python
nomic_cornstack_python_v1
function get_synchronization_signal self begin return __synchronization_signal end function
def get_synchronization_signal(self): return self.__synchronization_signal
Python
nomic_cornstack_python_v1