text
string
size
int64
token_count
int64
#generate_target.py #Generates a list of target genes from a flybase output import os import sys def main(): in_path = sys.argv[1] out_path = sys.argv[2] infile = open(in_path, "r") outfile = open(out_path, "x") for l0 in infile: l0s = l0.split(",") for item in l0s: if "...
429
160
import config from flask import current_app from flask_login import current_user from pgadmin.model import db, User, Server from pgadmin.utils.crypto import encrypt, decrypt MASTERPASS_CHECK_TEXT = 'ideas are bulletproof' def set_crypt_key(_key, _new_login=True): """ Set the crypt key :param _key: The k...
3,512
983
from django.urls import path from .views import DashboardTemplateView, DashboardView app_name = 'dashboard' urlpatterns = [ path('test/', DashboardView.as_view(), name='test'), path('', DashboardView.as_view(), name='index'), ]
238
80
import random from model.group import Group def test_group_removal(app, db, check_ui): old_group_list = db.get_group_list() group = random.choice(old_group_list) if len(db.get_group_list()) == 0: app.group.create(Group(name="test_group_random_name", header="random_header", footer="random_footer"))...
904
306
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from parlai.scripts.train_model import setup_args, TrainLoop if __name__ == '__main__': parser = setup_args() p...
1,946
743
import os import collections import numpy as np from ipywidgets import widgets from IPython.core.display import display, HTML import logging from NeuNorm.normalization import Normalization from __code import file_handler from __code.ipywe import myfileselector from __code.normalization.get import Get from __code.norm...
37,914
10,671
import contextlib import io import os import re import subprocess from . import backups_manager_lib from . import backups_main from . import lib from .test_util import AssertEquals from .test_util import AssertLinesEqual from .test_util import CreateDir from .test_util import CreateFile from .test_util import DoBacku...
12,719
4,144
from django import template from backend.models import Back register = template.Library() @register.inclusion_tag('backend/tags/scrollMenuB.html') def get_back(): scrollB = Back.objects.all() return {"scrollMenuB": scrollB }
234
68
"""Views for ecommerce""" from decimal import Decimal import logging from django.conf import settings from django.contrib.auth import get_user_model from django.http.response import Http404 from django.shortcuts import get_object_or_404 from django.urls import reverse from ipware import get_client_ip from rest_framewo...
9,116
2,537
import json import logging import os import torch from rnn import RNNModel import data JSON_CONTENT_TYPE = 'application/json' logger = logging.getLogger(__name__) def model_fn(model_dir): logger.info('Loading the model.') model_info = {} with open(os.path.join(model_dir, 'model_info.pth'), 'rb') as f:...
3,334
1,054
import pandas as pd import numpy as np import json import requests #Retrieving my api keys information to access the Google API. def get_keys(path): with open(path) as f: return json.load(f) keys = get_keys("/Users/jjherranzsarrion/.secret/google_blog2_api.json") api_key = keys['api_key'] url = 'http...
889
326
from django.apps import AppConfig from openslides.utils.collection import Collection from . import ( __description__, __license__, __url__, __verbose_name__, __version__, ) class ProtocolAppConfig(AppConfig): name = 'openslides_protocol' verbose_name = __verbose_name__ description = _...
1,807
510
# Generated by Django 3.0.3 on 2020-04-28 13:14 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('roster', '0039_unlock_units'), ] operations = [ migrations.AlterField( model_name='student', name='num_units_done', ...
701
221
#!/usr/bin/env python import json from typing import List, Optional, Tuple import datetime import re import io import base64 import os import sys import argparse from plotly.missing_ipywidgets import FigureWidget from tqdm import tqdm import minify_html ROOT=os.path.realpath(os.path.join(os.path.dirname(__file__), '....
9,700
3,853
from lib import rpclib from slickrpc import Proxy from lib import transaction, bitcoin, util from lib.util import bfh, bh2u from lib.transaction import Transaction import requests import pytest import subprocess import json import sys import os from dotenv import load_dotenv load_dotenv(verbose=True) IMPORT_API_HOST...
16,405
10,522
from pynito.cognitodecryptor import CognitoDecryptor
52
20
import sys from PySide2.QtGui import QPixmap, QImage from PySide2.QtWidgets import QApplication, QLabel, QPushButton, QVBoxLayout, QWidget, QFileDialog, QTextEdit, QSizePolicy, QMessageBox, QHBoxLayout from PySide2.QtCore import Slot, Qt, QStringListModel, QSize, QTimer from dbr import DynamsoftBarcodeReader dbr = Dy...
5,241
1,731
import sys import logging import numpy as np logger = logging.getLogger(__name__) class TryAgainError(Exception): """ signal to skip this image(s) and try a new one """ def __init__(self, message): # Call the base class constructor with the parameters it needs Exception.__init__(self,...
6,820
2,472
import pandas as pd from PIL import Image import requests from io import BytesIO import os import math df = pd.read_csv('C:\\Users\\v-ngdian\\Documents\\utilities\\thumbnail creator\\MetArtworksAugmented.csv') size = 512, 512 ids = [] def make_thumbnail(objectID, url, foldername): try: response = requests...
1,470
468
import ssl import certifi from promisedio import loop, ns, promise, timer async def example1(): context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) context.verify_mode = ssl.CERT_REQUIRED context.check_hostname = True context.load_default_certs() context.load_verify_locations( cafile=certifi...
1,050
361
# Copyright (c) 2013 Mirantis 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...
3,232
996
import FWCore.ParameterSet.Config as cms from RecoLocalCalo.HGCalRecProducers.hgcalLayerClusters_cfi import hgcalLayerClusters as hgcalLayerClusters_ from RecoLocalCalo.HGCalRecProducers.HGCalRecHit_cfi import dEdX, HGCalRecHit from RecoLocalCalo.HGCalRecProducers.HGCalUncalibRecHit_cfi import HGCalUncalibRecHit fr...
1,004
435
# Copyright (c) 2020 Intel Corporation. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, ...
1,705
548
import logging import time from spaceone.inventory.libs.manager import GoogleCloudManager from spaceone.inventory.libs.schema.base import ReferenceModel from spaceone.inventory.connector.bigquery.sql_workspace import SQLWorkspaceConnector from spaceone.inventory.model.bigquery.sql_workspace.cloud_service import BigQue...
8,033
2,141
for a in range(0,6): print('Olá!', a) print('Parei. \n') for b in range(6, 0, -1): print('Olá1', b) print('Parei. \n') for c in range(0, 6, 2): print('Olá!', c) print('Parei. \n')
192
99
# -*- coding: utf-8 -*- """ Created on Fri Feb 26 09:11:06 2016 @author: eikes """ import ConfigParser from components import Component from result import VariableResult _config = ConfigParser.ConfigParser() _config.read('scenario.cfg') _section = 'MySection' _results = 'results' def _create_comp(index): glob...
1,732
602
ncoders = int(input("enter no. of coders : ")) l=map(int,input().split(" ")) sl=[] l = sorted(list(l)) top = 1 for rotator in range(1,ncoders): sl = l[:rotator] if(top != ncoders): if(max(sl) < l[top]): l[l.index(max(sl))] = 0 top = top +1 elif(max(...
466
189
###################################################################################################################### # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # # ...
8,081
2,078
import argparse from typing import List class Solution: def max_profit(self, prices: List[int]) -> int: best_profit = 0 for idx in range(0, len(prices) - 1): # If the price is not greater, then "sell at the peak", else buy/hold if prices[idx + 1] > prices[idx]: ...
807
250
import calcWinRate as cwr def pp( a, b, table, k): result = cwr.calc_win_rate( a, b, table, k) print( "{} vs {} with {}".format( cwr.card_lst(a), cwr.card_lst(b), cwr.card_lst(table))) print( "{:2.2%} vs {:2.2%}\n".format(result[0], result[1])) k= 10000 # simulate k times # --- example 0 --- # --- 1...
947
481
import discord from discord.ext import commands from Utils.UserClass import UserClass as User permission_message = ["Guest [Permission Level : 0]", "User [Permission Level : 1]", "Developer [Permission Level : 2]", "Owner [Permission Level : 3]"] async def check_permission(ctx, level): now_user = User(ctx.author)...
1,085
387
import math test = [] def testPrime(num): sq = int(math.sqrt(num)) for i, factor in enumerate(test): if (i > sq): break if (num % factor == 0): return False test.append(num) return True sumPrimes = 2 for i in range(3, 2000000, 2): if not testPrime(i): ...
436
164
import sys import re import json import os.path import copy from mako.template import Template from clang import cindex configfile = "clangelscript.json" f = open(configfile) data = f.read() data = re.sub(r"//[^n]*n", "\n", data) config = json.loads(data) f.close() if "ObjectTypes" in config: arr = config["Obje...
37,403
11,560
''' 测试数据库存储数据demo >> mysql -u root -p < schema.sql ''' import orm from models import User, Blog, Comment import asyncio async def test (loop): await orm.create_pool(loop, user='www-data', password='www-data', db='awesome') # u = User(id='2', name='Test1', email='test1@example.com', passwd='1234567890', imag...
573
219
import avro.schema import json import fastavro SCHEMA = { "namespace": "avg_obj", "type": "record", "name": "Meme", "fields": [ {"name": "user", "type": { "type": "record", "name": "PostUser", "fields": [ {"name": "user_id", "type": "string"}...
1,358
403
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Program, ki vas vpraša po imenu, nato pa vas pozdravi. """ # povprašamo po imenu ime = input("Kako ti je ime? ") # pozdravimo print(f"Pozdravljen_a, {ime}!")
210
97
''' # Linear Regression: understanding loss function in linear regression #---------------------------------- # # This function shows how to use Tensorflow to # solve linear regression. # y = Ax + b # # We will use the iris data, specifically: # y = Sepal Length # x = Petal Width ''' import matplotlib.pyplot as plt i...
3,699
1,490
#pysh: shell in python import sys cmdlist = ['start','exit','cd','md','ls','pd','cf','cl'] convert = [] waiting = 0 print 'pysh 1.0.5 19.03.11 #6. type start to enter, exit to leave.' paths = ['pysh/'] direct = 'pysh/' added = [] entered = raw_input(': ') if entered == 'start': while entered != ['exit']: en...
3,258
800
from idautils import * from idaapi import * from idc import * import urllib2 def ida_set_function_colour(function_address, colour): idc.set_color(function_address, CIC_FUNC, colour) def ida_get_function_colour(function_address): function = idaapi.get_func(function_address) if not function: ...
3,813
1,355
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class AlipayCommerceEducateTuitioncodeMonitorCreateModel(object): def __init__(self): self._bank_type = None self._login_account = None self._out_apply_id = None self._p...
2,499
811
import unittest from code import instance as i from code import datamapping as dm from code import greedyfirst as gf from code import algorithm as a from code import baseobjects as bo from code import tabu class TestTabuSpecific(unittest.TestCase): def setUp(self): raw_data = dm.Importer() # ra...
2,888
1,086
""" examples on scikit-image : call : from skimage.feature import blob_dog, blob_log, blob_doh structure : skimage feature __init__.py (from .blob import blob_dog, blob_log, blob_doh) blob.py (contains blob_dog, blob_log, blob_doh) conclusion : module imported because it was defin...
381
133
import numpy as np from com.sparksamples.util import get_records from com.sparksamples.util import get_mapping from com.sparksamples.util import extract_features from com.sparksamples.util import extract_label from com.sparksamples.util import extract_features_dt #from pyspark.mllib.tree import DecisionTree from pysp...
1,941
689
import random import yaml class Grammar: """ A simpler version of Tracery's ideas. """ def __init__( self, rules = None ): self.rules = rules or { } # To be pop()'d off by the caller. self.saved = [ ] def parse( self, string ): if "[" in string or "]" in string: ...
5,010
1,602
from rest_framework import viewsets from kratos.apps.trigger import models, serializers class TriggerViewSet(viewsets.GenericViewSet): ''' Trigger信息 ''' serializer_class = serializers.TriggerRecordSerializer queryset = models.TriggerRecord.objects.all() def list(self, request): ''' Trigger调用记录列表 ...
543
175
from FileLoader import FileLoader tests = [ "non_existing_file.csv", "empty_file.csv", "../data/athlete_events.csv", ] if __name__=="__main__": for test in tests: print(f"==> TESTING {test}") fl = FileLoader() print(f"\n=> Loading file") df = fl.load(test) pri...
478
174
# REF: https://labs.ig.com/rest-trading-api-reference class Watchlists: """ DO NOT CHANGE Adding is ok ... and encouraged ;) """ base = { 'path': 'watchlists', 'GET': { 'version': '1', 'tokens': True, } # Not supported yet: 'POST' } ...
492
162
#!/usr/bin/env python # coding: utf-8 #AL - the above code is new for the griffin paper version #modified print commands for python3 # Analyze all possible things from BAM-file import sys import argparse from subprocess import call import numpy import scipy import scipy.stats import os.path import os import glob # ...
21,236
8,612
import sys def registrasi(): username = input("Masukan username: ") password = input("Masukan password: ") return username, password def login(username, password): # list_user, input_user = input("Masukan username: ") input_pass = input("Masukan password: ") if username == input_user and passw...
1,094
335
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) from builtins import * # this repo overrides ferenda.sources.legal.se.Regeringen to work # against old downloaded import re import codecs # from urllib.parse import urljoin from rdflib ...
7,631
2,241
import reverse_geocode reverse_geocode.search([(35.6963860567411,139.686436661882)]) reverse_geocode.search([(-33.8236171057086,151.021885871887)]) reverse_geocode.search([(47.3111740195794,8.52681624913163)])
211
140
from mesa.datacollection import DataCollector ### datacollection functions def density(model): """Density: number of cars per unit length of road.""" return len(model.schedule.agents) / model.space.length def flow(model): """Flow: number of cars passing a reference point per unit of time.""" # get...
803
240
import pymysql import logging from lambda_assistant.handlers.event_handler import EventHandler from lambda_assistant.errors import * logger = logging.getLogger() logger.setLevel(logging.INFO) class Select(): def Select(self, handler: EventHandler, conn: pymysql.connections.Connection, sql: str): ...
2,850
800
from django.contrib.auth import get_user_model from django.db import models # Create your models here. User = get_user_model() class Post(models.Model): text = models.TextField(verbose_name='Текст') pub_date = models.DateTimeField(auto_now_add=True, verbose_name="date published") author = models.ForeignK...
1,280
385
'''OpenGL extension AMD.blend_minmax_factor This module customises the behaviour of the OpenGL.raw.GL.AMD.blend_minmax_factor to provide a more Python-friendly API Overview (from the spec) The EXT_blend_minmax extension extended the GL's blending functionality to allow the blending equation to be specified by t...
1,508
413
"""This example demonstrates the basics on building complete forms using campos. It creates several fields, marking some of them as required and adding some custom validation. Finally fields are added to a CreationForm which have several buttons and a custom callback connected to one of them. After added, some relate...
2,506
755
from flask import Flask, request from structs import * import json import numpy as np import sys import random, time app = Flask(__name__) dx=0 dy=0 def create_action(action_type, target): actionContent = ActionContent(action_type, target.__dict__) #print(actionContent) return json.dumps(actionContent.__di...
8,452
2,928
from InstaFriend import InstaFriend friend = InstaFriend('bonesaw') friend.say_something()
92
32
import datetime as dt import os import attr @attr.s(repr=False) class Interval: start = attr.ib() end = attr.ib() key = attr.ib() def __repr__(self): return "%s(start=%r, end=%r, key=%r)" % ( type(self).__name__, self.start.isoformat(), self.end.isoformat(...
3,004
848
"""Tests for the mqtt_json component."""
41
14
from .console import embed, shell_entry from .misc import decode_webwx_emoji, enhance_connection, ensure_list, get_raw_dict, get_receiver, \ get_text_without_at_bot, get_username, match_attributes, match_name, match_text, new_local_msg_id, repr_message, \ smart_map, start_new_thread from .puid_map import PuidMa...
414
138
def compile_files(fp_list): for fp in fp_list: __compile_file(fp) def __compile_file(file_pointer): pass
123
47
# Plugin made by Dark cobra # For Dark cobra # Made by Shivam Patel(Team Cobra) # Kang with credits.. import random from userbot import CMD_HELP from userbot.events import register from userbot.utils import admin_cmd from telethon import events, types, functions, utils import asyncio def choser(cmd, pack, blacklist...
1,082
334
#!/usr/bin/env python import sys maximum = 0.0 selected = 0.0 results = [] for line in sys.stdin.readlines()[5:]: line = line.strip() if len(line) == 0: continue (inst, actual, predicted, error) = line.split() results.append([inst, actual, predicted, error]) predicted = float(predicted...
1,024
364
'''Logging module for symtuner library Logging module for symtuner library. All loggings in symtuner library use this module. ''' import logging as _logging _LOGGER = None def get_logger(): '''Get a logger. Get a singleton `Logger`. If `Logger` not defined make one and return. If `get_logger` called ...
941
285
import os import sys import cv2 import argparse import numpy as np import torch from torch import nn from torch.nn import MSELoss from torch.optim import Adam from torch.optim.lr_scheduler import MultiStepLR from torch.autograd import Variable from torch.utils.data import DataLoader from tensorboardX import SummaryWri...
3,326
1,146
# Online mode selection for FastEMRIWaveforms Packages # Copyright (C) 2020 Michael L. Katz, Alvin J.K. Chua, Niels Warburton, Scott A. Hughes # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, ...
6,371
1,941
from .city import City from .company import Company from .country import Country
81
19
""" opentrons_shared_data.deck.dev_types: types for deck defs This should only be imported if typing.TYPE_CHECKING is True """ from typing import Any, Dict, List, NewType, Union from typing_extensions import Literal, TypedDict from ..module.dev_types import ModuleType DeckSchemaVersion3 = Literal[3] DeckSchemaVers...
2,113
719
import math import torch import torch.nn as nn from torch.autograd import Variable from torchvision import models defaultcfg = { 11 : [64, 'M', 128, 'M', 256, 256, 'M', 512, 512, 'M', 512, 512], 13 : [64, 64, 'M', 128, 128, 'M', 256, 256, 'M', 512, 512, 'M', 512, 512], 16 : [64, 64, 'M', 128, 128, 'M', 256...
2,803
1,309
""" Preprocessing script for Stanford Sentiment Treebank data. """ import os import glob # # Trees and tree loading # class ConstTree(object): def __init__(self): self.left = None self.right = None def size(self): self.size = 1 if self.left is not None: self.size...
11,555
3,627
import warnings from collections import namedtuple import torch import torch.nn as nn import torch.nn.functional as F from torch import Tensor import torch.utils.model_zoo as model_zoo from typing import Optional, Tuple, List, Callable, Any from modules.layers import * __all__ = ['GoogLeNet', 'googlenet', "GoogLeNetO...
12,703
4,956
q = int(raw_input().strip()) for a0 in xrange(q): s=raw_input().strip() # if s.startswith('0'): # print "No" # print s.find('1') # print s.rfind(s,a0,a0-1) # posof1 = s.find('1') digits = [str(x) for x in str(s)] print digits for digit in len(digits): if digits[digit]-dig...
375
148
import requests from ..exceptions import ClientError class PGDBClient(object): """ Simple client for interacting with ISCAN servers. """ def __init__(self, host, token=None, corpus_name=None): self.host = host self.token = token if self.host.endswith('/'): self.hos...
8,457
2,227
import numpy as np import matplotlib.pyplot as plt from matplotlib.animation import FuncAnimation import matplotlib.animation as animation from matplotlib import rcParams import matplotlib.patches as patches rcParams['font.family'] = 'Times New Roman' rcParams['font.size'] = 20 rcParams['axes.edgecolor'] = (0.0, 0.0, ...
2,745
1,122
# Copyright (C) 2015-2021 Virgil Security, Inc. # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # (1) Redistributions of source code must retain the above copyright # notice, this li...
12,327
4,778
# coding: utf-8 """ Thingsboard REST API For instructions how to authorize requests please visit <a href='http://thingsboard.io/docs/reference/rest-api/'>REST API documentation page</a>. OpenAPI spec version: 2.0 Contact: info@thingsboard.io Generated by: https://github.com/swagger-api/swagger-co...
30,394
7,788
import os import subprocess from pathlib import Path from PIL import Image import errno import time from re import search CONVERT_PNG_TO_JPG = False TOTAL_ORIGINAL = 0 TOTAL_COMPRESSED = 0 TOTAL_GAIN = 0 TOTAL_FILES = 0 QUALITY = 85 def compress(location): for r, d, f in os.walk(location): for item in d:...
5,268
1,486
import os import typing from typing import Any, Callable, List, Tuple, Union import numpy as np from ..data_processor.readers import preprocess_image, read_image, restore_image from ..data_processor.visualizer import show_important_parts, visualize_image, save_image from ..common.paddle_utils import init_checkpoint, t...
16,968
4,904
from opendc.models.portfolio import Portfolio from opendc.models.scenario import Scenario from opendc.models.topology import Topology from opendc.util.rest import Response def POST(request): """Add a new Scenario for this Portfolio.""" request.check_required_parameters(path={'portfolioId': 'string'}, ...
2,106
488
# Copyright 2020 Rastko Sknepnek, University of Dundee, r.skepnek@dundee.ac.uk # # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated # documentation files (the "Software"), to deal in the Software without restriction, including without limitation # the rights ...
1,906
673
# -*- coding: utf-8 -*- # vim:se fenc=utf8 noet: from __future__ import (unicode_literals, division, absolute_import, print_function) try: import vim except ImportError: vim = {} from powerline.bindings.vim import (vim_get_func, buffer_name) from powerline.theme import requires_segment_info @requires_segment_info ...
884
313
from fastapi.security import OAuth2PasswordRequestForm from fastapi import APIRouter, Depends, HTTPException, status from datetime import timedelta from starlette.responses import JSONResponse from db.crud.users import blacklist_token from db.session import get_db from core import security from core.auth import authe...
2,844
859
import os import enum from aqt.qt import QDialog, QGraphicsScene, QGraphicsRectItem, QGraphicsEllipseItem, QApplication from aqt.qt import Qt, QPen, QGraphicsItem, QPixmap, QRectF, QPainter from aqt.qt import QPointF, QBrush, QColor, QPainterPath, QIcon, QSize, QPalette from aqt.utils import showInfo from ..sr_occlu...
5,530
1,846
""" Configuration class for handling configs with a given default. If you need custom functionality or need to apply post_processing to parsed config, simply extend this class. Example: ``` class FenceConfig(Config): def __init__(self, *args, **kwargs): super(FenceConfig, self).__init__(*args, **kwargs) ...
13,371
3,622
# coding:utf-8 # Type: Public import numpy as np import common.Math as cMath import math class CarlrUtils(object): Author = "BaoChuan Wang" AllowImport = False @staticmethod def get_direction_vector_series_and_car_to_next_waypoint_ratio( carla_engine, start_waypoint_xy_array...
8,150
3,113
import torch.nn as nn import torch.nn.functional as F class ResBlock(nn.Module): def __init__(self, inFeatures): super(ResBlock, self).__init__() self.conv = nn.Sequential(nn.ReflectionPad2d(1), nn.Conv2d(inFeatures, inFeatures, 3), nn.InstanceNorm2d(inFeatures), nn.ReLU(inplace=True),...
2,413
1,261
from stable_baselines3.bear.policies import BearPolicy from stable_baselines3.bear.bear import BEAR
99
33
#!/usr/bin/python """ This is written by Zhiyang Ong to modify text (non-binary) files. Synopsis: Script to modify text (non-binary) files. Revision History: 1) November 11, 2014. Initial working version. The MIT License (MIT) Copyright (c) <2014> <Zhiyang Ong> Permission is hereby granted, f...
5,194
1,822
import pydicom from tqdm import tqdm import pandas as pd import os import time import glob import numpy as np from pydicom import _dicom_dict as dc from constants import * import string def dcmtag2df(folder: str, list_of_tags: list): """ # Create a Pandas DataFrame with the <list_of_tags> DICOM tags # from...
8,771
2,604
# -*- coding: utf-8 -*- """ eve-swagger ~~~~~~~~~~~ swagger.io extension for Eve-powered REST APIs. :copyright: (c) 2015 by Nicola Iarocci. :license: BSD, see LICENSE for more details. """ try: from collections import OrderedDict except ImportError: from ordereddict import OrderedDict # no...
430
159
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ _ / | | __ _ __ _ / | / |_||_|| || / | / | |\ | ||_ /____ |__/\ . | | \|_|\_| __________________________ . ███████╗██████╗ ██████╗ ██████...
9,005
3,200
print("Lukas Ho, pronouns: he/him")
35
16
# coding: utf-8 from __future__ import absolute_import from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 from swagger_server.models.base_model_ import Model from swagger_server.models.preferences import Preferences # noqa: F401,E501 from swagger_server import util class...
2,965
890
import torch import torch.nn as nn import torch.optim as optim import numpy as np import time import logging from sklearn.metrics import roc_auc_score from sklearn.cluster import KMeans from sklearn.manifold import TSNE from src.models.optim.Loss_Functions import DMSADLoss from src.utils.utils import print_progessbar ...
14,649
4,296
from __future__ import print_function, unicode_literals from escher import __schema_version__ import escher.server from escher import Builder, get_cache_dir, clear_cache from escher.plots import (_load_resource, local_index, server_index, model_json_for_name, map_json_for_name) from escher.u...
7,600
2,740
from setuptools import find_packages, setup setup( name="casualty", version="0.1.9", packages=find_packages(exclude=["tests"]), install_requires=[ "structlog==18.2.0", "wrapt==1.10.11", "pre-commit-hooks==1.4.0", "mock==2.0.0", "pytest==3.8.2", "pytest-m...
656
259
import time from ..utils.log import log, INFO, ERROR, PASS from ..utils.isaac import submit_login_form, assert_logged_in from ..utils.i_selenium import assert_tab, image_div from ..utils.i_selenium import wait_for_xpath_element, wait_for_invisible_xpath from ..tests import TestWithDependency from selenium.common.except...
5,321
1,646
import re import sqlite3 conn = sqlite3.connect('loc.db') c = conn.cursor() c.execute('CREATE TABLE IF NOT EXISTS location(loc text PRIMARY KEY, code text)') conn.commit() f = open('loc_code.txt') for d in f.readlines(): data = re.sub(r'\s{2}', '|', d.strip()).split('|') print data[1].strip(), data[0] c....
423
155
# This file was automatically generated by SWIG (http://www.swig.org). # Version 3.0.12 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. from sys import version_info as _swig_python_version_info if _swig_python_version_info >= (2, 7, 0): def swig_im...
33,479
11,818