input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
'ignored_channels_not_on_list', channel=channel.mention)
else:
channels.remove(channel.id)
await MessageUtils.send_to(ctx, 'YES', 'ignored_channels_changes_removed', channel=channel.mention)
Configuration.save(ctx.guild.id)
@ignored_channels_changes.command("list")
async def ignored_channels_changes_list(self, c... | |
<gh_stars>100-1000
#!/usr/bin/env python3
import os
import sys
import errno
import stat
from binascii import unhexlify, hexlify
from fuse import FUSE, FuseOSError, Operations
import struct
import os
import socket
import json
import tempfile
## Class used to mimic file access to external memory.
class Physmem(Operatio... | |
Should return None if
the concrete agent does not require point name mapping and/or unit
conversion.
"""
def parse_point_name_mapping(self):
"""
Parses point name mapping, which should contain a mapping of service
points to standard points, with specified units.
"""
point_name_mapping = {}
try:
mapping_file... | |
<filename>cbuildbot/stages/build_stages.py
# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Module containing the build stages."""
from __future__ import print_function
import glob
import os
fr... | |
<filename>pytorch_fid_wrapper/fid_score.py<gh_stars>1-10
"""
# ----------------------------
# ----- pfw docstrings -----
# ----------------------------
Adapted from:
https://github.com/mseitzer/pytorch-fid/blob/4d7695b39764ba1d54ab6639e0695e5c4e6f346a/pytorch_fid/fid_score.py
Modifications are:
* modify calculate_ac... | |
received_damage = random.randint(r_monster[0].min_damage,
r_monster[0].max_damage)
player_hp = player_hp - received_damage
if player_hp <= 0:
player_hp = 0
await message.channel.send(
":shield:\n```ini\n{} received [{}] damage! Your HP:\n[{}/{}]```"
.format(message.author.name, received_damage, player_hp,
max_h... | |
<filename>tests/bugs/core_5501_test.py<gh_stars>0
#coding:utf-8
#
# id: bugs.core_5501
# title: Unclear gstat's diagnostic when damaged page in DB file appears encrypted
# decription:
# Test creates table 'TEST' with varchar and blob fields, + index on varchar, and add some data to it.
# Blob field is filled by long v... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, absolute_import
from six import iteritems
import os
import sys
import copy
import numpy
import platform
from dcase_util.containers import DictContainer, ListDictContainer, OneToOneMappingContainer
from dcase_util.utils import VectorR... | |
formed by the UV locations, and if `max_l1_interp` is
# provided, also the pixels whose interpolation is too much
# of a stretch to be trusted. In the context of "canvas
# painting," this will be the canvas' base color.
'max_l1_interp': np.inf, # trust/accept all interpolations
# Maximum L1 distance, which we can... | |
1) + shape[-2:] + (1, ))
shape = data.shape # (pages, planes, height, width, contig samples)
bytestr = bytes if sys.version[0] == '2' else (
lambda x: bytes(x, 'utf-8') if isinstance(x, str) else x)
tifftypes = {'B': 1, 's': 2, 'H': 3, 'I': 4, '2I': 5, 'b': 6,
'h': 8, 'i': 9, 'f': 11, 'd': 12, 'Q': 16, 'q... | |
self.mq_matching_id_points_9.append(" ")
if "9" in self.ilias_test_question_type_collection_mq_answers[i]:
self.mq_ilias_response_text_10.append(self.mattText_text_all_mq_answers[t + 9])
self.mq_ilias_response_img_label_10.append(self.mq_response_img_label[t + 9])
self.mq_ilias_response_img_string_base64_encoded_1... | |
+ l0_4 * 2.844781386 + l0_5 * 2.4526730903 + l0_6 * -1.9175165077 + l0_7 * -0.7443755288 + l0_8 * -3.1591419438 + l0_9 * 0.8441602697 + l0_10 * 1.1979484448 + l0_11 * 2.138098544 + l0_12 * 0.9274159536 + l0_13 * -2.1573448803 + l0_14 * -3.7698356464)
l1_21 = self.activation_tanh(l0_0 * 5.187120117 + l0_1 * -7.75256705... | |
2018-07-30 For some reason, cannot use super() in h1text or h2 text, as this
# leads to infinite recursion in javascript...
class h1text(h1):
"""A predefined h1 text element."""
def __init__(self, parent: base_element, h1text: str) -> None:
idstr = ""
h1.__init__(self, parent, idstr, {}, None)
self._textnode = tex... | |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import unicode_literals, division, print_function
"""
This module implements various equation of states.
Note: Most of the code were initially adapted from ASE and deltafactor by
@gmatteo but ... | |
"""Use EDIA to assess quality of model fitness to electron density."""
import numpy as np
from . import Structure, XMap, ElectronDensityRadiusTable
from . import ResolutionBins, BondLengthTable
import argparse
import logging
import os
import time
logger = logging.getLogger(__name__)
class ediaOptions:
def __init__(... | |
<gh_stars>10-100
# 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 requir... | |
import re
import math
import logging
import datetime
import pysolr
from urllib.parse import urlencode, unquote
from django import urls
from django.core.paginator import Paginator, Page
from django.db import connection, reset_queries
from django.http import QueryDict
from django.conf import settings
from core import m... | |
"220 pm")
embed20.add_field(name = "❯ **Isotopes**", value = "K (mass = 39, 93.25%), K (mass = 41, 6.73%), K (mass = 40, Unstable)",inline = False)
embed20.set_thumbnail(url = "https://thumbs.dreamstime.com/b/potassium-k-chemical-element-d-rendering-potassium-k-chemical-element-d-rendering-isolated-black-background-1... | |
<reponame>evodify/calls-files-manipulations<gh_stars>1-10
#!/usr/bin/python2
'''
This is a python module to operate on call files.
#File examples:
#Two-character code:
CHROM POS REF sample1 sample2 sample3 sample4 sample5 sample6 sample7 sample8
chr_1 1 A T/A ./. ./. A/A ./. ./. ./. ./.
chr_1 2 C T/C T/C ./. C/C C/C... | |
<filename>jarvis.py<gh_stars>1-10
import pyttsx3 #pip install pyttsx3 (For Speak)
import datetime
import speech_recognition as sr #pip install SpeechRecognition
import wikipedia #pip install wikipedia
import smtplib
import webbrowser as wb
import os
import pyautogui #pip install pyautogui (For Screenshot)
impo... | |
assert len(items) >= 3
def test_project_id_query_filter(self):
with self.feature("organizations:discover-basic"):
response = self.client.get(
self.url,
format="json",
data={
"end": iso_format(before_now()),
"start": iso_format(before_now(hours=2)),
"query": "project_id:1",
"interval": "30m",
"yAxis": "count... | |
+ f"j={self.lattice.j.__str__()}, "
+ f"field={self.lattice.field}, "
+ f"time_series={self.time_series}, "
+ f"interval={self.interval}, "
+ f"frames={self.frames})"
)
@property
def time(self):
return self.gen * self.interval / 1000
def update(self):
"""
Updates the system to the next generation, appendin... | |
good value and some bad values.
request.md5checksum = obj.getMd5Checksum()
badAccessions = [
"no such accession", objectList[0].getSourceAccessions()[0]]
for accession in badAccessions:
request.accession = accession
self.verifySearchResultsEmpty(request, path, responseClass)
request.accession = ""
if hasAssembl... | |
import itertools
from datetime import datetime
from numpy import nan
import numpy as np
from pandas.core.common import _possibly_downcast_to_dtype, isnull
from pandas.core.index import Index, MultiIndex, _ensure_index, _handle_legacy_indexes
from pandas.core.indexing import _check_slice_bounds, _maybe_convert_indices... | |
<reponame>lperezmo/scientific-computing<gh_stars>0
#!/usr/bin/env python
__description__ = \
"""
Tool for randomly creating groups/zoom breakout rooms for groups of students
weighted by a proficiency score.
"""
__author__ = "<NAME>"
__date__ = "2020-03-30"
import numpy as np
import pandas as pd
import json, random, r... | |
= self.GetPatches(2)
self.SetPatchDeps(patch2, [patch1.id])
self._SetQuery(series, patch1).AndReturn(patch1)
self.mox.ReplayAll()
self.assertResults(series, [patch2],
[], [patch2])
self.mox.VerifyAll()
def testApplyWithCommittedDeps(self):
"""Test that we apply a change with dependency already committed."""
... | |
as ex:
if str(ex).find('tsk_fs_dir_open: path not found'):
log.debug("Path not found : " + path)
else:
log.debug("Exception details:\n", exc_info=True) #traceback.print_exc()
log.error("Failed to get dir info!")
return items
def Open(self, path):
'''Open files less than 200 MB, returns open file handl... | |
#!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2021, OMRON SINIC X
# 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 ... | |
the grids spanned by each dictionary
in the list are explored. This enables searching over any sequence
of parameter settings.
scoring : string, callable or None, default=None
A string (see model evaluation documentation) or
a scorer callable object / function with signature
``scorer(estimator, X, y)``.
If ``No... | |
1)
name = fh.readline().decode("utf-8").strip().lower()
return name[:1].upper() + name[1:]
def set_inputfunc(func):
"""
Set function to be used for blocking on input from the user. The default
if unset is to use a prompt session from prompt-toolkit reading from stdin
of the process where text_game_maker is runn... | |
# encoding: utf-8
# module _socket
# from (pre-generated)
# by generator 1.147
"""
Implementation module for socket operations.
See the socket module for documentation.
"""
# no imports
# Variables with simple values
AF_APPLETALK = 16
AF_DECnet = 12
AF_INET = 2
AF_INET6 = 23
AF_IPX = 6
AF_IRDA = 26
AF_SNA = 11
AF_UN... | |
@pulumi.getter
def description(self) -> Optional[str]:
"""
Permission help text that appears in the admin app assignment and consent experiences.
"""
return pulumi.get(self, "description")
@property
@pulumi.getter(name="displayName")
def display_name(self) -> Optional[str]:
"""
Display name for the permissio... | |
#!/usr/bin/env ipython
import numpy as np
import re
from GDSII import GDSII
class GDSII_ARef(GDSII):
'''
GDSII_ARef class : subclass of GDSII
GDSII Stream file format release 6.0
Array of structure reference (ARef) Element
The ARef element references a cell and repeats it along an array. A cell
can be refe... | |
Args:
tensor: A tensor.
axis: The desired axis.
Returns:
tensor: A tensor with the new axis inserted.
"""
return numpy.expand_dims(tensor, axis)
def dtype(tensor: T.Tensor) -> type:
"""
Return the type of the tensor.
Args:
tensor: A tensor.
Returns:
type: The type of the elements in the tensor.
"""
... | |
{'name': mocked.APIC_NETWORK_EDGE_NAT + '-name',
'admin_state_up': True, 'shared': True,
'status': n_constants.NET_STATUS_ACTIVE,
'tenant_id': 'onetenant',
'router:external': True}}
db_net = self.driver.db_plugin.create_network(ctx, args)
net_ctx = self._get_network_context(self.actual_core_plugin,
ctx.tenant_id... | |
<reponame>giubby84/btclib
#!/usr/bin/env python3
# Copyright (C) 2017-2020 The btclib developers
#
# This file is part of btclib. It is subject to the license terms in the
# LICENSE file found in the top-level directory of this distribution.
#
# No part of btclib including this file, may be copied, modified, propagate... | |
COLOR IMAGE IOD': ['Image'],
'ENHANCED CT IMAGE IOD': ['Image'],
'XRF IMAGE IOD': ['Image'],
'VL PHOTOGRAPHIC IMAGE IOD': ['Image'],
'VL SLIDE-COORDINATES MICROSCOPIC IMAGE IOD': ['Image'],
'VL MICROSCOPIC IMAGE IOD': ['Image'],
'DIGITAL INTRA-ORAL X-RAY IMAGE IOD': ['Image'],
'ENHANCED PET IMAGE IOD': ['Image']... | |
<reponame>mudbungie/NetExplorer<filename>env/lib/python3.4/site-packages/bulbs/base/client.py
# -*- coding: utf-8 -*-
#
# Copyright 2011 <NAME> (http://jamesthornton.com)
# BSD License (see LICENSE for details)
#
"""
Bulbs supports pluggable backends. These are the abstract base classes that
provides the server-clien... | |
from __future__ import absolute_import
import torch
import numpy as np
import pandas as pd
import scipy
import copy
from pysurvival import HAS_GPU
from pysurvival import utils
from pysurvival.utils import neural_networks as nn
from pysurvival.utils import optimization as opt
from pysurvival.models import BaseModel
fro... | |
#!/usr/bin/env python3
import unittest as ut
import subtest_fix
import os
import sys
import glob
import argparse
import copy
import tempfile
from itertools import combinations
import c4.cmany as cmany
import c4.cmany.util as util
import c4.cmany.main as main
import c4.cmany.cmake as cmake
from multiprocessing import... | |
print("tmp scores = ", scores)
# normalize scores, so that they sume up to explained_var
sum_scores = scores.sum()
residual = max(explained_var, 0.0) - sum_scores
if residual > 0.0:
correction = residual / (iteration + 1)
scores[taken] += correction
scores[max_explained_var_index_long] += correction
# scores =... | |
+ " - img_data_string_placeholder"
self.sc_picture_answer_index += 1
excel_sheet.write(row_index, column_index, column_data, body_cell_format)
# Bilder für Fragen-Text
if isinstance(column_data, byteobj.ByteString) == True:
column_data = str(row[self.db_entry_to_index_dict[
'description_img_name_' + str(self.pi... | |
self._parent_class.tenant_id:
# Pull tenant_id from parent namespace cache.
tenant_id = self._parent_class.tenant_id
elif not tenant_id:
# No value for tenant_id.
raise TypeError("tenant_id is required but not set or cached.")
cur_ctlr = self._parent_class.controller
url = str(cur_ctlr) + "/{}/api/tenants/{}/se... | |
#!/usr/bin/env python
# coding=utf-8
# Copyright (c) 2015-2021 UT-BATTELLE, LLC
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyrigh... | |
<reponame>pllim/halotools
"""
Module containing the `~halotools.mock_observables.mean_delta_sigma` function
used to calculate galaxy-galaxy lensing.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
from functools import partial
import multiprocessing
from .engi... | |
the maximum number of terminal nodes
if len(terminal_nodes) >= plot_n_taxa:
break
# Now we need to go through and make sure to add any taxon which is >= 25% of the selected CAGs
for tax_id in cag_taxa_df.query(
"prop_specific >= 0.25"
)["tax_id"].drop_duplicates().values:
add_taxon(tax_id, terminal_nodes, inclu... | |
"""
Material.
Classes to create and manage music materials and lyrics.
"""
import abjad
from itertools import cycle
class Lyrics:
"""Lyrics."""
def __init__(self, target):
"""Initializer."""
self.lyrics = None
self.target = target
self.name = target + "_Lyrics"
def write_lyrics(self, lyrics):
"""Method to ... | |
map-model CC for '%s': %.3f " %(scaled_map_id,cc),
file = self.log)
print ("\n",79*"=","\nDone with local and overall sharpening\n",79*"=",
file = self.log)
def set_map_id_lists(self,kw):
if kw.get('overall_sharpen_before_and_after_local'):
kw['sharpen_all_maps'] = True
if kw.get('map_id') is None:
kw['map_id... | |
# if label can't apply to column but is defined raise error
if not applyc and self[label] == []:
for colname in self.colnames():
if self[label,colname] != []:
self.valid_check_error.append("Given metadata not allowed for a column: %s, %s, %s\n" %(label, colname, self[label,colname]))
#raise BADCTextFileM... | |
[Required] The ID of the Google Cloud Platform project that the
job belongs to.
region: [Required] The Cloud Dataproc region in which to handle the
request.
"""
jobId = _messages.StringField(1, required=True)
projectId = _messages.StringField(2, required=True)
region = _messages.StringField(3, required=True)
... | |
<reponame>MarineLasbleis/GrowYourIC<filename>GrowYourIC/data.py<gh_stars>1-10
#!/usr/bin/env python3
# Project : From geodynamic to Seismic observations in the Earth's inner core
# Author : <NAME>
""" Module data.py
This module define the classes SeismicData() to handle seismic data set.
These datasets define the geog... | |
QgsTextFormat()
format.setFont(getTestFont('bold'))
format.background().setEnabled(True)
format.background().setType(QgsTextBackgroundSettings.ShapeRectangle)
format.background().setSize(QSizeF(20, 10))
format.background().setSizeType(QgsTextBackgroundSettings.SizeFixed)
format.background().setSizeUnit(QgsUnitTyp... | |
row)
if idx == 0:
if not (x == 0 and y == 0):
logging.warning(
'The background component did not start at top left corner but at x={}, y={}!'.format(x, y))
continue
if area < ignore_pred_under:
continue
# dilate bbox
x_center = x + w // 2
y_center = y + h // 2
w = w * bbox_dilation_ratio + 2 * bbox_dilation_... | |
2
IN_PROGRESS = 3
class TargetRender(proto.Message):
r"""Details of rendering for a single target.
Attributes:
rendering_build (str):
Output only. The resource name of the Cloud Build ``Build``
object that is used to render the manifest for this target.
Format is
``projects/{project}/locations/{location}/bui... | |
# Copyright 2016 Canonical 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 in writing, so... | |
server-side information.
This is not available for all types of repositories. The information
will be specific to that type of repository.
"""
name = 'info'
singleton = True
allowed_methods = ('GET',)
mimetype_item_resource_name = 'repository-info'
@webapi_check_local_site
@webapi_check_login_required
@webap... | |
<filename>workflows/pipe-common/pipeline/api/api.py
# Copyright 2017-2019 EPAM Systems, Inc. (https://www.epam.com/)
#
# 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/... | |
<gh_stars>1-10
from matrx.objects.env_object import EnvObject
""" A number of standard, often used objects. """
class SquareBlock(EnvObject):
"""
An example of a simple object with a set of attributes that are always the same. In this case that it is not
traversable, and is visualized as a square. Otherwise it tak... | |
# -*- coding: utf-8 -*-
"""
Profile: http://hl7.org/fhir/StructureDefinition/Appointment
Release: R4
Version: 4.0.1
Build ID: 9346c8cc45
Last updated: 2019-11-01T09:29:23.356+11:00
"""
from typing import List as ListType
from pydantic import Field
from . import backboneelement, domainresource, fhirtypes
class Appoi... | |
+ 17*mckin**16 - 30*mbkin**14*q_cut +
122*mbkin**12*mckin**2*q_cut + 1566*mbkin**10*mckin**4*q_cut +
3382*mbkin**8*mckin**6*q_cut + 3382*mbkin**6*mckin**8*q_cut +
1566*mbkin**4*mckin**10*q_cut + 122*mbkin**2*mckin**12*q_cut -
30*mckin**14*q_cut - 17*mbkin**12*q_cut**2 + 180*mbkin**10*mckin**2*q_cut**2 +
2125*... | |
: 1), (3 : 3 : 1), (3 : 10 : 1), (4 : 1 : 1), (4 : 12 : 1), (6 : 2 : 1), (6 : 11 : 1), (7 : 1 : 1), (7 : 12 : 1), (8 : 4 : 1), (8 : 9 : 1), (9 : 4 : 1), (9 : 9 : 1), (12 : 5 : 1), (12 : 8 : 1)]
sage: set(C._points_fast_sqrt()) == set(C._points_cache_sqrt())
True
"""
# For givaro finite fields, taking square roots i... | |
#Misc
import time, os, sys, pdb, argparse
from glob import glob
from fnmatch import fnmatch
#Base
import numpy as np
import numpy.ma as ma
import pandas as pd
import scipy.io as sio
import scipy.stats as st
import multiprocessing
#Save
import json
import scipy.io as sio
import h5py
import io_dict_to_hdf5 as ioh5
#Pl... | |
# Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
#
# Modified by ERDOS team.
import math
import os
import random
import numpy as np
from numpy import... | |
<filename>sphinxcontrib/autophpdoc/__init__.py
"""
sphinxcontrib.autophpdoc
~~~~~~~~~~~~~~~~~~~~~~~~
Automatically insert docstrings for PHP functions, classes or whole modules into the doctree.
- use PHPDOC to build a structure.xml file of your whole project.
phpdoc -d src -t doc_src/phpdoc --template="xml"
... | |
# -*- coding: utf-8 -*-
"""
Namecheap SSL Certificate Management
.. versionadded:: 2017.7.0
Prerequisites
-------------
This module uses the ``requests`` Python module to communicate to the namecheap
API.
Configuration
-------------
The Namecheap username, API key and URL should be set in the minion configuration
... | |
# Domato - main generator script
# -------------------------------
#
# Written and maintained by <NAME> <<EMAIL>>
#
# Copyright 2017 Google 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 co... | |
import unittest
from datetime import datetime, timedelta
from django.utils import timezone
from textwrap import dedent
import pytz
from yaksh.models import User, Profile, Question, Quiz, QuestionPaper,\
AnswerPaper, Answer, Course, IntegerTestCase, FloatTestCase,\
StringTestCase, McqTestCase, ArrangeTestCase
def se... | |
"""Tests for graph_sage."""
import enum
import math
import os
from absl.testing import parameterized
import tensorflow as tf
import tensorflow_gnn as tfgnn
from tensorflow_gnn.models.graph_sage import layers as graph_sage
_FEATURE_NAME = "f"
def _get_test_graph():
graph = tfgnn.GraphTensor.from_pieces(
context=... | |
<reponame>santiagofdezg/textclassifier
import gensim
from gensim.models.doc2vec import TaggedDocument
from classifierlib.datasets import Reuters
# from tqdm import tqdm
from nltk.corpus import stopwords
from nltk.stem import SnowballStemmer
import re
import time
from joblib import dump, load
stop_words = sto... | |
"""
This environment provides an interface to software management features
through the C8y REST API.
With these we can emulate a user doing operations in the C8y UI.
They are rather slow as they use the complete chain from end to end.
WARNING: Handle with care!!!
The C8YDEVICEID will handle on which device this test w... | |
self.__default_allow_privilege_escalation = default_allow_privilege_escalation
self.__allow_privilege_escalation = (
allow_privilege_escalation
if allow_privilege_escalation is not None
else True
)
self.__allowed_host_paths = (
allowed_host_paths if allowed_host_paths is not None else []
)
self.__allowed_flex_... | |
<reponame>UnoSD/pulumi
# Copyright 2016-2021, Pulumi Corporation.
#
# 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 applica... | |
<gh_stars>10-100
"""
This contains wrapper functions that simplify plotting raster
and vector data for publication-ready figures.
The documentation of the examples can be found here:
https://lsdtopotools.github.io/LSDTopoTools_ChiMudd2014/
<NAME> and <NAME>, January 2018
Released under GPL3
"""
import matpl... | |
#!/usr/bin/env python3
import math
import re
# change anything you want here
precision = 131
file_name_operations_h = r'operations.h'
# don't touch anything here
bits_per_word = 32
hex_digits_per_word = bits_per_word // 4
min_bignum_number_of_words = math.ceil(precision / bits_per_word)
max_bignum_number_of_words = ... | |
##########################################################################
#
# Copyright (c) 2013-2015, Image Engine Design 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:
#
# * Redistributio... | |
<filename>Lectures/EOM_Workshop/unit_tests.py
## Unit tests for rigid_body functions
import rigid_body as rb
import numpy as np
import aerosonde_uav as uav
def within_tol(a,b,tol):
if (np.abs(a-b)<tol).all():
return True
else:
return False
## Init checks array
checks = [True]
## Specify tol on checks
tol = 1e-8
... | |
#!/usr/bin/env python
from big_ol_pile_of_manim_imports import *
from old_projects.triangle_of_power.triangle import TOP, OPERATION_COLORS
# To watch one of these scenes, run the following:
# python extract_scene.py file_name <SceneName> -p
#
# Use the flat -l for a faster rendering at a lower
# quality, use -s to ski... | |
import numpy as np
import nibabel as nib
import SimpleITK as sitk
from matplotlib import patches
import scipy.ndimage.filters as fi
from matplotlib import pyplot as plt
from dipy.align.reslice import reslice
plt.rcParams['image.cmap'] = 'gray'
# -------------------------
# Nifti Image Preprocessing
# ---------------... | |
import direct.gui
import direct.showbase
import pandac.PandaModules
import framework.eventmarkers.eventmarkers
import math
class BasicStimuli:
"""
A class that provides convenience functions for displaying psychological-type stimuli.
This includes text, rectangles, crosshairs, images, sounds, and video.
These fun... | |
else:
# <--------->
# <--------->
overlap_len = len(pre_sbjct[overlap_start:])
overlap_end_pos = pre_block_end
# Update current end
current_end = next_block_end
# Use the entire pre sequence and add the last part of the next sequence
final_sbjct += next_sbjct[overlap_len:]
final_qry += next_qry[overlap_len:]... | |
#from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import csv
import errno
import json
import os
import random
import numpy as np
import tensorflow as tf
from tensorflow.python.util import nest
import sys
sys.path.append("/home/liyi/video-pre... | |
<reponame>RicardoVinicioJara/LugaresTusisticos
# coding: utf-8
# Copyright 2018 IBM 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/LI... | |
<gh_stars>0
from montepython.likelihood_class import Likelihood
import io_mp
import scipy.integrate
from scipy import interpolate as itp
import os
import numpy as np
import math
# Adapted from <NAME>
class euclid_lensing(Likelihood):
def __init__(self, path, data, command_line):
Likelihood.__init__(self, path, d... | |
<reponame>ninavelikajne/RhythmCount
import pandas as pd
import numpy as np
import scipy.signal as signal
import scipy.stats as stats
import matplotlib.pyplot as plt
import statsmodels
import statsmodels.api as sm
from matplotlib.lines import Line2D
from RhythmCount import helpers as hlp
from RhythmCount import plot
im... | |
__all__ = ['POW']
from .base import BinaryHead, heads_precedence, Head, Expr, Pair, ArithmeticHead
from ..core import init_module
init_module.import_heads()
init_module.import_lowlevel_operations()
init_module.import_numbers()
@init_module
def _init(module):
from ..arithmetic.numbers import try_power
module.try_p... | |
<gh_stars>0
# coding: utf-8
"""
LogicMonitor REST API
LogicMonitor is a SaaS-based performance monitoring platform that provides full visibility into complex, hybrid infrastructures, offering granular performance monitoring and actionable data and insights. logicmonitor_sdk enables you to manage your LogicMonitor a... | |
<reponame>ccsourcecode/tixcraft_bot
#!/usr/bin/env python
#encoding=utf-8
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
# for close tab.
from selenium.common.exceptions import NoSuchWindowException
# for alert
from selenium.common.exceptions... | |
#!/usr/bin/env python
#
# Copyright 2014 <NAME>
#
# 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 ... | |
most recent invitation recepient."""
try:
return (self.orginvitation_set.select(
OrgInvitation.invitee).where(OrgInvitation.invitee_id == self.tech_contact_id)
.order_by(OrgInvitation.created_at.desc()).first().invitee)
except Exception:
return None
@property
def invitation_sent_at(self):
"""Get the timestamp... | |
type: dict
sample: null
sku:
description:
- SKU of the application gateway resource.
returned: always
type: dict
sample: null
contains:
name:
description:
- Name of an application gateway SKU.
returned: always
type: str
sample: null
tier:
description:
- Tier of an application gateway.
... | |
<reponame>libremente/service-app<filename>backend/ozon/api_base.py
# Copyright INRIM (https://www.inrim.eu)
# See LICENSE file for full licensing details.
from .appinit import *
import ujson
from .core.ServiceMain import ServiceMain
from json import JSONDecodeError
# TODO component base move to frontend
# Actions
@... | |
},
{
'content_type': 'audio',
'remote_file': source_url + filename_base + '.audio.10.zip',
'remote_bytes': 1726068853,
'remote_md5': '2ad595819ffa1d56d2de4c7ed43205a6',
'filename': filename_base + '.audio.10.zip'
},
{
'content_type': 'audio',
'remote_file': source_url + filename_base + '.audio.11.zip',
'remo... | |
' '),
('testspacelist', '\n')):
for lst in lists:
argv = ('./program', '--%s=%s' % (name, sep.join(lst)))
argv = FLAGS(argv)
self.assertEquals(getattr(FLAGS, name), lst)
# Test help text
flagsHelp = str(FLAGS)
assert flagsHelp.find("repeat") != -1, "cannot find flag in help"
assert flagsHelp.find(repeatHelp) ... | |
rule1323,
rule1324,
rule1325,
rule1326,
rule1327,
rule1328,
rule1329,
rule1330,
rule1331,
rule1332,
rule1333,
rule1334,
rule1335,
rule1336,
rule1337,
rule1338,
rule1339,
rule1340,
rule1341,
rule1342,
rule1343,
rule1344,
rule1345,
rule1346,
rule1347,
rule1348,
rule1349,
rule1350,
rule1351,
r... | |
(self.vpp_seq_number, 0),
"BFD sequence number not one of "
"(%s, 0)" % self.vpp_seq_number)
self.vpp_seq_number = recvd_seq_num
# last 20 bytes represent the hash - so replace them with the key,
# pad the result with zeros and hash the result
hash_material = bfd.original[:-20] + self.sha1_key.key + \
b"\0" * (2... | |
order to make room for new data, without going over the specified memory limit."
lazyfree_lazy_expire_desc = "Redis deletes objects independently of a user call because of expire. when a key with an associated time to live (see the EXPIRE command) must be deleted from memory."
lazyfree_lazy_server_del_desc = "Redis del... | |
"""Create entanglement state
Args:
- qc (QuantumCircuit): init circuit
Returns:
- QuantumCircuit: the added circuit
"""
for i in range(0, qc.num_qubits):
if i == qc.num_qubits - 1:
qc.cnot(qc.num_qubits - 1, 0)
else:
qc.cnot(i, i + 1)
return qc
def u_cluster_nqubit(qc: qiskit.QuantumCircuit, thetas: np.n... | |
t)*g, where t is an unrelated symbol and
filtering out solution that does not contain t.
For more information on the implemented algorithm refer to:
[1] <NAME>, <NAME>, <NAME>, Ideals, Varieties and
Algorithms, Springer, Second Edition, 1997, pp. 187
"""
if not isinstance(f, Poly):
f = Poly(f, *symbols)
elif... | |
<gh_stars>0
##########################################################################
#
# Copyright (c) 2014, Image Engine Design Inc. All rights reserved.
# Copyright (c) 2014, <NAME>. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided th... | |
lineSeparator
html = html + " <td class=\"left\">" + j2cCFResourceProperties[property] + "</td>" + lineSeparator
html = html + " <td>" + value + "</td>" + lineSeparator
html = html + " </tr>" + lineSeparator
# List the Connection Pool properties
html = html + " <tr>" + lineSeparator
html = html + " <td class=\"p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.