text
string
size
int64
token_count
int64
from a_top_k import * from b_top_k import * import time def main(): # test the generator for the top-k input # starting time values_k = [1, 2, 5, 10, 20, 50, 100] times_topk_join_a = [] times_topk_join_b = [] number_of_valid_lines_a = [] number_of_valid_lines_b = [] for k in values_...
1,235
488
"""Fix bound method attributes (method.im_? -> method.__?__). """ # Author: Christian Heimes # Local imports from .. import fixer_base from ..fixer_util import Name MAP = { "im_func" : "__func__", "im_self" : "__self__", "im_class" : "__self__.__class__" } class FixMethodattrs(fixer_bas...
639
241
import torch import torch.nn as nn import torch.nn.functional as F from typing import List class TextCNN2D(nn.Module): """ Implementation of 2D version of TextCNN proposed in paper [1]. `Here <https://github.com/yoonkim/CNN_sentence>`_ is the official implementation of TextCNN. Parameters ---...
4,764
1,555
def solution(bridge_length, weight, truck_weights): answer = 0 # { weight, time } wait = truck_weights[:] bridge = [] passed = 0 currWeight = 0 while True: if passed == len(truck_weights) and len(wait) == 0: return answer answer += 1 # sth needs to be passed ...
785
259
# # 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 in writing, software # ...
2,595
755
"""Holds the device gemoetry parameters (Table 5), taken from Wu et al., >> A Predictive 3-D Source/Drain Resistance Compact Model and the Impact on 7 nm and Scaled FinFets<<, 2020, with interpolation for 4nm. 16nm is taken from PTM HP. """ node_names = [16, 7, 5, 4, 3] GP = [64, 56, 48, 44, 41] FP = [40, 30, 28, 24, ...
440
260
# Copyright (c) AT&T 2012-2013 Yun Mao <yunmao@gmail.com> # Copyright 2012 IBM Corp. # # 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/LICENS...
2,605
835
"""Tests for miscellaneous properties, such as debuggability.""" import time from chopsticks.tunnel import Docker from chopsticks.group import Group def test_tunnel_repr(): """Tunnels have a usable repr.""" tun = Docker('py36', image='python:3.6') assert repr(tun) == "Docker('py36')" def test_group_repr...
780
286
import pandas as pd import re import glob def rebuild_counts_from_csv(path,n_dims, shots): df = pd.read_csv(path) return rebuild_counts_from_dataframe(dataframe=df, n_dims=n_dims, shots=shots) def rebuild_counts_from_dataframe(dataframe,n_dims,shots): dimension_counts = {} for dimension in range(n_d...
3,028
1,071
from sentry_sdk import capture_exception from dateutil.parser import parse from project_configuration.celery import app from orders.models import Charge from request_shoutout.domain.models import Charge as DomainCharge from .models import WirecardTransactionData CROSS_SYSTEMS_STATUS_MAPPING = { 'WAITING': Domai...
2,276
688
from typing import * from multiple_dispatch import multiple_dispatch @overload @multiple_dispatch def add(a: Literal[4, 6, 8], b): raise TypeError("No adding 2, 4, 6, or 8!") @overload @multiple_dispatch def add(a: int, b: str): return f"int + str = {a} + {b}" @overload @multiple_dispatch def add(a: int, b: in...
434
172
""" 动态图构建 AlexNet """ import paddle.fluid as fluid import numpy as np class Conv2D(fluid.dygraph.Layer): def __init__(self, name_scope, num_channels, num_filters, filter_size, stride=1, padding=0, ...
4,277
1,494
import turtle import random p1=turtle.Turtle() p1.color("green") p1.shape("turtle") p1.penup() p1.goto(-200,100) p2=p1.clone() p2.color("blue") p2.penup() p2.goto(-200,-100) p1.goto(300,60) p1.pendown() p1.circle(40) p1.penup() p1.goto(-200,100) p2.goto(300,-140) p2.pendown() p2.circle(40) p2.penup() p2.goto(-200,-...
905
430
#!/usr/bin/env python # vim: fdm=marker ''' author: Fabio Zanini date: 15/06/14 content: Check the status of the pipeline for one or more sequencing samples. ''' # Modules import os import sys from itertools import izip import argparse from Bio import SeqIO from hivwholeseq.utils.generic import getchar fr...
8,684
2,527
import streamlit as st import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt # -------------------------------------------------------------- # Import and clean data game_details = pd.read_csv('games_details.csv') # print(game_details.head(5)) game_details.drop(['GAME_ID', 'TEAM_...
1,633
605
""" Copyright (c) Facebook, Inc. and its affiliates. """ import numpy as np import random from datetime import datetime import sys import argparse import torch import os from inspect import currentframe, getframeinfo GEOSCORER_DIR = os.path.dirname(os.path.realpath(__file__)) CRAFTASSIST_DIR = os.path.join(GEOSCORER_...
19,228
7,405
#!/usr/bin/python from __future__ import absolute_import, division, print_function import subprocess from builtins import bytes, range from os.path import abspath, dirname from os.path import join as join_path from random import randint from CryptoAttacks.Block.gcm import * from CryptoAttacks.Utils import log def...
4,907
2,015
from python_clean_architecture.shared import use_case as uc from python_clean_architecture.shared import response_object as res class OrderDataGetUseCase(uc.UseCase): def __init__(self, repo): self.repo = repo def execute(self, request_object): #if not request_object: #return res...
507
143
from __future__ import (absolute_import, division, print_function) from owscapable.util import nspath_eval from owscapable.namespaces import Namespaces from owscapable.util import testXMLAttribute, testXMLValue, InfiniteDateTime, NegativeInfiniteDateTime from dateutil import parser from datetime import timedelta fro...
17,842
5,256
#!/usr/bin/env python # -*- coding: utf-8 -*- # Python version: 3.6 import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import copy import numpy as np from torchvision import datasets, transforms import torch import os import torch.distributed as dist from utils.sampling import mnist_iid, mnist_non...
11,386
4,091
from aws_cdk.aws_lambda import Function, Code, Runtime from aws_cdk.core import Stack, Duration from b_aws_testing_framework.tools.cdk_testing.testing_stack import TestingStack from b_cfn_lambda_layer.package_version import PackageVersion from b_lambda_layer_common.layer import Layer from b_lambda_layer_common_test.un...
2,085
521
""" This script creates a test that fails when metarl.tf.baselines failed to initialize. """ import tensorflow as tf from metarl.envs import MetaRLEnv from metarl.tf.baselines import ContinuousMLPBaseline from metarl.tf.baselines import GaussianMLPBaseline from tests.fixtures import TfGraphTestCase from tests.fixtures...
857
286
import jinja2 import json from send_email import send_email from app.models import User, MyResourcesAWS, db from app.es.awsdetailedlineitem import AWSDetailedLineitem from sqlalchemy import desc import subprocess import datetime from flask import render_template def monthly_html_template(): template_dir = '/usr/tr...
2,390
712
# Ryan Turner (turnerry@iro.umontreal.ca) from __future__ import division, print_function from builtins import range import numpy as np import scipy.stats as ss import mlpaper.constants as cc import mlpaper.mlpaper as bt import mlpaper.perf_curves as pc from mlpaper.classification import DEFAULT_NGRID, curve_boot fr...
7,309
2,912
def check_difference(): pass def update_benchmark(): pass
68
23
from typing import Any, Dict import numpy as np import pandas as pd import core.artificial_signal_generators as sig_gen import core.statistics as stats import core.timeseries_study as tss import helpers.unit_test as hut class TestTimeSeriesDailyStudy(hut.TestCase): def test_usual_case(self) -> None: idx...
3,047
1,095
#! -*- coding:utf-8 -*- import os import sys import cv2 import numpy as np def _resizing(img): #return cv2.resize(img, (256, 256)) return cv2.resize(img, (32, 32)) def _reg(img): return img/127.5 - 1.0 def _re_reg(img): return (img + 1.0) * 127.5 def get_figs(target_dir): ret = [] for file_...
718
301
# Generated by Django 3.2.7 on 2021-09-23 20:01 import cloudinary.models from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('myhoodApp', '0001_initial'), ] operations = [ migrations.AddField( model_name='healthfacilities', n...
471
156
# VAR example from statsmodels.tsa.vector_ar.var_model import VAR from random import random # contrived dataset with dependency data = list() for i in range(100): v1 = i + random() v2 = v1 + random() row = [v1, v2] data.append(row) # fit model model = VAR(data) model_fit = model.fit() # make prediction ...
380
142
import json import urllib.request import MySQLdb db = MySQLdb.connect(host="localhost", # your host, usually localhost user="root", # your username passwd="", # your password db="election") cur = db.cursor() # user_agent for sending headers w...
2,140
705
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Jun 9 23:28:21 2017 @author: samriddhi """ import re import sangita.hindi.tokenizer as tok import sangita.hindi.corpora.lemmata as lt def numericLemmatizer(instr): lst = type([1,2,3]) tup = type(("Hello", "Hi")) string = type("Hello") ...
3,101
1,311
# -*- coding: utf-8 -*- # Copyright 2021 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 require...
8,148
2,597
from markdown import markdown from unittest import TestCase from markdown_editing.extension import EditingExtension class TestExtension(TestCase): def test_substitution(self): source = '~{out with the old}{in with the new}' expected = '<p><span class="substitution"><del>out with the old</del><in...
4,471
1,449
""" SIREN/DIANA basic functionality testing framework Requires env vars: - GMAIL_USER - GMAIL_APP_PASSWORD - GMAIL_BASE_NAME -- ie, abc -> abc+hobitduke@gmail.com These env vars are set to default: - ORTHANC_PASSWORD - SPLUNK_PASSWORD - SPLUNK_HEC_TOKEN TODO: Move stuff to archive after collected TODO: Write data i...
15,477
5,465
# # Copyright (c) 2019 James E. King III # # Use, modification, and distribution are subject to the # Boost Software License, Version 1.0. (See accompanying file # LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt) # import json import networkx import re from pathlib import Path class BoostDependencyT...
6,735
1,967
from flask import Flask, flash, request, jsonify, render_template, redirect, url_for, g, session, send_from_directory, abort from flask_cors import CORS # from flask import status from datetime import date, datetime, timedelta from calendar import monthrange from dateutil.parser import parse import pytz import os impor...
7,357
2,300
""" .. --------------------------------------------------------------------- ___ __ __ __ ___ / | \ | \ | \ / the automatic \__ |__/ |__/ |___| \__ annotation and \ | | | | \ analysis ___/...
6,359
1,927
from mock import patch from django.contrib.contenttypes.models import ContentType from django.contrib.sites.models import Site from django.contrib.auth import get_user_model from django.core import exceptions from django_dynamic_fixture import G from django_webtest import WebTest from icekit.models import Layout from...
2,961
1,185
from imshowtools import imshow import cv2 if __name__ == '__main__': image_lenna = cv2.imread("lenna.png") imshow(image_lenna, mode='BGR', window_title="LennaWindow", title="Lenna") image_lenna_bgr = cv2.imread("lenna_bgr.png") imshow(image_lenna, image_lenna_bgr, mode=['BGR', 'RGB'], title=['lenna_...
548
232
# -*- coding: utf-8 -*- """Provides concept object.""" from __future__ import absolute_import from .. import t1types from ..entity import Entity class Concept(Entity): """Concept entity.""" collection = 'concepts' resource = 'concept' _relations = { 'advertiser', } _pull = { '...
729
247
""" Mock up a video feed pipeline """ import asyncio import logging import sys import cv2 logging.basicConfig(format="[%(thread)-5d]%(asctime)s: %(message)s") logger = logging.getLogger('async') logger.setLevel(logging.INFO) async def process_video(filename): cap = cv2.VideoCapture(filename) tasks = list() ...
932
322
#!/usr/bin/python3 """ Read "lspci -v" and "glxinfo" outputs """ import re from dataclasses import dataclass from InputFileNotFoundError import InputFileNotFoundError @dataclass class VideoCard: type = "graphics-card" manufacturer_brand = "" reseller_brand = "" internal_name = "" model = "" ...
11,807
3,247
#!/usr/bin/python import sys from loglib import SNYLogger import ftplib import argparse import re import os import calendar import time def read_skipfile(infile, log): skiplines = list() skipfile = open(infile, 'r') for line in skipfile: newline = line.rstrip('\r\n') linelength = len(...
9,682
2,926
#!/usr/bin/env python """ Classify oncodrive gene results and prepare for combination * Configuration parameters: - The ones required by intogen.data.entity.EntityManagerFactory * Input: - oncodrive_ids: The mrna.oncodrive_genes to process * Output: - combinations: The mrna.combination prepared to be calculated ...
2,637
1,093
def test_get_ip_placeholder(): """placeholder so pytest does not fail""" pass
86
26
#!/usr/bin/env python from sklearn import svm import csv_io def main(): training, target = csv_io.read_data("../Data/train.csv") training = [x[1:] for x in training] target = [float(x) for x in target] test, throwaway = csv_io.read_data("../Data/test.csv") test = [x[1:] for x in test] svc = s...
861
320
# -*- coding: utf-8 -*- from matplotlib import colors # max = 148 _COLOR_Genarator = iter( sorted( [ color for name, color in colors.cnames.items() if name not in ["red", "white"] or not name.startswith("light") or "gray" in name ] ) ) def curve_info_gener...
1,605
477
from urllib.parse import urlencode from decouple import config import hashlib import requests BASE = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" auth_key = config('AUTH_KEY') url = 'http://sms.globehost.com/api/sendhttp.php?' def encode_base(num, array=BASE): if(num == 0): return arr...
1,151
415
import sys import os sys.path.append(os.pardir) import random import time import requests from contextlib import closing from help import utils from threading import Thread def get_train_set_path(path: str): create_path = utils.join_root_path(path) return create_path def create_train_set_dir(path='auth-se...
1,522
553
import GeneralStats as gs import numpy as np from scipy.stats import skew from scipy.stats import kurtosistest import pandas as pd if __name__ == "__main__": gen=gs.GeneralStats() data=np.array([[1, 1, 2, 2, 3],[2, 2, 3, 3, 5],[1, 4, 3, 3, 3],[2, 4, 5, 5, 3]]) data1=np.array([1,2,3,4,5]) ...
3,912
2,146
#!/usr/bin/env python # encoding: utf-8 """ script to install all the necessary things for working on a linux machine with nothing Installing minimum dependencies """ import sys import os import logging import subprocess import xml.etree.ElementTree as ElementTree import xml.dom.minidom as minidom import socket import...
16,408
5,967
""" A simple, good-looking plot =========================== Demoing some simple features of matplotlib """ import numpy as np import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt fig = plt.figure(figsize=(5, 4), dpi=72) axes = fig.add_axes([0.01, 0.01, .98, 0.98]) X = np.linspace(0, 2, 200) Y = np...
400
184
import os import re from typing import Tuple from pfio._typing import Union from pfio.container import Container from pfio.io import IO, create_fs_handler class FileSystemDriverList(object): def __init__(self): # TODO(tianqi): dynamically create this list # as well as the patterns upon loading th...
4,087
1,258
import Analisis_Ascendente.Instrucciones.PLPGSQL.EjecutarFuncion as EjecutarFuncion from Analisis_Ascendente.Instrucciones.PLPGSQL.plasignacion import Plasignacion from Analisis_Ascendente.Instrucciones.instruccion import Instruccion from Analisis_Ascendente.Instrucciones.Create.createTable import CreateTable from ...
9,330
3,103
# -*- coding: utf-8 -*- from __future__ import unicode_literals class FetchOperator(object): '''Defines values for fetch operators''' ADD = 1 REMOVE = 2 REPLACE = 3
183
67
from threading import current_thread from jsbeautifier.javascript.beautifier import remove_redundant_indentation from pyparser.oleparser import OleParser from pyparser.hwp_parser import HwpParser from scan.init_scan import init_hwp5_scan from scan.bindata_scanner import BinData_Scanner from scan.jscript_scanner import...
6,067
1,838
""" Tests for plugins in core module. Only unit tests for now. """ from unittest.mock import patch import click from nile.core.plugins import get_installed_plugins, load_plugins, skip_click_exit def test_skip_click_exit(): def dummy_method(a, b): return a + b dummy_result = dummy_method(1, 2) ...
1,132
357
async def source(update, context): source_code = "https://github.com/Open-Source-eUdeC/UdeCursos-bot" await context.bot.send_message( chat_id=update.effective_chat.id, text=( "*UdeCursos bot v2.0*\n\n" f"Código fuente: [GitHub]({source_code})" ), parse_mod...
339
122
from django.contrib.contenttypes.models import ContentType from django.test import TestCase from django.test.client import Client from model_mommy import mommy from devices.models import Device from users.models import Lageruser class HistoryTests(TestCase): def setUp(self): self.client = Client() ...
1,255
384
# -*- coding: utf-8 -*- from django.core.management.base import BaseCommand, CommandError from django_git_info import get_git_info class Command(BaseCommand): help = 'Gets git info' #@transaction.commit_manually def handle(self, *args, **options): info = get_git_info() for key in info.ke...
376
122
from collections.abc import Callable as _Callable import networkx as _nx from opencog.type_constructors import AtomSpace as _AtomSpace from .args import check_arg as _check_arg def convert(data, graph_annotated=True, graph_directed=True, node_label=None, node_color=None, node_opacity=None, node_size=Non...
19,306
5,787
from builtins import * from pydantic import BaseModel class A(BaseModel): abc: str @classmethod def test(cls): return cls.<caret>
156
54
# -*- encoding: utf-8 -*- # Copyright (c) 2015 b<>com # # 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 o...
13,168
4,122
from __future__ import absolute_import, division, print_function from cctbx.array_family import flex from scitbx import matrix import math from libtbx import adopt_init_args import scitbx.lbfgs from mmtbx.bulk_solvent import kbu_refinery from cctbx import maptbx import mmtbx.masks import boost_adaptbx.boost.python as b...
31,044
12,362
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 1999-2018 Alibaba Group Holding Ltd. # # 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-...
25,941
10,213
import sys import matplotlib matplotlib.use('Agg') sys.path.insert(0, 'lib')
77
28
import matplotlib matplotlib.use('Agg') import numpy as np import matplotlib.pyplot as plt from glob import glob from astropy.table import Table, join from os import chdir, system from scipy.stats import norm as gauss_norm from sys import argv from getopt import getopt # turn off polyfit ranking warnings import warnin...
14,828
5,641
import ast from python_minifier.transforms.suite_transformer import SuiteTransformer class RemovePass(SuiteTransformer): """ Remove Pass keywords from source If a statement is syntactically necessary, use an empty expression instead """ def __call__(self, node): return self.visit(node) ...
707
208
import unittest from pkg import Linear_Algebra import numpy as np class TestLU(unittest.TestCase): def setUp(self): self.U_answer = np.around(np.array([[2,1,0],[0,3/2,1],[0,0,4/3]], dtype=float), decimals=2).tolist() self.L_answer = np.around(np.array([[1,0,0],[1/2,1,0],[0,2/3,1]], dtype=float), de...
1,214
494
from backend.common.models.mytba import MyTBAModel class Favorite(MyTBAModel): """ In order to make strongly consistent DB requests, instances of this class should be created with a parent that is the associated Account key. """ def __init__(self, *args, **kwargs): super(Favorite, self)._...
345
100
#---------------------------------------------------------------------- # Name: wxPython.lib.filebrowsebutton # Purpose: Composite controls that provide a Browse button next to # either a wxTextCtrl or a wxComboBox. The Browse button # launches a wxFileDialog and loads the result i...
17,296
4,667
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 encoding=utf-8 # arch: pacman -S python-pyserial # debian/ubuntu: apt-get install python-serial import serial import re import errors class DeviceWrapper(object): def __init__(self, logger, *args, **kwargs): self.device = serial.Serial(*args, **kwarg...
3,798
1,021
# while True: # # ejecuta esto # print("Hola") real = 7 print("Entre un numero entre el 1 y el 10") guess = int(input()) # =/= while guess != real: print("Ese no es el numero") print("Entre un numero entre el 1 y el 10") guess = int(input()) # el resto print("Yay! Lo sacastes!")
306
121
def rotCode(data): """ The rotCode function encodes/decodes data using string indexing :param data: A string :return: The rot-13 encoded/decoded string """ rot_chars = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', '...
1,426
412
import pickle, sys sys.path.append('../src') import data_io, sim_algo, eval, params ## run # wordfiles = [#'../data/paragram_sl999_small.txt', # need to download it from John Wieting's github (https://github.com/jwieting/iclr2016) # '../data/glove.840B.300d.txt' # need to download it first # ] wordfiles = [#...
1,762
640
class Foo: def bar(self): return "a" if __name__ == "__main__": f = Foo() b = f.bar() print(b)
120
50
import numpy as np import os from random import shuffle datasets_dir = './../data/' def one_hot(x,n): if type(x) == list: x = np.array(x) x = x.flatten() o_h = np.zeros((len(x),n)) o_h[np.arange(len(x)),x] = 1 return o_h def mnist(ntrain=60000,ntest=10000,onehot=True): ntrain=np.array(ntrain).astype(int).s...
1,602
754
import math import os import random import re import sys def compareTriplets(a, b): puntosA=0 puntosB=0 for i in range (0,3): if a[i]<b[i]: puntosB+=1 elif a[i]>b[i]: puntosA+=1 puntosTotales=[puntosA, puntosB] return puntosTotales if __name__ == '__mai...
686
256
#=============================================================== # @author: nityanarayan44@live.com # @written: 08 December 2021 # @desc: Routes for the Backend server #=============================================================== # Import section with referecne of entry file or main file; from __main__ i...
5,401
1,644
################################################################################# # The Institute for the Design of Advanced Energy Systems Integrated Platform # Framework (IDAES IP) was produced under the DOE Institute for the # Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021 # by the softwar...
15,624
5,529
"""TODO: Move the Threads Here"""
34
13
import functools import pickle import kerastuner import tensorflow as tf from tensorflow.python.util import nest from autokeras.hypermodel import base from autokeras.hypermodel import compiler class Graph(kerastuner.engine.stateful.Stateful): """A graph consists of connected Blocks, HyperBlocks, Preprocessors o...
17,569
4,941
''' Speed: 95.97% Memory: 24.96% Time complexity: O(n) Space complexity: O(n) ''' class Solution(object): def longestValidParentheses(self, s): ans=0 stack=[-1] for i in range(len(s)): if(s[i]=='('): stack.append(i) else: stack.pop() ...
474
155
from distutils.core import setup, Extension import os.path kw = { 'name':"PyOpenAES", 'version':"0.10.0", 'description':"OpenAES cryptographic library for Python.", 'ext_modules':[ Extension( 'openaes', include_dirs = ['inc', 'src/isaac'], # define_macros=[('ENABLE_PYTHON', '1')], sources = [ os....
447
211
#!/usr/bin/env python # Example taken from: # http://www.mathworks.com/access/helpdesk/help/techdoc/visualize/f5-3371.html from scitools.easyviz import * from time import sleep from scipy import io setp(interactive=False) # Displaying an Isosurface: mri = io.loadmat('mri_matlab_v6.mat') D = mri['D'] #Ds = smooth3(D...
967
426
import os import numpy as np import json import util_amira def getEdgeLabelName(label): if(label == 6): return "axon" elif(label == 4): return "apical" elif(label == 5): return "basal" elif(label == 7): return "soma" else: return "other" def getSomaPositio...
4,099
1,320
"""Blueprint definitions for maDMP integration.""" from flask import Blueprint, jsonify, request from invenio_db import db from .convert import convert_dmp from .models import DataManagementPlan def _summarize_dmp(dmp: DataManagementPlan) -> dict: """Create a summary dictionary for the given DMP.""" res = {...
3,503
1,152
from django.urls import path from . import views urlpatterns = [ path('', views.index, name='index'), path('retrieval_insert', views.retrieval_insert, name='retrieval_insert'), path('retrieval_get', views.retrieval_get, name='retrieval_get') ]
257
87
import RPi.GPIO as GPIO import threading class Encoder(object): def __init__(self, r_en_a,r_en_b,l_en_a,l_en_b): GPIO.setmode(GPIO.BCM) GPIO.setup(r_en_a, GPIO.IN) GPIO.setup(r_en_b, GPIO.IN) GPIO.setup(l_en_a, GPIO.IN) GPIO.setup(l_en_b, GPIO.IN) self.l_en_a=l_en_a;...
1,427
658
from django.conf.urls import url from django.urls import path, include from systori.apps.user.authorization import office_auth from systori.apps.equipment.views import EquipmentListView, EquipmentView, EquipmentCreate, EquipmentDelete, EquipmentUpdate, RefuelingStopCreate, RefuelingStopDelete, RefuelingStopUpdate, Mai...
2,286
815
#coding:utf-8 # Generated by the protocol buffer compiler. DO NOT EDIT! # source: check_info.proto import sys _b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode('latin1')) from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protob...
13,697
4,699
from numpy import zeros # Define ab2 function def ab2(f,t0,tf,y0,n): h = (tf - t0)/n t = zeros(n+1) y = zeros(n+1) t[0] = t0 y[0] = y0 y[1] = y[0] + h * f(t[0],y[0]) t[1] = t[0] + h for i in range(1,n): y[i+1] = y[i] + (3.0/2.0) * h * f(t[i],y[i])-1.0/2.0 * h * f(t[i-1]...
632
351
# # Copyright 2017 Mycroft AI 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 in writ...
40,331
16,157
# !/usr/bin/python # -*- coding: utf-8 -*- # @Time : 2020/9/18 12:02 # @Author : WardenAllen # @File : pluto_ftp.py # @Brief : import paramiko class PlutoFtp : # paramiko's Sftp() object. __sftp = object def connect_by_pass(self, host, port, uname, pwd): transport = paramiko.Transport(...
955
346
# Copyright (c) 2010-2011, Found IT A/S and Piped Project Contributors. # See LICENSE for details.
99
43
import sys sys.path = ['', '..'] + sys.path[1:] import daemon from assistance_bot import core from functionality.voice_processing import speaking, listening from functionality.commands import * if __name__ == '__main__': speaking.setup_assistant_voice(core.ttsEngine, core.assistant) while True: # st...
579
155
total = 0 partial_sums = [total := total + v for v in values] print("Total:", total) <ref>
107
35
# -*- coding: utf8 -*- ######################################################################################## # This file is part of exhale. Copyright (c) 2017-2022, Stephen McDowell. # # Full BSD 3-Clause license available here: # # ...
18,049
4,981
import argparse import multiprocessing import os import random import numpy as np from data_utils import DATAFILE_LIST, DATASET_LIST, prepare_data, RESULTS_DIR from models import SumOfBetaEce random.seed(2020) num_cores = multiprocessing.cpu_count() NUM_BINS = 10 NUM_RUNS = 100 N_list = [100, 200, 500, 1000, 2000, 5...
3,816
1,364
# # Princeton University licenses this file to You 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 in writ...
29,044
7,292