filename stringlengths 13 19 | text stringlengths 134 1.04M |
|---|---|
the-stack_106_28635 | from __future__ import absolute_import
import os
import xarray as xr
import pandas as pd
import numpy as np
from impax.mins import minimize_polynomial
def construct_weather(**weather):
'''
Helper function to build out weather dataarray
Parameters
----------
weather: dict
dictionary of pr... |
the-stack_106_28637 | """Show the profile in a donut."""
import plotly.graph_objects as go
from src.profile.colors import profile_colors
def make_donut(labels, values, title, colors):
"""Show the values in a donut."""
fig = go.Figure(
data=[
go.Pie(
title=dict(text=title),
lab... |
the-stack_106_28639 | #!/usr/bin/env python
import logging
import tornado.ioloop
import tornado.options
import tornado.web
import json
from tornado.options import define, options
define("port", default=8888, help="run on the given port", type=int)
class MainHandler(tornado.web.RequestHandler):
def get(self):
try:
... |
the-stack_106_28640 | # Limites
from limite.telaGenerica2 import TelaGenerica
# Controles
# Utils
from PySimpleGUI import PySimpleGUI as sg
class TelaArmaAltera(TelaGenerica):
def __init__(self, controlador):
super().__init__(controlador)
self.__dados_da_arma = {
"ID": None,
"NOME": None,
... |
the-stack_106_28641 |
# ----------------------------------------------------------------------------------------------
# Import dependencies
# ----------------------------------------------------------------------------------------------
from settings import *
from keras.utils import to_categorical
from random import shuffle
impor... |
the-stack_106_28642 | from bingads.v13.bulk.entities import QualityScoreData
from bingads.service_client import _CAMPAIGN_OBJECT_FACTORY_V13
from bingads.v13.internal.bulk.string_table import _StringTable
from bingads.v13.internal.bulk.entities.single_record_bulk_entity import _SingleRecordBulkEntity
from bingads.v13.internal.bulk.mappings... |
the-stack_106_28644 | # variavel , = variavel = troca os valores
def do_something():
primes = {2, 3, 5, 7, 11}
evens = {2, 4, 6, 8, 10}
x, = primes.intersection(evens)
print(x)
if __name__ == '__main__':
do_something()
x = 1
a = [2]
y = [9]
x, = a
|
the-stack_106_28646 | import re, fileinput, tempfile
from optparse import OptionParser
IGNOREDPREFIXES = [
'PRAGMA',
'BEGIN TRANSACTION;',
'COMMIT;',
'DELETE FROM sqlite_sequence;',
'INSERT INTO "sqlite_sequence"',
]
REPLACEMAP = {"INTEGER PRIMARY KEY": "INTEGER AUTO_INCREMENT PRIMARY KEY",
"AUTOINCREMENT": "AUTO_... |
the-stack_106_28650 | import os
import json
from os.path import join, basename
def parse(logpath):
DtoH = ""
HtoD = ""
with open(logpath) as ifile:
for line in ifile:
if "[CUDA memcpy DtoH]" in line:
DtoH = line
if "[CUDA memcpy HtoD]" in line:
HtoD = line
def ... |
the-stack_106_28652 | from robotframework_ls.impl.protocols import ICompletionContext, IKeywordFound
from typing import List, Optional, Union
def signature_help(completion_context: ICompletionContext) -> Optional[dict]:
from robocorp_ls_core.lsp import MarkupContent
from robocorp_ls_core.lsp import MarkupKind
keyword_definiti... |
the-stack_106_28654 | """This module deals with UML diagrams, especially PlantUML formats, for a legal paragraph.
"""
import os
def make_uml(res):
uml = ['@startuml', '', '!include conf.txt', '']
N3s = []
for tag in reversed(result.tag_list()):
N3 = {'subject': 'A', 'object': 'B', 'predicate': 'None'}
if tag.p... |
the-stack_106_28655 | # -*- coding: utf-8 -*-
'''
Module for managing timezone on POSIX-like systems.
'''
from __future__ import absolute_import
# Import python libs
import os
import errno
import logging
import re
import string
# Import salt libs
import salt.utils
import salt.utils.itertools
from salt.exceptions import SaltInvocationError... |
the-stack_106_28660 | __version__ = '0.7.2'
from typing import List, Optional
import torch
import torch.nn as nn
class CRF(nn.Module):
"""Conditional random field.
This module implements a conditional random field [LMP01]_. The forward computation
of this class computes the log likelihood of the given sequence of tags and
... |
the-stack_106_28663 | #!/usr/bin/python
# *****************************************************************************
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The A... |
the-stack_106_28665 | """
.. module: security_monkey.watcher
:platform: Unix
:synopsis: Slurps the current config from AWS and compares it to what has previously
been recorded in the database to find any changes.
.. version:: $$VERSION$$
.. moduleauthor:: Patrick Kelley <pkelley@netflix.com> @monkeysecurity
"""
from common.ut... |
the-stack_106_28666 | # -*- coding: utf-8 -*-
"""
=====================================================================
Spectro-temporal receptive field (STRF) estimation on continuous data
=====================================================================
This demonstrates how an encoding model can be fit with multiple continuous
input... |
the-stack_106_28668 | from pathlib import Path
from typing import Optional, Dict, List
from pandas import DataFrame, read_excel, Series, isnull
from aws_managers.utils.dtype_mappings import FS_NAME_TO_ATHENA_NAME
class FeaturesMetadata(object):
def __init__(self, metadata_fn: Path, dataset_name: str):
"""
Class to r... |
the-stack_106_28669 | # coding=utf-8
# Copyright 2021 Google LLC.
#
# 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 ... |
the-stack_106_28670 | """
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the 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.... |
the-stack_106_28673 | import os
import pandas as pd
from shutil import copyfile
def save_results(jordan, jordan_gw, jordan_ww, jordan_desal,
folder, template=None):
os.makedirs(folder, exist_ok=True)
if template:
copyfile(os.path.join(template, 'crop_production.gz'), os.path.join(folder, 'crop_produ... |
the-stack_106_28674 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import datetime
import logging
import tempfile
import time
import os
from collections import OrderedDict
import torch
from tqdm import tqdm
from ..structures.bounding_box import BoxList
from ..utils.comm import is_main_process
from ..utils.comm ... |
the-stack_106_28675 | #!/usr/bin/python3
# -*- coding: UTF-8 -*-
u""" Другая частая задача, с которой приходится сталкиваться - это получение
данных с чужих сайтом. Не у всех сайтов есть api, поэтому нужно уметь
получить html и добыть из него нужные данные:
Получение html-страницы при помощи requests
Основы библиотеки Beaut... |
the-stack_106_28676 | """Set up some common test helper things."""
import functools
import logging
from unittest.mock import patch
import pytest
import requests_mock as _requests_mock
from homeassistant import util
from homeassistant.auth.const import GROUP_ID_ADMIN, GROUP_ID_READ_ONLY
from homeassistant.auth.providers import homeassistan... |
the-stack_106_28680 | import os
os.environ['KMP_DUPLICATE_LIB_OK'] = 'True'
import re
from paddleocr import PaddleOCR, draw_ocr
import cv2 as cv
import numpy as np
import time
from collections import defaultdict
import json
from fuzzywuzzy import fuzz
from fuzzywuzzy import process
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
ke... |
the-stack_106_28682 | # coding: utf-8
#
# Copyright 2020 The Oppia 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 requi... |
the-stack_106_28683 | from pretalx.event.models import Organiser, Team
def create_organiser_with_user(*, name, slug, user):
organiser = Organiser.objects.create(name=name, slug=slug)
team = Team.objects.create(
organiser=organiser, name='Team {}'.format(name),
can_create_events=True, can_change_teams=True,
... |
the-stack_106_28684 | import torch
class SquashedMultivariateNormalDiag:
def __init__(self, loc, scale):
self._distribution = torch.distributions.normal.Normal(loc, scale)
def rsample_with_log_prob(self, shape=()):
samples = self._distribution.rsample(shape)
squashed_samples = torch.tanh(samples)
l... |
the-stack_106_28686 | import urllib.request
import urllib.error
import urllib.parse
import json
import sys
from arbitrage.public_markets.market import Market
class Bitstamp(Market):
def __init__(self, currency, code):
super().__init__(currency)
self.code = code
self.update_rate = 20
def update_depth(self):... |
the-stack_106_28688 | import pygame as pg
class SpriteSheetExtractor:
def __init__(self, image, colorkey=None):
self.colorkey = colorkey
self.sheet = image
def image_at(self, rectangle, colorkey=None):
"""Load a specific image from a specific rect."""
rect = pg.Rect(rectangle)
if colorkey:
... |
the-stack_106_28690 | # Copyright (c) 2018 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... |
the-stack_106_28691 | import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from transitleastsquares import transit_mask
import numpy as np
from lightkurve import LightCurve
import transit_tools.constants as c
##function to save all diagnostic plots as combined png
##function to generate vetting sheet
def tls_vetsheet(lc... |
the-stack_106_28692 | #
# Copyright 2016-2019 Crown Copyright
#
# 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 i... |
the-stack_106_28695 | #
# Code under the MIT license by Alexander Pruss
#
from mcturtle import *
t = Turtle()
t.penblock(GOLD_BLOCK)
#t.turtle(GIANT)
t.pendelay(0.01)
for i in range(7):
t.go(50)
t.left(180.-180./7)
|
the-stack_106_28697 | from collections import defaultdict
class Vocabulary:
def __init__(self):
pass
def __len__(self):
return self.__size
def stoi(self, s):
return self.__stoi[s]
def itos(self, i):
return self.__itos[i]
@staticmethod
def new(list_generator, size):
self = Vocabulary()
self.__size = ... |
the-stack_106_28699 | from contextlib import contextmanager
import dbt.exceptions
from dbt.adapters.base import Credentials
from dbt.adapters.sql import SQLConnectionManager
from dbt.logger import GLOBAL_LOGGER as logger
from dataclasses import dataclass
from typing import Optional
from dbt.helper_types import Port
from datetime import d... |
the-stack_106_28700 | import numpy as np
from mmocr.datasets.pipelines import LoadTextAnnotations
def _create_dummy_ann():
results = {}
results['img_info'] = {}
results['img_info']['height'] = 1000
results['img_info']['width'] = 1000
results['ann_info'] = {}
results['ann_info']['masks'] = []
results['mask_fiel... |
the-stack_106_28703 | import tensorflow as tf
import numpy as np
from crf_rnn_layer import crf_rnn_layer
def get_spatial_rank(x):
"""
:param x: an input tensor with shape [batch_size, ..., num_channels]
:return: the spatial rank of the tensor i.e. the number of spatial dimensions between batch_size and num_channels
"""
... |
the-stack_106_28706 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 8 14:10:11 2018
@author: spalazzo
"""
# import modules
# skeleton.py file to use as a template when porting CodeSkulptor
# projects over to PyGame. It should provide the basic structure
# to allow moving your code into PyGame. It will not make y... |
the-stack_106_28711 | # > \brief \b ZTRMM
#
# =========== DOCUMENTATION ===========
#
# Online html documentation available at
# http://www.netlib.org/lapack/explore-html/
#
# Definition:
# ===========
#
# def ZTRMM(SIDE,UPLO,TRANSA,DIAG,M,N,ALPHA,A,LDA,B,LDB)
#
# .. Scalar Arguments ..
# COMPLEX*16 ALPHA
# ... |
the-stack_106_28714 | # 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 required by applicable law... |
the-stack_106_28715 | # Copyright 2018 DeepMind Technologies Limited. 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 ... |
the-stack_106_28716 | """awstest URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based... |
the-stack_106_28720 | #
# Copyright The NOMAD Authors.
#
# This file is part of NOMAD. See https://nomad-lab.eu for further info.
#
# 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/licen... |
the-stack_106_28721 | import pytest
from unittest.mock import patch
from cartoframes.auth import Credentials
from cartoframes.data.observatory.catalog.dataset import Dataset
from cartoframes.data.observatory.catalog.geography import Geography
from cartoframes.data.observatory.catalog.country import Country
from cartoframes.data.observator... |
the-stack_106_28723 | import os
import traceback
import hashlib
import glob
import operator
from functools import reduce
import cv2
import numpy as np
import requests
def imread(filename):
return cv2.imdecode(np.fromfile(file=filename, dtype=np.uint8), cv2.IMREAD_COLOR)
def walk_dir_recursively(root_dir,ext_list = None):
if e... |
the-stack_106_28724 | import os
import random
import errno
import subprocess
from shutil import copytree
source_dir = 'omniglot'
target_dir = 'data/omniglot'
if not os.path.exists(target_dir):
os.makedirs(target_dir)
# change folder structure :
alphabet_folders = [family \
for family in os.listdir(source_dir) \
... |
the-stack_106_28726 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""Tests for the Find flow."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import re
from absl import app
from grr_response_client.client_actions import searching
from grr_response_core.lib import utils... |
the-stack_106_28729 | import argparse
import os
import random
import re
import string
import threading
import time
from typing import List
import keras
import nltk
import numpy as np
import spacy
import tensorflow as tf
import unidecode
from gensim.models.wrappers import FastText as FastTextWrapper
from keras import backend as K
from tenso... |
the-stack_106_28732 | # Copyright 1999-2020 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-2.0
#
# Unless required by applicable law or a... |
the-stack_106_28734 | from __future__ import absolute_import
from typing import Any
from django.views.debug import SafeExceptionReporterFilter
from django.http import HttpRequest, build_request_repr
class ZulipExceptionReporterFilter(SafeExceptionReporterFilter):
def get_post_parameters(self, request):
# type: (HttpRequest) -... |
the-stack_106_28737 | import tensorflow as tf
from gcn_layer import *
class GCN_graph_cls(object):
def __init__(self, feature_dim_size, hidden_size, num_GNN_layers, num_sampled, vocab_size):
# Placeholders for input, output
self.Adj_block = tf.compat.v1.sparse_placeholder(tf.float32, [None, None], name="Adj_block")
... |
the-stack_106_28738 | import os
import sys
import pip.backwardcompat
from pip.backwardcompat import urllib, string_types, b, u, emailmessage
urlopen_original = pip.backwardcompat.urllib2.urlopen
class CachedResponse(object):
"""
CachedResponse always cache url access and returns the cached response.
It returns an object compa... |
the-stack_106_28739 | """
Functionality for reading NISAR data into a SICD model.
"""
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
import logging
import os
from collections import OrderedDict
from typing import Tuple, Dict
import numpy
from numpy.polynomial import polynomial
from scipy.constants import speed_of_l... |
the-stack_106_28740 | import os
import threading
import copy
from PackageBuildDataGenerator import PackageBuildDataGenerator
from Logger import Logger
from constants import constants
from CommandUtils import CommandUtils
from PackageUtils import PackageUtils
from ToolChainUtils import ToolChainUtils
from Scheduler import Scheduler
from Thre... |
the-stack_106_28741 | from xml.dom.minidom import parse, parseString
dom = parse("eat100.xml")
stimuli = dom.getElementsByTagName('stimulus')
words = dict()
for i in range(100):
stim_word = str(stimuli[i].attributes['word'].value)
responses = stimuli[i].getElementsByTagName('response')
response_words = []
for response in responses:
... |
the-stack_106_28742 | """Metadata generation logic for source distributions.
"""
import atexit
import logging
import os
from pip._internal.exceptions import InstallationError
from pip._internal.utils.misc import ensure_dir
from pip._internal.utils.setuptools_build import make_setuptools_egg_info_args
from pip._internal.utils.subprocess im... |
the-stack_106_28743 | import os
import time
import numpy as np
import pandas as pd
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.ui import Select
import smtplib, ssl
from email.mime.text import MIMEText
from ... |
the-stack_106_28744 | import django
from django.db.models import Q, FieldDoesNotExist
if django.VERSION >= (1, 8):
from django.db.models.expressions import Expression
else:
from django.db.models.expressions import ExpressionNode as Expression
from django.db.models.sql.where import WhereNode
from collections import namedtuple
#=====... |
the-stack_106_28745 | #!/usr/bin/python
# gui.py
import sys
from PyQt4 import QtGui,QtCore
class SigSlot(QtGui.QWidget):
def __init__(self,parent=None):
QtGui.QWidget.__init__(self,parent)
self.setWindowFlags(QtCore.Qt.FramelessWindowHint | QtCore.Qt.WindowStaysOnTopHint)
self.setWindowTitle("signal and slot")
self.setMouseTracki... |
the-stack_106_28747 | # Copyright (c) 2017-2021 Neogeo-Technologies.
# 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... |
the-stack_106_28748 | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
"""
Base ... |
the-stack_106_28749 | import pytest
from dvc.repo.plots.diff import _revisions
@pytest.mark.parametrize(
"arg_revisions,is_dirty,expected_revisions",
[
([], False, ["workspace"]),
([], True, ["HEAD", "workspace"]),
(["v1", "v2", "workspace"], False, ["v1", "v2", "workspace"]),
(["v1", "v2", "worksp... |
the-stack_106_28750 | """
Predict age from connectivity.
The aim of the script is age prediction of CamCan features extracted with
diferent connectivity matrices and different atlases.
"""
import os
import pandas as pd
from collections import OrderedDict
import numpy as np
from camcan.datasets import load_camcan_connectivity_rest
from sk... |
the-stack_106_28751 | import argparse
import logging
import os
from dvc.command import completion
from dvc.command.base import CmdBase, append_doc_link, fix_subparsers
from dvc.exceptions import DvcException
from dvc.schema import PLOT_PROPS
from dvc.utils import format_link
logger = logging.getLogger(__name__)
PAGE_HTML = """<!DOCTYPE h... |
the-stack_106_28752 | import fnmatch
from collections import OrderedDict
from conans.paths import SimplePaths
from conans.client.output import Color
from conans.model.ref import ConanFileReference
from conans.model.ref import PackageReference
from conans.client.installer import build_id
class Printer(object):
""" Print some specific... |
the-stack_106_28753 | #!/usr/bin/env python3
# Copyright (c) 2019 The PIVX developers
# Copyright (c) 2020 The YEP developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Tests v2, v3 and v4 Zerocoin Spends
'''
from time import sleep
from test... |
the-stack_106_28754 | import discord, requests, json
from discord.ext import commands
import difflib
import config
class Fortnite:
def __init__(self, bot, config):
self.bot = bot
self.data = dict()
self.keys = []
self.config = config
with open(config["weapon_data_loc"], 'r') as f:
sel... |
the-stack_106_28758 | # -*- coding:utf-8 -*-
import pika
import sys
username = "faith"
pwd = "qq2921481"
user_pwd = pika.PlainCredentials(username, pwd)
connection = pika.BlockingConnection(
pika.ConnectionParameters(host='172.16.54.130',
credentials=user_pwd)
)
channel = connection.channel()
# 这里还是不声明 qu... |
the-stack_106_28759 | from mininet.topo import Topo
from mininet.net import Mininet
from mininet.node import CPULimitedHost
from mininet.link import TCLink
from mininet.log import setLogLevel
import time
import sys
import os
from gdb_log_utils import *
class GDPSimulationTopo(Topo):
def build(self, n, loss_rate=None):
switch = ... |
the-stack_106_28760 | #!/usr/bin/env python3
#
# Copyright (c) 2019, The OpenThread Authors.
# 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 copyright
# ... |
the-stack_106_28761 | # Copyright 2014 Ahmed H. Ismail
# 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... |
the-stack_106_28763 | #< @file DevAdf5901.m
#< @author Haderer Andreas (HaAn)
#< @date 2013-06-13
#< @brief Class for configuration of Adf5901 transmitter
#< @version 1.0.1
import src.cmd_... |
the-stack_106_28764 | '''Comparing a simple CNN with a convolutional MoE model on the CIFAR10 dataset. Based on the cifar10_cnn.py file in the
keras/examples folder.
'''
import numpy as np
import tensorflow as tf
import tensorflow.keras as keras
from tensorflow.keras.datasets import cifar10
from tensorflow.keras.preprocessing.image import I... |
the-stack_106_28766 | # coding: utf-8
from __future__ import unicode_literals
import os
from os import path
import random
import datetime
from pathlib import Path
from bin.wiki_entity_linking import wikipedia_processor as wp
from bin.wiki_entity_linking import training_set_creator, kb_creator
from bin.wiki_entity_linking.kb_creator import... |
the-stack_106_28768 | #!/usr/bin/python3
"""
AUTHOR: Matthew May - mcmay.web@gmail.com
"""
# Imports
import json
import redis
import io
from sys import exit
from dbconst import META, PORTMAP, REDIS_IP, SYSLOG_PATH, DB_PATH, HQ_IP
from time import gmtime, localtime, sleep, strftime
import maxminddb
import itertools
from collections import ... |
the-stack_106_28769 | # See LICENSE for licensing information.
#
# Copyright (c) 2016-2019 Regents of the University of California and The Board
# of Regents for the Oklahoma Agricultural and Mechanical College
# (acting for and on behalf of Oklahoma State University)
# All rights reserved.
#
import debug
import design
import utils
from te... |
the-stack_106_28770 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and contributors
# For license information, please see license.txt
"""
# Integrating RazorPay
### Validate Currency
Example:
from frappe.integration_broker.doctype.integration_service.integration_service import get_integration_controller
controlle... |
the-stack_106_28771 | from __future__ import print_function
from collections import defaultdict
from PIL import Image
from torch.autograd import Variable
from torchvision import datasets, transforms
import argparse
import codecs
import errno
import numpy as np
import os
import os
import os.path
import pickle
import random
import scipy as sp... |
the-stack_106_28773 | from tkinter.messagebox import NO
from typing import Optional, List
from fastapi import FastAPI, Request
from pydantic import BaseModel, HttpUrl
from async_lru import alru_cache
import logging
import requests
import json
import sys
import base64
import zlib
from fastapi.templating import Jinja2Templates
from reque... |
the-stack_106_28774 | # Copyright (C) 2015, Anuj Sharma (anuj.sharma80@gmail.com)
#
# This file is part of the Biopython distribution and governed by your
# choice of the "Biopython License Agreement" or the "BSD 3-Clause License".
# Please see the LICENSE file that should have been included as part of this
# package.
"""Structural alignme... |
the-stack_106_28775 | """ Implementation of all available options """
from __future__ import print_function
import configargparse
from onmt.models.sru import CheckSRU
def config_opts(parser):
parser.add('-config', '--config', required=False,
is_config_file_arg=True, help='config file path')
parser.add('-save_config... |
the-stack_106_28776 | # Copyright 2010 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
"""A small wrapper script around the core JS compiler. This calls tha... |
the-stack_106_28777 | from .dependencies.interfaceFAAL import interfaceFAAL
from gensim.test.utils import datapath
from gensim.models import KeyedVectors
from gensim.similarities import WmdSimilarity
import json
import os
from subprocess import *
import copy
from py4j.java_gateway import JavaGateway, GatewayParameters
from .progbar import ... |
the-stack_106_28778 | from collections import deque
from itertools import permutations
def calc(lhs: str, rhs: str) -> str:
current_op = lhs[-1]
tail_op = rhs[-1]
lhs = lhs[:-1]
rhs = rhs[:-1]
ret = 0
if current_op == '*':
ret = int(lhs) * int(rhs)
elif current_op == '-':
ret = int(lhs) - int(... |
the-stack_106_28779 | #
# Copyright 2019 The FATE Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
the-stack_106_28780 | import torch
from e3nn.math import normalize2mom
from e3nn.util.jit import compile_mode
from e3nn.o3 import SO3Grid
@compile_mode('script')
class SO3Activation(torch.nn.Module):
r'''Apply non linearity on the signal on SO(3)
Parameters
----------
lmax_in : int
input lmax
lmax_out : int
... |
the-stack_106_28782 | # Loading dependencies
import airflow
from airflow import DAG
from airflow.operators.dagrun_operator import TriggerDagRunOperator
from datetime import date, timedelta
from datetime import datetime as dt
# Import script files which are going be executed as Tasks by the DAG
import folder_watch
# DAG unique identifier
D... |
the-stack_106_28783 | #!/usr/bin/env python
#from meter.features.context import packet_direction
#from features.context import packet_direction
from features.context.packet_direction import PacketDirection
def get_packet_flow_key(packet, direction) -> tuple:
"""Creates a key signature for a packet.
Summary:
Creates a ke... |
the-stack_106_28784 | # coding: utf-8
"""
NiFi Rest Api
The Rest Api provides programmatic access to command and control a NiFi instance in real time. Start and stop processors, monitor queues, query provenance data, and more. Each endpoint below includes a description, ... |
the-stack_106_28787 | #!/usr/bin/env python3
import itertools
import logging
from reagent.core import aggregators as agg
from reagent.core.observers import IntervalAggregatingObserver, ValueListObserver
from reagent.reporting.reporter_base import ReporterBase
from reagent.workflow.training_reports import SlateQTrainingReport
logger = lo... |
the-stack_106_28789 | #!/usr/bin/env python
from __future__ import print_function
import os
import sys
import logging
import argparse
import platform
import subprocess
os.environ["PYTHONUNBUFFERED"] = "y"
PY2 = sys.version_info[0] == 2
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.app... |
the-stack_106_28790 | import os
import pygame
import pygame.locals
from button import *
import globs
width = 864
height = 480
images = {
'player': pygame.image.load(os.path.join("data","sprites","player.png")),
'sky': pygame.image.load(os.path.join("data","tiles","sky.png")),
'border': pygame.image.load(os.path.join("data","tiles","... |
the-stack_106_28791 | import pandas as pd;
import numpy as np;
datas = np.random.randint(10,100,(6,4));
print(datas);
df = pd.DataFrame(datas);
df.columns = ['score1','score2','score3','score4'];
df.columns = ['s1','s2','s3','s4'];
#df.index = pd.date_range('20210114', periods=6);
print(df); |
the-stack_106_28792 | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
the-stack_106_28793 | import re # used for split
modname = 'pyparams'
def super_split(string, delim):
ret = [i.strip() for i in string.split(delim)]
while ret.count(''):
ret.remove('')
return ret
def get_params(arglist):
ret = dict()
ret[''] = []
is_key = False
look_for_val = False
key = ''
... |
the-stack_106_28795 | """Represent fhir entity."""
from os import stat
from anvil.transformers.fhir import make_workspace_id, make_identifier
import logging
INSTITUTES = []
class Organization:
"""Create fhir entity."""
class_name = "organization"
resource_type = "Organization"
@staticmethod
def slug(resource):
... |
the-stack_106_28797 | # Copyright (c) 2015 EMC Corporation.
# 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 requ... |
the-stack_106_28799 | #!/usr/bin/env python
# PYTHON_ARGCOMPLETE_OK
# Copyright: (c) 2020, Jordan Borean (@jborean93) <jborean93@gmail.com>
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import argparse
import os
import os.path
imp... |
the-stack_106_28800 | from django.contrib.auth import get_user_model
from django.contrib.postgres.search import SearchVector
from django.shortcuts import get_object_or_404
from drf_yasg import openapi
from drf_yasg.utils import swagger_auto_schema
from rest_framework import status
from rest_framework.generics import ListCreateAPIView, Retri... |
the-stack_106_28802 | from .errors import *
class Store:
"""
Store record
Each postcode record contains basic information like name
and coordinates in WGS84 geographic system
"""
def __init__(self, postcode: str, name: str, lon: float = None, lat: float = None):
"""
Create new store record.
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.