input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
0
for label in self.gridline_values:
#draw the gridline
gridline = ET.Element("path", d="M %d %d L %d %d" % (0, (self.grid_height - count * grid_space), self.grid_width, (self.grid_height - count * grid_space)))
gridline.attrib['class'] = 'y-gridline'
y_axis.append(gridline)
#draw the text label
gridline_label ... | |
import pytest
import networkx as nx
from networkx.algorithms.similarity import (
graph_edit_distance,
optimal_edit_paths,
optimize_graph_edit_distance,
)
from networkx.generators.classic import (
circular_ladder_graph,
cycle_graph,
path_graph,
wheel_graph,
)
def nmatch(n1, n2):
return n1 == n2
def ematch(e... | |
"""
control_utils.py utility module for manipulating controllers
"""
# import standard modules
import re
# import local modules
import read_sides
import constraint_utils
import name_utils
# import custom modules
from maya_utils import file_utils
from maya_utils import object_utils
from maya_utils import attribute_uti... | |
<reponame>TanayShukla/Random
#!/usr/bin/env python
#
# Copyright (C) 2011-2012 <NAME>
# Copyright (C) 2011-2012 <NAME>
# Copyright (C) 2005-2011 <NAME>
# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under t... | |
= Parameter(name = 'VV1x1',
nature = 'internal',
type = 'complex',
value = 'RVV1x1',
texname = '\\text{VV1x1}')
VV1x2 = Parameter(name = 'VV1x2',
nature = 'internal',
type = 'complex',
value = 'RVV1x2',
texname = '\\text{VV1x2}')
VV2x1 = Parameter(name = 'VV2x1',
nature = 'internal',
type = 'complex',
valu... | |
############################################# IMPORTING MODULES
import tkinter as tk
from tkinter import ttk
from tkinter import PhotoImage
from tkinter import Canvas
from tkinter import messagebox as mess
import tkinter.simpledialog as tsd
import os
from cv2 import cv2
import csv
import numpy as np
from PIL import Ima... | |
<reponame>inuitwallet/plunge_android
import json
from kivy.app import App
from kivy.config import ConfigParser
from kivy.core.window import Window
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy.uix.popup import Popup
from kivy.uix.slider import Sli... | |
"""
Python 2-3 Tree implementation
2-3 Tree is a balanced tree each node of which may contain 2 elements
and 3 references on its children.
Element lookup speed is log2(N) < x < log3(N)
Insertion and deletion is about 2 * log2(N)
See http://en.wikipedia.org/wiki/2-3_tree for more info
2011 by <NAME>
"""
cl... | |
"▁yuk": 28792,
"▁Úr": 28793,
"anam": 28794,
"kz": 28795,
"laid": 28796,
"shti": 28797,
"sional": 28798,
"\x92": 28799,
"łów": 28800,
"▁Abdurrahman": 28801,
"▁Bele": 28802,
"▁Coruña": 28803,
"▁Dating": 28804,
"▁Freude": 28805,
"▁Gondol": 28806,
"▁Karya": 28807,
"▁Tibb": 28808,
"▁Yanga": 28809,
"▁Yazı":... | |
lmr <-> gpcp
indok = np.isfinite(gpcpvec); nbok = np.sum(indok); nball = gpcpvec.shape[1]
ratio = float(nbok)/float(nball)
if ratio > valid_frac:
lg_csave[k] = np.corrcoef(lmrvec[indok],gpcpvec[indok])[0,1]
else:
lg_csave[k] = np.nan
print(' lmr-gpcp correlation : %s' % str(lg_csave[k]))
# lmr <-> cmap
indok... | |
headers = {
"Content-type": "application/x-www-form-urlencoded",
"Accept": "text/plain"
}
connection = httplib.HTTPConnection(host, port)
connection.request("POST", pathinfo, params, headers)
# Status
response = connection.getresponse()
print("Status: " + str(response.status), "Reason: " + str(response.reason... | |
an ISO date formatted string or a Python `datetime` object.
:return: Returns `None` if no alerts were found, otherwise returns a dict with three keys: "n" and "t", the same as supplied in the client
data, the key "a" (for alert) which contains a *description string* of the alert similar to `value < min_threshold` ... | |
# This script is to replace the missing values in a modified paleogeography.
import netCDF4 as nc
import numpy as np
import matplotlib.pyplot as plt
import os
import pyproj as proj4
import scipy.interpolate as si
# The CoordinateSystem and GeographicSystem classes are hereby used courtesy of Dr. <NAME>; his
# reposito... | |
request for private IP on its own. Otherwise, false
"""
EnablePrivateIPRequest = None # bool
"""
Amount of emails sent from this Account
"""
TotalEmailsSent = None # long
"""
Percent of Unknown users - users that couldn't be found
"""
UnknownUsersPercent = None # double
"""
Percent of Complai... | |
)
self._ats.registerCallback(self.msg_filter_callback)
rospy.logdebug("Camera sensor message_filter created.")
# Create state listener
self._tf2_buffer = tf2_ros.Buffer()
self._tf2_listener = tf2_ros.TransformListener(self._tf2_buffer)
# Create publisher to publish the place pose
rospy.logdebug("Creating place... | |
<gh_stars>0
'''Wrapper for dbmi.h
Generated with:
./ctypesgen.py --cpp gcc -E -I/Applications/GRASS-7.8.app/Contents/Resources/include -D_Nullable= -I/Users/cmbarton/grass_source/grass-7.8.3/dist.x86_64-apple-darwin18.7.0/include -I/Users/cmbarton/grass_source/grass-7.8.3/dist.x86_64-apple-darwin18.7.0/include -D__GLI... | |
<gh_stars>1-10
"""
List of command codes and handler functions for commands sent to and
from the alarm panel, plus code to tect mappings.
"""
from concord_helpers import BadMessageException, ascii_hex_to_byte
from concord_tokens import decode_text_tokens
from concord_alarm_codes import ALARM_CODES
STAR = 0xa
HASH = ... | |
import sys
import argparse
from .version import VERSION
import string, random
import re
# This function tryes different methods to download the web page
def gethtml(url, headers = None, retry = True):
# Delay importing libraries
import urllib3
import requests
urllib3.disable_warnings()
try:
if headers is None:... | |
<gh_stars>0
#!/usr/bin/python3
import os
import shutil
import sys
import math
# import copy
import numpy as np
import Tool_Box
from ArgParsing import parse_clubb_args
import Supporting as sp
def main():
sp.log(msg="# Parsing and checking input arguments\n", level="STEP")
args = parse_clubb_args()
sp.log(msg="# R... | |
generator dispatch by default
or according to the distribution scheme provided in ``slack_weights``.
If ``False`` only the slack generator takes up the slack.
slack_weights : pandas.Series|str, default 'p_set'
Distribution scheme describing how to determine the fraction of the total slack power
a bus of the subnet... | |
IOD': ['Study'],
'VL PHOTOGRAPHIC IMAGE IOD': ['Study'],
'GENERAL AUDIO WAVEFORM IOD': ['Study'],
'MR IMAGE IOD': ['Study'],
'OPHTHALMIC TOMOGRAPHY IMAGE IOD': ['Study'],
'VIDEO ENDOSCOPIC IMAGE IOD': ['Study'],
'ARTERIAL PULSE WAVEFORM IOD': ['Study'],
},
# SeriesTime
0x00080031L: {
'BASIC STRUCTURED DISPLAY IO... | |
# # # # # # # # Python Tuples (a,b)
# # # # # # # # Immutable - size is fixed
# # # # # # # # Use - passing data that does not need changing
# # # # # # # # Faster than list - less bookkeeping no worries about size change
# # # # # # # # "safer" than list
# # # # # # # # Can be key in dict unlike list
# # # # # # # # F... | |
Generated from::
id: 226
job: tests/stage-array-dirs-job.yml
label: stage_array_dirs
output:
output:
- checksum: sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709
class: File
location: a
size: 0
- checksum: sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709
class: File
location: B
size: 0
tags:
- resource
- com... | |
= Var(within=Reals,bounds=(0,0.000845292359445023),initialize=0.000845292359445023)
m.x1237 = Var(within=Reals,bounds=(0,0.000473679951457969),initialize=0.000473679951457969)
m.x1238 = Var(within=Reals,bounds=(0,5.80519362905298E-5),initialize=5.80519362905298E-5)
m.x1239 = Var(within=Reals,bounds=(0,None),initialize=... | |
e:
print("{exception_type} <--Number--- {q_string_input}".format(
exception_type=type_name(e),
q_string_input=q_in,
))
# NOTE: print THEN a stack trace
raise
match_x = floats_really_same(x_new, x)
# Compare Number(x) and q
try:
q_new = Number(x).qstring()
except Exception as e:
print("{x_input:.17e} ---Num... | |
"""ILI9341 LCD/Touch module."""
from time import sleep
from math import cos, sin, pi, radians
from sys import implementation
import ustruct
from uio import BytesIO
def color565(r, g, b):
"""Return RGB565 color value.
Args:
r (int): Red value.
g (int): Green value.
b (int): Blue value.
"""
return (r & 0xf8) <<... | |
from flask import session,request,url_for,redirect, flash, current_app
from functools import wraps
import os,time
from lightserv import db_lightsheet, db_admin
import datajoint as dj
import paramiko
import subprocess
import logging
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
formatter = loggi... | |
region corners list file %s does not exist" % region_corners_path
)
# read in the region corners data
with open(region_corners_path, 'r', encoding='utf-8') as flf:
tiled_region_corners = json.load(flf)
tiled_region_corners = json_utils.rename_missing_fovs(tiled_region_corners)
# define the parameter dict to ret... | |
<reponame>vmirage/YouTubeTV.bundle<filename>Contents/Code/__init__.py
# -*- coding: utf-8 -*-
# Copyright (c) 2014, KOL
# 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 sourc... | |
import itertools
import numpy as np
from . import ffi, lib, backend, binary, monoid, semiring
from .base import BaseExpression, BaseType, call
from .dtypes import lookup_dtype, unify, _INDEX
from .exceptions import check_status, NoValue
from .expr import AmbiguousAssignOrExtract, IndexerResolver, Updater
from .mask imp... | |
from __future__ import print_function
import collections, gzip, time
import numpy as np
import tensorflow as tf
import sys, os
sys.path.append("../tuner_utils")
from yellowfin import YFOptimizer
import inspect
class MediumConfig(object):
"""Medium config."""
init_scale = 0.05
learning_rate = 0.25
max_grad_norm =... | |
<filename>tests/core/test_test.py
import os
import sys
import pytest
from golem.core import test as test_module, settings_manager
from golem.core.project import Project
from golem.core.test import Test
SAMPLE_TEST_CONTENT = """
description = 'some description'
tags = []
data = [{'a': 'b'}]
pages = ['page1', 'pag... | |
strike, dip, rake
aplane = obspy.imaging.beachball.aux_plane(fplane.strike, fplane.dip, fplane.rake)
Tstrike = axes[0].strike
Tdip = axes[0].dip
Pstrike = axes[2].strike
Pdip = axes[2].dip
S1 = fplane.strike
D1 = fplane.dip
R1 = fplane.rake
S2 = aplane[0]
D2 = aplane[1]
R2 = aplane[2]
mplanes = [Pstrike,Pdi... | |
_evalfunc(self, reader_arg=None, process_cnt=None):
"""
Initialize a Fits-instance and perform a fit.
(used for parallel processing)
Parameters
----------
reader_arg : dict
A dict of arguments passed to the reader.
process_cnt : list
A list of shared-memory variables that are used to update the
progressbar
... | |
#!/usr/bin/env python3
from cache import Cache
from math import ceil
import string
DISK = "" # disk location
ROOT_LOCATION = 0 # root dir location
# file globals var
FILE_NAME_SIZE = 10
CHARS_ALLOWED = string.ascii_letters + string.digits + "."
NAME_PROHIBITED = ("..", ".")
# Formatting a virtual partition.
def ... | |
is not None:
return self._resume_checkpoint(
*args, checkpoint_resume=checkpoint_resume, **kwargs
)
if branch:
rev = self.scm.resolve_rev(branch)
logger.debug(
"Using '%s' (tip of branch '%s') as baseline", rev, branch
)
else:
rev = self.repo.scm.get_rev()
self._scm_checkout(rev)
force = kwargs.get("force... | |
import glob
import os
from copy import copy, deepcopy
from dataclasses import dataclass, field
from typing import List, Optional, Tuple, Union
import imageio
import numpy as np
import pandas as pd
from PIL import Image
from fedot.core.data.load_data import JSONBatchLoader, TextBatchLoader
from fedot.core.data.merge i... | |
<reponame>DAQuestionAnswering/Bert-n-Pals
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. team.
#
# 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
#
#... | |
import logging
import math
import slidingwindow as sw
import cv2
import numpy as np
import tensorflow as tf
import time
from tf_pose import common
from tf_pose.common import CocoPart
from tf_pose.tensblur.smoother import Smoother
import datetime
## Initialize variables starts here
sess = None
def initialize_varia... | |
Player 0 rolls 1 dice and gets outcomes [6].
End scores = (103, 24)
>>> print(turns[7])
Game Over
""",
'hidden': False,
'locked': False
},
{
'code': r"""
>>> turns = tests.play_utils.describe_game(hog, hog_gui, test_number=8964, score0=79, score1=56, goal=83, feral_hogs=False)
>>> print(turns[0])
Start scor... | |
"""Validation class for ChemKED schema.
"""
from warnings import warn
import re
from pkg_resources import resource_filename
import yaml
import numpy as np
import pint
from requests.exceptions import HTTPError, ConnectionError
from cerberus import Validator, SchemaError
import habanero
from .orcid import search_orcid
... | |
= len(freq_array)
channel_width = np.median(np.diff(freq_array))
freq_array = freq_array.reshape(1, -1)
spw_array = np.array([0])
Nspws = 1
# get baselines keys
antpairs = sorted(data.antpairs())
Nbls = len(antpairs)
Nblts = Nbls * Ntimes
# reconfigure time_array and lst_array
time_array = np.repeat(time_ar... | |
<reponame>KaushikSathvara/django<gh_stars>1-10
import hashlib
import json
import os
import posixpath
import re
from urllib.parse import unquote, urldefrag, urlsplit, urlunsplit
from django.conf import settings
from django.contrib.staticfiles.utils import check_settings, matches_patterns
from django.core.exceptions imp... | |
import math
import random
import PIL, PIL.ImageOps, PIL.ImageEnhance, PIL.ImageDraw
import torch
import torchvision
import numpy as np
from torchvision.datasets.folder import default_loader
from PIL import Image
def level2val(level, value_range, val_type='float'):
v = value_range[0] + level * float(value_range[1] - ... | |
"""
Tests for dataset creation
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
__author__ = "<NAME>"
__copyright__ = "Copyright 2016, Stanford University"
__license__ = "MIT"
import unittest
import tempfile
import os
import shutil
import numpy as np
im... | |
leave some symbols undefined.
TODO: right now this procedure is guided by the model. Maybe
it should be flipped and be guided by the vocabulary of the
program and num_states, asserting that it finds everything needed in the
model.
'''
if isinstance(z3model, CVC4Model):
return Z3Translator._old_model_to_trace(z... | |
blob's tier determines the allowed size, IOPS, and bandwidth of
the blob. A block blob's tier determines Hot/Cool/Archive storage type. This operation does not
update the blob's ETag.
:param tier: Indicates the tier to be set on the blob.
:type tier: str or ~azure.storage.blob.models.AccessTierRequired
:param sna... | |
<filename>rbf/linalg.py
'''
Module for linear algebra routines.
'''
import logging
import warnings
import numpy as np
import scipy.sparse as sp
import scipy.sparse.linalg as spla
from scipy.linalg.lapack import (dpotrf, dpotrs, dtrtrs, dgetrf,
dgetrs)
from rbf.sputils import row_norms, divide_rows
LOGGER = logging... | |
by (jumps)
pointerBoost = [0,0]
#the currently selected character/instruction
currentChar = self.code[self.pointerY][self.pointerX]
#if it is a command or code character
if currentChar in validParts or currentChar in otherCommands:
#if the character is the invoke command
if currentChar == "I":
#get wh... | |
Data adn writes them to file
Parameters
----------
SD : DataContainer
Star Data in question
iter : int
Total Fits to compute and use for Errorbar calculation
"""
FileToWriteTo = outputFile
if 'File' in kwargs.keys():
FileToWriteTo = kwargs['File']
if 'UseSGRA_Pos' in kwargs.keys():
useSGRA_Pos = kwargs['U... | |
* x)
R0 += 0.00000002371 * mu.cost(4.75067664712 + 103.09277421860 * x)
R0 += 0.00000002963 * mu.cost(0.23381699914 + 20597.24396304120 * x)
R0 += 0.00000002190 * mu.cost(6.18344448099 + 3346.13535100720 * x)
R0 += 0.00000002444 * mu.cost(1.92547995169 + 7799.98064550240 * x)
R0 += 0.00000002121 * mu.cost(4.874912... | |
+ m)), round(255 * (rgb_[1] + m)), round(255 * (rgb_[2] + m)))
def hsv_to_cmyk_nocheck(hue, saturation, value):
saturation /= 100
value /= 100
c = value * saturation
x = c * (1 - abs((hue / 60) % 2 - 1))
m = value - c
if hue < 60:
rgb_ = (c, x, 0)
elif hue < 120:
rgb_ = (x, c, 0)
elif hue < 180:
rgb_ = (... | |
4
def process_doc_info(doc_info: DocInfo, success: List[str], fail: List[str], doc_infos: List[DocInfo], seen_docs: Dict[str, DocInfo]):
if doc_info.error_msg == EMPTY_FILE_MSG:
# ignore empty files
return
if doc_info.error_msg:
fail.append(f'{doc_info.readme} ({doc_info.error_msg})')
elif doc_info.id in seen_d... | |
is_master_gpu:
filtered_cost_volume_tower = RegNetUS0({'data': cost_volume}, is_training=True, reuse=tf.AUTO_REUSE)
else:
filtered_cost_volume_tower = RegNetUS0({'data': cost_volume}, is_training=True, reuse=True)
filtered_cost_volume = tf.squeeze(filtered_cost_volume_tower.get_output(), axis=-1)
# depth map by s... | |
#**************************************************************
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you... | |
<filename>desktop/core/ext-py/Twisted/twisted/trial/reporter.py<gh_stars>10-100
# -*- test-case-name: twisted.trial.test.test_reporter -*-
#
# Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
#
# Maintainer: <NAME>
"""
Defines classes that handle the results of tests.
"""
import sys, os... | |
in range(int(self._quad_cells[index1][1].y), int(self._quad_cells[index1][2].y)):
if y_left in range(self._quad_cells[index2][0].y, self._quad_cells[index2][3].y):
same_boundary.append(index2)
break
temp = self._quad_cells[index1][0:4]
centroid_vertex = centroid(temp)
place = centroid_vertex.find_point(graph_ver... | |
<reponame>smchartrand/MarkovProcess_Bedload<filename>BeRCM/model/logic.py<gh_stars>1-10
from __future__ import division
import math
import random
import numpy as np
import sympy as sy
import copy
#TODO: Refactor functions so that they don't reach into the paramters file
from collections import defaultdict
from codeti... | |
<filename>lib/googlecloudsdk/third_party/apis/apikeys/v2/apikeys_v2_messages.py
"""Generated message classes for apikeys version v2.
Manages the API keys associated with developer projects.
"""
# NOTE: This file is autogenerated and should not be edited by hand.
from __future__ import absolute_import
from apitools.b... | |
<reponame>lserraga/labUGR<gh_stars>1-10
from __future__ import division, print_function, absolute_import
import warnings
from distutils.version import LooseVersion
from numpy.testing import suppress_warnings
import numpy as np
from numpy.testing import (assert_array_almost_equal,
assert_array_equal, assert_array_les... | |
Error.multi_context() as errors:
stdlib = StdLib.Base(self.effective_wdl_version)
# Pass through input & postinput declarations again, typecheck their
# right-hand side expressions against the type environment.
for decl in (self.inputs or []) + self.postinputs:
errors.try1(
lambda: decl.typecheck(
type_env, stdl... | |
(' }\n')
cfile.write (' return err;\n')
cfile.write ('}\n')
cfile.write ('\n')
cfile.write ('\n')
for ftr in allFeatures:
for cmd in ftr.cmds + ftr.evts:
cfile.write ('void ' + cCallbackName (ftr, cmd) + ' (')
for arg in cmd.args:
cfile.write (xmlToCcharAreConst (LIB_MODULE, ftr, cmd, arg, True) + ' ' + arg.n... | |
used to open or close output `file`.
email : bool, optional
The argument is used to open or close output `email`.
html : bool, optional
The argument is used to open or close output `html`.
table : bool, optional
The argument is used to open or close output `table`.
directory : str, optional
The argument is used... | |
> txi or yj1 > tyj):
lcs_tmp.append((txi,tyj,xi1-1,yj1-1,4))
txi = xi2+1
tyj = yj2+1
isnake = isnake + 1
if (txi <= Me or tyj <= Ne):
lcs_tmp.append((txi,tyj,Me,Ne,4))
else:
lcs_tmp.append((Mb,Nb,Me,Ne,4))
lcs = lcs_tmp
#
# Expand certain differences
#
nsnake = len(lcs)
isnake = 0
tsnake = 0
lcs_tmp = ... | |
<reponame>ws0416/tencentcloud-cli-intl-en<gh_stars>0
# -*- coding: utf-8 -*-
import os
import json
import tccli.options_define as OptionsDefine
import tccli.format_output as FormatOutput
from tccli import __version__
from tccli.utils import Utils
from tccli.exceptions import ConfigurationError
from tencentcloud.common ... | |
# this file contains all of the Chalice routing logic to implement the AWS Data API as a REST JSON Endpoint using IAM
# authentication. The Data API can also be accessed natively as a python library using aws_data_api.py
from chalice import Chalice, CORSConfig, Response, IAMAuthorizer, CognitoUserPoolAuthorizer, AuthRe... | |
not LOAD_AW1_TO_RAW_TABLE or LOAD_AW2_TO_RAW_TABLE")
return GenomicSubProcessResult.ERROR
# look up if any rows exist already for the file
records = dao.get_from_filepath(self.target_file)
if records:
logging.warning(f'File already exists in raw table: {self.target_file}')
return GenomicSubProcessResult.SUCCESS... | |
actions is None or not isinstance(actions, list):
raise TypeError("actions should be a list, found: %r" % actions)
# for a in actions:
# validate_action(a)
self.actions = actions
self.tell_why_am_i_running = tell_why_am_i_running
# store other attributes
self.file_dep = file_dep
self.task_dep = task_dep
self.... | |
<reponame>pingjuiliao/cb-multios
#!/usr/bin/env python
from cStringIO import StringIO
from generator.actions import Actions
import random
import struct
SAMPLE_RATE = 8000.0
SAMPLE_MAX = 0x7FFFFFFF
SAMPLE_MIN = -0x80000000
# *$!@ this #%*!
def c_div(num, denom):
neg = -1 if num < 0 else 1
if num < 0:
num = -num
re... | |
b:
e = self.extensionEntry
e.delete(0,"end")
e.insert(0,ext)
# Print options.
b = c.config.getBool("print_both_lines_for_matches")
if b == None: b = 0
self.printBothMatchesVar.set(b)
b = c.config.getBool("print_matching_lines")
if b == None: b = 0
self.printMatchesVar.set(b)
b = c.config.getBool("print_mi... | |
**kwargs):
self.update_query = kwargs
super(UpdateQuery, self).__init__(_model)
def clone(self):
query = UpdateQuery(self.model, **self.update_query)
query._where = self.clone_where()
query._where_models = set(self._where_models)
query._joined_models = self._joined_models.copy()
query._joins = self.clone_joins... | |
#! /usr/bin/env python
###############################################################################
# PyDial: Multi-domain Statistical Spoken Dialogue System Software
###############################################################################
#
# Copyright 2015 - 2019
# Cambridge University Engineering Departme... | |
node, or set of nodes, as returned by find()
IMPORTANT: match_from and match_to, if created by calls to find(), MUST use different node dummy names;
e.g., make sure that for match_from, find() used the option: dummy_node_name="from"
and for match_to, find() used the option: dummy_node_name="to"
:param rel_name: Th... | |
import torch
from torch import Tensor
from logging import debug
import os
import sys
from warnings import resetwarnings
from torch._C import device
from torch.functional import Tensor
from h5_util import read_list, write_list
import h5py
import torch.distributed as dist
import numpy as np
from . import projection a... | |
# -*- coding: utf-8 -*-
# ******************************************************
# Filename : clientRun.py
# Author : <NAME>
# Email : <EMAIL>
# Blog : https://iyuanshuo.com
# Last modified: 2020-06-18 21:10
# Description :
# ******************************************************
import sys
from dagComps ... | |
<reponame>emma-d-cotter/Hologram-Processing<filename>code/reconstruction.py
import time
import numpy as np
import torch
import cv2
from utils import *
from params import *
from detection import *
import warnings
# written by: <NAME>
# <EMAIL>
# functions for reconstruction of holograms
# includes:
# physical_to_optica... | |
<filename>FlaskRESTFULAPITest_JE/venv/Lib/site-packages/werkzeug/debug/tbtools.py
# -*- coding: utf-8 -*-
"""
werkzeug.debug.tbtools
~~~~~~~~~~~~~~~~~~~~~~
This module provides various traceback related utility functions.
:copyright: 2007 Pallets
:license: BSD-3-Clause
"""
import codecs
import inspect... | |
<filename>snerg/snerg/rendering.py
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
... | |
cons228,
cons198,
cons358,
)
rule1388 = ReplacementRule(pattern1388, replacement1388)
pattern1389 = Pattern(
Integral(
(x_ * WC("f", S(1))) ** m_
* (a_ + x_ ** WC("n2", S(1)) * WC("c", S(1))) ** p_
* (d_ + x_ ** n_ * WC("e", S(1))) ** WC("q", S(1)),
x_,
),
cons2,
cons8,
cons29,
cons50,
cons127,
cons19... | |
import tkinter
import opros
import param_module
import time
import threading
import start
general_shift = 50 # переменная для сдвига всех элементов по вертикали
flag_cheks = True # флаг для того чтобы ставить и снимать галочки на всех модулях
flag_cheks_on_51 = True # флаг для того чтобы ставить и снимать г... | |
# Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the MIT license.
# See the LICENSE file in the project root for more information.
"""A script to evaluate test values for special functions in high precision.
This scripts looks for .csv files in /test... | |
self.result = None
self.content_related = True
self.channel = channel # type: TypeInputChannel
self.id = id # type: int
self.grouped = grouped # type: TypeBool
def resolve(self, client, utils):
self.channel = utils.get_input_channel(client.get_input_entity(self.channel))
def to_dict(self):
return {
'_': 'Ex... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Authors: <NAME> <<EMAIL>>
import unittest
from utils_py import const
from utils_py import time_seg_util
class TestTimeSegUtil(unittest.TestCase):
def test_time_list_create(self):
first_minute_of_day = 0
self.assertEqual(time_seg_util.gen_still_seg_list(
first_minute_... | |
than alat!!
info['celldm(1)'] = float(line.split()[1]) * units['Bohr']
info['alat'] = info['celldm(1)']
elif 'number of atoms/cell' in line:
info['nat'] = int(line.split()[-1])
elif 'number of atomic types' in line:
info['ntyp'] = int(line.split()[-1])
elif 'crystal axes:' in line:
info['cell'] = info['celldm(1... | |
# Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import logging
import math
from unittest import TestCase
import pytest
import torch
from torch.distributions import constraints
import pyro
import pyro.contrib.gp.kernels as kernels
import pyro.distributions as dist
import pyro.o... | |
<filename>pybind/slxos/v16r_1_00b/brocade_fcoe_ext_rpc/fcoe_get_login/input/__init__.py<gh_stars>0
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import Y... | |
'''
/‾/ /‾/‾‾‾‾‾‾‾‾/‾| /‾| /‾/
/ /___/ /‾‾‾/ /‾‾/ |/ | / /
/ ___ / / / / | | / |/ /
/ / / / / / / /|__/| | /____
/_/___/_/_ /_/ / / _|_|_____/
/ _____/‾/ /‾//‾| /‾/ / |\ /‾/
/ <_____\ \/ // |/ /‾‾/ /‾/ / | \/ /
\______ \\ // | | / / / / /| |> <
______/ // // /| / / / / /_| | /\ \
/________//_//_/_|_/_... | |
<reponame>jacobrask/critic<gh_stars>0
# -*- mode: python; encoding: utf-8 -*-
#
# Copyright 2012 <NAME>, Opera Software ASA
#
# 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.apac... | |
5127, 5128, 5134, 5133)
model.createElement(3440, 5368, 3038, 3039, 5374, 5128, 2998, 2999, 5134)
model.createElement(3441, 2362, 5369, 5375, 2361, 2322, 5129, 5135, 2321)
model.createElement(3442, 5369, 5370, 5376, 5375, 5129, 5130, 5136, 5135)
model.createElement(3443, 5370, 5371, 5377, 5376, 5130, 5131, 5137, 5136)
... | |
= 'annual mean in-canopy flow'
flow_set.units = 'm s-1'
flow_set[:, :] = 0
if self._map_output['tme']:
temp_set = self._map_data.createVariable('Tc', 'f8', ('time', 'nmesh2d_face'))
temp_set.long_name = 'annual mean coral temperature'
temp_set.units = 'K'
temp_set[:, :] = 0
low_temp_set = self._map_data.create... | |
def test_any_ninf(self):
# atan2(+-y, -infinity) returns +-pi for finite y > 0.
assert_almost_equal(ncu.arctan2(1, np.NINF), np.pi)
assert_almost_equal(ncu.arctan2(-1, np.NINF), -np.pi)
def test_any_pinf(self):
# atan2(+-y, +infinity) returns +-0 for finite y > 0.
assert_arctan2_ispzero(1, np.inf)
assert_arctan... | |
of the document
callback : str or callable
JavaScript or Python callback to be executed when clicking on an image. A
dictionnary containing the data for the full cell is directly available as
`data` in JS. For Python, the callback function must have `data` as the first
argument to the function. All the values in t... | |
import logging
from json.decoder import JSONDecodeError
from typing import Dict, Optional, Union, List
from requests import Session, Response
from requests.exceptions import RequestException
from tmdbapis.exceptions import TMDbException, NotFound, Unauthorized, WritePermission, PrivateResource, \
Authentication, Inval... | |
in folders:
if isinstance(inc, bytes):
inc = inc.decode()
inc = sds_endswith(inc, add=True)
# don't put .sds in result item name
name = inc[:-4]
# don't check for existence of file, CPP loader will just skip it
# pull ref to list, or create a new one
inc_list = include_dict.setdefault(name, [])
inc_li... | |
param
] + list(value))
else:
log.error(f'Unexpected parameter value {value} for parameter {param}.')
return False
if process_result.returncode != 0:
log.error(f'Unexpected return code from NSSM when modifying at parameter. '
f'Return code {process_result.returncode}')
return False
return True
def get_serv... | |
destinationStream, autoAdd = True):
'''
Assume that element1 and element2 are two elements in sourceStream
and destinationStream with other elements (say eA, eB, eC) between
them. For instance, element1 could be the downbeat at offset 10
in sourceStream (a Stream representing a score) and offset 20.5
in dest... | |
# -*- coding: utf-8 -*-
"""
Copyright (c) 2015 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from copy import deepcopy
from flexmock import flexmock
from textwrap import dedent
import six
import time
import json... | |
from os import path, sys
import os
import unittest
from models.dojo import Dojo
os.sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
class TestDojo(unittest.TestCase):
"""Test cases for the Dojo class"""
def setUpClass():
if os.path.isfile('data/db/fellow.db'):
os.remove(os.path.realpath("dat... | |
nodes to upi cluster
Args:
node_list (list): of AWSUPINode objects with RHEL os
"""
rhel_pod_name = "rhel-ansible"
rhel_pod_obj = create_rhelpod(constants.DEFAULT_NAMESPACE, rhel_pod_name, 600)
timeout = 4000 # For ansible-playbook
# copy openshift-dev.pem to RHEL ansible pod
pem_src_path = "~/.ssh/openshift... | |
that the branch from that method has been fully traversed
if not methodInDB(method_name, dict_link, crsr)[0]:
getInterfacesFromReport(method_name, dict_link, folder_path, crsr, inv_list_text[0]) # calls getInt. on next method
def createInterfaceGraphFromDB(method_name, dict_link, interface_db_cursor):
"""
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.