content
stringlengths
5
1.05M
from django.contrib.auth.models import User from django.contrib.auth.password_validation import validate_password from django.contrib.contenttypes.models import ContentType from rest_framework import serializers from accounts.api.serializers import UserSerializer from fanfics.models import Fanfic from chapters.model...
from functools import wraps from flask import request, make_response, jsonify, Blueprint from service.invite_service import InviteService class AdminController: def token_required(self, f): @wraps(f) def decorator(*args, **kwargs): token = None if 'x-api-key' in request....
#!/usr/bin/env python 3 # -*- coding: utf-8 -*- import sys if __name__ == '__main__': num = {1: 'one', 2: 'two', 3: 'tree'} num_rev = dict(map(reversed, num.items())) print(num_rev)
# SPDX-License-Identifier: Apache-2.0 # Licensed to the Ed-Fi Alliance under one or more agreements. # The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0. # See the LICENSE and NOTICES files in the project root for more information. from typing import Tuple from unittest.mock import Mag...
# File: ErrorWindow.py # Author: Marvin Smith # Date: 6/18/2015 # # Purpose: Show the user an error. # __author__ = 'Marvin Smith' # LLNMS Libraries import UI_Window_Base # Python Libraries import curses # ------------------------------ # # - Error Window - # # -------------------...
from PyQt5 import QtGui
# this holds the views for the adminLTE class Profile(object): def __init__(self): print "init" def render(data): print data
""" Created on Fri Fev 13 16:26:00 2020 @author: Bruno Aristimunha """ import sys import scipy.io as sio from pandas import DataFrame from numpy import array from os import listdir from os.path import isfile, join from myMNE import makeMNE def files_in_path(path): return [path+"/"+f for f in listdir(path) if isf...
# AUTOGENERATED! DO NOT EDIT! File to edit: 00_retrieve_spot.ipynb (unless otherwise specified). __all__ = ['cred', 'get_tracks', 'track_reduce', 'update'] # Cell import requests import base64 import json import pandas as pd import boto3 import math from datetime import date, timedelta # Cell def cred(): secret...
from tinderbotz.helpers.storage_helper import StorageHelper class Geomatch: def __init__(self, name, age, work, study, home, gender, bio, distance, passions, image_urls): self.name = name self.age = age self.work = work self.study = study self.home = home self.gende...
# %% [markdown] # # Metadata Organization # ## Imports import pandas as pd import numpy as np import os.path import glob import pathlib import functools import time import re import gc from nilearn.input_data import NiftiMasker import matplotlib as plt plt.use('Agg')#needed because we don't have an X window system on...
import unittest import asyncio from lichess_client.clients.base_client import BaseClient from tests.utils import async_test, get_token_from_config class TestBaseClient(unittest.TestCase): event_loop = None client: 'BaseClient' = None token = get_token_from_config(section='amasend') @classmethod ...
from setuptools import setup # Get package version import os version = {} with open(os.path.join('dykstra', 'version.py')) as fp: exec(fp.read(), version) __version__ = version['__version__'] setup( name='Dykstra', version=__version__, description="An implementation of Dykstra's projection algorithm w...
#!/usr/bin/env ambari-python-wrap """ Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the...
# This file contains all the UUIDs for each service to try and cut it down. # Also contains all the descriptors # Generic UUIDs FIRMWARE_VERSION = "2021.04.06.1" DEVINFO_SVC_UUID = "180A" FIRMWARE_SVC_UUID = "0000180a-0000-1000-8000-00805f9b34fb" MANUFACTURE_NAME_CHARACTERISTIC_UUID = "2A29" FIRMWARE_REVISION_CHARACTE...
#!/usr/bin/env python # -*- coding: utf-8 -*- from bs4 import BeautifulSoup import executiveorder from executiveorder.processors import * def main(): wikisource.run() if __name__=="__main__": main()
# Generated by Django 4.0 on 2021-12-23 21:34 from django.db import migrations, models import users.models class Migration(migrations.Migration): dependencies = [ ('users', '0002_customuser_bio_customuser_short_bio'), ] operations = [ migrations.AlterField( model_name='custo...
"""Initial experiments with the lenet network to check the trends of the time with k, batch and parallelism""" import argparse import time from multiprocessing import Process from typing import Tuple from common.experiment import * from common.metrics import start_api from common.utils import * output_folder = './te...
""" 1) Define two variables – one to save user's name and one to save user's age 2) Create 2 functions with each to get name and age from the command prompt 3) Create a function which prints the name and age 4) Create a function which calculates and returns the number of decades the user already lived (e....
""" Magnitude Pruner by weight """ from typing import List import numpy as np from lowrank.pruners import AbstractPrunerBase class WeightMagPruner(AbstractPrunerBase): """ Magnitude pruners scores singular vectors based on magnitude of the vector """ def compute_scores(self) -> List[np.ndarray]: ...
from bokeh.io import show from bokeh.plotting import figure import datetime import argparse from bokeh.models import NumeralTickFormatter def line_plot(p, x, y, line_width = 2, legend=None): p.line(x,y, line_width =line_width,legend=legend ) p.yaxis.formatter=NumeralTickFormatter(format="0,") show(p)
#!/usr/bin/env python3 # clang-tidy review # Copyright (c) 2020 Peter Hill # SPDX-License-Identifier: MIT # See LICENSE for more information import argparse import itertools import fnmatch import json import os from operator import itemgetter import pprint import re import requests import subprocess import textwrap i...
from django import template from bc.alerts.models import Alert register = template.Library() @register.simple_tag def get_alerts(page): return Alert.get_alerts_for_page(page)
import glob import json import os import shlex import subprocess import sys import click import yaml __version__ = '1.2.1' # Takes information about command and creates an argument list from it # In addition to an argument list, a 'cleaner' string is returned to be shown to the user # This essentially replaces 'pyt...
from django.conf import settings from classification.models.classification import ClassificationImport, \ ClassificationImportAlleleSource, Classification from library.log_utils import report_exc_info from snpdb.clingen_allele import populate_clingen_alleles_for_variants from snpdb.liftover import create_liftover_...
""" This file contains the residuals for testing GLM. All residuals were obtained with Stata. The residuals are column ordered as Pearson, Deviance, Working, Anscombe, and Response Residuals """ import numpy as np lbw = [-.67369007, -.86512534, -.06703079, -.93506245, -.31217507, -.38301082, -.52323205, -.0...
class Calculator: def add(self, op1, op2): if (op1 < 0 or op2 < 0): raise ArithmeticError("No se permiten valores negativos") return op1 + op2 def minus(self, op1, op2): if (op1 < 0 or op2 < 0): raise ArithmeticError("No se permiten valores negativos") ret...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ (c) 2018 Brant Faircloth || http://faircloth-lab.org/ All rights reserved. This code is distributed under a 3-clause BSD license. Please see LICENSE.txt for more information. Created on 14 April 2018 16:12 CDT (-0500) """ import os import re import glob import Conf...
from web import SPACES from lang import trn _langs = 'EN', 'CZ' def page(web): yield web.heading( 2, trn['Choose Language']) yield web.table_head((trn['Language'], ''), 'frame="hsides"', 'style="text-align:left"') for l in _langs: yield web.table_row((l, web.button(trn['Use'], 'lnguse', (('l...
"""More comprehensive traceback formatting for Python scripts. Original version know as cgitb written By Ka-Ping Yee <ping@lfw.org> Modified for Webware by Ian Bicking <ianb@colorstudy.com> """ import inspect import keyword import linecache import os import pydoc import sys import tokenize from types import MethodTyp...
import random as rnd import numpy as np from imblearn.over_sampling import SMOTE from sklearn.linear_model import SGDClassifier from ..utils import augmented_rvalue, DataChecker, generate_features class MOS(DataChecker): """ Performs Minimizing Overlapping Selection under SMOTE (MOSS) or under No-Sampli...
# -*- coding: utf-8 -*- # Generated by Django 1.11.29 on 2021-04-30 06:16 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('mooringlicensing', '0107_...
""" In this solution, the caller function passes the set of values to the callee function. Then, the callee function retrieves the callee's last executed line of code and uses a regular expression to guess the identifiers that were used. > As I said, I don't recommend using that, nor would I ever use such a hack. > ...
# Programa 4.6 - Categoria x preço '''Tabela 4.1 - Categoria de produtos e preço Categoria Preço 1 10,00 2 18,00 3 23,00 4 26,00 5 31,00 ''' categoria = int(input("Digite a ...
class Consumer: def __init__(self, w): "Initialize consumer with w dollars of wealth" self.wealth = w def earn(self, y): "The consumer earns y dollars" self.wealth += y def spend(self, x): "The consumer spends x dollars if feasible" new...
# Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import argparse import errno import os def make_directories(path): try: os.makedirs(path) except OSError as exc: if exc.errno == errno.EEXIST an...
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0 # AWS X-ray support from aws_xray_sdk.core import xray_recorder from aws_xray_sdk.ext.flask.middleware import XRayMiddleware from aws_xray_sdk.core import patch_all patch_all() xray_recorder.begin_segment("Videos-in...
import pandas as pd # pd.options.mode.chained_assignment = None import numpy as np import lightgbm as lgb from sklearn import preprocessing from sklearn.model_selection import train_test_split,cross_val_score,cross_val_predict from sklearn.ensemble import RandomTreesEmbedding, RandomForestClassifier, GradientBoostin...
import json import numpy as np import math from bokeh.plotting import figure, output_file, show, gridplot,save from bokeh.models import ColumnDataSource, LabelSet, HoverTool, Div, Label, CustomJS, Span from bokeh.models.widgets import Panel, Tabs from datetime import date import re def missing_plot(source,missing_va...
#!/usr/bin/env python3 def parse(fname): rules, messages = dict(), [] for ll in map(str.rstrip, open(fname).readlines()): if ': ' in ll: left, right = ll.replace('"', '').split(': ') if len(right) == 1: rules[left] = right else: rules[l...
from src.data import Problem, Case, Matter from src.operator.solver.common.color import only_color class AutoAddColor: def __init__(self): pass @classmethod def matter(cls, m: Matter, op: str, const: int, color_add: int) -> Matter: assert m.a is not None if op == "<=": ...
from .gradient_ascent import *
#!/usr/bin/env python # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # Michael A.G. Aivazis # California Institute of Technology # (C) 1998-2003 All Rights Reserved # # <LicenseText> # # ~~~~~~~~~~...
# -*- coding: utf-8 -*- # example/simple/views.py from django.http import HttpResponse from authomatic import Authomatic from authomatic.adapters import DjangoAdapter from config import CONFIG authomatic = Authomatic(CONFIG, 'a super secret random string') def home(request): # Create links and OpenID form to t...
import torch import torch.nn as nn import torch.nn.functional as F a1 = torch.randn(10,11,requires_grad=True) x = a1.chunk(10,0) a,b = x[0],x[1] b1 = a+b c = b1*2 c.backward() a.grad b.grad a1.grad a3 = a1+a2 a3 c = a3*2 c.backward() a2.grad a1.grad
import _sqlite3 mydb = _sqlite3.connect(database = 'namelist') with mydb: cur = mydb.cursor() selectquery = 'SELECT * FROM users' cur.execute(selectquery) results = cur.fetchall() print('Original data: ') for row in results: print(row) cur = mydb.cursor() updatequery = 'U...
import csv import os from golem.core import utils def save_test_data(root_path, project, full_test_case_name, test_data): if test_data[0]: tc_name, parents = utils.separate_file_from_parents(full_test_case_name) data_directory_path = os.path.join(root_path, 'projects', project, 'data', ...
import numpy as np from skimage.filters import gabor_kernel import cv2 class KernelParams: def __init__(self, wavelength, orientation): self.wavelength = wavelength self.orientation = orientation def __hash__(self): return hash((self.wavelength, self.orientation)) def __eq__(se...
#!/usr/bin/python import os, sys from wallaby import * import constants as c import motors as m def wait_4_button(): print("waiting for button") ao() while right_button() == 0: pass print("pressed") def line_follow(speed, time): #Cheet for the curved line while analog(c.ET) < 2000: ...
# Copyright 2014 Cloudera 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, so...
#!/usr/bin/python import json import os import sys import time import xmlrpclib if len(sys.argv) != 7: print("Must provide 6 arguments.{} {} {} {} {} {} {}".format(sys.argv[0], "job_name","LAVA_KEY", "kernel_image","kernel_modules_archive", "lttng_modules_archive", "tools_commit")) sys.exit() job_nam...
__all__ = ['VERSION', 'version_info'] VERSION = '1.4a1' def version_info() -> str: import platform import sys from importlib import import_module from pathlib import Path from .main import compiled optional_deps = [] for p in ('typing-extensions', 'email-validator', 'devtools'): ...
# -*- coding: utf-8 -* # @Time : 2020/11/10 15:00 import json from fastapi import APIRouter, Depends, Query from sqlalchemy.orm import Session from starlette.requests import Request from app.api.utils.responseCode import resp_200 from app.common.deps import get_db from app.config.development_config import settings fr...
import six import math if six.PY3: ZERO_LONG = 0 else: ZERO_LONG = long(0) # noqa class EWMA(object): """ Exponentially-weighted moving avergage. Based on the implementation in Coda Hale's metrics library: https://github.com/codahale/metrics/blob/development/metrics-core/src/main/java/c...
#!/usr/bin/env python """ Simple web server for WSGI applications using only Python standard libraries """ import sys from wsgiref import simple_server from optparse import OptionParser usage = """python wsgirunner.py [options] arg where arg is the name of a Python module arg.py which contains a WSGI-compliant web a...
''' Gauged - https://github.com/chriso/gauged Copyright 2014 (c) Chris O'Hara <cohara87@gmail.com> ''' from gauged.drivers import parse_dsn, SQLiteDriver from .test_case import TestCase class TestDSN(TestCase): '''Test the driver functions''' def test_stripping_dialect_from_schema(self): driver = p...
"""Auto-generated file, do not edit by hand. BR metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_BR = PhoneMetadata(id='BR', country_code=55, international_prefix='00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)', general_desc=PhoneNumberDesc(national_number_pattern='[1-46...
#!/usr/bin/env python3 import os.path from os import path import json import base64 import bibtexparser import markovify from PIL import Image import numpy as np from wordcloud import WordCloud, STOPWORDS researchAreas = ['economics','biology','computerscience','math','astronomy','chemistry','psychology',...
# # PySNMP MIB module WHISP-APS-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/WHISP-APS-MIB # Produced by pysmi-0.3.4 at Wed May 1 15:36:25 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 201...
from django.conf.urls import url from . import api urlpatterns = [ url(r'district/$', api.GetDistrictView.as_view()), ]
from osbot_browser.javascript.ArrayExpression import ArrayExpression from osbot_browser.javascript.AssignmentExpression import AssignmentExpression from osbot_browser.javascript.BinaryExpression import BinaryExpression from osbot_browser.javascript.BlockStatement import BlockStatement from osbot_browser.javascript.Brea...
@pytest.mark.skip(reason="no way of currently testing this") def test_the_unknown(): pass def test_1(): if True: pytest.skip("unsupported configuration") @pytest.mark.skipif( "sys.version_info < (3,8)", reason="requires python3.8 or higher" ) def test_2(): pass @pytest.mark.skipif('os.enviro...
from abc import abstractmethod, ABCMeta class Controller(object, metaclass=ABCMeta): @abstractmethod def initialize(self): pass @abstractmethod def act(self, observations, actions): pass @abstractmethod def train(self, rollouts, train_step): pass
import jupytext import textwrap import mistune class Render(mistune.Renderer): def __init__(self, gen): super().__init__() self.gen = gen def header(self, text, level, raw=None): if level == 1: self.gen.gen(f"__toc.title('{text}')") if level == 2: self....
from enum import Enum from pydantic import Field from uuid import UUID from .base import BaseModel class ReportState(Enum): NotApplicable = 'not-applicable' Good = 'good' Monitor = 'monitor' Repair = 'repair' Retire = 'retire' class ReportElement(BaseModel): id: UUID = Field(...) title...
import os import sys sys.path.append(os.path.abspath(os.path.join(__file__, "../../../.."))) import argparse import json import v1.lib.s3.rgw as rgw_lib import v1.utils.log as log import yaml from v1.lib.io_info import AddIOInfo from v1.lib.s3.rgw import Config from v1.utils.test_desc import AddTestInfo def test_ex...
import datetime from django.shortcuts import render, get_object_or_404, HttpResponseRedirect from django.views import generic from django.utils import timezone from django.urls import reverse from django.core.paginator import Paginator from .models_posts import Post, PostComment from .models import Category, Partner ...
from days.day21 import get_goodfood_count from days.day21 import get_badfood from utils.reading_data import get_string_input_array input = get_string_input_array(path="2020/test/data/day21.txt") def test_get_goodfood_count(): expected = 5 actual = get_goodfood_count(input) assert expected == actual def...
import cv2 as cv import sys import numpy as np import matplotlib.pyplot as plt img = cv.imread("img/test.png") if img is None: sys.exit("Could not read the image.") cv.imshow("image", img) hsv = cv.cvtColor(img,cv.COLOR_BGR2HSV) hist = cv.calcHist([hsv], [0, 1], None, [180, 256], [0, 180, 0, 256]) plt.imshow(h...
''' Auto Response Module ''' from modules.parser.models import (ChildMetadataType, CompoundMetadataType, MetadataType, get_child_objects) class AutoResponseRule(CompoundMetadataType): ''' AutoResponseRule Child Metadata Implementation ''' TAG_NAME = 'autoResponseRule' PA...
import os import marmot def ConlluToConll2009(conllu2016Path): with open(conllu2016Path) as corpusFile: lines = corpusFile.readlines() Conll2009Text = '' for line in lines: if len(line) > 0 and line.endswith('\n'): line = line[:-1] if line.startswi...
from EvaMap.Metrics.metric import metric def duplicatedRules(g_onto, liste_map, g_map, raw_data, g_link) : result = metric() result['name'] = "Duplicated rules" result['score'] = 1 if len(liste_map) > len(g_map): result['score'] = len(g_map)/len(liste_map) # Propriété d'un graph RDF res...
''' configs & settings are defined in this file ''' from os.path import join from os.path import abspath from os.path import dirname from os import pardir from datetime import datetime import numpy as np class Config(object): # directory paths CURRENT_DIR = abspath(dirname(__file__)) ROOT_DIR = abspat...
from django import forms from django.contrib.auth import authenticate class AuthenticationForm(forms.Form): code = forms.CharField(max_length=254) error_messages = { 'invalid_login': "An error occurred when trying to log in" } def __init__(self, request=None, *args, **kwargs): self.r...
derived_age_to_age_start = { 0: "1.1", 32: "1.1", 127: "1.1", 160: "1.1", 173: "1.1", 174: "1.1", 502: "3.0", 506: "1.1", 536: "3.0", 544: "3.2", 545: "4.0", 546: "3.0", 564: "4.0", 567: "4.1", 578: "5.0", 592: "1.1", 681: "3.0", 686: "4.0", 68...
from layout import create_image
""" Shared memory across multiple machines to the heavy AJAX lookups. Select2 uses django.core.cache_ to share fields across multiple threads and even machines. Select2 uses the cache backend defined in the setting ``SELECT2_CACHE_BACKEND`` [default=``default``]. It is advised to always setup a separate cache server...
import unittest import os import json from datetime import datetime from unittest.mock import MagicMock, patch from src.notifiers.json_entry_writer import JsonEntryWriter, FileType from src.status_tracker import Status, StatusChange from src.connection_entry import ConnectionEntry connection_entry_data = [ { ...
from sapextractor.algo import ap_ar, o2c, p2p, factory
import unittest from rocktype.rocktype import Rocktype class RocktypeTest(unittest.TestCase): def test_something(self): assert str(Rocktype()) == "Rocktype"
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'BatchProcessing.ui' # # Created by: PyQt5 UI code generator 5.9.2 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_BatchProcessing(object): def setupUi(self, BatchProcessing):...
# -*- coding: utf-8 -*- """ Created on Mon Jun 19 10:09:38 2017 @author: tih """ import os import watertools.General.raster_conversions as RC import watertools.General.data_conversions as DC import numpy as np import pandas as pd def Calc_Humidity(Temp_format, P_format, Hum_format, output_format, Startdate, Enddate,...
class SimIo: def __init__(self, sim, name, getter, setter): self.sim = sim self.name = name self.getter = getter self.setter = setter def get(self): if self.getter is None: raise NotImplementedError return self.getter() def set(self, ...
#!/usr/bin/env python3 # Copyright (c) 2015-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Utilities for manipulating blocks and transactions.""" from .mininode import * from .script import CSc...
from abc import ABC from workflow.ui import get_path_folder from workflow.ms_sql_handler import ms_sql_handler from workflow.ssh_handler import ssh_handler from workflow.reader import read_json from workflow.ui import get_path from workflow.ui import get_path_folder from workflow.writer import write_json import time im...
import math from math import floor import numpy as np import torch import torch.nn as nn from cross_correlation import xcorr_torch from spectral_tools import gen_mtf def net_scope(kernel_size): """ Compute the network scope. Parameters ---------- kernel_size : List[int] ...
from test_common import * init_common_redis("192.168.0.11", "192.168.0.22", "192.168.0.33") compare_all()
# # # Author: Mahmoud Bassiouny <mbassiouny@vmware.com> from device import Device from window import Window from actionresult import ActionResult from menu import Menu class SelectDisk(object): def __init__(self, maxy, maxx, install_config): self.install_config = install_config self.menu_items ...
"""take meta argument and run the injection infrastructure""" import os, sys, time, glob sys.path.append("..") from ctest_const import * from program_input import p_input from parse_input import * from inject import inject_config from run_test import run_test_seperate run_mode = p_input["run_mode"] mapping = parse_...
#!/usr/bin/env python # coding: utf-8 from __future__ import absolute_import, division, print_function, unicode_literals import os, sys, unittest, tempfile, json, io, platform, subprocess sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) from yq import yq, cli # noqa USING_PYTHON2 ...
a,b = [int(i) for i in input().split()] diff = {} m = 0 for i in range(1,a+1): for j in range(1,b+1): k = i+j if not k in diff: diff[k] = 1 else: diff[k] += 1 m = max(m,diff[k]) for n in diff.keys(): if diff[n] == m: print(n)
# coding: utf-8 """ Logic module for locations and object location assignments. Locations are fully user-defined using a name and a description. Users with WRITE permissions for an object can assign it to a location with an optional description for details on where the object is stored. """ import collections import ...
from django.conf.urls import include, url from provisioner.views import ProvisionStatus, login urlpatterns = [ url(r'^$', ProvisionStatus, name='home'), url(r'login.*', login), url(r'^events/', include('events.urls')), url(r'^provisioner/', include('provisioner.urls')), ]
from .cachedir import *
""" This file is part of the TheLMA (THe Laboratory Management Application) project. See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information. Trac tools dealing with ISO Trac tickets. AAB, Mar 2012 """ from StringIO import StringIO from tractor import AttachmentWrapper from tractor import create_w...
from floodsystem.stationdata import build_station_list from floodsystem.geo import stations_within_radius from floodsystem.utils import sorted_by_key def run(): """Requirements for Task 1C""" # Build list of stations all_stations = build_station_list() #cambridge centre centre = (52.2053, 0.1218...
# Copyright (C) 2019 Yanwei Fu, Chen Liu, Fudan University # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. # The ASF 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 Lice...
import unittest import igraph import collections import json from h3.tree import Tree """ Customized print tree to terminal Note: implemented by recursion, not scalable to a large number of nodes, only suitable for a small number of nodes """ def print_tree(tree, node_id, depth=0): children = tree.nodes[...
import logging import paddle UNK = 0 logger = logging.getLogger("paddle") logger.setLevel(logging.INFO) def mode_attr_name(mode): return mode.upper() + "_MODE" def create_attrs(cls): for id, mode in enumerate(cls.modes): setattr(cls, mode_attr_name(mode), id) def make_check_method(cls): """ ...
#!/usr/bin/env python import argparse from bioblend import galaxy import json def main(): """ This script uses bioblend to import .ga workflow files into a running instance of Galaxy """ parser = argparse.ArgumentParser() parser.add_argument("-w", "--workflow_path", help='Path to workflow file...