input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
<filename>formats/blast.py
"""
parses tabular BLAST -m8 (-format 6 in BLAST+) format
"""
import os.path as op
import sys
import logging
from itertools import groupby
from collections import defaultdict
from jcvi.formats.base import LineFile, BaseFile, must_open
from jcvi.formats.bed import Bed
from jcvi.formats.coor... | |
""" serial_connection.get_device_id_from_device_packet(packet)
Return the device id from the device packet.
It assumes the first entry in the packet tuple is the device id.
"""
return packet[0]
def build_packet(self, data_block):
""" serial_connection.build_packet(self, data_block)
Build a packet beginning wit... | |
<filename>notebooks/drive-download-20190731T104457Z-001/20190711/data.py<gh_stars>0
from common import *
# https://www.kaggle.com/adkarhe/dicom-images
# https://www.kaggle.com/c/siim-acr-pneumothorax-segmentation/overview/resources
# https://www.kaggle.com/abhishek/train-your-own-mask-rcnn
# ------
# component
# comp... | |
'project': projPart,
'msg': msg
} )
if len(recs):
coll.insert_many( recs, ordered=True )
#return recs
def collectBoincStatus( db, dataDirPath, statusType ):
# will collect data only from "checked" instances
wereChecked = db['checkedInstances'].find( {'state': 'checked' } )
reportables = []
for inst in wereChe... | |
# -*- coding: utf-8 -*-
"""
.. invisible:
_ _ _____ _ _____ _____
| | | | ___| | | ___/ ___|
| | | | |__ | | | |__ \ `--.
| | | | __|| | | __| `--. \
\ \_/ / |___| |___| |___/\__/ /
\___/\____/\_____|____/\____/
Created on Dec 4, 2013
Unit test for pooling layer forward propagation.
███████████████████████████... | |
# Copyright 2014 ARM Limited
#
# Licensed under the Apache License, Version 2.0
# See LICENSE file for details.
# standard library modules, , ,
import os
import logging
import re
import itertools
from collections import defaultdict
from collections import OrderedDict
# bsd licensed - pip install jinja2
from jinja2 im... | |
from typing import List
import matplotlib.pyplot as plt
import numbers
import numpy as np
import pandas as pd
from scipy import stats
from sklearn.metrics import auc, plot_roc_curve, roc_curve, RocCurveDisplay
from sklearn.model_selection import KFold, LeaveOneOut, GroupKFold, LeaveOneGroupOut
from sklearn.preprocessin... | |
import json
import textwrap
from datetime import datetime, date
import pytest
import transaction
from freezegun import freeze_time
from libres.db.models import Reservation
from libres.modules.errors import AffectedReservationError
from onegov.form import FormSubmission
from onegov.reservation import ResourceCollectio... | |
+ y, z + x), tvm.min(y, z) + x)
ck.verify(tvm.min(x + y, x + z), tvm.min(y, z) + x)
ck.verify(tvm.min(x - y, x - z), x - tvm.max(y, z))
ck.verify(tvm.min(y - x, z - x), tvm.min(y, z) - x)
ck.verify(tvm.min(tvm.min(x, 1), 10), tvm.min(x, 1))
ck.verify(tvm.min(tvm.min(x, 11), 10), tvm.min(x, 10))
ck.verify(tvm.m... | |
"""
MIT License
Copyright (c) 2020 <NAME>
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, distri... | |
#!/usr/bin/env python3
"""
Comments in PyCharm style.
References
- Tag sorter by Zack
/common-samples/blob/master/tools/net/tag_sorter/tag_sorter.py
- README standard format
/common-samples/wiki/Standard-sample-documentation-template-%28README.md%29
"""
import os
import re
import typing
import argparse
# region... | |
<gh_stars>1-10
#!/usr/bin/env python3
#"""
#Implements the Dragonfly (SAE) handshake.
#Instead of using a client (STA) and a access point (AP), we
#just programmatically create a peer to peer network of two participiants.
#Either party may initiate the SAE protocol, either party can be the client and server.
#In a m... | |
# This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even... | |
file types in this logical file group - subclass needs to override this
return [".*"]
@classmethod
def type_name(cls):
return cls.__name__
@classmethod
def check_files_for_aggregation_type(cls, files):
"""Checks if the specified files can be used to set this aggregation type. Sub classes that
support aggregat... | |
<filename>Experiments_Synthetic/run_method.py
import gc
from keras import backend as K
import tensorflow as tf
from sklearn.metrics import log_loss
from binnings import *
from kde import KDE_estimator
from data_generation import generate_data
from pycalib.models import IsotonicCalibration, SigmoidCalibration... | |
<gh_stars>1000+
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import print_function
import sys
sys.path.insert(1, "../../../") # allow us to run this standalone
import h2o
from h2o.estimators.random_forest import H2ORandomForestEstimator
from h2o.estimators.glm import H2OGeneralizedLinearEstimator
... | |
import argparse
import asyncio
import json
import logging
import urllib.parse
import atexit
import time
import functools
import webbrowser
import multiprocessing
import socket
import sys
import typing
from random import randrange
from Utils import get_item_name_from_id, get_location_name_from_address, ReceivedItem
e... | |
<gh_stars>0
"""
short term archiving
case_st_archive, restore_from_archive, archive_last_restarts
are members of class Case from file case.py
"""
import shutil, glob, re, os
from CIME.XML.standard_module_setup import *
from CIME.utils import run_and_log_case_status, ls_sorted_by_mtime, symlink_force, safe_copy, find_... | |
failobj
def __getitem__(self, id):
"""__getitem__(self, id) -> object
Return a Prosite entry. id is either the id or accession
for the entry. Raises a KeyError if there's an error.
"""
from Bio import ExPASy
# First, check to see if enough time has passed since my
# last query.
self.limiter.wait()
try:
... | |
<reponame>oneflyingfish/tvm<filename>tests/python/contrib/test_ethosu/infra.py
# 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
# ... | |
<reponame>hanya/pyuno3ext<gh_stars>1-10
#**************************************************************
#
# 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. T... | |
if
``True``, it returns the coefficients with respect to
the basis for the total degree of this element
OUTPUT:
A list of elements of the base field.
EXAMPLES::
sage: A.<x,y,z,t> = GradedCommutativeAlgebra(QQ, degrees=(1, 2, 2, 3))
sage: A.basis(3)
[t, x*z, x*y]
sage: (t + 3*x*y).basis_coefficients()
[1, ... | |
{'key': 'properties.customDomainVerificationTest', 'type': 'str'},
'custom_domain_verification_failure_info': {'key': 'properties.customDomainVerificationFailureInfo', 'type': 'ErrorEntity'},
'has_conflict_on_scale_unit': {'key': 'properties.hasConflictOnScaleUnit', 'type': 'bool'},
'has_conflict_across_subscription... | |
<reponame>scott-techart/flottitools
from contextlib import contextmanager
import maya.OpenMaya as OpenMaya
import maya.OpenMayaAnim as OpenMayaAnim
import pymel.core as pm
import flottitools.utils.namespaceutils as nsutils
import flottitools.utils.selectionutils as selutils
import flottitools.utils.skeletonutils as s... | |
"""
Created on March 14, 2017
Originally written by <NAME> in 2015
@author: <NAME>
"""
import os
from datetime import datetime
import numpy as np
import pandas as pd
import pytz
def storms(precipitation, perc_snow, mass=1, time=4,
stormDays=None, stormPrecip=None, ps_thresh=0.5):
"""
Calculate the decimal days ... | |
fov):
self.fov = fov
# this is vertical fov
P = perspective(self.fov, float(self.width) /
float(self.height), 0.01, 100)
self.P = np.ascontiguousarray(P, np.float32)
def set_projection_matrix(self, w, h, fu, fv, u0, v0, znear, zfar):
L = -(u0) * znear / fu;
R = +(w-u0) * znear / fu;
T = -(v0) * znear / fv;
... | |
points[1].name)
return super().name
def free_point(self, **kwargs):
if 'comment' not in kwargs:
kwargs = dict(kwargs)
kwargs['comment'] = Comment('point on line $%{line:line}$', {'line': self})
point = CoreScene.Point(self.scene, CoreScene.Point.Origin.line, line=self, **kwargs)
point.belongs_to(self)
return ... | |
<reponame>IBM/graph4nlp
import json
from stanfordcorenlp import StanfordCoreNLP
from graph4nlp.pytorch.data.data import GraphData
from graph4nlp.pytorch.modules.utils.vocab_utils import VocabModel
from .base import StaticGraphConstructionBase
import networkx as nx
class IEBasedGraphConstruction(StaticGraphConstruc... | |
is_training=self.is_training,
scope="cluster_bn")
else:
cluster_biases = tf.get_variable("cluster_biases",
[cluster_size],
initializer = tf.random_normal_initializer(stddev=1 / math.sqrt(self.feature_size)))
tf.summary.histogram("cluster_biases", cluster_biases)
activation += cluster_biases
activation = tf.nn... | |
<gh_stars>1-10
#!/usr/bin/python
#
# This source file is part of appleseed.
# Visit https://appleseedhq.net/ for additional information and resources.
#
# This software is released under the MIT license.
#
# Copyright (c) 2010-2013 <NAME>, Jupiter Jazz Limited
# Copyright (c) 2014-2018 <NAME>, The appleseedhq Organiza... | |
call end on PhoneA.
Returns:
True if pass; False if fail.
"""
call_ab_id, call_ac_id = self._test_volte_mo_mo_add_volte_swap_x(0)
if call_ab_id is None or call_ac_id is None:
return False
return self._test_ims_conference_merge_drop_second_call_no_cep(
call_ab_id, call_ac_id)
@TelephonyBaseTest.tel_test_wrap... | |
from os import add_dll_directory
from tkinter import *
import tkinter as tk
from tkinter import ttk
from PIL import ImageTk,Image
from PIL import ImageTk
import psycopg2
from tkinter_custom_button import TkinterCustomButton
import tkinter.messagebox
root=tk.Tk()
root.configure(background='#ffff99')
emplo... | |
import __clrclasses__.System.Configuration as Configuration
import __clrclasses__.System.IO as IO
import __clrclasses__.System.Security as Security
import __clrclasses__.System.Resources as Resources
import __clrclasses__.System.Globalization as Globalization
import __clrclasses__.System.Diagnostics as Diagnostics
impo... | |
<gh_stars>10-100
"""@file layer.py
Neural network layers """
import string
import tensorflow as tf
from tensorflow.python.ops.rnn import bidirectional_dynamic_rnn, dynamic_rnn
from nabu.neuralnetworks.components import ops, rnn_cell, rnn, rnn_cell_impl
from ops import capsule_initializer
from tensorflow.python.ops im... | |
<filename>main/settings.py
"""
Django settings for ocw_studio.
"""
import logging
import os
import platform
from urllib.parse import urlparse
import dj_database_url
from django.core.exceptions import ImproperlyConfigured
from mitol.common.envs import (
get_bool,
get_delimited_list,
get_features,
get_int,
get_site... | |
'%=' ) expression
pass
if self.input.LA(1) == 57 or (122 <= self.input.LA(1) <= 131):
self.input.consume()
self._state.errorRecovery = False
else:
if self._state.backtracking > 0:
raise BacktrackingFailed
mse = MismatchedSetException(None, self.input)
raise mse
self._state.following.append(self.FOLLOW_ex... | |
from __future__ import absolute_import, division
from psychopy import locale_setup, core, gui, data#, event#, logging#, visual
from psychopy.constants import (NOT_STARTED, STARTED, PLAYING, PAUSED,
STOPPED, FINISHED, PRESSED, RELEASED, FOREVER)
# Make sure that under Psychopy preferences, under audio library pygame ... | |
import torch
import numpy as np
import torch_utils
from Models import base_model
import losses as my_losses
import torch_utils as my_utils
import torch.optim as optim
from torch.optim.lr_scheduler import StepLR
import time
import os
from handlers import output_handler, mz_sampler
from Evaluation import mzEvaluator as m... | |
XOR
'wedge': '\u2227', # ∧ LOGICAL AND
'wr': '\u2240', # ≀ WREATH PRODUCT
}
mathclose = {
'Rbag': '\u27c6', # ⟆ RIGHT S-SHAPED BAG DELIMITER
'lrcorner': '\u231f', # ⌟ BOTTOM RIGHT CORNER
'rangle': '\u27e9', # ⟩ MATHEMATICAL RIGHT ANGLE BRACKET
'rbag': '\u27c6', # ⟆ RIGHT S-SHAPED BAG DELIMITER
'rbrace': '}', # ... | |
and uniform
B-splines as special cases. Thus we will talk about non-uniform B-splines when we mean the general case, incorporating
both uniform and open uniform.
What can you do to control the shape of a B-spline?
- Move the control points.
- Add or remove control points.
- Use multiple control points.
- Change... | |
# coding: utf-8
import pprint
import re
import six
class QueryJobResp:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
sensitive_list = []
openapi_types = {
... | |
modeled astronomical tide as well as the highest and lowest observed tide for that time range, the total observation count and the maximum count of observations for any one pixel in the polygon, the polygon ID number (from 1 to 306), the polygon centroid in longitude and latitude and the count of tide stages attributed... | |
<filename>scripts/nasbench/train_cellss_pkl.py<gh_stars>100-1000
# -*- coding: utf-8 -*-
# pylint: disable-all
from io import StringIO
import os
import sys
import copy
import shutil
import logging
import argparse
import random
import pickle
import yaml
import setproctitle
from scipy.stats import stats
import torch
i... | |
<filename>database_manager.py<gh_stars>0
"""
Object that manages the database that stores the blockchain.
"""
import sqlite3
from transaction import Transaction
from block import Block
import os
class BlockchainDatabase:
def __init__(self, blockchain, p, name='/blockchain', ):
self.name = name
with sqlite3.connec... | |
<gh_stars>10-100
"""Flexmock tests."""
# pylint: disable=missing-docstring,too-many-lines,disallowed-name,no-member,invalid-name,no-self-use
import functools
import os
import random
import re
import sys
import unittest
from contextlib import contextmanager
from typing import Type, Union
from flexmock._api import (
AT... | |
# coding: utf-8
"""
EVE Swagger Interface
An OpenAPI for EVE Online # noqa: E501
OpenAPI spec version: 0.8.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility library
import six
from swag... | |
<filename>Reexec.py
import sublime, sublime_plugin
import os, sys, re
import threading
import subprocess
import functools
import time
import traceback
import posixpath
import difflib
def plugin_loaded():
"""This function checks settings for sanity."""
plugin_settings = sublime.load_settings("Reexec.sublime-settings"... | |
OnTaskCharacteristics(self,event):
try:
dialog = TaskCharacteristicsDialog(self)
dialog.ShowModal()
dialog.Destroy()
except ARMException,errorText:
dlg = wx.MessageDialog(self,str(errorText),'Edit Task Characteristics',wx.OK | wx.ICON_ERROR)
dlg.ShowModal()
dlg.Destroy()
return
def OnConceptReferences(self,e... | |
# pylint: disable=invalid-name
"""Create json data which will be send via post for the V4 api"""
if not params:
params = [{
"clientid": self.client_id,
"nickname": self.nickname
}, [{
"clientid": self.client_id,
"nickname": self.nickname,
"value": "yes",
"function": "WOL"
}]]
return {
"metho... | |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division,print_function,absolute_import,unicode_literals
import time
import datetime
import os
LTsv_HourMAXLower,LTsv_HourMAXUpper=(24,48)
LTsv_overhour=LTsv_HourMAXLower
LTsv_diffminute=0
LTsv_zodiacjp=("鼠","牛","虎","兎","龍","蛇","馬","羊","猿","鶏","犬","... | |
b * acosh(c * x)) ** (n + S(-1))
* (c * x + S(-1)) ** (p + S(-1) / 2)
* (c * x + S(1)) ** (p + S(-1) / 2),
x,
),
x,
)
+ Simp(
(f * x) ** (m + S(1))
* (a + b * acosh(c * x)) ** n
* (d + e * x ** S(2)) ** p
/ (f * (m + S(1))),
x,
)
)
def replacement6170(a, b, c, d, e, f, m, n, x):
return (
-Dist(
c ** ... | |
<reponame>zxjzxj9/aipot<filename>model.py
#! /usr/bin/env python
import tensorflow as tf
import yaml
from option import opts
import itertools
import numpy as np
import math
class AttnNet(object):
"""
This code is inspired by google's paper Attention Is All You Need
Build a transformer to predict the system energy
... | |
<reponame>AgriculturalModelExchangeInitiative/PyCropML<filename>src/pycropml/transpiler/antlr_py/tests/examples/DssatComponent/SoilTemp/STEMP.py<gh_stars>1-10
def STEMP(SOILPROP, SRAD, SW, TAVG, TMAX, XLAT, TAV, TAMP,NL, SRFTEMP, ST) :
#USE ModuleDefs #Definitions of constructed variable types,
# which contain con... | |
import functools
from pylearn2.models.mlp import MLP, CompositeLayer
from pylearn2.space import CompositeSpace, VectorSpace
import theano
from theano import tensor as T
from theano.compat import OrderedDict
from theano.sandbox.rng_mrg import MRG_RandomStreams
from adversarial import AdversaryPair, AdversaryCost2, Gen... | |
array-like, optional
Array of integers defining frame times of the first data. If not provided,
regular time-spaced data is assumed.
t2 : array-like, optional
Array of integers defining frame times of the second data. If not provided,
regular time-spaced data is assumed.
n : int, optional
Determines the lengt... | |
# -*- coding: utf-8 -*-
# Copyright 2020 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 agr... | |
out_coord = Quantity(self.radec_wcs.all_world2pix(coords, 0), output_unit).round(0).astype(int)
elif input_unit == "pix" and out_name == "deg":
out_coord = Quantity(self.radec_wcs.all_pix2world(coords, 0), output_unit)
# These go between degrees and XMM sky XY coordinates
elif input_unit == "deg" and out_name == "... | |
, 'N':'R:U6_S_0' , 'E':'T:U6_W_1' },
{'name':'U5;10->01;sw' , 'parity':0, 'S':'L:U4_N_0' , 'W':'B:U4_E_1' , 'N':'iL:U5;10->01' , 'E':'iB:U5;10->01' },
{'name':'U5;10->01;se' , 'parity':1, 'S':'R:U4_N_0' , 'W':'iB:U5;10->01' , 'N':'iR:U5;10->01' , 'E':'B:U6_W_1' },
{'name':'U5;10->10;nw' , 'parity':1, 'S':'iL:U5;10->... | |
# -*- coding: utf-8 -*-
# Copyright 2019 Cohesity Inc.
import logging
from cohesity_management_sdk.api_helper import APIHelper
from cohesity_management_sdk.configuration import Configuration
from cohesity_management_sdk.controllers.base_controller import BaseController
from cohesity_management_sdk.http.auth.auth_manag... | |
True})
self.assertEqual({'another_value': 2}, response.body)
self.assertEqual(1, stub_test_action_1.call_count)
self.assertEqual({}, stub_test_action_1.call_body)
self.assertEqual(1, stub_test_action_2.call_count)
self.assertEqual({'input_attribute': True}, stub_test_action_2.call_body)
stub_test_action_1.assert... | |
None,
'balance_classes': None,
'build_tree_one_node': None,
'classification': 1,
'cols': None,
'destination_key': None,
'ignored_cols': None,
'ignored_cols_by_name': None,
'importance': 1, # enable variable importance by default
'max_after_balance_size': None,
'max_depth': None,
'min_rows': None, # how many... | |
import warnings
from django.contrib.auth.models import Permission
from django.conf.urls import url
from django.core.urlresolvers import reverse
from django.core.exceptions import ImproperlyConfigured
from django.db.models import Model
from django.forms.widgets import flatatt
from django.utils.translation import ugette... | |
#!/usr/bin/env python
#
# PrettyTable 0.5
# Copyright (c) 2009, <NAME> <<EMAIL>>
# All rights reserved.
# With contributions from:
# * <NAME>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of sour... | |
self._contributor(
display_name="<NAME>", viaf="73520345",
)
# _contributor() set sort_name to a random value; remove it.
with_viaf.sort_name = None
expect = ContributorData(
display_name="<NAME>", sort_name="<NAME>",
viaf="73520345"
)
_match(
expect, m(display_name="<NAME>")
)
# Again, this works even if... | |
all the column in :class:`UltimateListCtrl`."""
count = len(self._mainWin._columns)
for n in range(count):
self.DeleteColumn(0)
return True
def ClearAll(self):
"""Deletes everything in :class:`UltimateListCtrl`."""
self._mainWin.DeleteEverything()
def DeleteColumn(self, col):
"""
Deletes the specified ... | |
from ..mapping import MappedArray, AccessType
from ..indexing import is_fullslice, split_operation, slicer_sub2ind, invert_slice
from .. import volutils
from ..readers import reader_classes
from .metadata import ome_zooms, parse_unit
from nitorch.spatial import affine_default
from nitorch.core import pyutils, dtypes
fr... | |
**Response Structure**
- *(dict) --*
- **ComplianceSummaryItems** *(list) --*
A list of compliant and non-compliant summary counts based on compliance types. For example, this call returns State Manager associations, patches, or custom compliance types according to the filter criteria that you specified.
- *(di... | |
<filename>bb-master/sandbox/lib/python3.5/site-packages/buildbot/scripts/runner.py
# This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distr... | |
self.hemi = "both"
if self.hemi == "both":
# check if arrays are in string format
for hemi in ["L", "R"]:
self.data['normal'][hemi] = string2float(self.data['normal'][hemi])
self.data['position'][hemi] = string2float(self.data['position'][hemi])
else:
self.data['normal'][self.hemi] = string2float(self.data['no... | |
self.pan))
c.append(('elevation', self.elevation))
return c
class Part(MusicXMLElementList):
'''
This assumes a part-wise part
'''
def __init__(self):
MusicXMLElementList.__init__(self)
self._tag = 'part'
# attributes
self._attr['id'] = None
# component objects
self.componentList = [] # a list of measure... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'mayanqiong'
import math
from datetime import datetime
from typing import Callable
from tqsdk.datetime import _is_in_trading_time
from tqsdk.diff import _simple_merge_diff
from tqsdk.sim.utils import _get_price_range, _get_option_margin, _get_premium, _get_cl... | |
"""HTTP client functional tests."""
import binascii
import gc
import io
import os.path
import json
import http.cookies
import asyncio
import socket
import unittest
from unittest import mock
from multidict import MultiDict
import aiohttp
from aiohttp import client, helpers
from aiohttp import test_utils
from aiohttp.... | |
<reponame>HashSplat/np_rw_buffer
import numpy as np
from .utils import make_thread_safe
from .buffer import RingBuffer, RingBufferThreadSafe, UnderflowError
__all__ = ['UnderflowError', 'AudioFramingBuffer']
class AudioFramingBuffer(RingBufferThreadSafe):
"""The Audio Framing Buffer differs from the RingBuffer by... | |
to the beginning of the line.
CTRL-E Go to the end of the line.
CTRL-K Delete through to the end of the line.
CTRL-V Paste into command line (operating system dependent.)
If no text is on the command line, then control keys correspond to molecular editing:
Command Entry Field on the External GUI (gray window).
... | |
"""_import_vdb_ensemble.py: Module to import a vdb ensemble into resqml format."""
version = '15th November 2021'
# Nexus is a registered trademark of the Halliburton Company
import logging
log = logging.getLogger(__name__)
import resqpy.model as rq
import resqpy.olio.vdb as vdb
import resqpy.olio.xml_et as rqet
i... | |
def get_stp_brief_info_output_spanning_tree_info_spanning_tree_mode_rpvstp_rpvstp_port_if_role(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_stp_brief_info = ET.Element("get_stp_brief_info")
config = get_stp_brief_info
output = ET.SubElement(get_stp_brief_info, "output")
spannin... | |
"""Internal implementation of binana software
(http://nbcr.ucsd.edu/data/sw/hosted/binana/)
"""
import numpy as np
from oddt.scoring.descriptors import (atoms_by_type,
close_contacts_descriptor,
oddt_vina_descriptor)
from oddt.interactions import (close_contacts, hbonds, hydrophobic_contacts,
pi_cation, pi_stackin... | |
<filename>skyportal/services/test_server/test_api_server.py
import glob
import json
import datetime
import re
import os
import vcr
import tornado.ioloop
import tornado.httpserver
import tornado.web
from suds import Client
import requests
from baselayer.app.env import load_env
from baselayer.log import make_log
def ... | |
and word inputs
inputs_concat = tf.concat([char_inputs, word_inputs], 2)
if is_training and self.config['dropout'] < 1:
inputs_concat = tf.nn.dropout(inputs_concat, self.config['dropout'], name="dropout_inputs")
return inputs_concat
def get_char_embedding(self, pos):
with tf.variable_scope(str(pos)):
... | |
8*m.b1110 == 0)
m.c1318 = Constraint(expr= m.x85 + 6*m.b1111 == 0)
m.c1319 = Constraint(expr= m.x86 + 2*m.b1112 == 0)
m.c1320 = Constraint(expr= m.x87 + m.b1113 == 0)
m.c1321 = Constraint(expr= m.x88 + 3*m.b1114 == 0)
m.c1322 = Constraint(expr= m.x89 + 8*m.b1115 == 0)
m.c1323 = Constraint(expr= m.x90 + 3*m.b1116 ... | |
#
# For licensing see accompanying LICENSE.txt file.
# Copyright (C) 2020 Apple Inc. All Rights Reserved.
#
from pylab import *
import argparse
import h5py
import inspect
import os
import pandas as pd
import scipy.linalg
import sklearn.preprocessing
import sklearn.metrics
import path_utils
path_utils.add_path_to_sys... | |
# BY: SebasttianVelez
import pygame
import random
from Objects.Player import *
from Objects.Enemy import *
from Objects.Bullet import *
from Objects.Life import *
from Objects.Boss import *
from Objects.Nave import *
#Variables globales
ancho = 700
alto = 500
close = False
fondo1 = pygame.image.load('Mapa1.png')
relo... | |
self.generate_command(c, mode=mode, level=level + 1)
if level == 0 and isinstance(item, (list, tuple)) \
and mode == 'Command':
# commandline elements should be strings
item = repr(item)
new_command.append(item)
if isinstance(command, tuple):
new_command = tuple(new_command)
elif isinstance(command, set):
new_... | |
# rot_z=rotbox,
# filenames_sub=confinedfield_namesub,
# vals_name=mlfield_ensemble_name)
# del ccx, ccy, ccz
# Update old whole fields to new confined fields
grad_k, k = mlfield_ensemble[:, :3], mlfield_ensemble[:, 3]
epsilon = mlfield_ensemble[:, 4]
grad_u = mlfield_ensemble[:, 5:14]
u = mlfield_ensemble[:, 1... | |
"""
post_bands:
post_bands extract data from static-o_DS3_EBANDS.agr and it will build
the kpoints length: xcoord_k from the high symmetry line and the corresponding
basis for reciprocal space.
b1 = 1 / a1, b2 = 1 / a2 and b3 = 1 / a3.
"""
import os
import numpy as np
import matplotlib.pyplot as plt
... | |
Campus"),
("Remington College-Colorado Springs Campus","Remington College-Colorado Springs Campus"),
("Remington College-Columbia Campus","Remington College-Columbia Campus"),
("Remington College-Dallas Campus","Remington College-Dallas Campus"),
("Remington College-Fort Worth Campus","Remington College-Fort Worth ... | |
= models.CharField(max_length=255)
education = models.CharField(max_length=255)
# profession
def vote_smart_candidate_bio_object_filter(one_candidate_bio):
"""
Filter down the complete dict from Vote Smart to just the fields we use locally
:param one_candidate_bio:
:return:
"""
one_candidate_bio_filtered = {
... | |
<gh_stars>0
# usage:
#
# import SedmlToRr as s2p
# ret = s2p.sedml_to_python("full_path/sedml_file.sedml")
# exec ret
#
# import SedmlToRr as s2p
# ret = s2p.sedml_to_python("full_path/sedml_archive.sedx")
# exec ret
# a "full_path/sedml_archive" folder will be created and the unarchived files placed within
#
# import ... | |
for number in numberOfElements:
if number <= len(mediumElements):
m1 = MassFunction(*[(x, 1.0/number) for x in random.sample(mediumElements, number)])
m2 = MassFunction(*[(x, 1.0/number) for x in random.sample(mediumElements, number)])
m3 = MassFunction(*[(x, 1.0/number) for x in random.sample(mediumElements, numbe... | |
import jax.numpy as np
from jax import vmap
from jax.ops import index_add, index_update, index
from jax.scipy.linalg import cho_factor, cho_solve
from jax.scipy.linalg import solve as jsc_solve
from .utils import mvn_logpdf, solve, transpose, inv, inv_vmap
from jax.lax import scan, associative_scan
import math
INV2PI ... | |
<filename>rcnn/symbol/symbol_vgg.py<gh_stars>1-10
import mxnet as mx
import proposal
import proposal_target
from rcnn.config import config
import numpy as np
def get_vgg_conv(data):
"""
shared convolutional layers
:param data: Symbol
:return: Symbol
"""
# group 1
conv1_1 = mx.symbol.Convolution(
... | |
<filename>src/azure-cli/azure/cli/command_modules/ams/tests/latest/test_ams_live_event_scenarios.py<gh_stars>1-10
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt i... | |
from collections import OrderedDict
from .model import Param, RustType, non_keyword_name, prefixed, pascal_to_snake
class RustClassBinding:
def __init__(self, model):
self.__model = model
self.overloads = OverloadTree(model)
self.overloads.print_tree()
self.__methods = [RustMethodBinding(self, m) for m in model.... | |
<filename>cfnet/data.py
import os
import random
import h5py
import numpy as np
import math
from PIL import Image
from scipy import ndimage
from scipy.stats import truncnorm
def stretch_images(images, min_values, max_values):
perc = np.percentile(images, [0.1, 99.9], axis=[0, 1])
min_values = perc[0, :]
max_values ... | |
import os
import unittest
import numpy as np
import pandas as pd
from swamp.utils import create_tempfile
from swamp.wrappers.gesamt import Gesamt
class MockGesamt(Gesamt):
"""A class to mock :py:obj:`~swmap.wrappers.gesamt.Gesamt` for testing purposes"""
def run(self):
"""Override :py:func:`~swmap.wrappers.gesamt... | |
<gh_stars>10-100
import tensorflow as tf
import numpy as np
from scipy.integrate import odeint
import matplotlib.pyplot as plt
from plotting import newfig, savefig
import matplotlib.gridspec as gridspec
import seaborn as sns
import time
from utilities import neural_net, fwd_gradients, heaviside, \
tf_session, mean_sq... | |
#coding=utf-8
"""
Visualisations for the input-output function of neurons over time.
"""
import logging
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib import cm, colors, pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from src.config import settings
from src.io_time_heatmap import f... | |
<filename>source/gmm.py
from my_widgets import LabelSlider
from process import Image, FitFunctions, FitBroadening
from process_monitor import Monitor
from PyQt5 import QtCore, QtWidgets, QtGui, QtChart
from sys import getsizeof
from sklearn.mixture import BayesianGaussianMixture
from sklearn.mixture._gaussian_mixture i... | |
j: float, k: float) -> float: ...',
'def one(i: float) -> float: ...',
'def one_None(i: float) -> None: ...',
]
assert ti.pretty_format(__file__) == '\n'.join(expected)
def test_typeshed_complex():
"""Tests functions that take and return complex."""
def one(i): return i
def one_None(i): return None
def many(i,... | |
<filename>barajar/barajar.py<gh_stars>0
import random
import warnings
from _io import TextIOWrapper
virg = ','
pyignore = '#'#, '"""',"'''"
bloco = '#@B','#@A'
recuo = {
None:[4,1], # O índice de tamanhos, em ordem decrescente
'\t': 4,
' ': 1,
1: ' ',
4: '\t',
0:pyignore # comentários são sinalizados pelo 0
}
de... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.