text stringlengths 3.07k 22.1k |
|---|
from csympy.lib.csympy_wrapper import (densematrix, Symbol, Integer,
function_symbol, I)
def test_get():
A = densematrix(2, 2, [1, 2, 3, 4])
assert A.get(0, 0) == 1
assert A.get(0, 1) == 2
assert A.get(1, 1) == 4
a = Symbol("a")
b = Symbol("b")
c = Symbol("c")
d = Symbol("d")
... |
import os
import glob
import loglib
import wrplib
import protocTool
import SCons.Environment
class BuildManager:
def __init__(self):
self.origdir = os.getcwd()
# warning: for origdir = '.' scons may loose library dependency (!)
#self.origdir = "."
self.env = SCons.Environment.Environment()
protocTool.addTo... |
"""
This file contains test functions for MusicXML import and export.
"""
import logging
import unittest
from tempfile import TemporaryFile
from . import MUSICXML_IMPORT_EXPORT_TESTFILES, MUSICXML_UNFOLD_TESTPAIRS
from partitura import load_musicxml, save_musicxml
from partitura.directions import parse_direction
f... |
import tensorflow as tf
import numpy as np
import pickle
import time
import os
repeat = 299
use_gpu = False
num_articles=321
num_arm_features=325
alpha=0.1
query_feature_num=25
page_feature_num=300
# i = tf.constant(0)
# repeat = 600
# use_gpu = False
# num_articles=321
# num_arm_features=305
# alpha=0.1
# query_feat... |
#========================================================================
def sumDict(d):
return reduce(lambda x,y:x+y, d.values())
#========================================================================
def avgDict(d):
return reduce(lambda x,y:x+y, d.values()) / (len(d)*1.0)
#==========================... |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
import tkinter as tk
from tkinter import ttk
from PIL import Image, ImageTk
from shutil import *
import os
import cv2
import numpy as np
import time
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdr... |
import datetime
import json
from urllib.parse import urlencode
from django.http import HttpResponse, Http404
from django.shortcuts import get_object_or_404, redirect, render
from django.utils.timezone import now
from main.models import Package, PackageFile, Arch, Repo
from main.utils import empty_response
f... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
# Program to facilitate manual editing of COVID-19 sequence.
# The program uses MAFFT and read base coverage to provide additional
# evidence to users to investigate evidence support the resolution of
# ambigous bases, predicted indels, and variable sites.
# Written in ... |
from collections import OrderedDict
import cv2
import numpy as np
# Representation of a single bounding box,
# used to ensure compability with darknet python API
class BBox:
def __init__(self, name, prob, x, y, w, h):
self.name = name
self.prob = prob
self.x = x
self.y = y
... |
# Made by KilKenny & DrLecter
import sys
from com.l2jfrozen import Config
from com.l2jfrozen.gameserver.model.quest import State
from com.l2jfrozen.gameserver.model.quest import QuestState
from com.l2jfrozen.gameserver.model.quest.jython import QuestJython as JQuest
qn = "344_1000YearsEndofLamentation"
#Rewards
ADENA... |
"""Support for MySensors lights."""
from __future__ import annotations
from typing import Any, Tuple, cast
from homeassistant.components import mysensors
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_RGB_COLOR,
ATTR_RGBW_COLOR,
COLOR_MODE_BRIGHTNESS,
COLOR_MODE_RGB,
COLOR_... |
# This Software (Dioptra) is being made available as a public service by the
# National Institute of Standards and Technology (NIST), an Agency of the United
# States Department of Commerce. This software was developed in part by employees of
# NIST and in part by NIST contractors. Copyright in portions of this softwar... |
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D # noqa: F401
from .. import style
def make_axes(fig_width, wpad_edge=0, wpad_mid=0.05, hpad_top=0.05, hpad_bottom=0.05,
small_sq_width=0.07):
sq_width = (1. - 2 * wpad_edge - small_sq_width - 4 * wpad_mid) /... |
import json
from . import globals
from . import ts4
from .util import *
class Address:
"""The :class:`Address <Address>` object, which contains an
Address entity.
"""
def __init__(self, addr):
"""Constructs :class:`Address <Address>` object.
:param str addr: A string representing the ... |
#!/usr/bin/python3
import sys
import subprocess
import pathlib
import pytz
from datetime import datetime
MODE = "tick"
BROKER = "ig.com"
BASE_PATH = "/mnt/storage/Data/market/ig.com/MT5"
FROM = datetime.strptime("2018-01-01T00:00", "%Y-%m-%dT%H:%M").replace(tzinfo=pytz.utc)
TO = datetime.strptime("2020-01-03T23:59", ... |
#!/usr/local/bin/python3
"""
Author: <NAME>
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from matplotlib import animation
import shapely
from shapely.geometry import LineString, Point
from collections import deque
import random
fig = plt.figure()
plt.axis('equal')
ax = ... |
from core.config import Settings
from core.terraform.utils import get_terraform_resource_path
from core.terraform.utils import get_formatted_resource_attr_value, get_resource_created_status_op_file
from core.log import SysLog
from abc import ABCMeta
import json
import os
import sys
import re
class BaseTerraformResour... |
import pytest
import socket
import os
import tarfile
import configparser
import pandas as pd
from pandas.util.testing import assert_frame_equal
from oasislmf.api.client import APIClient
# ------------ load command line optios -------------------- #
cli_test_conf = os.environ.get('PY_CONFIG', '/var/oasis/test/conf.... |
from utils import Node, append_unique_char, str2int, lcp, string_length
import check_correctness
from bisect import bisect_left
import argparse
import os.path
timers = dict()
timers["fastscan"] = 0
def binary_search(array, element):
idx = bisect_left(array, element)
result_idx = idx
if not (idx < len(ar... |
import numpy as np
from open_spiel.python.algorithms.nash_solver import subproc
import os
import pickle
import itertools
import logging
"""
This script connects meta-games with gambit. It translates a meta-game to a payoff matrix format
that gambit could recognize.
Gambit file format: http://www.gambit-project.org/ga... |
import argparse
from textwrap import dedent
from unittest.mock import Mock
from pyscaffold import api, cli
from pyscaffold.extensions import config, interactive
from ..helpers import ArgumentParser
def normalise(text: str) -> str:
return "\n".join(text.strip().splitlines())
def test_wrap():
text = "as eir... |
"""
This file contains the illuminatio CLI
"""
import logging
import time
import json
import click
import click_log
import kubernetes as k8s
from illuminatio.cleaner import Cleaner
from illuminatio.test_case import merge_in_dict, from_merged_dict
from illuminatio.test_generator import NetworkTestCaseGenerator
from il... |
# coding: utf-8
__author__ = 'ZFTurbo: https://kaggle.com/zfturbo'
import datetime
import pandas as pd
import numpy as np
from sklearn.cross_validation import train_test_split
import xgboost as xgb
import random
from operator import itemgetter
import zipfile
from sklearn.metrics import roc_auc_score
import time
random... |
import json
import time
import argparse
import numpy as np
import pandas as pd
import carla
#Local imports
import torch
from control.nn_control import NNController
from environment import Environment
from net.ddpg_net import DDPGActor, DDPGCritic
from net.utils import ReplayBuffer
from spawn import df_to_spawn_points,... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 2 09:09:02 2017
@author: jlao
"""
import numpy as np
from scipy import stats
n = 3
eta=.9
beta0 = eta - 1 + n/2
shape = n * (n-1) // 2
triu_ind = np.triu_indices(n, 1)
beta = np.array([beta0 - k/2 for k in triu_ind[0]])
# partial correlations s... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Process input data (sea-surface iodide) to a DataFrame for modelling.
This file is intended to run as a standard alone script. It generates a file of
observational data including any new observational files in the provided template file
and combines them with the existing... |
"""Real-time information about public transport departures in Norway."""
from datetime import datetime, timedelta
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
ATTR_ATTRIBUTION, CONF_LATITUDE, CONF_LONGITUDE, CONF_NAME,
CO... |
# Copyright 2022 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, ... |
# Back-Propagation Neural Network for estimated value learning
#
# Written in Python with Numeric python
#
# <NAME> <jamartin AT dia fi upm es>
import pickle
import time
import numpy as np
from numpy.random import uniform, normal
def GetBinaryCode(value, ranges, max_deep):
a, b = ranges
deep = ... |
"""
python -m unittest pwseqdist/tests/test_distances.py
"""
import sys
import unittest
import numpy as np
from scipy.spatial.distance import squareform
import parasail
import pytest
import pwseqdist as pwsd
mixed_seqs = ['CACADLGAYPDKLIF',
'CACDALLAYTDKLIF',
'CACDAVGDTLDKLIF',
'CACDDVTEVEGD... |
import os
import json
import numpy as np
from PIL import Image
import torch
import copy
from torch.utils.data import Dataset
from torchvision import transforms
def get_metadata(dataset_name):
if dataset_name == 'pascal':
meta = {
'num_classes': 20,
'path_to_dataset': 'data/pascal',
... |
import os
import math
import argparse
import wandb
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torchvision
import torchvision.transforms as transforms
import torchvision.datasets as datasets
device = 'cuda' if torch.cuda.is_available() else 'cpu'
os.environ[... |
import requests
from requests.auth import AuthBase
from dcos import config, util
from dcos.errors import (DCOSAuthenticationException,
DCOSAuthorizationException, DCOSBadRequest,
DCOSConnectionError, DCOSException, DCOSHTTPException,
DCOSUnpro... |
# -*- coding: utf-8 -*-
# http://www.multiweb.cz/twoinches/MP4inside.htm
# !/usr/bin/python3
# !/Author : Gibartes
from moduleInterface.defines import *
from moduleInterface.interface import ModuleComponentInterface
from structureReader import structureReader as sr
from collections import OrderedDict
import os, sys, ... |
from collections import OrderedDict
from enum import Enum, unique
import sys
import re
import copy
thisModule = sys.modules[__name__]
supportedClassType = [
'RAILModelElement', # Base-type element, shouldn't be used by itself
'RAILModelInfo', # Simple single-element data type, store... |
# Single-Path NAS (Apache License 2.0)
# ==============================================================================
"""Parsing the NAS search progress."""
import numpy as np
from tensorboard.backend.event_processing.event_accumulator import EventAccumulator
from collections import OrderedDict
def parse_indicators... |
#!/usr/bin/env python
import os
import sys
# Run with most recent version of Enthought Canopy Python Distribution
# https://www.enthought.com/products/canopy/
import numpy as np
import matplotlib
#matplotlib.use("PDF") # backend selection (must be done before other imports)
matplotlib.use("Agg") # backend selection ... |
# Copyright (c) 2020 Sony Corporation. 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 applicabl... |
import base64
import os
import tempfile
from shutil import copy2
from textwrap import dedent as s
import dash_core_components as dcc
import dash_daq as daq
import dash_html_components as html
from dash.dependencies import Input, Output, State
from dash_bio.utils import pdb_parser as parser, mol3dviewer_styles_creator ... |
from .core import FunctionExpression
FUNCTION_LISTING = {
"utcyear": "returns the year for a given date input, in UTC time",
"indexof": "returns the first index of an element (for array inputs) or substring (for string inputs) e.g., `indexof(\"visualization\", \"i\") == 1",
"upper": "transforms a string to uppe... |
#!/usr/bin/env python3
#
# Copyright 2016 Red Hat, Inc.
#
# Authors:
# <NAME> <<EMAIL>>
#
# This work is licensed under the MIT License. Please see the LICENSE file or
# http://opensource.org/licenses/MIT.
import urllib.request, urllib.parse, urllib.error
from django.shortcuts import render
from django.http impor... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from fairseq import utils
from fairseq.modules import LayerNorm
class LSTMEncoderLayer(nn.Module):
def __init__(self, embed_dim, hidden_dim, num_layers=1, dropout=0.1,
bidirectional=False, left_pad=True, normalize_befor... |
# @see https://matplotlib.org/users/image_tutorial.html
import sys
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
import random
import imutils
from imutils import paths
import cv2
import os
from functools import reduce
from .clean_img import clean_img
from .create_sets import crea... |
"""Computations of phyvars that are not output by StagYY.
Time series are returned along with the time at which the variables are
evaluated. Radial profiles are returned along with the radial positions at
which the variables are evaluated.
"""
import numpy as np
from scipy import integrate
from .error import NotAvai... |
# coding: utf-8
# In[1]:
from __future__ import print_function
import numpy as np
from functools import reduce
import torch
import torch.nn as nn
from torch.autograd import Variable
from copy import deepcopy
import sys, os
sys.path.append(os.path.join(os.path.dirname("__file__"), '..', '..'))
from mela.pytorch.uti... |
"""Biconnectivity.py
DFS-based algorithm for computing biconnected components.
<NAME>, April 2004.
"""
import unittest
from Graphs import isUndirected
from Util import arbitrary_item
from PartialOrder import TopologicalOrder
import DFS
disconnected = object() # flag for BiconnectedComponents
class BiconnectedComp... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright ©2011 <NAME>
# <EMAIL>
#
# Modified and redistributed as part of pyXMLSecurity by <EMAIL>
# with permission from the original author
#
"""Parse x509 PEM Certificates.
The objective of this script is to parse elements from x509
certificates in PEM binary format whic... |
from __future__ import annotations
from collections import defaultdict
from dataclasses import dataclass, astuple
from enum import IntEnum
from functools import reduce
from itertools import product
from math import sqrt
from typing import Generator, NamedTuple
import numpy as np
from tool.runners.python import Submis... |
# -*- coding: utf-8 -*-
from tkinter import *
from Fileop import File
from config_tk import *
from tkinter import ttk , filedialog as fd ,messagebox as msg
import sys , os , re , threading ,json
from _entry import scroll_text , _text
from PIL import Image , ImageTk
import subprocess as subp
import argparse
... |
"""
description: Trie data structure for fast string lookups
author: <NAME>
"""
__all__ = ['Trie', 'StringTrie', 'WordCountTrie']
from collections.abc import MutableMapping
import dill
import operator
class Node:
__slots__ = 'value', 'children', 'n_items', 'parent'
ChildrenFactory = dict
def __... |
#!/usr/bin/python3 #coding=utf-8
import os
import sys
import datetime
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import DataLoader
try:
from tensorboardX import SummaryWriter
BOARD_FLAG = True
except:
BOARD_FLAG = False
from lib import data... |
import torch
import torch.nn as nn
class Env():
def __init__(self, x, node_embeddings):
super().__init__()
""" depot_xy: (batch, 2)
customer_xy: (batch, n_nodes-1, 2)
--> self.xy: (batch, n_nodes, 2), Coordinates of depot + customer nodes
demand: (batch, n_nodes-1)
node_embeddings: (batch, n_nodes, em... |
# coding: utf-8
import numpy as np
import glob
from tqdm import tqdm
import os
from skimage.io import imread
import tensorflow as tf
import sklearn.preprocessing as prep
import joblib
def min_max_scale(X):
preprocessor = prep.MinMaxScaler().fit(X)
X_scaled = preprocessor.transform(X)
return X_scaled
# ##... |
"""Module providing handling of the LAT point spread function.
$Header: /nfs/slac/g/glast/ground/cvs/pointlike/python/uw/irfs/psf.py,v 1.4 2016/06/30 00:02:42 wallacee Exp $
Author: <NAME>
"""
__version__='$Revision: 1.4 $'
import os
import numpy as np
from astropy.io import fits
from scipy import integrate
from uw... |
# 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
# d... |
import pyrebase
import RPi.GPIO as GPIO
from picamera import PiCamera
import time
#import PyFCM as FCMNotification
#Configuration Firebase
config = {
"apiKey": "<KEY>",
"authDomain": "robotics-17a2b.firebaseapp.com",
"databaseURL": "https://robotics-17a2b.firebaseio.com",
"storageBucket": "robotics-17a... |
# numbers in this file are references to headings in this paper:
# https://sites.uclouvain.be/gramlink/Gramlink-NL/morfologie/pdf/m_nl_02_subst_03_meervoud.pdf
from dutch_pluralizer import pluralize
import pytest
@pytest.mark.parametrize("singular,plural", [
("boek", "boeken"),
("fiets", "fietsen"),
("vr... |
#***********************************************************************
#* Program:
#* cfg2ase.py
#* Author:
#* <NAME>, <NAME> University
#* Summary:
#* This is a library to help with the reading of cfg format file (from
#* MTP) to ASE atoms object.
#********************************************************... |
#!/usr/bin/python3
import pickle
import os.path
import base64
import binascii
import html2text
from googleapiclient.discovery import build
from googleapiclient.errors import HttpError
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
# If modifying these scopes,... |
import os
import random
import sys
import urllib.request
import requests
import time
from bs4 import BeautifulSoup
from flask import Flask, abort, request
from linebot import LineBotApi, WebhookHandler
from linebot.exceptions import InvalidSignatureError
from linebot.models import (MessageEvent, SourceUser,... |
import lldb
import re
base_save_path = None # "simple/dy/lldb_result"
assert base_save_path, "提示:请设置文件保存路径"
max_loop = 2
def dump_function(debugger, command, result, internal_dict):
interpreter = lldb.debugger.GetCommandInterpreter()
return_object = lldb.SBCommandReturnObject() # 用来保存结果
interpreter.H... |
#-*- coding: utf-8 -*-
import tensorflow as tf
import numpy as np
import sys
import argparse
import os
import nsml
from nsml import DATASET_PATH
from model import Model
from dataset_batch import Dataset
from data_loader import data_loader
from evaluation import get_ner_bi_tag_list_in_sentence
from evaluation import dif... |
""" Implementation of a graph to svg formatter. """
from statistics import median
from .collections import OrderedSet
class Node:
def __init__(self):
self.nid = id(self)
self.label = ""
self.color = None
self.width = 0
self.height = 0
self.children = []
self... |
import os.path as osp
import os
import numpy as np
import pandas as pd
import glob
import cv2
from data_utils import *
from concurrent.futures import ProcessPoolExecutor, as_completed
import multiprocessing
def gen_past_files(seq_label_root, past_label_root, past_length=30, img_size=None):
if not osp.exists(seq_l... |
import os
import time
from unittest.mock import MagicMock, patch
from flask import g, url_for
import pytest
from tests.astronomer.flask_appbuilder.conftest import AUDIENCE
from astronomer.flask_appbuilder.security import AirflowAstroSecurityManager, timed_lru_cache
@pytest.mark.usefixtures('client_class', 'run_in_t... |
import scipy.io as sio
import joblib
import numpy as np
import h5py
import tensorflow as tf
from tqdm import tqdm
import cv2
from vgg19 import VGG19
from keras.preprocessing import image as ki
from keras.models import Model, Sequential
from keras.layers import Flatten, Dense, Input, Lambda, Dropout
from keras.layers im... |
"""Define celery tasks for hs_core app."""
from __future__ import absolute_import
import os
import sys
import traceback
import zipfile
import logging
import requests
from xml.etree import ElementTree
from rest_framework import status
from django.conf import settings
from django.core.mail import s... |
from _collections import OrderedDict
import click
import py42.sdk.queries.alerts.filters as f
from c42eventextractor.extractors import AlertExtractor
from py42.sdk.queries.alerts.filters import AlertState
from py42.sdk.queries.alerts.filters import RuleType
from py42.sdk.queries.alerts.filters import Severity
import ... |
from __future__ import unicode_literals, division, absolute_import
import logging
from datetime import datetime, timedelta
from sqlalchemy import Column, Integer, String, Unicode, DateTime
from sqlalchemy.schema import Index, MetaData
from flexget import db_schema
from flexget.plugin import register_plugin, register_pa... |
import torch
import torch.nn as nn
from torchmetrics.functional import accuracy
from pytorch_lightning import LightningModule
from .models import Generator, Discriminator
from ..target_models.target_model import TargetModel
import wandb
def weights_init(m):
classname = m.__class__.__name__
if classname.find... |
import tensorflow as tf
from keras.models import Sequential, Model
from keras.layers import Dense, Activation, Dropout, Flatten, Reshape, Input, Lambda, Cropping2D
from keras.layers.recurrent import LSTM
from keras.layers.convolutional import Conv2D
from keras.layers.pooling import MaxPooling2D
from keras.callbacks imp... |
"""Common functionality."""
import logging
import shlex
from pathlib import Path
from boltons.strutils import bytes2human, html2text, is_uuid
from boltons.timeutils import relative_time
from jupitotools.time import fmt_duration
import pyutils.files
import pyutils.misc
# from pyutils.misc import fmt_size
import json... |
#!/usr/bin/env python3
# --------------------------------------------------------------------------- #
# The MIT License (MIT) #
# #
# Copyright (c) 2021 <NAME> <<EMAIL>> #
# ... |
#!/usr/bin/env python
"""Create movie from a series of images using mencoder"""
from optparse import OptionParser
import sys
import os
import glob
import future
import shutil
from pathlib import Path
__author__ = "<NAME>"
__copyright__ = "Copyright 2009"
__credits__ = "<NAME>"
__license__ = "MIT"
__version__ = "0.1"... |
# -*- encoding=utf-8 -*-
# Copyright 2016-2017 <NAME>; licensed under the Apache License,
# Version 2.0
"""Support for fast decimals with five decimal places
This class provides defined behavior, relatively free from external
influences.
"""
import sys
_NBR_DECIMAL_PLACES = 5
_FACTOR = pow(10, _NBR_DECIMAL_PL... |
from __future__ import print_function
import os
from io import BytesIO
import numpy as np
from functools import partial
import PIL.Image
import matplotlib.pyplot as plt
from IPython.display import clear_output, Image, display, HTML
import tensorflow as tf
model_fn = 'tensorflow_inception_graph.pb'
# creating TensorF... |
#!/usr/bin/env python3
#
# Cross Platform and Multi Architecture Advanced Binary Emulation Framework
#
import struct
from qiling.os.windows.const import *
from qiling.os.windows.fncc import *
from qiling.os.const import *
from qiling.os.windows.utils import *
from qiling.os.windows.thread import *
from qiling.os.wi... |
import os
import sys
import time
from tqdm import tqdm as print_progress
import csv
import json
import logging
import numpy as np
import pandas as pd
import random
import cv2
from PIL import Image
from matplotlib import pyplot as plt
import re
import requests
from io import BytesIO
from bs4 impo... |
from __future__ import division, print_function, unicode_literals
"""
Use this module in the same way as Python's SimpleHTTPServer:
python -m RangeHTTPServer [port]
The only difference from SimpleHTTPServer is that RangeHTTPServer supports
'Range:' headers to load portions of files. This is helpful for doing local... |
"""" Cli module that creates application and modules """
import os
import uuid
from shutil import copyfile
import kervi.utility.nethelper as nethelper
import click
from kervi_cli.scripts.template_engine import SuperFormatter
import kervi_cli
#import pip
def _create_cam(template_path):
#template_engine = SuperForm... |
# LIBTBX_SET_DISPATCHER_NAME xia2
#
# see https://github.com/xia2/xia2/issues/172
# LIBTBX_PRE_DISPATCHER_INCLUDE_SH ulimit -n `ulimit -Hn 2>&1 |sed 's/unlimited/4096/'`
import logging
import os
import sys
import time
import traceback
from dials.util import Sorry
from dials.util.version import dials_version
from lib... |
# Code based on kwang's original test.py script
# Customized test script, removing not unused functions.
# Clearer result printing
# Allow easier testing on own-defined datasets
import os
import sys
import time
import numpy as np
import cv2
from six.moves import xrange
from geom import *
def cal_deg_mAP(errs, thres=... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import json
import multiprocessing as mp
import os
import subprocess
import sys
import time
import redis
from maro.cli.grass.lib.services.utils.exception import ResourceAllocationFailed
from maro.cli.grass.lib.services.utils.name_creator import... |
'''
python -m unittest test_crop_production_io
'''
import unittest
import os
import pprint
import tempfile
import shutil
import pygeoprocessing as pygeo
import invest_natcap.crop_production.crop_production_io as io
import crop_production_data as test_data
current_dir = os.path.dirname(os.path.realpath(__file__))
wo... |
import itertools
import multiprocessing as mpr
import os
from os.path import join
import itertools
import numpy as np
import pandas as pd
from scipy import sparse
from scipy.sparse import coo_matrix
from typing import Callable, List, Tuple, Dict
os.environ['NUMEXPR_MAX_THREADS'] = '16'
def bow(s: np.ndarray) -> st... |
#Jeux du pendu dans la console - Pas fini
# Bibliotheque
from tkinter import Tk,Label,Button,Entry,NW,PhotoImage,StringVar,Place,Text,Canvas,Message
from tkinter import messagebox
from tkinter.filedialog import askopenfilename
from PIL import Image, ImageTk
from datetime import datetime
# Mes fonctions
from MyFunc... |
#!/usr/bin/env python
# coding: utf-8
# # Multiclass Classification using Keras and TensorFlow 2.0 on Food-101 Dataset
# 
# Check if GPU is enabled
import tensorflow as tf
seed_value=42
import os
os.environ['PYTHONHASHSEED']=s... |
import itertools
import re
import sunfish
################################################################################
# This module contains functions used by test.py and xboard.py.
# Nothing from here is imported into sunfish.py which is entirely self-sufficient
#################################################... |
import asyncio
import calendar
import configparser
import datetime
import json
import os
import re
import textwrap
import traceback
import discord
import pytz
import requests
from bs4 import BeautifulSoup
from .getApi import getApi
from .Log import logger
if os.path.isfile("config.ini"):
config = configparser.Co... |
from __future__ import absolute_import
from __future__ import print_function
from amitools.fs.block.Block import *
import amitools.fs.DosType as DosType
class FSHeaderDeviceNode:
valid_flags = ('type', 'task', 'lock', 'handler', 'stack_size',
'priority', 'startup', 'seg_list_blk', 'global_vec')
... |
# coding=utf-8
# Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... |
import mesh_tensorflow as mtf
import tensorflow.compat.v1 as tf
from tensorflow.python.tpu import tpu_estimator
import mesh_tensorflow.transformer as mtf_transformer
from .optimizers import get_optimizer
from .utils import mode_to_str, get_graph_info, create_host_call, simd_mesh_setup, scalar_summary
from .dalle_mtf im... |
#!/usr/bin/env python
# generate_combined_ASV_table.py
# Copyright <NAME>, Neufeld Research Group, 2019
# Creates a TSV-format QIIME2 feature table with overlaid taxonomy and sequence information for convenience of viewing
# Imports
import sys
import os
import time
import logging
import argparse
import re
from Bio.Se... |
# Copyright (c) 2016 OpenStack Foundation
# 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 ... |
#!/usr/bin/env python
"""
See the file "LICENSE" for the full license governing this code.
Copyright 2011,2012,2013,2017 <NAME>
"""
#adjust pylint for pytest oddities:
#pylint: disable=missing-docstring
#pylint: disable=unused-argument
#pylint: disable=attribute-defined-outside-init
#pylint: disable=protected-a... |
import sys
sys.path.append("..") # Adds higher directory to python modules path.
from importlib import reload
import datetime as dt
import numpy as np
import pandas as pd
from time import time as t_clock
from os import path
import os
from pathlib import Path
import pickle as pk
import matplotlib.pyplot as plt
import sq... |
import unicodedata
def remove_diacritic( s ):
'''
Accept a unicode string, and return a normal string
without any diacritical marks.
'''
try:
return unicodedata.normalize('NFKD', '{}'.format(s)).encode('ASCII', 'ignore').decode()
except:
return s
def normalize( s ):
return remove_diacritic( s.replace('.','... |
"""The predefined gob types.
These are the well-known gob types that both senders and receivers
already agree on to bootstrap the protocol.
"""
import struct
import collections
# We do not use an Enum for this since this set isn't the full set of
# all type IDs -- the protocol allows a sender to define custom IDs in... |
import base64
import json
import platform
import sys
import requests
from ..exceptions import Auth0Error, RateLimitError
from time import sleep
from random import randint
UNKNOWN_ERROR = 'a0.sdk.internal.unknown'
class RestClientOptions(object):
"""Configuration object for RestClient. Used for configuring
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.