input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 27 16:01:31 2020
@author: kirk.mutafopulos
"""
import sys
import serial
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
class Pumps(QMainWindow):
def __init__(self):
super().__init__()
self.initU... | |
import collections, os, sys
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from scipy.special import erf
import scipy.interpolate
fontsize = 11/1.4
latex_preamble = r'''
\usepackage{lmodern}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{mathtools}
\usepackage{bm}
'''
matplotlib.rc... | |
np.digitize(self.time_uniform,
self.trajectories[t, :, 0], right=False) - 1, 1]
#self.z_interpolated[t, :] = self.interpolate_trajectories(t, noise=noise)
def interpolate_trajectories(self, t, noise=0):
interpolated = np.zeros([self.time_uniform.size])
for i, x in enumerate(self.time_uniform):
time_index = np.a... | |
<reponame>bckim92/dotfiles
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
@wookayin's ███████╗██╗██╗ ███████╗███████╗
██████╗ █████╗ ████████╗██╔════╝██║██║ ██╔════╝██╔════╝
██╔══██╗██╔══██╗╚══██╔══╝█████╗ ██║██║ █████╗ ███████╗
██║ ██║██║ ██║ ██║ ██╔══╝ ██║██║ ██╔══╝ ╚════██║
██████╔╝╚█████╔╝ ██║ ██║ ██║█████... | |
)
"""
Key, val pairs of the parameters (`F0`, `F1`, ..., including glitch parameters),
and the units (`Hz`, `Hz/s`, ...).
"""
transform_dictionary = dict(
tglitch={
"multiplier": 1 / 86400.0,
"subtractor": "minStartTime",
"unit": "day",
"label": r"$t^{g}_0$ \n [d]",
}
)
"""
Key, val pairs of the parameter... | |
<reponame>lao-tseu-is-alive/tensorflow2-tutorial
import matplotlib.pyplot as plt
import numpy as np
import os
# next line is to limit tensorflow verbose output
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import tensorflow as tf
from tensorflow.keras.preprocessing import image_dataset_from_directory
from my_tf_lib import i... | |
<filename>cqlengine/models.py
from collections import OrderedDict
import re
from cqlengine import columns
from cqlengine.exceptions import ModelException, CQLEngineException, ValidationError
from cqlengine.query import ModelQuerySet, DMLQuery, AbstractQueryableColumn
from cqlengine.query import DoesNotExist as _DoesNo... | |
<reponame>rupakgoyal/panel-<gh_stars>1-10
"""
Interact with functions using widgets.
The interact Pane implemented in this module mirrors
ipywidgets.interact in its API and implementation. Large parts of the
code were copied directly from ipywidgets:
Copyright (c) Jupyter Development Team and PyViz Development Team.
... | |
<filename>toolbox/alignment.py
#!/usr/bin/env python
"""
The alignment module contains functions used in aligning two channel data.
See our `walkthrough <https://github.com/ReddingLab/Learning/blob/master/image-analysis-basics/Image-alignment-with-toolbox.ipynb/>`_
of the alignment module's usage.
"""
__all__ = ['FD_... | |
# ------------------------------------------------------------------------
# MIT License
#
# Copyright (c) [2021] [<NAME>]
#
# This code is part of the library PyDL <https://github.com/nash911/PyDL>
# This code is licensed under MIT license (see LICENSE.txt for details)
# -----------------------------------------------... | |
<filename>openpecha/formatters/hfml.py
"""
Formatter for HFML annotations in the text
This module implements all classes necessary to format HFML annotation to OpenPecha format.
HFML (Human Friendly Markup Language) contains tagset used for structuring and annotating the text.
"""
import re
from json import encoder
fr... | |
"4781")),
((Standards.JSIC13, "5894"), (Standards.ISIC4, "4722")),
((Standards.JSIC13, "5894"), (Standards.ISIC4, "4781")),
((Standards.JSIC13, "5895"), (Standards.ISIC4, "4721")),
((Standards.JSIC13, "5895"), (Standards.ISIC4, "4781")),
((Standards.JSIC13, "5896"), (Standards.ISIC4, "4721")),
((Standards.JSIC13,... | |
#!/usr/bin/env python
"""
_WorkQueue_t_
WorkQueue tests
"""
from __future__ import print_function
from builtins import next, range
from future.utils import viewitems
import os
import threading
import time
import unittest
import logging
from retry import retry
from Utils.PythonVersion import PY3
from WMCore.WMBase... | |
<gh_stars>0
# -*- coding:utf-8 -*-
from ciscoconfparse import CiscoConfParse
from logzero import logger as log
import logzero
import re
# from netaddr import IPNetwork, IPAddress
# from ipaddress import IPv4Network
import ipaddress
from time import time
## v0.1a - 2015-06-01: add lastseen property
## v0.1b - 2016-0... | |
import tensorflow as tf
import sonnet as snt
import numpy as np
from graph_nets import blocks
from tensorflow_addons.image import gaussian_filter2d
from graph_nets.graphs import GraphsTuple
from graph_nets.modules import _unsorted_segment_softmax, _received_edges_normalizer, GraphIndependent, SelfAttention, GraphNetwor... | |
<reponame>jscsmk/medicaldetectiontoolkit<filename>predictor.py
#!/usr/bin/env python
# Copyright 2018 Division of Medical Image Computing, German Cancer Research Center (DKFZ).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ma... | |
not not_found == []:
print('Missing files: ' + ', '.join(not_found))
else:
print('Recognised input fields were: ' + ', '.join(all_features))
if not self.to_generate == []:
print('These dust files will be generated: ' + ', '.join(self.to_generate))
print('Found {0} out of {1} files.'.format(len(all_features), len... | |
g_param[OptionsDefine.Filter])
def doModifyDeviceAutoRenewFlag(args, parsed_globals):
g_param = parse_global_arg(parsed_globals)
cred = credential.Credential(
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[O... | |
= get_object_or_404(Document, docalias__name=name)
if doc.get_state_slug() != "expired":
raise Http404
resurrect_requested_by = None
e = doc.latest_event(type__in=('requested_resurrect', "completed_resurrect"))
if e and e.type == 'requested_resurrect':
resurrect_requested_by = e.by
if request.method == 'POST':... | |
leger lines: {0}'
''.format(notehead.id))
# Determine: is notehead above or below staff?
is_above_staff = (notehead.top < current_staff.top)
# Determine: is notehead on/next to (closest) leger line?
# This needs to be done *after* we know whether the notehead
# is above/below staff: if the notehead is e.g. abov... | |
<filename>src/oogeso/core/devices/base.py
import logging
from abc import ABC, abstractmethod
from typing import Dict, List, Optional, Union
import pyomo.environ as pyo
from pyomo.core import Constraint
from oogeso.core.networks.network_node import NetworkNode
from oogeso.dto import CarrierData, DeviceData, TimeSeries... | |
# By definition this means that the template is not a match, so
# we return None to indicate that we could not generate the product
# structures
# We need to think this way in order to distinguish between
# intermolecular and intramolecular versions of reaction families,
# which will have very different kinetics
... | |
number=1,)
sentiment_data = proto.Field(proto.MESSAGE, number=2, message="SentimentData",)
class IssueAssignment(proto.Message):
r"""Information about the issue.
Attributes:
issue (str):
Resource name of the assigned issue.
score (float):
Score indicating the likelihood of the issue assignment.
currently bou... | |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | |
the
derivatives of the mean and variance. Resulting arrays are sized:
dmu_dX* -- [N*, Q ,D], where D is the number of output in this GP (usually one).
Note that this is not the same as computing the mean and variance of the derivative of the function!
dv_dX* -- [N*, Q], (since all outputs have the same variance)
... | |
# ncgmp09_ValidateDatabase.py
# Python script to inventory tables, feature datasets
# and feature classes in a geodatabase and to check
# for conformance with NCGMP09 geodatabase schema.
# For more information, see tail of this file.
# Assumes ArcGIS 10 or higher.
# <NAME>, USGS
#
# Takes two arguments: <geodatabaseN... | |
import unittest
from nose.tools import assert_equals, assert_true, assert_false
from robotide.robotapi import TestCaseFile
from robotide.controller import Project
from robotide.controller.macrocontrollers import KEYWORD_NAME_FIELD
from robotide.controller.commands import (
Undo, FindOccurrences, FindVariableOc... | |
import random
import math
import cv2
import numpy as np
import pylab as plt
import scipy.io as sio
import scipy.misc as sm
import os
from os import listdir, makedirs, system
def get_minibatches_idx(n,
minibatch_size,
shuffle=False,
min_frame=None,
trainfiles=None,
del_list=None):
"""
Used to shuffle the datase... | |
self.body.append('\\end{itemize}\n')
def visit_hlistcol(self, node: Element) -> None:
pass
def depart_hlistcol(self, node: Element) -> None:
pass
def latex_image_length(self, width_str: str, scale: int = 100) -> str:
try:
return rstdim_to_latexdim(width_str, scale)
except ValueError:
logger.warning(__('dime... | |
<reponame>skochanski/blinx_rev<filename>pyblinx/chunk.py
from .node import Node
from .texlist import Texlist
from .address import section_addresses, rawaddress
from .helpers import verify_file_arg_o, verify_file_arg_b
from .world_transform import transform
from struct import unpack
import operator
TEXTURE_MAGI... | |
= access_key_id
self.owner_id = owner_id
self.resource_owner_id = resource_owner_id
self.resource_owner_account = resource_owner_account
self.owner_account = owner_account
self.project_id = project_id
self.material_ids = material_ids
def validate(self):
self.validate_required(self.project_id, 'project_id')
se... | |
<reponame>XLearning-SCU/2021-NeurIPS-NCR
"""SGRAF model"""
import math
from collections import OrderedDict
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
from torch.nn.... | |
<reponame>meadowdata/meadowflow<gh_stars>1-10
from __future__ import annotations
import abc
import asyncio
import dataclasses
import functools
import io
import os.path
import pickle
import shlex
import threading
import uuid
from typing import Callable, TypeVar, Union, Any, Dict, Optional, Sequence, cast, Tuple
import... | |
#!/usr/bin/env python
# coding: utf-8
# Copyright (c) Qotto, 2019
""" KafkaConsumer class
This class consume event / command / result in Kafka topics.
Todo:
* In function listen_store_records, add commit store (later V2)
"""
import asyncio
import json
from logging import Logger, getLogger
from typing import List, ... | |
<filename>plenum/test/consensus/view_change/test_new_view_builder.py
import pytest
from plenum.common.messages.node_messages import Checkpoint, ViewChange
from plenum.server.consensus.consensus_shared_data import ConsensusSharedData
from plenum.server.consensus.view_change_service import NewViewBuilder
from plenum.ser... | |
"Given sequence dictionary empty"
c_uc = 0
for seq_id in seqs_dic:
c_uc += len(re.findall(r"[A-Z]", seqs_dic[seq_id]))
return c_uc
#######################################################################
def seqs_dic_count_lc_nts(seqs_dic):
"""
Count number of lowercase nucleotides in sequences stored in seque... | |
Standard <https://github.com/toml-lang/toml>`_\\n* `The currently '
'supported TOML specification '
'<https://github.com/toml-lang/toml/blob/v0.5.0/README.md>`_\\n\\nInstallation\\n============\\n\\nTo '
'install the latest release on `PyPI '
'<https://pypi.org/project/toml/>`_,\\nsimply run:\\n\\n::\\n\\n pip '
'... | |
<reponame>cpitts1/snakeplane
# Copyright (C) 2019 Alteryx, Inc. 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 ... | |
<filename>deepinspect/coco_gender/coco_gender_deepinspect.py
import math, os, random, json, pickle, sys, pdb, csv, copy
import string, shutil, time, argparse
import numpy as np
from sklearn.metrics import average_precision_score
from sklearn.metrics import roc_auc_score
from tqdm import tqdm as tqdm
import matplotlib
... | |
temp_priority = priority_obj.priority(STEPS[index], step_value['value'])
else:
temp_priority = priority_obj.priority('Evgen', step_value['value'])
step_template = fill_template(STEPS[index], ctag, temp_priority, output_formats, memory)
if 'priority' in step_value['changes']:
temp_priority = step_value['changes'][... | |
<filename>katsdpscripts/RTS/spectral_baseline.py
from __future__ import absolute_import
from __future__ import print_function
import os
import numpy as np
from numpy.ma import MaskedArray
import scipy.interpolate as interpolate
import scipy.ndimage as ndimage
import katdal
from katdal import averager
import matplotl... | |
# Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | |
= nTurbines
self.direction_id = direction_id
self.use_rotor_components = use_rotor_components
self.cp_points = cp_points
self.cp_curve_spline = cp_curve_spline
# set finite difference options (only used for testing)
self.deriv_options['check_form'] = 'central'
self.deriv_options['check_step_size'] = 1.0e-6
sel... | |
if ftype == TType.STOP:
break
if fid == 1:
if ftype == TType.LIST:
self.tables = []
(_etype3, _size0) = iprot.readListBegin()
for _i4 in range(_size0):
_elem5 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
self.tables.append(_elem5)
iprot.readListEnd()
else:
iprot.sk... | |
[
'hbase-site/hbase.hregion.memstore.flush.size'],
'hbase-site/hbase.client.scanner.caching': [
'hbase-site/hbase.client.scanner.caching',
'global/client_scannercaching'],
'hbase-site/zookeeper.session.timeout': [
'hbase-site/zookeeper.session.timeout',
'global/zookeeper_sessiontimeout'],
'hbase-site/hbase.clie... | |
<gh_stars>100-1000
""" Cisco_IOS_XR_ipv4_bgp_oc_oper
This module contains a collection of YANG definitions
for Cisco IOS\-XR ipv4\-bgp\-oc package operational data.
This module contains definitions
for the following management objects\:
oc\-bgp\: OC\-BGP operational data
Copyright (c) 2013\-2018 by Cisco Systems, ... | |
return qs
def get_search_form(self):
"""
Return the PartnerSearchForm on the page.
Parameters:
- self : the object itself
Returns:
the PartnerSearchForm on the page.
"""
search_form = self.form = PartnerSearchForm(self.request.REQUEST)
return search_form
class EditStudyView(LoginRequiredMixin, UpdateView... | |
import re
from typing import List, Tuple, Optional, Set
import sqlparse
import time
import os
import json
import logging
from tqdm.notebook import tqdm as tq
from sqlparse.tokens import Keyword, DML, Token, Wildcard, Literal, Punctuation, Whitespace, Newline, Comment, Operator
from sqlparse.sql import Identifier, Ident... | |
<gh_stars>0
from collections import namedtuple
import numpy as np
import torch
from scipy.spatial.distance import cdist
from scipy.spatial import Delaunay, Voronoi, voronoi_plot_2d
from scipy.sparse import dok_matrix
from matplotlib.patches import Polygon
from matplotlib.collections import PatchCollection
impor... | |
postCellId="../AS4/0/"/>
</projection>
<projection id="NC_AVAR_AS5_Generic_GJ" postsynapticPopulation="AS5" presynapticPopulation="AVAR" synapse="">
<connection id="0" preCellId="../AVAR/0/" postCellId="../AS5/0/"/>
</projection>
<projection id="NC_AVAR_AS5_FMRFamide" postsynapticPopulation="AS5" presynapticPopula... | |
self.shape:
utcs = [utc] * self.shape[0]
argsets = zip(year, month, day, hour, minute, second, milli, utcs)
dt = array([datetime(*args) for args in argsets])
else:
dt = datetime(year, month, day, hour, minute, second, milli, utc)
return dt, leap_second
def utc_iso(self, places=0):
"""Return an ISO 8601 string ... | |
<filename>apitest/api_test/api/automationReport.py<gh_stars>0
from django.core.exceptions import ObjectDoesNotExist
from api_test.common.auth import TokenAuthentication
from rest_framework.views import APIView
from django.db.models import Q
from django.core import serializers
from django.db import connection,connection... | |
in this loop
# Simplifications for j=i, kij is always 0 by definition.
t200 = a_alphas[i]*zs[i]
a_alpha_j_rows[i] += t200
a_alpha += t200*zs[i]
zi_zj = zs[i]*zs[i]
da_alpha_dT_ij = -da_alpha_dT_i - da_alpha_dT_i#da_alpha_dT_i*-2.0
da_alpha_dT_j_rows[i] += zs[i]*da_alpha_dT_ij
da_alpha_dT_ij *= zi_zj
da_alpha... | |
#!/usr/bin/env python3
import numpy as np
import poppy
import time
from astropy import units as u
from astropy.constants import codata2014 as const
from astropy.modeling.blackbody import blackbody_lambda
from functools import reduce
from .inject_images import InjectCompanion
from .my_warnings import warnings
class S... | |
'endip': services["endip"], 'zoneid': services["zoneid"]}
if "podid" in services:
cmd['podid'] = services["podid"]
cmd['vlan'] = services["vlan"]
if account:
cmd['account'] = account
if domainid:
cmd['domainid'] = domainid
return PublicIpRange(api_client.createVlanIpRange(**cmd))
def delete(self, api_client... | |
import itertools
from .. import AssertsCompiledSQL
from .. import AssertsExecutionResults
from .. import config
from .. import fixtures
from ..assertions import assert_raises
from ..assertions import eq_
from ..assertions import in_
from ..assertsql import CursorSQL
from ..schema import Column
from ..schema import Tab... | |
is None or not self.warm_start:
self.model = self._get_model()
self.model.initialize_bias_terms(mx.nd.array(wd_freqs).squeeze()) ## initialize bias weights to log frequencies
trainer = gluon.Trainer(self.model.collect_params(), self.optimizer, {'learning_rate': self.lr})
sc_obj, npmi, ppl, redundancy = 0.0, 0.0, ... | |
from train_generation import TrainingData, DataSampler
from auxiliary_functions import EmpiricalDist, AllBinaryStrings, num_bytes_needed, SampleListToArray
from kernel_functions import KernelAllBinaryStrings
from param_init import NetworkParams
from sample_gen import BornSampler
import json
import numpy as np
im... | |
from itertools import cycle
import random
import sys
import pygame
from pygame.locals import *
FPS = 30
SCREENWIDTH = 288
SCREENHEIGHT = 512
# amount by which base can maximum shift to left
PIPEGAPSIZE = 100 # gap between upper and lower part of pipe
BASEY = SCREENHEIGHT * 0.79
# image, sound and hitmask dicts
IMAGES... | |
<filename>lib/mechanize/_response.py
"""Response classes.
The seek_wrapper code is not used if you're using UserAgent with
.set_seekable_responses(False), or if you're using the urllib2-level interface
HTTPEquivProcessor. Class closeable_response is instantiated by some handlers
(AbstractHTTPHandler), but the clo... | |
('IsFT1248H', ctypes.c_ubyte),
('FT1248CpolH', ctypes.c_ubyte),
('FT1248LsbH', ctypes.c_ubyte),
('FT1248FlowControlH', ctypes.c_ubyte),
('IsVCPH', ctypes.c_ubyte),
('PowerSaveEnableH', ctypes.c_ubyte),
('PADDING_0', ctypes.c_ubyte),
]
FT_PROGRAM_DATA = struct_ft_program_data
PFT_PROGRAM_DATA = POINTER_T(struct_... | |
None:
self.parent.parent.set_statusmessage('Selection is None?')
if not items:
return
for _, data in items:
new_item = self.gui.add_listitem(data[0])
self.gui.set_listitem_values(new_item, [data[0]] + list(data[2:]))
def change_selected(self, item_n):
"""callback voor wijzigen geselecteerd item, o.a. door ver... | |
<gh_stars>0
import copy
from django import forms
from django.db import connection
class AddInstituteForm(forms.Form):
name = forms.CharField(
label='Institute Name',
help_text='Enter the name of the institute here.',
min_length=1
)
city = forms.CharField(
label='City',
help_text='Enter the city of the instit... | |
<filename>discord/client.py
# -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015-2017 Rapptz
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 withou... | |
# Copyright ClusterHQ Inc. See LICENSE file for details.
"""
AWS provisioner.
"""
import logging
from itertools import izip_longest, repeat
from pyrsistent import PClass, field
from twisted.internet.defer import DeferredList, fail, maybeDeferred
from zope.interface import implementer
from boto.ec2 import connect... | |
#!/usr/bin/env python3
# MIT License
#
# Copyright (c) 2020 FABRIC Testbed
#
# 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 ... | |
promises that use the workflow's output names.
new_promises = [Promise(var, wf_outputs_as_literal_dict[var]) for var in expected_output_names]
return create_task_output(new_promises, self.python_interface)
class ImperativeWorkflow(WorkflowBase):
def __init__(
self,
name: str,
failure_policy: Optional[WorkflowF... | |
<reponame>tbloch1/HelioML<filename>book/_build/jupyter_execute/08/notebook.py
#!/usr/bin/env python
# coding: utf-8
# # Notebook
#
# **Authors:** <NAME> (<EMAIL>), <NAME> (<EMAIL>), <NAME> (<EMAIL>)
# [ 444-0268',
## 'number' : '+19104440268',
## 'price' : '0.35',
## 'rateCenter' : 'WILMINGTON',
## 'state' : 'NC'}
## ]
print(numbers[0]["number"])
## +19104440230
"""
kwargs["city"] = city
kwargs["state"] = state
kwargs["zip"] = zip_code
kwargs["area... | |
__init__(self, verbose, name, cmd):
self.name = name
self.cmd = cmd
self.module = None # if this is a module command
self.verbose = verbose
self.doc_with_list = []
def getSynopsis(self, command_list):
if self.doc_with_list:
syn_cmd_list = []
for c in self.doc_with_list:
if command_list.has_key(c):
syn_cmd_l... | |
else:
tmp = self.empty(tsr.shape)
self.ng.power(self.fabs(tsr), order, tmp)
self.ng.sum(tmp, axis, out)
self.ng.power(out, (1.0 / order), out)
return out
def mean(self, tsr, axes, out):
"""
Calculates the arithmetic mean of the elements along the specified
axes.
Arguments:
tsr (GPUTensor): Input tensor
ax... | |
= nameMap.get(sp[2].lower(), sp[2][0].upper())
third = nameMap.get(sp[3].lower(), sp[3][0].upper())
paren = [ '(%s,(%s,%s))' % (first, sec, third),
'((%s,%s),%s)' % (first, sec, third),
'((%s,%s),%s)' % (first, third, sec),
'(%s,%s,%s)' % (first, sec, third) ]
else:
sec = nameMap.get(sp[1].lower(), sp[1][0].up... | |
"""
pass
Architecture = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""The architecture of the ELF file.
Get: Architecture(self: IElfHeader) -> ElfMachine
"""
Is64Bit = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Wh... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 10 17:49:15 2012
@author: empeeu
"""
import scipy as sp
from scipy import sparse
import scipy.linalg as splinalg
from scipy.sparse import linalg as sparselinalg
import copy
from time import time
from src.pyutil import unique
from src.master.mk_basis impor... | |
# -*- coding: utf-8 -*-
#
# Copyright 2017-2019 Spotify AB.
#
# 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 la... | |
have at least ' + str(args[i].min_ndims) + \
' dimension')
else:
write_fatal_block(w1file,'The ' + args[i].name + \
' array must have at least ' + str(args[i].min_ndims) + \
' dimensions')
if not args[i].is_scalar:
dstr = ""
for j in range(len(args[i].dsizes_names)):
#
# If we're not dealing with a scalar, the... | |
from pydantic import BaseModel
from sly import Parser, Lexer
import io
import os
import pandas as pd
import re
import spacy
from nltk.tokenize import RegexpTokenizer
from rich import pretty
import subprocess
from subprocess import Popen, PIPE, STDOUT
pretty.install()
try:
nlp = spacy.load('en_core_web_lg')
except:
... | |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
###
#
# @file framework.py
#
# DMFT is a software package provided by Rutgers Univiversity,
# the State University of New Jersey
#
# @version 1.0.0
# @author <NAME>
# @date 2016-02-15
#
###
from utils import shellcmd, writefile, delfiles, fixpaths, includefromlib
import ... | |
2.01252e-9, 2.01252e-9])
assert_allclose(
get_positional_probabilities(freqs, probs, 50), expected, rtol=1e-5
)
# value that is truely over raises an error
freqs = [51.0000000001, 0.0, 0.0]
probs = [0.33, 0.33, 0.33]
self.assertRaises(ValueError, get_positional_probabilities, freqs, probs, 50)
def test_sca_inp... | |
где
каждая строка - значение этого поля. В итоге запрос
вернет только те лоты, значения полей которых,
соответствуют данной фильтрации. То есть, для каждого
ключа, будут отфильтрованы те лоты, значения
соответствующего поля которого не находится в
списке-значении. '''
try:
request_json = RestAPI.request_data_t... | |
""" Very heavily inspired by the official evaluation script for SQuAD version 2.0 which was
modified by XLNet authors to update `find_best_threshold` scripts for SQuAD V2.0
In addition to basic functionality, we also compute additional statistics and
plot precision-recall curves if an additional na_prob.json file is p... | |
"""
PocketSmith
The public PocketSmith API # noqa: E501
The version of the OpenAPI document: 2.0+0.3.3
Contact: <EMAIL>
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from pocketsmith.api_client import ApiClient, Endpoint as _Endpoint
from pocketsmith.model_uti... | |
<filename>skyline/webapp/ionosphere_backend.py
from __future__ import division
import logging
from os import path, walk, listdir, remove
# import string
import operator
import time
import re
# import csv
# import datetime
import shutil
import glob
from ast import literal_eval
import traceback
from flask import request... | |
<filename>solvers/solver_helpers.py
import json
from abc import ABC, abstractmethod
import numpy as np
import os
import re
import torch
from collections import defaultdict, OrderedDict
from functools import wraps
from gensim.models import KeyedVectors
from pymorphy2 import MorphAnalyzer
from pytorch_pretrained_bert im... | |
"""
Tests for Template Tags
"""
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission
from django.template import Template, Context
from django.test import TestCase, override_settings, RequestFactory
from django.urls import NoReverseMatch
from... | |
"""str: The queue's play mode.
Case-insensitive options are:
* ``'NORMAL'`` -- Turns off shuffle and repeat.
* ``'REPEAT_ALL'`` -- Turns on repeat and turns off shuffle.
* ``'SHUFFLE'`` -- Turns on shuffle *and* repeat. (It's
strange, I know.)
* ``'SHUFFLE_NOREPEAT'`` -- Turns on shuffle and turns off
repeat.
... | |
path of ELMo""",
)
group.add_argument(
"--elmo.weight_file",
type=str, default="elmo_2x4096_512_2048cnn_2xhighway_weights.hdf5", dest="token.elmo.embedding.weight_file",
help=""" The weight file path of ELMo""",
)
group.add_argument(
"--elmo.trainable",
type=arg_str2bool, default=False, dest="token.elmo.embedd... | |
* from mp4 where (upper(NAME) GLOB upper(?)) OR (upper(series) GLOB upper(?)) OR (upper(genre) GLOB upper(?)) ORDER BY id desc", (searchmoviestream, searchmoviestream, searchmoviestream))
rows = cur.fetchall();
return render_template("moviestreamdblist.html", rows=rows)
@app.route('/searchmoviestreamascdb')
def ... | |
26312.2479372761 * self.t)
Z0 += 0.00000000005 * math.cos(2.14793916248 + 128320.75184749259 * self.t)
Z0 += 0.00000000004 * math.cos(3.03681019540 + 151.0476698429 * self.t)
Z0 += 0.00000000004 * math.cos(0.23608219351 + 26057.57628056979 * self.t)
Z0 += 0.00000000004 * math.cos(2.78449581166 + 25138.7275326044 * ... | |
an argument.
### Usage:
----
>>> td_client._prepare_arguments_list(
parameter_list=['MSFT', 'SQ']
)
"""
return ','.join(parameter_list)
def get_quotes(self, instruments: List) -> Dict:
"""Grabs real-time quotes for an instrument.
Serves as the mechanism to make a request to the Get Quote and... | |
# !/usr/bin/jython
# This Jython script is run via run-otp.should
# It assumes
# - OTP, Jython and Sqlite jars are acquired
# - required input files are present and accurately specified as arguments
################################################################################################
# Example usage from B... | |
))._positive()
def write( self, file_name = "output.scad" ):
"""write the shape to the specified file
:param file_name: name of the file
This function prints the OpenSCAD representation of the
shape to the indicated file (default: output.scad).
That file can be opened in OpenSCAD
for visualization or ex... | |
r[5][i] == 's':
ms.add('ms_' + str(reaction_index) + '_' + str(reg))
kms.add('kms_' + str(reaction_index) + '_' + str(reg))
if 's' in r[5]:
ant_str += ')' + enzyme_end
else:
ant_str += enzyme_end
if kinetics[0][8:10] == 'FM':
if 's' in r[5]:
ant_str += '/((('
else:
ant_str += '/(('
ant_str += 'S' + str(... | |
<reponame>aduckworth1969/smc
# -*- coding: utf-8 -*-
from datetime import datetime, timedelta
# import sys
import traceback
# import ldap
import ssl
from ldap3 import Server, Connection, ALL, NTLM, Tls
import ldap3.core.exceptions
from ldap3.extend.microsoft.addMembersToGroups import ad_add_members_to_groups
from ld... | |
#!/usr/bin/env python
import os
try:
__IPYTHON__
import sys
del sys.argv[1:]
except:
pass
import srwl_bl
import srwlib
import srwlpy
import srwl_uti_smp
def set_optics(v=None):
el = []
pp = []
names = ['MOAT_1', 'MOAT_1_MOAT_2', 'MOAT_2', 'MOAT_2_HFM', 'HFM', 'HFM_VFM', 'VFM', 'VFM_VDM', 'VDM', 'VDM_SSA', 'S... | |
is_initial=False, final_update=final_update, is_unordered_catenation=False)
states.append(st_4)
final_update = set()
final_update.add(fac.UpdateInstruction(cc_3, False))
symbol = pyxb.binding.content.ElementUse(CTD_ANON_2._UseForTag(pyxb.namespace.ExpandedName(Namespace, 'Reference')), pyxb.utils.utility.Location('... | |
"""Module containing the abstract base classes (ABCs) which define the interfaces of
various objects expected by the ``pygmol`` framework.
"""
from abc import ABC, abstractmethod
from typing import Union, Sequence, Dict, Callable, Mapping
from numpy import ndarray, float64
from pyvalem.formula import FormulaParseError... | |
import time
class Joc:
"""
Clasa care defineste jocul. Se va schimba de la un joc la altul.
"""
NR_COLOANE = 7
NR_LINII = 6
NR_CONNECT = 4 # cu cate simboluri adiacente se castiga
SIMBOLURI_JUC = ['X', '0'] # ['G', 'R'] sau ['X', '0']
JMIN = None # 'R'
JMAX = None # 'G'
GOL = '.'
def __init__(self, tabla=N... | |
),
migrations.CreateModel(
name='SKPDAsalGedungBangunanDinkesJuai',
fields=[
],
options={
'verbose_name': '05 SKPD Asal Gedung Dinkes Juai',
'proxy': True,
'verbose_name_plural': '05 SKPD Asal Gedung Dinkes Juai',
},
bases=('gedungbangunan.skpdasalgedungbangunan',),
),
migrations.CreateModel(
name='SKPDAsa... | |
= np.std([poly.area for poly in polygon_list])\
/ img_area * 100.
return pd.DataFrame({'Class': CLASSES, 'Counts': counts,
'TotalArea': total_area, 'MeanArea': mean_area,
'STDArea': std_area})
def collect_stats():
"""
Collect the area statistics for all images and concatenate them
:return:
"""
stats = []
t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.