filename
stringlengths
13
19
text
stringlengths
134
1.04M
the-stack_0_6800
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
the-stack_0_6802
import elasticsearch import datetime node = 'Elasticsearch:80' #node = '54.186.33.136:9200' es = elasticsearch.Elasticsearch(node) entry_mapping = { 'entry-type': { 'properties': { 'id': {'type': 'string'}, 'created': {'type': 'date'}, 'title': {'type': 's...
the-stack_0_6803
import numpy as np import torch from .primitives import fexp, cuboid_inside_outside_function, \ inside_outside_function, points_to_cuboid_distances, \ transform_to_primitives_centric_system, deform, sq_volumes from .regularizers import get as get_regularizer def sampling_from_parametric_space_to_equivalent_...
the-stack_0_6806
""" RESTful platform for notify component. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/notify.rest/ """ import logging import requests import voluptuous as vol from homeassistant.components.notify import ( ATTR_TARGET, ATTR_TITLE, ATTR_TITLE_DEF...
the-stack_0_6807
from __future__ import absolute_import, division, print_function import boost_adaptbx.boost.python as bp ext = bp.import_ext("iotbx_pdb_hierarchy_ext") from iotbx_pdb_hierarchy_ext import * from libtbx.str_utils import show_sorted_by_counts from libtbx.utils import Sorry, plural_s, null_out from libtbx import Auto, dic...
the-stack_0_6808
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 1999-2018 Alibaba Group Holding 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-...
the-stack_0_6809
import json import plotly import pandas as pd from nltk.stem import WordNetLemmatizer from nltk.tokenize import word_tokenize from flask import Flask from flask import render_template, request, jsonify from plotly.graph_objs import Bar from sklearn.externals import joblib from sqlalchemy import create_engine app = ...
the-stack_0_6810
# -*- coding: utf-8 -*- # # Electrum - lightweight Bitcoin client # Copyright (C) 2018 The Electrum developers # # 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, # includi...
the-stack_0_6811
# finding the count of even numbers between 0 and 100. #x=10%2 #print("x",x) #y=7%2 #print("y",y) #onemli not: space and tab are important in python!!!! nums = [0,1,2,3,4,5,6,7,8,9,10] count=0 for item in nums: print("ev even a yan na:", item) if item%2==0: # heger cift sayi ye yan na! #bele cif...
the-stack_0_6812
from parameterized import parameterized from test_plus.test import TestCase from ...generic.tests.test_views import ( AuthorshipViewSetMixin, GenericViewSetMixin, OrderingViewSetMixin, ) from ..factories import InstitutionFactory from ..serializers import InstitutionSerializer class InstitutionViewSetTes...
the-stack_0_6813
#------------------------------------------------------------------------------ # Copyright 2013 Esri # 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/LICENS...
the-stack_0_6817
import math import time import datetime class LoadBar: """ """ def __init__(self, max=100, size=20, head='.', body='.', border_left='[', border_right=']', show_step=True, show_percentage=True, show_eta=True, title=None, show_total_time=True, show_time=False): """ :param...
the-stack_0_6818
import base64 import json import os import tempfile import zipfile none = "d3043820717d74d9a17694c176d39733" # region Application class Application: def __init__(self, name): self.name = name # endregion # region Environment class Environment: def __init__(self, name, application_id, providers=non...
the-stack_0_6819
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ import os import sys from setuptools import setup, find_packages # pylint: disable=redefined-builtin here = os.path.abspath(os.path.dirname(__file__)) # pylint: disable=invali...
the-stack_0_6820
import argparse from io import BytesIO from urllib.parse import unquote_plus from urllib.request import urlopen from flask import Flask, request, send_file from waitress import serve from ..bg import remove app = Flask(__name__) @app.route("/", methods=["GET", "POST"]) def index(): file_content = "" if re...
the-stack_0_6821
import argparse import json import os import random import time import numpy as np import torch.distributed as dist import torch.utils.data.distributed from apex import amp from apex.parallel import DistributedDataParallel from warpctc_pytorch import CTCLoss from data.data_loader import AudioDataLoader, SpectrogramDa...
the-stack_0_6822
""" stdint ====== Although Python has native support for arbitrary-precision integers, Javascript by default uses 64-bit floats as the only numeric type, signifying they cannot store more than 53 integral bits. Therefore, in Javascript, 64-bit integers are stored as an array of 2 numbers. ...
the-stack_0_6823
import os import pytest import ray from ray import serve if os.environ.get("RAY_SERVE_INTENTIONALLY_CRASH", False): serve.controller._CRASH_AFTER_CHECKPOINT_PROBABILITY = 0.5 @pytest.fixture(scope="session") def _shared_serve_instance(): ray.init(num_cpus=36) serve.init() yield @pytest.fixture de...
the-stack_0_6824
import mock import zeit.cms.browser.interfaces import zeit.cms.browser.listing import zeit.cms.content.interfaces import zeit.cms.interfaces import zeit.cms.testing import zope.component import zope.publisher.browser class HitColumnTest(zeit.cms.testing.ZeitCmsTestCase): def test_sort_key(self): class Fa...
the-stack_0_6825
import sys from typing import Any from typing import List from kurobako import problem from naslib.utils import get_dataset_api op_names = [ "skip_connect", "none", "nor_conv_3x3", "nor_conv_1x1", "avg_pool_3x3", ] edge_num = 4 * 3 // 2 max_epoch = 199 prune_start_epoch = 10 prune_epoch_step = 1...
the-stack_0_6827
def to_openmm_Topology(item, selection='all', frame_indices='all', syntaxis='MolSysMT'): from molsysmt.tools.openmm_Modeller import is_openmm_Modeller from molsysmt.basic import convert if not is_openmm_Modeller(item): raise ValueError tmp_item = convert(item, to_form='openmm.Topology', selec...
the-stack_0_6828
import re from django import forms from django.core.validators import RegexValidator regex_validator_open = RegexValidator( regex=re.compile("open", flags=re.ASCII), message="You can't use open function", inverse_match=True, ) regex_validator_eval = RegexValidator( regex=re.compile("eval", flags=re.AS...
the-stack_0_6830
import random import time import warnings import sys import argparse import shutil import torch import torch.backends.cudnn as cudnn from torch.optim import SGD from torch.optim.lr_scheduler import LambdaLR, MultiStepLR from torch.utils.data import DataLoader from torchvision.transforms import Compose, ToPILImage sys...
the-stack_0_6833
# -*- coding: utf-8 -*- # # wxcast: A Python API and cli to collect weather information. # # Copyright (c) 2021 Sean Marlow # # 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 restricti...
the-stack_0_6834
import demistomock as demisto from CommonServerPython import * from CommonServerUserPython import * from googleapiclient.discovery import build from httplib2 import Http import json from oauth2client import service_account from google.oauth2 import service_account as google_service_account import googleapiclient.http f...
the-stack_0_6836
import torch from torch import nn import torch.nn.functional as F class EmbedVector(nn.Module): def __init__(self, config): super(EmbedVector, self).__init__() self.config = config target_size = config.label self.embed = nn.Embedding(config.words_num, config.words_dim) if co...
the-stack_0_6837
STEMS = [ ('кон', ['конят', 'коня']), ('стол', ['столът']), ('хълм', ['хълма']), ('кола', ['колата', 'колите']), ('колело', ['колелото']), ('маса', ['маси']), ('стол', ['столове']), ('легло', ['легла']), ('чайник', ['чайници']), ('апарат', ['апарати']), ('дърво', ['дървета'])...
the-stack_0_6838
import sys import palmettopy.exceptions from palmettopy.palmetto import Palmetto words = ["cherry", "pie", "cr_eam", "apple", "orange", "banana", "pineapple", "plum", "pig", "cra_cker", "so_und", "kit"] palmetto = Palmetto() try: result = palmetto.get_df_for_words(words) sys.exit(0) except palmettopy.e...
the-stack_0_6840
import re import vbox.base from . import ( base, props, exceptions, ) class HostDevice(base.SubEntity): state = property(lambda s: s.getPayload()["Current State"].lower()) product = property(lambda s: s.getPayload()["Product"]) manufacturer = property(lambda s: s.getPayload()["Manufacturer"])...
the-stack_0_6841
#print is function when we want to print something on output print("My name is Dhruv") #You will notice something strange if you try to print any directory #print("C:\Users\dhruv\Desktop\dhruv.github.io") #Yes unicodeescape error # Remember i told about escape character on previous tutorial # yes it causing prob...
the-stack_0_6843
""" The tests in this package are to ensure the proper resultant dtypes of set operations. """ import numpy as np import pytest from pandas.core.dtypes.common import is_dtype_equal import pandas as pd from pandas import Float64Index, Int64Index, RangeIndex, UInt64Index import pandas._testing as tm from pandas.api.typ...
the-stack_0_6845
# coding:utf-8 from schemaobject.collections import OrderedDict def column_schema_builder(table): """ Returns a dictionary loaded with all of the columns availale in the table. ``table`` must be an instance of TableSchema. .. note:: This function is automatically called for you and set to ...
the-stack_0_6846
""" Copyright (c) 2020 Intel 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 applicable law or agreed to in writin...
the-stack_0_6848
#------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. #-------------------------------------------------------------------------- from typing import Dict from logging import getLogger from onnx import he...
the-stack_0_6849
#!/usr/bin/python import pickle import numpy import _pickle as cPickle from sklearn.model_selection import cross_validate from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.feature_selection import SelectPercentile, f_classif from sklearn.model_selection import train_test_split def preprocess(...
the-stack_0_6850
import django from gui.lnd_deps import router_pb2 as lnr from gui.lnd_deps import router_pb2_grpc as lnrouter from gui.lnd_deps.lnd_connect import lnd_connect from lndg import settings from os import environ from time import sleep environ['DJANGO_SETTINGS_MODULE'] = 'lndg.settings' django.setup() from gui.models import...
the-stack_0_6851
""" Copyright (c) 2017 Alex Forencich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute...
the-stack_0_6853
from django.urls import path, include from rest_framework.routers import DefaultRouter from bills import views from django.conf.urls import url router = DefaultRouter() router.register('headbill', views.HeadBillViewSet) router.register('relationshipTaxProduct', views.RelationshipTaxProductViewSet) router.register('b...
the-stack_0_6854
import os import re import subprocess import sys from setuptools import Extension, setup, find_packages from setuptools.command.build_ext import build_ext # Convert distutils Windows platform specifiers to CMake -A arguments PLAT_TO_CMAKE = { 'win32': 'Win32', 'win-amd64': 'x64', 'win-arm32': 'ARM', '...
the-stack_0_6855
# # Cormorant training script for the residue deletion dataset # import logging import torch from cormorant.data.collate import collate_activity from cormorant.data.utils import initialize_datasets from cormorant.engine import Engine from cormorant.engine import init_argparse, init_file_paths, init_logger, init_cuda ...
the-stack_0_6857
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="PacaPy-raul-guajardo", version="0.0.1", author="Raul Guajardo", author_email="rguajardo95@gmail.com", description="A package designed as a wrapper over Alpaca API for my general use.", ...
the-stack_0_6858
# coding=utf-8 import torch import torch.utils.data as data import torchvision.transforms as transforms from PIL import Image from PIL import ImageDraw import os.path as osp import numpy as np import json class CPDataset(data.Dataset): """Dataset for CP-VTON+. """ def __init__(self, opt): super...
the-stack_0_6859
import sys from time import time import pandas as pd from pandas import DataFrame import numpy as np import matplotlib.pyplot as plt import itertools import matplotlib as mpl from scipy import linalg from sklearn import metrics from sklearn.cluster import KMeans from sklearn.decomposition import PCA from sklearn.prep...
the-stack_0_6866
import torch import torch.nn as nn import torch.nn.functional as F from torch_geometric.nn import GCNConv class MPNNLSTM(nn.Module): r"""An implementation of the Message Passing Neural Network with Long Short Term Memory. For details see this paper: `"Transfer Graph Neural Networks for Pandemic Forecasting." <...
the-stack_0_6867
import os import unittest from digiroad.connection.PostgisServiceProvider import PostgisServiceProvider from digiroad.entities import Point from digiroad.logic.Operations import Operations from digiroad.util import CostAttributes, FileActions class PostgisServiceProviderTest(unittest.TestCase): def setUp(self): ...
the-stack_0_6869
# -*- coding: utf-8 -*- from bs4 import BeautifulSoup from base64 import b64decode from glob import glob import imghdr import os import requests import warnings def acquire_note(directory, div): if div.find('div').text is not None: with open(os.path.join(directory, f'curation_notes.txt'), 'w', encoding='u...
the-stack_0_6871
import os import sys import time import shlex import signal import logging import traceback import subprocess as sp import multiprocessing as mp import path import daemon import packaging logger = logging.getLogger(__name__) def status(module_name): """ Return the status of the module *module_name* A mod...
the-stack_0_6872
#!/usr/bin/env python3 import argparse import json from pathlib import Path from typing import NamedTuple import subprocess as sp from dataset_utils import rm_imgs_without_labels LABEL_MAP = { "car": 0, "bus": 1, "person": 2, "bike": 3, "truck": 4, "motor": 5, "train": 6, "rider": 7, ...
the-stack_0_6873
#!/usr/bin/env python3 """Python S3 Manager""" import sys import os import pandas as pd import boto3 from botocore.exceptions import ClientError from shapely.geometry import box class s3UploadDownload: """ A class to upload/pull files to/from S3. """ def __init__(self, bucket_name=None): """...
the-stack_0_6874
from urllib import request import xml.etree.ElementTree as ET import os wnid = "n02783161" dirpath = os.path.join("raw_images",wnid) if os.path.isdir(dirpath) == False: os.mkdir(dirpath) IMG_LIST_URL="http://www.image-net.org/api/text/imagenet.synset.geturls.getmapping?wnid={}" url = IMG_LIST_URL.format(wnid) w...
the-stack_0_6875
#!/usr/bin/env python # # Use the raw transactions API to spend BONTEs received on particular addresses, # and send any change back to that same address. # # Example usage: # spendfrom.py # Lists available funds # spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00 # # Assumes it will talk to a bontecoind or bon...
the-stack_0_6878
from __future__ import absolute_import from __future__ import division from __future__ import print_function import abc from scipy.ndimage import gaussian_filter import numpy as np class AffinityRefinementOperation(metaclass=abc.ABCMeta): def check_input(self, X): """Check the input to the refine() metho...
the-stack_0_6880
import sys sys.path.append('./') import unittest from Added import Added class AddedTest(unittest.TestCase): def test_add(self): added = Added() expected = added.add(1,2) self.assertEqual(3, expected) if __name__ == '__main__': unittest.main()
the-stack_0_6882
import _plotly_utils.basevalidators class SizeValidator(_plotly_utils.basevalidators.NumberValidator): def __init__( self, plotly_name="size", parent_name="densitymapbox.colorbar.tickfont", **kwargs ): super(SizeValidator, self).__init__( plotly_name=plotly_...
the-stack_0_6885
import torch.nn as nn import math import torch.utils.model_zoo as model_zoo import torch.nn.functional as F import pdb import torch import numpy as np __all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101', 'resnet152'] model_urls = { 'resnet18': 'https://download.pytorch.org/models/resn...
the-stack_0_6887
import math import torch from torch.distributions import constraints from pyro.nn import PyroModule, pyro_method, PyroParam root_three = math.sqrt(3.0) root_five = math.sqrt(5.0) five_thirds = 5.0 / 3.0 class MaternKernel(PyroModule): """ Provides the building blocks for representing univariate Gaussian Pr...
the-stack_0_6888
import torch import torch.nn as nn import numpy as np from mushroom_rl.policy.torch_policy import TorchPolicy, GaussianTorchPolicy def abstract_method_tester(f, *args): try: f(*args) except NotImplementedError: pass else: assert False class Network(nn.Module): def __init__(...
the-stack_0_6889
import gym from keras.models import Sequential from keras.layers import Dense from keras.optimizers import Adam import numpy as np import random from matplotlib import pyplot as plt from custom_gym.cartpole import CustomCartPoleEnv import timeit # AGENT/NETWORK HYPERPARAMETERS EPSILON_INITIAL = 1.0 # exploration rate...
the-stack_0_6890
# -*- coding: utf-8 -*- """ Created on Fri Jan 6 23:45:59 2017 @author: yxl """ import os, sys, os.path as osp from glob import glob from sciapp.action import Macros, Widget, Report from .. import root_dir from .manager import DocumentManager, DictManager from codecs import open def get_path(root, path): for i i...
the-stack_0_6892
"""distutils.ccompiler Contains CCompiler, an abstract base class that defines the interface for the Distutils compiler abstraction model.""" import sys, os, re from distutils.errors import * from distutils.spawn import spawn from distutils.file_util import move_file from distutils.dir_util import mkpath from distuti...
the-stack_0_6893
import pytest from thefrick.rules.tsuru_login import match, get_new_command from thefrick.types import Command error_msg = ( "Error: you're not authenticated or your session has expired.", ("You're not authenticated or your session has expired. " "Please use \"login\" command for authentication."), ) @...
the-stack_0_6896
from vpp_tunnel_interface import VppTunnelInterface class VppIpsecTunInterface(VppTunnelInterface): """ VPP IPsec Tunnel interface """ def __init__(self, test, parent_if, local_spi, remote_spi, crypto_alg, local_crypto_key, remote_crypto_key, integ_alg, local_integ_k...
the-stack_0_6897
import cv2 import numpy as np f='image287.jpg' img=cv2.imread(f) gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) gray=np.float32(gray) dst=cv2.cornerHarris(gray,2,3,0.04) dst=cv2.dilate(dst,None) ret,dst=cv2.threshold(dst,0.01*dst.max(),255,0) dst=np.uint8(dst) ret,labels,stats,centroids=cv2.connectedComponentsWithStats(...
the-stack_0_6898
from PyQt5.QtCore import QTimer, Qt from PyQt5.QtWidgets import (QApplication, QVBoxLayout, QMainWindow, QTabWidget, QPushButton, QWidget, QFileDialog) from controller.config_controller import ConfigController from widgets import (NewOrLoad, ExperimentConfigTab, CardSelectionsConfigTab, ...
the-stack_0_6901
# Import models from mmic_md.models.input import MDInput from mmic_md_gmx.models import ComputeGmxInput from cmselemental.util.files import random_file # Import components from mmic_cmd.components import CmdComponent from mmic.components.blueprints import GenericComponent from typing import Any, Dict, List, Tuple, Op...
the-stack_0_6903
# _base_ = ['../../_base_/models/csn_ig65m_pretrained.py'] # ir-CSN (interaction-reduced channel-separated network) architecture ann_type = 'tanz_base' # * change accordingly num_classes = 9 if ann_type == 'tanz_base' else 42 # model settings model = dict( type='Recognizer3D', backbone=dict( type='R...
the-stack_0_6904
import graphene from django.core.exceptions import ValidationError from ...account import models as account_models from ...core.error_codes import ShopErrorCode from ...core.permissions import SitePermissions from ...core.utils.url import validate_storefront_url from ...site import models as site_models from ..account...
the-stack_0_6905
# Lint as: python3 # Copyright 2020 Google Research. 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 require...
the-stack_0_6908
############################################################################### # Convert coco annotations to a SQLite database # # # # # ...
the-stack_0_6913
import mailbox import quopri import email.utils import lxml.html.clean import re def read_mail(path): mdir = mailbox.Maildir(path) return mdir def extract_email_headers(msg): """Extract headers from email""" msg_obj = {} msg_obj["from"] = {} from_field = msg.getheaders('From')[0] msg_obj[...
the-stack_0_6914
# program to delete a specific item from a given doubly linked list. class Node(object): # Singly linked node def __init__(self, value=None, next=None, prev=None): self.value = value self.next = next self.prev = prev class doubly_linked_list(object): def __init__(self): self...
the-stack_0_6917
from __future__ import absolute_import, division, print_function import tensorflow as tf import numpy as np import os import zipfile def _parse_flat(filename, label): image_string = tf.read_file(filename) image_decoded = tf.image.decode_jpeg(image_string, channels=1) # the image gets decoded in the shape...
the-stack_0_6918
'''test pysftp.Connection.stat and .lstat - uses py.test''' # pylint: disable = W0142 # pylint: disable=E1101 from common import * def test_stat(psftp): '''test stat''' dirname = 'pub' psftp.chdir('/home/test') rslt = psftp.stat(dirname) assert rslt.st_size >= 0 def test_lstat(psftp): '''te...
the-stack_0_6919
import os from pathlib import Path from shutil import which from invoke import task PKG_NAME = "conda_hooks" PKG_PATH = Path(f"{PKG_NAME}") ACTIVE_VENV = os.environ.get("VIRTUAL_ENV", None) VENV_HOME = Path(os.environ.get("WORKON_HOME", "~/.local/share/virtualenvs")) VENV_PATH = Path(ACTIVE_VENV) if ACTIVE_VENV else ...
the-stack_0_6920
from Maix import I2S, GPIO from fpioa_manager import fm from modules import SpeechRecognizer import utime, time # register i2s(i2s0) pin fm.register(20, fm.fpioa.I2S0_OUT_D0, force=True) fm.register(18, fm.fpioa.I2S0_SCLK, force=True) fm.register(19, fm.fpioa.I2S0_WS, force=True) # close WiFi, if use M1W Co...
the-stack_0_6923
import logging from copy import deepcopy from datetime import timezone from typing import Any, Dict, List, Optional import pytz import requests from dateutil import parser from obsei.sink.base_sink import Convertor from obsei.sink.http_sink import HttpSink, HttpSinkConfig from obsei.payload import TextPayload from ob...
the-stack_0_6925
# -*- coding: utf-8 -*- # Example for using WebDriver object: driver = self.get_current_driver() e.g driver.current_url from QAutoLibrary.extension import TESTDATA from selenium.webdriver.common.by import By from QAutoLibrary.QAutoSelenium import * from time import sleep class Cs_backup_restore_dlg_up_back_conf_exist(...
the-stack_0_6926
from pynput.mouse import * import random from time import sleep import subprocess subprocess.call("pip install pynput",shell=True) mouse = Controller() def randomMousePosition(): random_x = random.randint(1,10000) random_y = random.randint(1,10000) moveMouse(random_x,random_y) def moveMouse(x,y): mo...
the-stack_0_6927
from constants import * from mobject.mobject import Mobject from utils.bezier import interpolate from utils.color import color_gradient from utils.color import color_to_rgba from utils.color import rgba_to_color from utils.config_ops import digest_config from utils.iterables import stretch_array_to_length from utils...
the-stack_0_6929
"""Image loaders.""" from .common import SDLError from .compat import UnsupportedError, byteify from .. import endian, surface, pixels _HASPIL = True try: from PIL import Image except ImportError: _HASPIL = False _HASSDLIMAGE = True try: from .. import sdlimage except ImportError: _HASSDLIMAGE = False...
the-stack_0_6930
""" Contains website related routes and views. """ import json from operator import itemgetter import os from urllib import parse as urlparse import boto3 from boto3.exceptions import Boto3Error from botocore.exceptions import BotoCoreError from pyramid.decorator import reify from pyramid.events import NewResponse fr...
the-stack_0_6931
"""Testing v0x05 error message class.""" from pyof.v0x05.asynchronous.error_msg import ErrorMsg from tests.test_struct import TestStruct class TestErrorMsg(TestStruct): """ErroMsg message tests (also those in :class:`.TestDump`).""" @classmethod def setUpClass(cls): """Configure raw file and its ...
the-stack_0_6935
# MIT License # # Copyright (c) 2020 Jonathan Zernik # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, mer...
the-stack_0_6938
# -*- coding: utf-8 -*- # # Copyright 2015 Ternaris, Munich, Germany # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, c...
the-stack_0_6939
from snovault import ( CONNECTION, upgrade_step, ) @upgrade_step('fastqc_quality_metric', '2', '3') def fastqc_quality_metric_2_3(value, system): # http://redmine.encodedcc.org/issues/3897 # get from the file the lab and award for the attribution!!! conn = system['registry'][CONNECTION] f = co...
the-stack_0_6940
# =============================================================================== # Copyright 2012 Jake Ross # # 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...
the-stack_0_6941
import sqlite3 def make_db(): con = sqlite3.connect("Paths.db") c = con.cursor() c.execute('''CREATE TABLE IF NOT EXISTS Paths ( Fromm text not null, Tooo text not null)''') con.commit() def insert(x,y): con = sqlite3.connect("Paths.db") SQLinsertfb = '''INSERT INTO P...
the-stack_0_6942
from nominal_unification.Syntax import * class Closure(): """ A closure represents an expression within a context with bindings. Variables within said expression may or may not be captured by the scope. """ def __init__(self, expr, scope): self.expr = expr self.scope = sco...
the-stack_0_6943
""" Utility functions for cmiles generator """ import numpy as np import copy import collections import warnings try: from rdkit import Chem has_rdkit = True except ImportError: has_rdkit = False try: from openeye import oechem if not oechem.OEChemIsLicensed(): has_openeye = False has_...
the-stack_0_6945
from cx_Freeze import setup, Executable includefiles = [] includes = [] excludes = [] packages = ["PIL.Image", "PIL.WebPImagePlugin"] setup( name = "WEBP Converter", version = "0.1.0", description = "This is my program", options = {'build_exe': {'includes': includes, 'excludes': excludes, '...
the-stack_0_6946
# -*- coding: utf-8 -*- from setuptools import setup, find_packages import os _here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(_here, 'README.rst'), encoding='utf-8') as f: README = f.read() with open(os.path.join(_here, 'LICENSE'), encoding='utf-8') as f: LICENSE = f.read() version...
the-stack_0_6947
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe import random from frappe.utils import random_string from frappe.desk import query_report from erpnext.accounts.doctype.journal_entry.jo...
the-stack_0_6948
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Oct 16 19:59:07 2021 @author: Alexander Southan """ import numpy as np import unittest from src.pyPreprocessing import transform class TestTransform(unittest.TestCase): def test_transform(self): x = np.linspace(0, 10, 1100) y = ...
the-stack_0_6950
#!/usr/bin/env python3 # Copyright (c) 2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ Test addr relay """ from test_framework.messages import ( CAddress, NODE_NETWORK, NODE_WITNESS...
the-stack_0_6954
""" Fourier Transforms The frequency components of an image can be displayed after doing a Fourier Transform (FT). An FT looks at the components of an image (edges that are high-frequency, and areas of smooth color as low-frequency), and plots the frequencies that occur as points in spectrum. In fact, an FT tr...
the-stack_0_6955
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # (C) British Crown Copyright 2017-2021 Met Office. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions a...
the-stack_0_6956
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2021/11/26 14:20 # @Author : Adyan # @File : setup.py import setuptools with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read() setuptools.setup( name="Adyan", version="0.0.2", author="Adyan", author_email="...
the-stack_0_6957
from typing import Callable try: # Assume we're a sub-module in a package. from utils import numeric as nm except ImportError: # Apparently no higher-level package has been imported, fall back to a local import. from ..utils import numeric as nm def shifted_func(func) -> Callable: def func_(x, y) -> li...
the-stack_0_6959
import math # pad input string with character c and modulo operand mod_op def padWithChars(sinp,c,mod_op): ret_val = sinp if len(sinp) % mod_op == 0: return ret_val for i in range(0,mod_op-len(sinp)%mod_op): ret_val += c return ret_val # split input string into a list where each elemen...
the-stack_0_6960
# coding: utf-8 """ FreeClimb API FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site teleph...