text stringlengths 2 999k |
|---|
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import socket
import struct
import random
import time
import urllib2
from config import is_port_open, is_http
def random_str(len):
str1 = ""
for i in range(len):
str1 += (random.choice("ABCDEFGH1234567890"))
return str(str1)
# @is_port_open
def verify... |
import logging
from dvc.cache import NamedCache
from dvc.exceptions import InvalidArgumentError
from . import locked
logger = logging.getLogger(__name__)
def _do_gc(typ, remote, clist, jobs=None):
from dvc.remote.base import Remote
removed = Remote.gc(clist, remote, jobs=jobs)
if not removed:
... |
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
#
# 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, includin... |
# -*- coding: utf-8 -*-
#
# 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
#... |
import sys
import argparse
import json
# ----------------------------------------
# Helpers
# ----------------------------------------
module_header = """
from trame import get_app_instance
from trame.html import AbstractElement, Template
# Make sure used module is available
_app = get_app_instance()
if "vuetify" no... |
astring = "Hello world!"
print("single quotes are ' '")
print(len(astring))
astring = "Hello world!"
print(astring.index("o"))
astring = "Hello world!"
print(astring.count("l"))
astring = "Hello world!"
print(astring[3:7])
astring = "Hello world!"
print(astring[3:7:2])
astring = "Hello world!"
print(astring[3:7])... |
import json
import setuptools
kwargs = json.loads(
"""
{
"name": "ros-cdk-mongodb",
"version": "1.0.3",
"description": "Aliyun SDK Copyright (C) Alibaba Cloud Computing All rights reserved. http://www.aliyun.com",
"license": "Apache-2.0",
"url": "https://github.com/aliyun/Resource-Orchestration... |
import pytest
import paramsurvey
def test_only_builtins():
with pytest.raises(ValueError):
paramsurvey.init()
|
"""Rofication indicator
https://github.com/DaveDavenport/Rofication
simple module to show an icon + the number of notifications stored in rofication
module will have normal highlighting if there are zero notifications,
"warning" highlighting if there are nonzero notifications,
... |
#!/usr/bin/env python3
"""
Merge Sort Script
"""
def merge_sort(L):
"""
Sorts a list in increasing order.
This algorithm uses merge sort.
@param L: a list (in general unsorted)
@return: a reference containing an ascending order
sorted version of L
"""
def... |
import codecs
import os
import platform
import re
import sys
from setuptools import Extension, setup
NO_EXTENSIONS = bool(os.environ.get("MULTIDICT_NO_EXTENSIONS"))
if sys.implementation.name != "cpython":
NO_EXTENSIONS = True
CFLAGS = ["-O2"]
# CFLAGS = ['-g']
if platform.system() != "Windows":
CFLAGS.exte... |
# -*- coding: utf-8 -*-
'''
'''
from urllib.request import build_opener, HTTPCookieProcessor, ProxyHandler
from urllib.parse import urlencode
from http.cookiejar import CookieJar
import pprint
import json
from bs4 import BeautifulSoup
import os
import argparse
def authenticate(mail_add, passwd):
"""Activate nico... |
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RRcpparmadillo(RPackage):
"""'Rcpp' Integration for the 'Armadillo' Templated Linear Algeb... |
# -*- coding: utf-8 -*-
import unittest
from argparse import Namespace
from io import StringIO
from comet.models import CometRanker
from comet.models.utils import average_pooling, max_pooling
import torch
class TestCometRanker(unittest.TestCase):
hparams = Namespace(
**{"encoder_model": "LASER", "pretr... |
#
# Copyright 2019 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. T... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020-2022 F4PGA Authors
#
# 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
#
# Unl... |
# sector.py -- Sector class definition and related functions
#
# Copyright (c) 2020 Steve Simenic <orffen@orffenspace.com>
#
# This file is part of the Cepheus Engine Toolbox and is licensed
# under the MIT license - see LICENSE for details.
from dice import *
from world import *
from typing import Dict
import sys
c... |
# GENERATED BY KOMAND SDK - DO NOT EDIT
import komand
import json
class Component:
DESCRIPTION = "Upload multiple threat reports in one request"
class Input:
REPORTS = "reports"
class Output:
REPORTS = "reports"
class SubmitReportsInBulkInput(komand.Input):
schema = json.loads("""
{
... |
# -*- coding: utf-8 -*-
'''
:codeauthor: Jayesh Kariya <jayeshk@saltstack.com>
'''
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import TestCase
from tests.suppo... |
# Copyright © 2019-2021 HQS Quantum Simulations GmbH. 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 required... |
#!/usr/bin/env python3
r"""
usage: _cspsh3.py [-h] [-c COMMAND]
chat over programs written as "communicating sequential processes"
options:
-h, --help show this help message and exit
-c COMMAND take the command as the only input, else as the first input before -i
examples:
_cspsh3.py
_cspsh3.py -c'VMCT = ... |
#
# 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 under t... |
# Copyright 2017 The TensorFlow Authors. 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 required by applica... |
#-*-coding:utf-8-*-
import os
import io
import sys
import magic
from raids_h import rehis_zero_pic,rehis_zero
import numpy as np
from PIL import Image
import tensorflow as tf
import base64,time
from config import config_h
_MODEL_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'data/models/1547856517')
_... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests the main tool functionality."""
import unittest
import logging
import inspect
from dftimewolf.cli import dftimewolf_recipes
from dftimewolf.lib import state as dftw_state
from dftimewolf import config
class MainToolTest(unittest.TestCase):
"""Tests for main to... |
import tkinter.font as TkFont
import tkinter
import threading
import math
from time import time, sleep
from sys import exit
from pynput.keyboard import Listener
from pynput import *
def startimer():
global timer;global splitTime;global startime;global splitBeg;global currentSplit;global start;global labels;global ... |
PROPFIND_DATA = """<?xml version="1.0"?>
<a:propfind xmlns:a="DAV:">
<a:prop xmlns:oc="http://owncloud.org/ns">
<oc:checksums/>
<a:getcontenttype/>
</a:prop>
</a:propfind>"""
BASE_URL = "https://polybox.ethz.ch"
WEBDAV_PUBLIC_URL = "https://polybox.ethz.ch/public.php/webdav/"
WEBDAV_REMOTE_URL ... |
#!/usr/bin/env python
# coding: utf-8
# # Python Decisions
# # One way decision
# In[1]:
x = 25
if x > 10:
print('big')
print('it is big')
print('done')
# In[2]:
x = 2
if x > 10:
print('big')
print('it is big')
print('done')
# # Two ways decision
# In[3]:
x = 25
if x > 10:
print('big... |
n=1
integer_list = [n,n+1]
n = len(integer_list)
print(n)
print(integer_list)
t = tuple(integer_list)
print(hash(t))
# integer_list = [int(x) for x in integer_list]
# t=tuple(n,integer_list)
# hash(t) |
"""
Description
The collection of attachments of the specified entity.
URL:
http://host:port/qcbin/rest/domains/{domain}/projects/{project}/{Entity Type}/{Entity ID}/attachments
HTTP Methods
GET: Retrieves the list of attachments.
PUT: N/A
DELETE: N/A
POST: Creates a new attachment.
"""
|
import torch
def matrix_nms(seg_masks, cate_labels, cate_scores, kernel='gaussian', sigma=2.0, sum_masks=None):
"""Matrix NMS for multi-class masks.
Args:
seg_masks (Tensor): shape (n, h, w)
cate_labels (Tensor): shape (n), mask labels in descending order
cate_scores (Tensor): shape (... |
from flask import Flask
from flask import jsonify
from polyglot.detect import Detector
app = Flask(__name__)
@app.route('/')
def hello():
return 'hello world!'
languageCodes = {
"zh":"zh-CN",
"zh_Hant":"zh-TW",
"zh_Hans":"zh-CN"
}
@app.route('/detect/<text>')
def detect(text):
result = {'result'... |
import tensorflow as tf
weight = tf.Variable(1.0, name="weight")
input_value = tf.constant(0.5, name="input_value")
expected_output = tf.constant(0.0, name="expected_output")
model = tf.multiply(input_value,weight, "model")
loss_function = tf.pow(expected_output - model, 2, name="loss_function")
optimizer = tf.train.... |
import sys as _sys
import pytest
import kbbi
def test_bersihkan_kuki_tidak_ada(mock_lokasi_kuki, tanpa_kuki, capsys):
hasil = kbbi.autentikasi(["--bersihkan"])
tangkap = capsys.readouterr()
assert tangkap.out == "Kuki tidak ditemukan pada kukifix.json!\n"
assert hasil == 1
def test_bersihkan_kuki_... |
"""Certbot client."""
# version number like 1.2.3a0, must have at least 2 parts, like 1.2
__version__ = '1.6.0.dev0'
|
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... |
import logging
import mock
import time
from mock import Mock
from cryptoadvance.specter.util.checker import Checker
def test_checker(caplog):
callback_mock = Mock()
caplog.set_level(logging.DEBUG)
checker = Checker(lambda: callback_mock(), period=0.01)
checker.start()
time.sleep(
0.1
)... |
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Handle version information related to Visual Stdio."""
import os
import glob
from gyp.MSVS import TryQueryRegistryValue
msvs_version_map = {
'auto': ('16.0'... |
import numpy as np
from abc import abstractmethod
from gym import Env
from gym.spaces import MultiDiscrete, Discrete, Box
class IdentityEnv(Env):
def __init__(
self,
episode_len=None
):
self.observation_space = self.action_space
self.episode_len = episode_len
s... |
#!/usr/bin/env python
"""
Compute the enrichment of all ATC codes and all outcomes.
"""
import sys
import csv
from itertools import product
import functools
import collections
import multiprocessing
import pandas as pd
import numpy as np
import scipy.stats
from exphewas.utils import qvalue
import exphewas.db.tree a... |
import json
import datetime
from src.models import Item
from src.models import Flavor
from sqlalchemy import engine
from src.models import Orders
from flask import jsonify, request
from flask.views import MethodView
from src.schema.orders import OrdersSchema
class ClientView(MethodView):
schema = OrdersSchema()
... |
import os
import re
import sys
import time
import math
import random
import subprocess
from appionlib import apFile
from appionlib import apDisplay
from appionlib import apImagicFile
try:
import EMAN2
except:
apDisplay.printError("EMAN2 not found")
####
# This is a low-level file with NO database connections
# Plea... |
"""
Syntax: .info .help .howto
Customized by @meanii
Please Don't remove credit name
"""
import sys
from telethon import events, functions, __version__
from uniborg.util import admin_cmd
@borg.on(admin_cmd(pattern="info ?(.*)"))
@borg.on(events.NewMessage(pattern=r"\.info(.*)",incoming=True))
async def _(event):
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
# print(os.name)
# print(os.environ)
print([x for x in os.listdir('/Users/jiangmingli/myfile/python-learn/io') if os.path.isfile(x) and os.path.splitext(x)[1] == '.py']) |
from logging_utils import info, error
import logging
import requests
import threading
from random import randint
logging.basicConfig(level=logging.DEBUG, format="%(message)s")
def get_pokemon_name(response_json):
name = response_json.get("forms")[0].get("name")
info(f"Pokemon name is: {name}")
def get_name_r... |
"""
Rescue board configuration datamodel
Copyright (c) 2020 The Fuel Rat Mischief,
All rights reserved.
Licensed under the BSD 3-Clause License.
See LICENSE.md
"""
import attr
@attr.dataclass
class BoardConfigRoot:
cycle_at: int = attr.ib(validator=attr.validators.instance_of(int))
|
# Copyright 2014 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 agreed to in writing, s... |
# Authors: Soledad Galli <solegalli@protonmail.com>
# License: BSD 3 clause
from typing import List, Optional, Union
import numpy as np
import pandas as pd
from feature_engine.base_transformers import BaseNumericalTransformer
from feature_engine.variable_manipulation import _define_variables
class ReciprocalTransf... |
#!/usr/bin/env python3
"""
Adapted from https://github.com/numba/conda-recipe-cudatoolkit
BSD 2-Clause License
Copyright (c) 2018 Onwards, Quansight, LLC
Copyright (c) 2017, Continuum Analytics, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted... |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI 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 ... |
class DataGridViewRowHeightInfoNeededEventHandler(MulticastDelegate,ICloneable,ISerializable):
"""
Represents the method that will handle an System.Windows.Forms.DataGridView.RowHeightInfoNeeded event of a System.Windows.Forms.DataGridView control.
DataGridViewRowHeightInfoNeededEventHandler(object: object,m... |
"""Provides python helper functions."""
load("@pydeps//:requirements.bzl", _requirement = "requirement")
def filter_deps(deps = None):
if deps == None:
deps = []
return [dep for dep in deps if dep]
def py_library(deps = None, **kwargs):
return native.py_library(deps = filter_deps(deps), **kwargs)... |
from polygraphy.backend.onnxrt.loader import *
from polygraphy.backend.onnxrt.runner import *
|
# coding=UTF-8
# ex:ts=4:sw=4:et=on
# Copyright (c) 2013, Mathijs Dumon
# All rights reserved.
# Complete license can be found in the LICENSE file.
class RefinableMixin(object):
"""
Mixing for the ~:class:`mvc.models.properties.LabeledProperty` descriptor
that allows the property to be refinable.
When... |
import os
from os.path import dirname, abspath
import numpy as np
from numpy import genfromtxt
from keras.models import Sequential
from keras.layers import Dense
from keras.utils.np_utils import to_categorical
# fix random seed for reproducibility
np.random.seed(100)
project_dir = dirname(dirname(dirname(dirname(abs... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
sys.path.append('../../../')
from rusentrel.classic.ctx.bilstm import run_testing_bilstm
from rusentrel.classic_cv.common import CV_COUNT, \
classic_cv_common_callback_modification_func, \
CV_NAME_PREFIX
if __name__ == "__main__":
run_testing_bilstm... |
from conda_package_handling import cli
cli.cli()
|
#!/usr/bin/env python3
# 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... |
import contextlib
import fnmatch
import io
import math
import os
import re
import shutil
import sys
import tempfile
import textwrap
import zipfile
from datetime import datetime
import requests
import sarge
from .xml import ( # noqa
elementtree_parse_file,
remove_xml_element,
remove_xml_element_file,
... |
default_app_config = 'datahub.investment.investor_profile.apps.InvestorProfileConfig'
|
#
# Parse tree nodes for expressions
#
from __future__ import absolute_import
import cython
cython.declare(error=object, warning=object, warn_once=object, InternalError=object,
CompileError=object, UtilityCode=object, TempitaUtilityCode=object,
StringEncoding=object, operator=object,
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import platform
import optparse
import re
import shutil
import time
__author__ = 'sinlov'
is_verbose = False
is_force = False
level_set = 1
folder_path = os.getcwd()
hint_help_info = """
more information see
"""
enter_error_info = """
Your input e... |
import math
import re
from sales.helpers.exceptions import HMoneyException
millnames = {'K': 6, 'M': 9, 'B': 12}
def abbreviate_to_decimal(value):
"""
Format abbreviate value to decimal
Eg: $739K -> 739000.0
$233.7M -> 233700000.0
$23.3B -> 23300000000.0
"""
validate_patter = r"(... |
"""
jupytercad setup
"""
import json
import sys
from pathlib import Path
import setuptools
HERE = Path(__file__).parent.resolve()
# The name of the project
name = "jupytercad"
lab_path = (HERE / name.replace("-", "_") / "labextension")
# Representative files that should exist after a successful build
ensured_targe... |
import os
from scripts.test import shared
from . import utils
class FeatureValidationTest(utils.BinaryenTestCase):
def check_feature(self, module, error, flag, const_flags=[]):
p = shared.run_process(shared.WASM_OPT +
['--mvp-features', '--print', '-o', os.devnull] +
... |
from mido import MidiFile
from logger import LoggerFactory
import os
import sys
import midi2audio
from midi2audio import FluidSynth
logger = None
def playSongs(inputPath):
songs = os.listdir(inputPath)
for song in songs:
print(song)
songPath = os.path.join(inputPath, song)
mid = MidiF... |
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------
# Alcatel.OS62xx.get_chassis_id
# ----------------------------------------------------------------------
# Copyright (C) 2007-2018 The NOC Project
# See LICENSE for details
# ------------------------------------------------... |
from django.contrib.auth import get_user_model
from django.test import TestCase
from .models import (Blog, BlogLikes, Comment, CommentLikes, SubComment, SubCommentLikes)
from rest_framework.test import APIClient
User = get_user_model()
# Create your tests here.
class BlogTestCase(TestCase):
def setUp(self):
... |
import os
import uuid
from contextlib import contextmanager
from dagster import build_init_resource_context, build_input_context, build_output_context
from hacker_news.resources.snowflake_io_manager import ( # pylint: disable=E0401
connect_snowflake,
snowflake_io_manager,
)
from pandas import DataFrame
def ... |
from datetime import timedelta
from collections import OrderedDict
from django.conf import settings
from constance import config
from djangorestframework_camel_case.render import CamelCaseJSONRenderer
from rest_framework import status
from tars.deployment import constants
from roll_engine import constants as _
mapp... |
import subprocess
import shlex
from time import sleep
import datetime
import shutil
import re
from django.conf import settings
from django.core.files import File
from django.utils import timezone
import thread
import traceback
import tempfile
import pytz
import requests
import os
import zipfile
from kushillu.models im... |
# Get Text and URL in your Twitter favorites which contains URLs
from twitter import *
consumer_key = ''
consumer_secret = ''
access_token = ''
access_token_secret = ''
instance = Twitter(auth=OAuth(access_token, access_token_secret, consumer_key, consumer_secret))
favorites_list = instance.favorites.list(screen_nam... |
# Generated by Django 3.1 on 2020-08-24 06:40
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('shortener', '0003_auto_20200824_0616'),
]
operations = [
migrations.RenameField(
model_name='shortenedurl',
old_name='source',... |
import xarray as xr
from vcm.cubedsphere.coarsen import NUM_TILES, SUBTILE_FILE_PATTERN
def combine_subtiles(subtiles):
"""Combine subtiles of a cubed-sphere dataset
In v.12 of xarray, with data_vars='all' by default, combined_by_coords
broadcasts all the variables to a common set of dimensions, dramatic... |
# Copyright 2020 The Oppia Authors. 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 required by applicable ... |
# -*- coding: utf-8 -*-
# Copyright 2017 IBM RESEARCH. 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
#
# U... |
import mc
import board
def run():
brd = board.Board(5, komi=0)
simulator = mc.MonteCarlo(brd, time=5)
state = brd.start()
simulator.update(state)
while brd.winner(state, [s.bithash() for s in simulator.states]) == 0:
print(state)
move = simulator.get_play()
state = brd.next_... |
from .statistics import *
from .relative_entropy import *
from .statespecific import *
from .visualization import *
from .metrics import *
|
def get_fasta(input, output):
with open(output, 'w') as op:
with open(input, 'r') as fp:
for (i, line) in enumerate(fp):
if i > 0:
now = line.split(',')
now_str = ">" + now[1] + "\n" + now[2] + "\n"
op.write(now_str)
#... |
#!/usr/bin/env python3
import json
import time
import fnmatch
from collections import namedtuple
import jwt
import requests # type: ignore
import boto3 # type: ignore
API_URL = "https://api.github.com/repos/ClickHouse/ClickHouse"
SUSPICIOUS_CHANGED_FILES_NUMBER = 200
SUSPICIOUS_PATTERNS = [
"tests/ci/*",
... |
"""
NNI hyperparameter optimization example.
Check the online tutorial for details:
https://nni.readthedocs.io/en/stable/tutorials/hpo_quickstart_pytorch/main.html
"""
from pathlib import Path
import signal
from nni.experiment import Experiment
# Define search space
search_space = {
'features': {'_type': 'choic... |
#!/usr/bin/env python
# Author: Will Skywalker
# Core Python Programming - Homework 8
import string
def ranran(start, end, increment=1): # 8-1
lst = []
num = start
while num < end:
lst.append(num)
num += increment
return lst
def isprime(num): # 8-4
# for i in xrange(2, num/2)... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
sbpy.data
---------
:author: Michael Mommert (mommermiscience@gmail.com)
``Conf`` contains metadata for ``sbpy`` `~sbpy.DataClass` field names.
``Conf.fieldnames_info`` is a list of dictionaries, one per field, with the keys: `'description'`, `'fie... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
%prog infile [options]
This script combines pairwise alignments, sort and filter the alignments.
Infile expect BLAST tabular format (-m8) or nucmer .coords file.
In order to handle dups, we have to run two monotonic chains in both genomes,
first chain using ref, and ... |
import re
import sys
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
sys.path.insert(0, '../../')
from segmentation.code import tools, splitters, representations
punctuation_pat = re.compile(r"""([!"#$%&\'()*+,-./:;<=>?@[\\\]^_`{|}~])""")
hyphenline_pat = re.compile(r"-\s*\n\s*")
multiwhite_pa... |
import inspect
import six
getargspec = inspect.getargspec if six.PY2 else inspect.getfullargspec
|
"""
Utility functions for preprocessing
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import inspect
from datetime import datetime
def print_start_msg():
"""
Print process starting message
"""
print "%s Running %s" % (datetime.now()... |
from ase.atoms import Atoms
def ase_atoms_to_pytraj_atoms(atoms: Atoms):
pass |
#! /usr/bin/env python3
import subprocess
subprocess.call(["ps", "aux"])
|
#!/usr/bin/env python3
# Copyright (c) 2017-2019 The Rain Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test multiwallet.
Verify that a raind node can load multiple wallet files
"""
import os
import shutil
imp... |
#!/usr/bin/env python3
# Automatic download the question html.
import glob
import os
import urllib.request
import requests
from pycookiecheat import chrome_cookies
oj = {'rqnoj': 'http://www.rqnoj.cn/problem/',
'hdu': 'http://acm.hdu.edu.cn/showproblem.php?pid=',
'zoj': 'http://acm.zju.edu.cn/onlinejudge/s... |
# pip install lxml
from lxml import etree
text='''
<response status="success"><result><address-group>
<entry name="test1">
<dynamic>
<filter>'paupdate' or 'paupdate' </filter>
</dynamic>
<tag>
<member>paupdate</member>
</tag>
</entry>
<entry name="tagTestGroup">
<dynamic>
<f... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from math import log, ceil
from decimal import Decimal
def entropy(x):
'''
calc entropy with a given list
'''
return sum(map(lambda i: - i*log(i, 2), x))
def Shanon(p):
if abs(sum(p) - 1) > 1e-6:
print "Error data."
... |
"""Jabber (XMPP) notification service."""
from concurrent.futures import TimeoutError as FutTimeoutError
import logging
import mimetypes
import pathlib
import random
import string
import requests
import voluptuous as vol
from homeassistant.const import (
CONF_PASSWORD, CONF_RECIPIENT, CONF_RESOURCE, CONF_ROOM, CO... |
"""Initialize and start pygame."""
import pygame
import pygame.gfxdraw
import random
import time
import signal
import numpy as np
import tensorflow as tf
from bullet import Bullet
from fighter import Fighter, Vision
from colors import *
from settings import *
from gene_functions import *
def init_pygame():
"""In... |
"""Auto-generated file, do not edit by hand. PE metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_PE = PhoneMetadata(id='PE', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='1\\d\\d', possible_length=(3,)),
em... |
# -*- coding: utf-8 -*-
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# vispy: gallery 30
"""
Show 10,000 realtime scrolling plots
"""
from vispy import app, scene
import numpy as np
canvas = scene.SceneCanvas(keys='interactive',... |
import redis
from django.conf import settings
from django.http import JsonResponse
from django.views import View
from utils.locations import LOCATIONS
from utils.geo_hash import GeoHash
from utils.parsed_view import parsed_view
from utils.timestamp_encoder import TimestampEncoder
def gen_ant(features):
def gen_f... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... |
# ----------------------------------------------------------------------------
# cymunk
# Copyright (c) 2007-2012 Victor Blomqvist
#
# 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 re... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.