input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
notchwidth / 2.0,
thefreq + notchwidth / 2.0,
)
def harmonicnotchfilter(timecourse, Fs, Ffundamental, notchpct=1.0, debug=False):
r"""Harmonic notch filter - removes a fundamental and its harmonics from a timecourse.
Parameters
----------
timecourse: 1D numpy array
Input data
Fs: float
Sample rate
Ffundame... | |
# Copyright 2004-2019 <NAME> <<EMAIL>>
#
# 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,... | |
"""RefineNet-LightWeight
RefineNet-LigthWeight PyTorch for non-commercial purposes
Copyright (c) 2018, <NAME> (<EMAIL>)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code... | |
<reponame>aidotse/Team-rahma.ai<gh_stars>0
import numpy
import cellprofiler_core.utilities.grid
import cellprofiler_core.image
import cellprofiler_core.measurement
import cellprofiler.modules.definegrid
import cellprofiler.modules.identifyobjectsingrid
import cellprofiler_core.object
import cellprofiler_core.pipeline... | |
<filename>src/melange/src/soc/views/helper/surveys.py
#!/usr/bin/env python2.5
#
# Copyright 2009 the Melange 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.or... | |
None:
query = query.filter(cls.gateway_id == gateway_id)
if since:
query = query.filter(cls.created_at >= since)
if until:
query = query.filter(cls.created_at <= until)
if types and len(types) > 0:
query = query.filter(cls.type.in_(types))
if resolved is not None:
if resolved:
query = query.filter(cls.resol... | |
is None:
percentile_delta = 0.005
max_values = self.extreme_values[:, :, 1].compressed()
min_values = self.extreme_values[:, :, 0].compressed()
# Remove masked values.
max_values.sort()
min_values.sort()
length = len(max_values)
index = int((1.0 - percentile_delta) * length)
max_val = max_values[index]
index ... | |
<filename>addon.py
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import base64
import hashlib
import html
import json
import random
import re
import string
import sys
import time
import urllib
import requests
# import xbmcgui
from bs4 import BeautifulSoup
from xbmcswift2 import Plugin, xbmcgui, xbmc, xbmcaddon, xbmcplu... | |
import numpy
import scipy.constants as codata
from numpy.testing import assert_almost_equal
import h5py
import time
# IMPORTANT: Column 11 (index 10) is wavenumber (cm^-1) as internally in Shadow
class Beam(object):
def __init__(self, N=1000, array=None):
"""
:param N:
:param array:
:return:
"""
if array i... | |
import numpy as np
import pytest
from shapecheck import (ShapeError, check_shapes, is_checking_enabled, is_compatible,
set_checking_enabled, str_to_shape)
from .utils import CaptureStdOut
def test_basic():
@check_shapes('3', '4', out_='2')
def f(x, y):
return x[:2]**2 + y[:2]**2
f(np.array([1, 2, 3]), np.arra... | |
choice = await self.wait_for('message', check=check)
while choice.content not in ('1', '2', '/стоп'):
await message.channel.send(user_player + ', чтобы ответить,'
' введите один из следующих вариантов: \n1\n2\n/стоп')
choice = await self.wait_for('message', check=check)
if choice.content == '/стоп':
# игрок... | |
<gh_stars>10-100
# -*- coding: utf-8 -*-
# Copyright 2022, SERTIT-ICube - France, https:#sertit.unistra.fr/
# This file is part of eoreader project
# https:#github.com/sertit/eoreader
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#... | |
<filename>pyNastran/op2/result_objects/grid_point_weight.py<gh_stars>0
"""defines the GridPointWeight class"""
from io import StringIO
from struct import pack
import numpy as np
from pyNastran.utils import object_attributes, object_methods
from pyNastran.op2.result_objects.op2_objects import _write_table_header
from p... | |
<filename>widgets/history.py
from utils import pmts
from kivy.clock import Clock
from kivy.core.text import Label
from kivy.graphics import Color, Rectangle
from kivy.metrics import pt
from kivy.uix.behaviors.focus import FocusBehavior
from kivy.uix.widget import Widget
from dsn.history.construct import eh_note_play
... | |
<filename>DeepBach/model_manager.py
"""
Created on 15 mars 2016
@author: <NAME>
"""
import os
import pickle
from keras.models import model_from_json, model_from_yaml
from music21 import midi
from tqdm import tqdm
from .data_utils import generator_from_raw_dataset, BACH_DATASET, \
all_features, START_SYMBOL, END_SYM... | |
<filename>bmdal/feature_maps.py<gh_stars>1-10
from .feature_data import *
import math
import utils
def robust_cholesky(matrix: torch.Tensor) -> torch.Tensor:
"""
Implements a Cholesky decomposition.
If the Cholesky decomposition fails, it is retried with increasing added jitter on the diagonal.
:param matrix: Sym... | |
<reponame>Khan/rbtools<gh_stars>0
#!/usr/bin/env python
import base64
import cookielib
import getpass
import logging
import mimetools
import os
import re
import sys
import urllib2
from optparse import OptionParser
from pkg_resources import parse_version
from urlparse import urljoin, urlparse
# We may have a problem: r... | |
updated podcast
'''
self._check_arguement_type(podcast_id, int, 'Podcast ID must be int type')
pod = self.db_session.query(Podcast).get(podcast_id)
if not pod:
self._fail("Podcast not found for ID:%s" % podcast_id)
if podcast_name is not None:
self._check_arguement_type(podcast_name, str, 'Podcast name must be ... | |
#
# Copyright (C) 2013 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the fo... | |
project_path)
plot.delete()
return file_to_add
return None
@aedt_exception_handler
def plot_model_obj(
self,
objects=None,
show=True,
export_path=None,
plot_as_separate_objects=True,
plot_air_objects=False,
force_opacity_value=None,
clean_files=False,
):
"""Plot the model or a substet of objects.
Para... | |
specified control.
c: The System.Windows.Forms.Control to assign the System.Windows.Forms.Control.Paint event to.
e: An System.Windows.Forms.PaintEventArgs that contains the event data.
"""
pass
def InvokePaintBackground(self, *args): #cannot find CLR method
"""
InvokePaintBackground(self: Control... | |
[ 38497 : 78598 ] wmpLDDT: 88.44
# score bias c-Evalue i-Evalue hmmfrom hmm to alifrom ali to envfrom env to acc
--- ------ ----- --------- --------- ------- ------- ------- ------- ------- ------- ----
1 ! 31.5 11.0 3.6e-10 3.6e-06 87 124 .. 27 64 .. 15 74 .. 0.87
2 ? -1.1 0.3 3.4 3.4e+04 129 168 .. 225 236 .. 202... | |
<gh_stars>1-10
"""
The Monroe domain knowledge base, re-encoded as a copct causal relation.
The causes function is implemented with two separate sub-routines:
One for the top-level causes, and one for all other mid-level causes.
This way the top-level causes can be easily omitted in the modified Monroe experiments.
Th... | |
<reponame>Accelize/drm
# -*- coding: utf-8 -*-
"""
Test logging mechanism of DRM Library.
"""
import pytest
from glob import glob
from os import remove, getpid, makedirs, access, R_OK, W_OK
from os.path import getsize, isfile, dirname, join, realpath, isdir, expanduser
from re import search, findall, finditer, MULTILIN... | |
0): (0, 1),
(8, 15, 4, 1): (0, 1),
(8, 15, 4, 2): (0, 1),
(8, 15, 4, 3): (0, 0),
(8, 15, 4, 4): (0, 1),
(8, 15, 4, 5): (0, 1),
(8, 15, 5, -5): (0, 1),
(8, 15, 5, -4): (0, 1),
(8, 15, 5, -3): (0, 1),
(8, 15, 5, -2): (0, 1),
(8, 15, 5, -1): (0, 1),
(8, 15, 5, 0): (0, 1),
(8, 15, 5, 1): (0, 1),
(8, 15, 5, 2):... | |
p, pub_content pc
where pc.pub_id = p.pub_id
and pc.title_id = t1.title_id)
and c.report_type = 275
and t1.title_id = c.record_id
order by t1.title_title"""
cleanup.none = 'Title Dates Before First Publication Dates'
cleanup.note = 'This report is currently limited to ANTHOLOGY, CHAPBOOK, COLLECTION, COVERART, O... | |
"""Tests for module state accessors in the protocol engine state store."""
import pytest
from pytest_lazyfixture import lazy_fixture # type: ignore[import]
from contextlib import nullcontext
from typing import ContextManager, Dict, NamedTuple, Optional, Type, Union
from opentrons_shared_data import load_shared_data
f... | |
<reponame>draguscloud/MultiWorld-Utilities<gh_stars>0
#!/usr/bin/env python3
import argparse
import copy
import os
import logging
import random
import textwrap
import shlex
import sys
from Main import main, get_seed
from Rom import get_sprite_from_name
from Utils import is_bundled, close_console
class ArgumentDefaul... | |
Compute moments
M = createImageF(numMoments,numMoments)
for m,n in itertools.product(range(0, numMoments), range(0, numMoments)):
for indexPixel in range(0, numPoints):
y = (pixelList[indexPixel])[0]
x = (pixelList[indexPixel])[1]
val = (pixelList[indexPixel])[2]
M[n,m] += (x**n) * (y**m) * val
# Geometric ce... | |
= self._default_is_radian if is_radian is None else is_radian
_pose1 = [pose1[i] if i <= 2 or is_radian else math.radians(pose1[i]) for i in range(6)]
_pose2 = [pose2[i] if i <= 2 or is_radian else math.radians(pose2[i]) for i in range(6)]
ret = self.arm_cmd.get_pose_offset(_pose1, _pose2, orient_type_in, orient_typ... | |
<reponame>jbeilstenedmands/cctbx_project<filename>iota/components/iota_ui_init.py
from __future__ import division, print_function, absolute_import
from past.builtins import range
'''
Author : Lyubimov, A.Y.
Created : 04/14/2014
Last Changed: 11/05/2018
Description : IOTA GUI Initialization module
'''
import os
import... | |
+ m.x388 - m.x423 + m.x472 + m.x486 - m.x521 + m.x570 + m.x584 - m.x619 + m.x668
+ m.x682 - m.x717 + m.x766 + m.x780 - m.x815 <= 100)
m.c2543 = Constraint(expr= m.x375 + m.x389 - m.x424 + m.x473 + m.x487 - m.x522 + m.x571 + m.x585 - m.x620 + m.x669
+ m.x683 - m.x718 + m.x767 + m.x781 - m.x816 <= 100)
m.c2544 = Cons... | |
other objects as well.
Parameters:
- animation: may be a Trajectory or a list of configurations.
- speed: a modulator on the animation speed. If the animation is a list of
milestones, it is by default run at 1 milestone per second.
- endBehavior: either 'loop' (animation repeats forever) or 'halt' (plays once).
... | |
field.name == 'date' or field.name == 'startTime':
setattr(sf, field.name, str(getattr(session, field.name)))
else:
setattr(sf, field.name, getattr(session, field.name))
sf.websafeKey = session.key.urlsafe()
sf.check_initialized()
return sf
def _createSessionObject(self, request):
"""Create or update Session o... | |
# -----------------------------------------------------------------------------
# Copyright (c) 2013-2021, NeXpy Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING, distributed with this software.
# -------------------------------------------------... | |
#!/usr/bin/env python3
"""Command-line interface to gruut"""
import argparse
import csv
import dataclasses
import itertools
import json
import logging
import os
import shutil
import sys
import tempfile
import typing
from collections import Counter
from pathlib import Path
import jsonlines
import pydash
import yaml
im... | |
# Unit testing for the Event socket
import logging
import io
import random
import socket
import os
import errno
import time
from collections import deque
from chai import Chai
import eventsocket
from eventsocket import EventSocket
class EventSocketTest(Chai):
def setUp(self):
super(EventSocketTest,self).setUp()
... | |
"""Stockham kernel generator."""
import functools
import sys
from collections import namedtuple
from math import ceil
from pathlib import Path
from types import SimpleNamespace as NS
from generator import *
#
# Stockham FFTs!
#
LaunchParams = namedtuple('LaunchParams', ['transforms_per_block', 'threads_per_block'... | |
<gh_stars>0
import asyncio
import os
import unicodedata
import aiohttp
import discord
import lavalink
import unidecode
from redbot.core import Config, checks, commands
from redbot.core.utils.chat_formatting import pagify
from redbot.core.utils.predicates import MessagePredicate
from .api import generate_urls
try:
... | |
<filename>tests/diag/test_ccsd.py
import wicked as w
def print_comparison(val, val2):
print(f"Result: {val}")
print(f"Test: {val2}")
def compare_expressions(test, ref):
test_expr = w.Expression()
ref_expr = w.Expression()
for s in ref:
ref_expr += w.string_to_expr(s)
for eq in test:
test_expr += eq.rhs_expr... | |
# Copyright (c) 2011, <NAME> [see LICENSE.txt]
# This software is funded in part by NIH Grant P20 RR016454.
# Python 2 to 3 workarounds
import sys
if sys.version_info[0] == 2:
_strobj = str
_xrange = xrange
elif sys.version_info[0] == 3:
_strobj = str
_xrange = range
import collections
import csv
import itertoo... | |
<gh_stars>0
import requests
import random
from datetime import datetime, timedelta
import os
from lxml import etree
# Define Path Variables
CURDIR = os.path.dirname(__file__)
def elapsed_time(previous_time):
"""
Calculates the elapsed time, in seconds, since a given previous time.
:param previous_time: Datetime s... | |
<reponame>kirmerzlikin/intellij-community
r'''
This module provides utilities to get the absolute filenames so that we can be sure that:
- The case of a file will match the actual file in the filesystem (otherwise breakpoints won't be hit).
- Providing means for the user to make path conversions when doing a remote ... | |
# review, is copy really needed?
if edge[0] > vertex:
self.edges[ei][0] = edge[0] - 1
if edge[1] > vertex:
self.edges[ei][1] = edge[1] - 1
if self.hasEdgeLabels():
newEdgeLabels = {}
for key, value in self.edge_labels.items():
key0 = key[0]
key1 = key[1]
if key0 >= vertex:
key0 -= 1
if key1 >= vertex:
k... | |
## attack.py -- generate audio adversarial examples
##
## Copyright (C) 2017, <NAME> <<EMAIL>>.
##
## This program is licenced under the BSD 2-Clause licence,
## contained in the LICENCE file in this directory.
import numpy as np
import tensorflow as tf
import argparse
from shutil import copyfile
import s... | |
# 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 applicable ... | |
## Zaszi's config.py for Qutebrowser
# ----------------------------------------------------------------------------
# GENERAL
# ----------------------------------------------------------------------------
## This is here so configs done via the GUI are still loaded.
## Remove it to not load settings done via the GUI.... | |
'Ethernet Controller X710 for 10GbE SFP+ [1572]', 'link_mode': '0',
'driver': 'i40e', 'pclass': 'Ethernet controller [0200]', 'mtu': 9216,
'psdevice': 'Ethernet Converged Network Adapter X710-2 [0008]',
'mac': '3c:fd:fe:b5:73:28', 'prevision': '-r01', 'sriov_vf_pdevice_id': None,
'sriov_totalvfs': 64, 'pciaddr': '0... | |
from physicsTable import *
from operator import itemgetter
import sys
import geometry
import numpy as np
# Constants for ease
L = 101
R = -101
T = 103
B = -103
# Wall class for various operations
class Wall(object):
def __init__(self, p1, p2):
self.l = p1[0]
self.t = p1[1]
self.r = p2[0]
self.b = p2[1]
self.gro... | |
value="INYU_LIT - INYU_LIT (Taught at NYU)">INYU_LIT - INYU_LIT (Taught at NYU)</option>
<option value="INYU_MES - INYU_MES (Taught at NYU)">INYU_MES - INYU_MES (Taught at NYU)</option>
<option value="INYU_MET - INYU_METRO ST (Taught at NYU)">INYU_MET - INYU_METRO ST (Taught at NYU)</option>
<option value="... | |
<span class="js-select-button-text hidden-select-button-text">
<svg aria-hidden="true" class="octicon octicon-mute" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M8 2.81v10.38c0 .67-.81 1-1.28.53L3 10H1c-.55 0-1-.45-1-1V7c0-.55.45-1 1-1h2l3.72-3.72C7.19 1.81 8 2.14 8 2.81zm7.53 ... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
import io
import os
import pytest
import zipfile
from textwrap import dedent
from os.path import join
from .base import BaseTestApp
from .. import run_nbgrader
from ...utils import rmtree
@pytest.fixture
def archive_dir(request, course_dir):
path = os.path.join(course_dir, "... | |
<reponame>fegonda/icon_demo
import cPickle
import gzip
import os
import sys
import time
import numpy
import numpy as np
import theano
import theano.tensor as T
from scipy.ndimage.interpolation import shift
base_path = os.path.dirname(__file__)
sys.path.insert(1,os.path.join(base_path, '../'))
sys.path.insert(2,os.p... | |
<filename>pronaHotMod/lib_parser.py
import math
import sys
import re
class ParseError(Exception): pass #To indicate a parsing error
class EmptyError(Exception): pass #To indicate empty data passed to the parser
class NoResultError(Exception): pass #To indicate that a method did not feel like producing a result, use... | |
<gh_stars>1-10
#!/usr/bin/env python
# coding: utf-8
# # Lexical normalization pipeline
#
# author - <NAME>
# date - 15-7-2019
#
# Python 3 script
#
# This pipeline takes raw text data and performs:
# - Removes URLs, email addresses
# - Tokenization with NLTK
# - Removes non_English posts (conservat... | |
df.agg("mean", axis="columns")
0 2.0
1 5.0
2 8.0
3 NaN
dtype: float64
See also
--------
DataFrame.apply : Perform any type of operations.
DataFrame.transform : Perform transformation type operations.
pandas.core.groupby.GroupBy : Perform operations over groups.
pandas.core.resample.Resampler : Perform opera... | |
<filename>s9k.py
#!/usr/bin/env python3
import logging
import shlex
import argparse
import os
from geventwebsocket import WebSocketError
from geventwebsocket.handler import WebSocketHandler
from gevent import pywsgi
from gevent.select import select
from gevent.subprocess import Popen, PIPE
import bottle
from bottle.e... | |
<filename>qwiic_oled_base/qwiic_oled_base.py
#-----------------------------------------------------------------------------
# qwiic_oled_base.py
#
#------------------------------------------------------------------------
#
# Written by SparkFun Electronics, May 2021
#
#
# More information on qwiic is at https:= www.spa... | |
if (not minor) and (char >= "0" and char <= "9"): # noqa
major += char
continue
minor+=char
if debug:
myPrint("D","Decoded: %s.%s" %(major,minor))
try:
return [int(major),minor]
except:
return [0,0]
def check_for_updatable_extensions_on_startup(statusLabel):
global lIgnoreOutdatedExtensions_TB
Toolbox_v... | |
#/*
# * Copyright (c) 2019,2020 Xilinx Inc. All rights reserved.
# *
# * Author:
# * <NAME> <<EMAIL>>
# *
# * SPDX-License-Identifier: BSD-3-Clause
# */
import copy
import struct
import sys
import types
import unittest
import os
import getopt
import re
import subprocess
import shutil
from pathlib import Path
from path... | |
from keras import backend as K
from keras.applications.imagenet_utils import _obtain_input_shape
from keras.models import Model
from keras.engine.topology import get_source_inputs
from keras.layers import Activation, Add, Concatenate, GlobalAveragePooling2D,GlobalMaxPooling2D, Input, Dense
from keras.layers import Conv... | |
#
# Copyright (c) 2015-2020 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
import json
import pecan
from pecan import rest
import six
from six.moves import http_client as httplib
from wsme import types as wsme_types
import wsmeext.pecan as wsme_pecan
from nfv_common import debug
from nfv_common imp... | |
<reponame>n-longuetmarx/tbip<gh_stars>10-100
"""Helpful functions for analysis."""
import numpy as np
import os
import scipy.sparse as sparse
from scipy.stats import bernoulli, poisson
def load_text_data(data_dir):
"""Load text data used to train the TBIP.
Args:
data_dir: Path to directory where data is stored.... | |
"""
Module contains tools for processing files into DataFrames or other objects
"""
from StringIO import StringIO
import re
from itertools import izip
from urlparse import urlparse
import numpy as np
from pandas.core.index import Index, MultiIndex
from pandas.core.frame import DataFrame
import datetime
import pandas.... | |
data_dict.update({hdu.header['CTYPE' + str(i)]:
(hdu.header['NAXIS'] - i + 1,
hdu.header['NAXIS' + str(i)])})
# Save shape and dimensions of data recarray
self.data_dict = data_dict
self.nif = data_dict['IF'][1]
self.nstokes = data_dict['STOKES'][1]
# Create dictionary with necessary slices
slices_dict = Order... | |
<reponame>ydallilar/flaremodel
# Licensed under a 3-clause BSD style license - see LICENSE
import numpy as np
import warnings
from .utils import *
from .utils.gfuncs import GPU_ENABLED
class Geometry:
"""
Base Geometry class to extend for other geometries
Parameters
----------
edist: str
Name of the electron ... | |
validate(self):
return
def __hash__(self):
value = 17
value = (value * 31) ^ hash(self.cxt_id)
value = (value * 31) ^ hash(self.mgrp_handle)
value = (value * 31) ^ hash(self.l1_handle)
return value
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
return '%s(%s)'... | |
circmask
@staticmethod
def get_unique_values(mask):
"""Get all unique positive values from labeled mask."""
values = np.unique(mask[mask > 0])
if values.size == 0:
values = None
return values
@staticmethod
def get_unique_count(mask):
"""Get count of unique positive values from labeled mask."""
return np.un... | |
<reponame>DeVriesMatt/VGN
# a special script for testing images in the HRF dataset
# here, multiple sub-images from a single image are independently tested
# and tiled to make a result for the whole image
# coded by syshin (180430)
# updated by syshin (180903)
import numpy as np
import os
import pdb
import argparse
i... | |
f_dist_new[3])
f2_diff = f2_change / sampling_time
# Change in finger 3 distal x-coordinate position
f3_change = abs(f_dist_old[6] - f_dist_new[6])
f3_diff = f3_change / sampling_time
# Sum of changes in distal fingers
f_all_change = f1_diff + f2_diff + f3_diff
#print("f_all_change: ", f_all_change)
# If th... | |
return
t = (cartype,
carclass,
railroad,
home_station,
car)
sql = 'update car set cartype = ?, carclass = ?, railroad = ?, home_station = ? where car = ?'
if self.db_update(sql, t) != 0:
return
#report the change to the screen
print('CAR DETAILS CHANGED SUCCESSFULLY')
print('RUNNING #: ' + ca... | |
import os
import collections
import numpy as np
from ipywidgets import widgets
from IPython.core.display import display, HTML
import logging
from NeuNorm.normalization import Normalization
from __code import file_handler
from __code.ipywe import myfileselector
from __code.normalization.get import Get
from __code.norm... | |
# coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class ListEventItems:
"""
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 i... | |
<reponame>rekhabiswal/sage<gh_stars>0
"""
Root system data for dual Cartan types
"""
#*****************************************************************************
# Copyright (C) 2008-2009 <NAME> <anne at math.ucdavis.edu>
# Copyright (C) 2008-2013 <NAME> <nthiery at users.sf.net>
#
# Distributed under the terms of th... | |
check if it's in our lookup
if state in county_by_code and county_code in county_by_code[state]:
obj['legal_entity_county_name'] = county_by_code[state][county_code]
obj['legal_entity_zip5'] = obj['legal_entity_zip4'][:5]
if len(obj['legal_entity_zip4']) > 5:
obj['legal_entity_zip_last4'] = obj['legal_entity_zip4... | |
= grad
assert w.is_dense()
return w
g_output = [from_untyped(grad) for grad in g_output]
grad_defs_str, g_input = C.get_gradient_defs(
op_def.SerializeToString(), g_output)
def to_untyped(grad_wrapper):
if grad_wrapper.is_empty():
return None
if grad_wrapper.is_sparse():
return GradientSlice(grad_wrapper.in... | |
"""Tests for Gremlin database."""
import requests
import pprint
from behave import then, when
from semantic_version import Version
import time
from src.attribute_checks import check_and_get_attribute, check_attribute_presence, check_cve_value
from src.json_utils import check_request_id_value_in_json_response
from src.... | |
<filename>BriVL-code-inference/models/vl_model.py
import torch
import torch.nn as nn
from .fakeTransformer import FakeTransformer
from .bert import Bert
from utils import pairLoss, alignmentLoss, attAlignmentLoss, AlignTripLoss, SimpTripLoss, NCELoss
import torch.nn.functional as F
import timm
import numpy as np... | |
<gh_stars>10-100
import unittest
import sys
import inspect
from unittest.mock import Mock
from io import StringIO
from math import ceil
from damage import Damage
from classes import Paladin
from spells import PaladinSpell
from models.spells.loader import load_paladin_spells_for_level
class PaladinTests(unittest.Test... | |
<reponame>rashecl/COVID_Inisghts<filename>US_coronavirus_map.py<gh_stars>0
import matplotlib
matplotlib.use('Agg')
import numpy as np
from bokeh.io import show
from bokeh.layouts import column, row
from bokeh.io import curdoc
from bokeh.models import LogColorMapper, LinearColorMapper, ColorBar, ColumnDataSource, LogTi... | |
#!/usr/bin/env python
# This file is part of Diamond.
#
# Diamond 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, either version 3 of the License, or
# (at your option) any later version.
#
# Diamond is distr... | |
#!/usr/bin/env python3
# mc_chain_sw_module.py
#------------------------------------------------------------------------------------------------#
# This software was written in 2016/17 #
# by <NAME> <<EMAIL>>/<<EMAIL>> #
# and <NAME> <<EMAIL>> ("the authors"), #
# to accompany the book "Computer Simulation of Liquids"... | |
Face
GUI selection: yes
Selection by name: yes
Recursive: yes
Default value: None
# rel
Description: If equals True, the function try to relimit the rebuild face using the source face edges.
Type: Boolean
GUI selection: -
Selection by name: -
Recursive: -
Default value: False
# switc... | |
[])
events = ("start", "end")
context = iterparse(SIMPLE_XMLFILE, events)
self.assertEqual([(action, elem.tag) for action, elem in context], [
('start', 'root'),
('start', 'element'),
('end', 'element'),
('start', 'element'),
('end', 'element'),
('start', 'empty-element'),
('end', 'empty-element'),
('end', ... | |
spring2_axis
spring3_pos = self.walls[(Num_layer - 1) * 6 + 4]
spring3_axis = self.walls[(Num_layer - 1) * 6 + 5]
spring3_end = spring3_pos + spring3_axis
dis_spr1 = (spring1_end - point_pos).mag - point_radius
dis_spr2 = (spring2_end - point_pos).mag - point_radius
dis_spr3 = (spring3_end - point_pos).mag ... | |
<filename>interface.py
import re
import googleapiclient
import os
import sys
import subprocess
import urllib.request
import tempfile
import tkinter
import ffmpeg_script
import api_logic
import typing
import time
from pathlib import Path
from tkinter import filedialog, messagebox, ttk, font
from ffmpeg_script import *... | |
def make_partition_list(N, mod=10**9+7):
# http://d.hatena.ne.jp/inamori/20121216/p1
# N 以下の分割数のリストを返す O(n**(3/2))
# mod は素数でなくても良い
from itertools import count
P = [0]*(N+1)
P[0] = 1
for n in range(1, N+1):
p = 0
m1 = 0
for k in count(1):
m1 += 3*k - 2 # m1 = k * (3*k-1) // 2
if n < m1:
break
p += P[n-m1]... | |
'M',
87: 'u', 88: 'E', 89: 'P', 90: 'W', 91: 'j', 92: 'L', 93: 'O', 94: 'T',
95: 'X', 96: 'p', 97: 'B', 98: 'u', 99: '^', 100: '\\', 101: 'c',
102: 'l', 103: 'k', 104: '0', 105: '4', 106: 'I', 107: 'C', 108: '^',
109: 'A', 110: '3', 111: 'E', 112: 'g', 113: 'b', 114: 'v', 115: '`',
116: '@', 117: 'U', 118: 'u', 11... | |
:type vv1: GXVV
:type vv2: GXVV
.. versionadded:: 5.0.8
**License:** `Geosoft End-User License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-end-user-lic>`_
**Note:** Removes all indices where either `GXVV <geosoft.gxapi.GXVV>` has a dummy, or is
not defined (due to length dif... | |
== sync_t.CONTEXT: # pragma: no cover
return
if te_inst.subformat == sync_t.TRAP:
self.report_trap(te_inst)
if not te_inst.interrupt:
self.report_epc(self.exception_address(te_inst))
if te_inst.thaddr == 0:
return
self.inferred_address = False
self.address = te_inst.address << self.settings["iaddress_lsb_p"]
... | |
result = self.mgmt_client.disks.grant_access(resource_group.name, DISK_NAME, ACCESS, DURATION_IN_SECONDS)
result = result.result()
# SAS_URI = result.access_sas
# Grant acess snapshot (TODO: need swagger file)
ACCESS = "Read"
DURATION_IN_SECONDS = 1800
result = self.mgmt_client.snapshots.grant_access(resource_gr... | |
<gh_stars>1-10
#!/usr/bin/env python
# coding: utf-8
## How to get started with Numerai
## *The hardest data science tournament on the planet?*
# 如何开始使用Numerai
# 地球上最艰苦的数据科学比赛?
# 
#
# )
sys.path.insert(0, os.path.abspath('%s/..' % cur... | |
import re
import os.path
import functools
import mathutils
from math import radians
import bpy
import pyawd
from pyawd.core import *
from pyawd.anim import *
from pyawd.scene import *
from pyawd.geom import *
from pyawd.material import *
from pyawd.utils.math import *
from pyawd.utils.geom import AWDGeomUtil
class... | |
# Copyright (C) 2020 Georgia Tech Center for Experimental Research in Computer
# Systems
import argparse
import datetime
import os
import re
import shutil
import subprocess
import threading
import time
import jinja2
import yaml
from ssh_client import SSHClient
### Global variables
DOCKER_HUB_USERNAME = None
DOCKER... | |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# sources: inference/dataplane.proto
# plugin: python-betterproto
from dataclasses import dataclass
from typing import Dict, List, Optional
import betterproto
import grpclib
from betterproto.grpc.grpclib_server import ServiceBase
@dataclass(eq=False, repr=Fal... | |
1),
(7, 5, -5, -2): (0, 1),
(7, 5, -5, -1): (0, 1),
(7, 5, -5, 0): (0, 1),
(7, 5, -5, 1): (0, 1),
(7, 5, -5, 2): (0, 1),
(7, 5, -5, 3): (0, 1),
(7, 5, -5, 4): (0, 1),
(7, 5, -5, 5): (0, 1),
(7, 5, -4, -5): (-1, 0),
(7, 5, -4, -4): (-1, -1),
(7, 5, -4, -3): (0, 1),
(7, 5, -4, -2): (0, 1),
(7, 5, -4, -1): (0... | |
(self, alg):
"""Return True if HASHCRACK can crack this type of algorithm and
False if it cannot."""
if alg in self.supported_algorithm:
return True
else:
return False
def crack (self, hashvalue, alg):
"""Try to crack the hash.
@param hashvalue Hash to crack.
@param alg Algorithm to crack."""... | |
<reponame>utdsimmons/ohpc
#!/usr/bin/env python
# ClusterShell (distant, pdsh worker) test suite
# Written by <NAME>
"""Unit test for ClusterShell Task (distant, pdsh worker)"""
import copy
import shutil
import sys
sys.path.insert(0, '../lib')
from TLib import HOSTNAME, make_temp_filename, make_temp_dir
from Clust... | |
# Run the simulation
data.binary('sander', args, basename)
# Check if output is okay
util.check_output(sander_out, ['FATAL'])
top, crds, vels = get_restart_files(basename)
util.check_output(top)
util.check_output(crds)
# ##########################################################
# # 4. Read trajectories with ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.