text
string
size
int64
token_count
int64
#! usr/bin/env python3 from os import times from bs4 import BeautifulSoup from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.by import By import numpy...
4,031
1,380
""" 64. Minimum Path Sum Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path. Note: You can only move either down or right at any point in time. http://www.tangjikai.com/algorithms/leetcode-64-minimum-path-sum Dynamic P...
1,264
420
# coding=utf-8 from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import logging import os import re import subprocess import sys from contextlib import contextmanager from abc import abstractproperty from pants.bin...
12,507
4,284
import torch from torch import nn import numpy as np class convmodel(torch.nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(3, 16, 3, 1, padding=1, bias=False) self.conv2 = nn.Conv2d(16, 32, 3, 1, padding=1, bias=False) self.linear = nn.Linear(32*10*10, 1, ...
5,121
2,049
# -*- coding:utf-8 -*- # Author: hankcs # Date: 2019-12-06 15:32
64
41
# Define here the models for your scraped items # # See documentation in: # http://doc.scrapy.org/topics/items.html from scrapy.item import Item, Field class KrakItem(Item): # define the fields for your item here like: # name = Field() # pass# company_name = Field() company_site_url = Field() ...
563
167
import re import copy from mau.lexers.base_lexer import TokenTypes, Token from mau.lexers.main_lexer import MainLexer from mau.parsers.base_parser import ( BaseParser, TokenError, ConfigurationError, parser, ) from mau.parsers.text_parser import TextParser from mau.parsers.arguments_parser import Argum...
29,630
8,051
#!/usr/bin/python # # Copyright 2018 Google LLC # # 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 ag...
3,344
1,413
from pathlib import Path from unittest import mock import pytest from freedesktop_icons import Icon, Theme, lookup, lookup_fallback, theme_search_dirs @pytest.mark.parametrize( ("env", "expected"), ( ("", [Path.home() / '.icons']), ("/foo:", [Path.home() / '.icons', Path('/foo/icons')]), ...
3,731
1,343
# -*- coding: utf-8 -*- __author__ = "Paul Schifferer <dm@sweetrpg.com>" """ """ import os import sentry_sdk from sentry_sdk.integrations.flask import FlaskIntegration from sentry_sdk.integrations.redis import RedisIntegration from sweetrpg_library_api.application import constants sentry_sdk.init(dsn=os.environ[con...
569
181
""" Compiles stellar model isochrones into an easy-to-access format. """ from numpy import * from scipy.interpolate import LinearNDInterpolator as interpnd from consts import * import os,sys,re import scipy.optimize #try: # import pymc as pm #except: # print 'isochrones: pymc not loaded! MCMC will not work' i...
13,674
5,789
import unittest from pterradactyl.util import as_list, memoize, merge_dict, lookup class TestCommonUtil(unittest.TestCase): def memoize_func(self, *arg, **kwargs): pass def test_as_list_string(self): elem = "3" r = as_list(elem) self.assertListEqual(r, list(elem)) def te...
1,263
460
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import numpy as np import pandas as pd import os import logging from functions.et_helper import findFile,gaze_to_pandas import functions.et_parse as parse import functions.et_make_df as make_df import functions.et_helper as helper import imp # for edfread reload im...
15,223
5,227
import music21 KEY_TO_SEMITONE = {'c': 0, 'c#': 1, 'db': 1, 'd': 2, 'd#': 3, 'eb': 3, 'e': 4, 'f': 5, 'f#': 6, 'gb': 6, 'g': 7, 'g#': 8, 'ab': 8, 'a': 9, 'a#': 10, 'bb': 10, 'b': 11, 'x': None} def parse_note(note): n = KEY_TO_SEMITONE[note[:-1].lower()] octave = int(no...
768
377
from dsa.lib.math.tests.fixture import MathTestCase class DsTestCase(MathTestCase): pass class ParenthesesTestCase(DsTestCase): pass
145
52
# import typing # # import boto3 # import typer # # import pacu.data as p # # # if typing.TYPE_CHECKING: # from mypy_boto3_iam import type_defs as t # from mypy_boto3_iam.client import IAMClient # from mypy_boto3_iam.paginator import ListRolesPaginator # # # def fetch(profile_name: typing.Optional[str] = ty...
763
287
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import re import http.cookiejar import urllib.request # your v2ex cookie value for key [auth] after login # refer README.md if cannot find cookie [auth] V2EX_COOKIE = '' V2EX_DOMAIN = r'v2ex.com' V2EX_URL_START = r'https://' + V2EX_DOMAIN V2EX_MISSION = V2EX_U...
1,698
661
# -*- coding: utf-8 -*- import re import shlex import os import inspect __version__ = '1.1.0' try: FileNotFoundError except NameError: # Python 2 FileNotFoundError = IOError ENV = '.env' def read_env(path=None, environ=None, recurse=True): """Reads a .env file into ``environ`` (which defaults to ``os.e...
2,309
739
import asyncio import sys from types import TracebackType from typing import Any, AsyncContextManager, List, Optional, Sequence, Tuple, Type from trio import MultiError from p2p.asyncio_utils import create_task class AsyncContextGroup: def __init__(self, context_managers: Sequence[AsyncContextManager[Any]]) ->...
2,535
709
from setuptools import setup, find_packages VERSION = '0.2' setup( name='trybox-django', version=VERSION, description='TryBox:Django', author='Sophilabs', author_email='contact@sophilabs.com', url='https://github.com/sophilabs/trybox-django', download_url='http://github.com/sophilabs/trybo...
895
286
from bflib.items import gems class GemTypeRow(object): __slots__ = ["min_percent", "max_percent", "gem_type"] def __init__(self, min_percent, max_percent, gem_type): self.min_percent = min_percent self.max_percent = max_percent self.gem_type = gem_type class GemTypeTable(object): ...
1,152
467
from Simulacion import Optimizacion from Simulacion import Graficos from Simulacion import Genetico from Simulacion import Model_close from mylib import mylib
158
43
# This need to be sorted out in a smarter way class InitializationError(Exception): def __init__(self, SomeClass, description): self.value = SomeClass self.description = description.format(SomeClass.__name__) def __str__(self): return self.description class ReservedValueError(Exce...
760
197
# # Copyright (c) 2017 Cossack Labs Limited # # 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...
1,964
683
'''Tests the rpc middleware and utilities. It uses the calculator example.''' import unittest from pulsar.apps import rpc from pulsar.apps.http import HttpWsgiClient class rpcTest(unittest.TestCase): def proxy(self): from examples.calculator.manage import Site http = HttpWsgiClient(Site()) ...
819
278
# -*- coding: utf-8 -*- """EN3-BT MCD Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1cnvSgNDexJ0cqrTWGygI_smZ0y8EIWZn """ import torch import numpy as np import tqdm import copy from torch.nn import functional as F from torch.nn.modules.module import...
22,042
7,080
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'jriver.ui' # # Created by: PyQt5 UI code generator 5.15.2 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doing. from PyQt5 import QtCore, QtGui...
16,974
5,109
from src.sensors.door_block_sensor import DoorBlockSensor from src.sensors.door_state_sensor import DoorStateSensor from src.sensors.light_sensor import LightSensor from src.sensors.movement_sensor import MovementSensor from src.sensors.smoke_sensor import SmokeSensor from src.sensors.weight_sensor import WeightSensor
320
104
# ---------------------------------------------------------------------------- # Title: Scientific Visualisation - Python & Matplotlib # Author: Nicolas P. Rougier # License: BSD # ---------------------------------------------------------------------------- import numpy as np import matplotlib.pyplot as plt import m...
888
298
import yaml import socket import subprocess, ctypes, os, sys from subprocess import Popen, DEVNULL def read_yaml(file_path): with open(file_path, "r") as f: return yaml.safe_load(f) def check_admin(): """ Force to start application with admin rights """ try: isAdmin = ctypes.windll.shell32...
2,773
892
import __init__ from Kite.database import Database from Kite import config from Kite import utils import jieba import pkuseg import logging logging.basicConfig(level=logging.INFO, format='%(asctime)s %(filename)s[line:%(lineno)d] %(levelname)s %(message)s', datefmt='%a, %d %b ...
5,623
2,056
from app.docs import SAMPLE_OBJECT_IDS ID_DUPLICATION_CHECK_GET = { 'tags': ['회원가입'], 'description': '이메일이 이미 가입되었는지를 체크(중복체크)합니다.', 'parameters': [ { 'name': 'email', 'description': '중복을 체크할 이메일', 'in': 'path', 'type': 'str', 'required': ...
2,659
1,229
import sys class add_path(): def __init__(self, path): self.path = path def __enter__(self): sys.path.insert(0, self.path) def __exit__(self, exc_type, exc_value, traceback): try: sys.path.remove(self.path) except ValueError: pass """ Remove """ ...
366
120
import numpy as np import pandas as pd from collections import OrderedDict, Counter import itertools from typing import * Group = tuple[str, list[int]] Groups = list[Group] def df_groups(groups: Groups) -> pd.DataFrame: return pd.DataFrame(dict_groups.values(), index=dict_groups.keys())
295
88
# my_lambdata/my_mod.py def enlarge(n): """ Param n is a number Function will enlarge the number """ return n * 100 # this code breakes our ability to omport enlarge from other files # print("HELLO") # y = int(input("Please choose a number")) # print(y, enlarge(y)) if __name__ == "__main__": ...
517
174
from allhub.response import Response from enum import Enum class SubjectType(Enum): ORGANIZATION = "organization" REPOSITORY = "repository" ISSUE = "issue" PULL_REQUEST = "pull_request" NONE = None class UsersMixin: def user(self, username): """ Provides publicly available i...
2,406
660
# This file is created by generate_build_files.py. Do not edit manually. test_support_sources = [ "src/crypto/aes/internal.h", "src/crypto/asn1/asn1_locl.h", "src/crypto/bio/internal.h", "src/crypto/bn/internal.h", "src/crypto/bn/rsaz_exp.h", "src/crypto/bytestring/internal.h", "src/crypto/...
22,360
9,405
# -*- coding: utf-8 -*- """ Author:by 王林清 on 2021/11/2 13:02 FileName:ci.py in shiyizhonghua_resource Tools:PyCharm python3.8.4 """ from util import get_time_str, get_json, get_file_path, save_json, \ save_split_json if __name__ == '__main__': dir_name = r'./../data/ci' authors = {} ci_jsons = [] ...
1,291
419
# Copyright 2019 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 agreed to in writing,...
2,307
733
# coding=utf-8 from related.types import TypedSequence, TypedMapping, TypedSet, ImmutableDict from attr.exceptions import FrozenInstanceError from related.converters import str_if_not_none from collections import OrderedDict import pytest def test_immutable_dict(): immutable = ImmutableDict(dict(a=1)) with p...
2,379
867
def inicio(): print('\033[33m=' * 60) print('MENU PRINCIPAL'.center(50)) print('=' * 60) print('\033[34m1\033[m - \033[35mCadastrar nova pessoa\033[m') print('\033[34m2\033[m - \033[35mVer pessoas cadastradas\033[m') print('\033[34m3\033[m - \033[35mSair do Sistema\033[m') print('\033[33m=\0...
2,203
871
import tornado.ioloop import tornado.web import tornado.gen import logging from concurrent.futures import ThreadPoolExecutor logger = logging.getLogger() logger.setLevel(logging.DEBUG) executor = ThreadPoolExecutor(max_workers=2) @tornado.gen.coroutine def callback(): """ when a function decorator with corou...
1,613
520
from dpia.modules import * # @primary_assets_required # @supporting_assets_required @login_required def threat_identification(request, q_id=None): ''' Shows a list of the added supporting assets which are assigned to a primary asset. The user here selects threats from the list of generic threats or adds a ...
12,523
3,679
#!/usr/bin/env python import rospy import sys import numpy as np from geometry_msgs.msg import Pose, Twist from nav_msgs.msg import Odometry from sensor_msgs.msg import Range from math import cos, sin, asin, tan, atan2 # msgs and srv for working with the set_model_service from gazebo_msgs.msg import ModelState from ga...
10,737
3,543
""" package related livefs modification subsystem """
54
14
# 根据一棵树的前序遍历与中序遍历构造二叉树。 # # 注意: # 你可以假设树中没有重复的元素。 # # 例如,给出 # # 前序遍历 preorder = [3,9,20,15,7] # 中序遍历 inorder = [9,3,15,20,7] # # 返回如下的二叉树: # # 3 # / \ # 9 20 # / \ # 15 7 # Related Topics 树 深度优先搜索 数组 # leetcode submit region begin(Prohibit modification and deletion) # Definition for a binary tree node...
1,153
496
# A child is playing a cloud hopping game. In this game, there are sequentially numbered clouds that can be thunderheads or cumulus clouds. The character must jump from cloud to cloud until it reaches the start again. # There is an array of clouds, e and an energy level e=100. The character starts from c[0] and uses 1...
1,644
512
# -*- coding: utf-8 -*- """ computes the lag of the amdf function Args: x: audio signal iBlockLength: block length in samples iHopLength: hop length in samples f_s: sample rate of audio data (unused) Returns: f frequency t time stamp for the frequency value """ import numpy as np impo...
1,575
655
from google.appengine.ext import ndb ATTACHMENTS = [ 'beforeBegin', 'afterEnd', 'middle' ] TYPES = [ 'strike', 'insert' ] class Modification(ndb.Model): type = ndb.StringProperty(choices=TYPES) start_index = ndb.IntegerProperty() trigram_at_start = ndb.StringProperty() content = ndb.StringProperty(...
636
234
import logging logger = logging.getLogger(__name__) GLOBAL_LANG_NAME = 'en' def set_global_language_to(lang: str) -> None: global GLOBAL_LANG_NAME logger.info('Setting the global language config to: %s', lang) GLOBAL_LANG_NAME = lang def get_global_language() -> str: return GLOBAL_LANG_NAME
316
117
import os import math import numpy as np import time import torch import torch.optim as optim from torch.utils.data import DataLoader from tensorboardX import SummaryWriter import sys sys.path.append(os.path.dirname("../")) from lib.utils.meter import Meter from models.model_MNFEAM import MFEAM_SSN from lib.dataset.s...
6,878
2,141
# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-05-09 12:19 from __future__ import unicode_literals import core.model_fields import core.models import core.validators import core.wagtail_fields from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migratio...
5,331
1,663
''' New Integration Test for 2 normal users zstack-cli login @author: MengLai ''' import hashlib import zstackwoodpecker.operations.account_operations as acc_ops import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.test_state as test_state import...
3,800
1,378
"""Unit tests for the :mod:`networkx.algorithms.structuralholes` module.""" import math import pytest import networkx as nx class TestStructuralHoles: """Unit tests for computing measures of structural holes. The expected values for these functions were originally computed using the proprietary software ...
5,226
1,920
"""Tests for the logbook component."""
39
11
""" Asset Allocation By Patrick Murrell Created 6/17/2020 This program that takes a csv positions file from fidelity.com from a Roth IRA account that contains the investments of SPAXX, FXNAX, FZILX, and FZROX. Since SPAXX is a Money Market fund then it is assumed that the money in here is not meant to be calcul...
19,069
5,778
#!/usr/bin/env python __author__ = 'Kurohashi-Kawahara Lab, Kyoto Univ.' __email__ = 'contact@nlp.ist.i.kyoto-u.ac.jp' __copyright__ = '' __license__ = 'See COPYING' import os from setuptools import setup, find_packages about = {} here = os.path.abspath(os.path.dirname(__file__)) exec(open(os.path.join(here, 'pyknp'...
919
340
import collections from supriya import CalculationRate from supriya.ugens.DUGen import DUGen class Dreset(DUGen): """ Resets demand-rate UGens. :: >>> source = supriya.ugens.Dseries(start=0, step=2) >>> dreset = supriya.ugens.Dreset( ... reset=0, ... source=sourc...
559
195
from database.models import Team, UserProfile from _main_.utils.massenergize_errors import MassEnergizeAPIError, InvalidResourceError, ServerError, CustomMassenergizeError from _main_.utils.massenergize_response import MassenergizeResponse from _main_.utils.context import Context class TeamStore: def __init__(self):...
1,729
559
""" https://oj.leetcode.com/problems/valid-parentheses/ Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in the correct order, "()" and "()[]{}" are all valid but "(]" and "([)]" are not. """ class Solution: # @return ...
1,125
356
from random import random def joga_moeda(): if random() > 0.5: return "Coroa" else: return "Cara" print (joga_moeda())
142
52
# -*- coding: utf-8 -*- # Generated by Django 1.11.7 on 2017-11-30 16:38 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('shop', '0005_frequentlysearched_latestsearches_soldvehicles_transaction'), ] operat...
483
166
import pytest from model_bakery import baker pytestmark = pytest.mark.django_db def test_get_global_settings(client_anonymous): settings = baker.make_recipe("settings.global_setting") response = client_anonymous.get("/global_settings") assert response.json() == {"productVat": settings.product_vat}
315
97
import click from dotpyle.commands.add.dotfile import dotfile @click.group() def add(): """ This command will take KEY and ... DOTFILE """ add.add_command(dotfile)
181
62
import sys import os from common.invoker import newRequest from common.invoker import request from common.invoker import threadize port = 8080 if len(sys.argv) > 1: port = int(sys.argv[1]) workload = 10000 req = newRequest( "GET", "http://localhost:{0}/".format(port), headers = { "X-FUNCTION...
646
233
import sys import numpy as np import h5py import random import os from subprocess import check_output # 1. h5 i/o def readh5(filename, datasetname): data=np.array(h5py.File(filename,'r')[datasetname]) return data def writeh5(filename, datasetname, dtarray): # reduce redundant fid=h5py.File(filename,...
3,679
1,567
#!/usr/bin/env python # This example demonstrates how to extract "computational planes" from # a structured dataset. Structured data has a natural, logical # coordinate system based on i-j-k indices. Specifying imin,imax, # jmin,jmax, kmin,kmax pairs can indicate a point, line, plane, or # volume of data. # # In this ...
3,277
1,277
from diagrams import Cluster, Diagram, Edge from diagrams.aws.compute import EC2 from diagrams.aws.database import RDS from diagrams.aws.integration import SQS from diagrams.aws.network import ELB from diagrams.aws.storage import S3 from diagrams.onprem.ci import Jenkins from diagrams.onprem.client import Client, User,...
1,482
477
from django.db import models class InputFile(models.Model): input = models.FileField(upload_to='input/%Y/%m/%d') next_one = models.FileField(upload_to='documents/%Y/%m/%d') name=models.CharField(max_length=100) privacy=models.BooleanField(default=False)
259
93
from __future__ import absolute_import, division, print_function from builtins import * # @UnusedWildImport from mcculw import ul from mcculw.ul import ULError from examples.console import util from examples.props.ai import AnalogInputProps use_device_detection = True def run_example(): board_num = 0 if...
1,751
554
from oocsi import OOCSI from NAO_Speak import NAO_Speak # (file name followed by class name) import unidecode ################################# IP = "IP_OF_PEPPER_ROBOT" text = "" my_nao = NAO_Speak(IP, 9559) ################################## def receiveEvent(sender, recipient, event): print('from ', sender, ' ...
721
263
# encoding:utf-8 import asyncio import os import mimetypes from urllib import parse response = { # 200: [b'HTTP/1.0 200 OK\r\n', # 正常的response # b'Connection: close\r\n', # b'Content-Type:text/html; charset=utf-8\r\n', # b'\r\n'], 404: [b'HTTP/1.0 404 Not Found\r\n', # 请求文件不存在的r...
8,161
2,906
from core.object import Object style= Object({ 'btn': { 'bg': '#123321', 'fg': '#dddddd', 'font': ('Ariel', 14, 'bold') } })
157
63
class Test: def __init__(self): self.a=10 self.b=20 def display(self): print(self.a) print(self.b) t=Test() t.display() print(t.a,t.b)
193
84
from physics import * s1, s2 = Speed(9, 3, unit='cm/s', extra_units=['cm/h']), Speed(9, 2, unit='cm/h', extra_units=['cm/h']) print(s2.distance.unit)
151
71
import random import time from book_book.books_directory import books_requests_queue from book_book.rental_request import RentalRequest def rent_a_book(author: str, title: str, renter_name: str) -> None: time.sleep(random.randint(0, 1)) rental_request = RentalRequest(author=author, title=title, renter_name=...
378
126
emk.module("java")
19
9
# 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 # distributed ...
2,111
641
from typing import List import dace from dace import subsets from dace import memlet from dace import dtypes from dace.sdfg.sdfg import InterstateEdge, SDFG from dace.sdfg.state import SDFGState from dace.transformation.interstate.sdfg_nesting import NestSDFG from dace.transformation.optimizer import Optimizer from dac...
11,168
4,340
""" WAVECAR parser. --------------- The file parser that handles the parsing of WAVECAR files. """ from aiida_vasp.parsers.file_parsers.parser import BaseFileParser from aiida_vasp.parsers.node_composer import NodeComposer class WavecarParser(BaseFileParser): """Add WAVECAR as a single file node.""" PARSABL...
1,134
354
#! /usr/bin/env python # encoding: utf-8 import re import os import subprocess import json class Package: def __init__(self) -> None: self.manager = "" self.name = "" self.version = "" def toString(self): print('package manager:' + self.manager) print('package name:' ...
4,184
1,266
from copy import deepcopy import numpy as np import tensorflow as tf from ampligraph.datasets import NumpyDatasetAdapter, AmpligraphDatasetAdapter from ampligraph.latent_features import SGDOptimizer, constants from ampligraph.latent_features.initializers import DEFAULT_XAVIER_IS_UNIFORM from ampligraph.latent_features...
16,951
4,784
# num2txt.py # Jeff Smith ''' Convert a given number into its text representation. e.g. 67 becomes 'sixty-seven'. Handle numbers from 0-99. ''' # Create dictionaries of number-text key pairs ones = {0: '', 1: 'one', 2: 'two', 3: 'three', 4: 'four', 5: 'five', 6: 'six', 7: 'seven', 8: 'eight', 9: 'nine'} twos...
1,518
643
import ctypes from typing import get_type_hints, Any from abc import ABC from .c_pointer import TypedCPointer, attempt_decode from contextlib import suppress class Struct(ABC): """Abstract class representing a struct.""" def __init__(self, *args, **kwargs): hints = get_type_hints(self.__cl...
1,811
576
__source__ = 'https://leetcode.com/problems/kth-smallest-number-in-multiplication-table/' # Time: O() # Space: O() # # Description: Leetcode # 668. Kth Smallest Number in Multiplication Table # # Nearly every one have used the Multiplication Table. # But could you find out the k-th smallest number quickly from the mul...
4,852
1,778
import ezc3d # This example reads a file that contains 2 force platforms. It thereafter print some metadata and data for one them c3d = ezc3d.c3d("../c3dFiles/ezc3d-testFiles-master/ezc3d-testFiles-master/Qualisys.c3d", extract_forceplat_data=True) print(f"Number of force platform = {len(c3d['data']['platform'])}") ...
1,141
433
from __future__ import print_function, unicode_literals import os from io import open from pyNastran.utils.log import get_logger2 import shutil IGNORE_DIRS = ['src', 'dmap', 'solver', '__pycache__', 'op4_old', 'calculix', 'bars', 'case_control', 'pch', 'old', 'solver', 'test', 'dev', 'bkp...
7,062
2,504
import pandas as pd from toucan_data_sdk.utils.postprocess import top, top_group def test_top(): """ It should return result for top """ data = pd.DataFrame( [ {'variable': 'toto', 'Category': 1, 'value': 100}, {'variable': 'toto', 'Category': 1, 'value': 200}, {'v...
4,650
1,818
from Main import db, login_manager from faker import Faker from flask_login import UserMixin from werkzeug.security import generate_password_hash, check_password_hash fake = Faker() @login_manager.user_loader def load_user(user_id): return User.query.get(user_id) class User(db.Model, UserMixin): __tablenam...
2,439
836
import sys import os import SimpleITK as sitk import pydicom from slugify import slugify import shutil import argparse def gen_dcm_identifiers(in_dir): ##Get Absolute Path For Every DCM File Recursively dcms_path_list = [os.path.abspath(os.path.join(dire,dcm)) for dire,sub_dir,dcms in os.walk(in_dir) if 'dcm' ...
2,199
822
from PyQt5 import QtWidgets from .cnmf_viz_pytemplate import Ui_VizualizationWidget from .evaluate_components import EvalComponentsWidgets from mesmerize_core.utils import * from mesmerize_core import * import caiman as cm class VizWidget(QtWidgets.QDockWidget): def __init__(self, cnmf_viewer, batch_item): ...
2,384
836
# SPDX-License-Identifier: BSD-3-Clause # # Configuration file for textgen. This file defines the graphic lumps # that are generated, and the text to show in each one. # import re # Adjustments for character position based on character pairs. Some # pairs of characters can fit more snugly together, which looks more #...
7,459
3,227
import fnmatch, os, subprocess from multiprocessing import Pool import tqdm sdkPath = subprocess.check_output('xcodebuild -version -sdk iphonesimulator Path', shell=True).strip() def parseSymbols(fn): args = [ 'headerparser_output/headerparse', fn, '-ObjC', '-fmodules', '-isysroot', sdkPath, '-I%s/usr/...
1,840
784
""" Tools for waiting for a cluster. """ import click import click_spinner import urllib3 from cli.common.options import ( superuser_password_option, superuser_username_option, ) from ._common import ClusterVMs from ._options import existing_cluster_id_option @click.command('wait') @existing_cluster_id_opt...
1,331
409
class Graph(dict): """A Graph is a dictionary of dictionaris. The outer dictionary maps from a vertex to an inner dictionary. The inner dictionary maps from other vertices to edges. For vertices a and b, graph([a, b], [ab]) maps to the edge that connects a->b, if it exists.""" def __init__(sel...
1,922
609
# -*- coding: utf-8 -*- """Unit test package for graphql_env."""
65
27
# -*- coding: utf-8 -*- """ Created on Fri Sep 3 20:33:21 2021 @author: zhang """ import os import numpy as np import pandas as pd import tensorflow as tf from sklearn.model_selection import train_test_split from sklearn.utils import shuffle import tensorflow.keras as keras from tensorflow.keras.preprocessing import ...
3,642
1,352
import torch import matplotlib.pyplot as plt import numpy as np import glob import cv2 from esim_torch import EventSimulator_torch def increasing_sin_wave(t): return (400 * np.sin((t-t[0])*20*np.pi)*(t-t[0])+150).astype("uint8").reshape((-1,1,1)) if __name__ == "__main__": c = 0.2 refractory_period_ns = ...
2,280
906
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ load_csv.py This script controlls all load csv information. Created on: Fri Jul 16 15:54:43 2021 Author: Alex K. Chew (alex.chew@schrodinger.com) Copyright Schrodinger, LLC. All rights reserved. """ # Loading modules import os import pandas as pd import numpy as n...
6,642
1,837
from ivory.layers import (activation, affine, convolution, core, dropout, embedding, loss, normalization, recurrent) __all__ = [ "activation", "affine", "convolution", "core", "dropout", "embedding", "loss", "normalization", "recurrent", ]
303
96