filename stringlengths 13 19 | text stringlengths 134 1.04M |
|---|---|
the-stack_0_1702 | import aiohttp
import aiosqlite
import asyncio
import discord
from discord.ext import commands
from backend.config import DATABASE_LOCATION
if __name__ == "__main__":
with open("token.txt") as file:
TOKEN = file.read().strip()
bot = commands.Bot(".", case_insensitive=True)
@bot.event
async def on_ready... |
the-stack_0_1703 | # Copyright 2014 - 2016 OpenMarket 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... |
the-stack_0_1704 | import unittest
import os
import json
import numpy as np
import rastervision as rv
from rastervision.core import Box
from rastervision.data.raster_source import RasterSourceConfig
from rastervision.data.crs_transformer import IdentityCRSTransformer
from rastervision.utils.files import str_to_file
from rastervision.rv... |
the-stack_0_1705 | """
Copyright 2021 Merck & Co., Inc. Kenilworth, NJ, USA.
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the ... |
the-stack_0_1706 | from ..data_class.data_manager import DataManager
from ..directories import data_loaded
import numpy as np
import scipy.sparse as sp
class TpfaScheme(DataManager):
def __init__(self, data_impress, elements_lv0, data_name: str='TpfaScheme.npz', load=False):
super().__init__(data_name, load=load)
se... |
the-stack_0_1707 | """
Filter data from DBPedia for inclusion in ConceptNet.
The data we use here is far from the entirety of DBPedia, which lists millions
of things that are not general knowledge, such as villages with a population of
20, individual roads, sports team rosters from a particular season, and so on.
We try to filter this i... |
the-stack_0_1708 | import unittest
import uuid
from aioresponses import aioresponses
from canvasaio import Canvas
from canvasaio.assignment import (
Assignment,
AssignmentGroup,
AssignmentOverride,
AssignmentExtension,
)
from canvasaio.exceptions import CanvasException, RequiredFieldMissing
from canvasaio.peer_review imp... |
the-stack_0_1709 | # Copyright 2011 Justin Santa Barbara
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
the-stack_0_1712 | # Script to sort the large NZ Charities files into smaller files by year
# Alasdair Rutherford, Diarmuid McDonnell
# Created: 29 March 2018
# Last edited: Github history - https://github.com/DiarmuidM/mission_accomp/tree/master/syntax/data_collection/nz
# Edited by Tom Wallace
# Because of download limmitations of the ... |
the-stack_0_1713 | import unittest
import os
from conans.paths import EXPORT_SOURCES_DIR_OLD
from conans.util.files import tar_extract
from conans.test.utils.tools import TestServer, TestClient
from conans.model.ref import ConanFileReference
from conans.test.utils.test_files import temp_folder
class DoNotKeepOldExportSourcesLayoutTest... |
the-stack_0_1714 | from copy import copy, deepcopy
from typing import (
Any,
Collection,
Dict,
List,
NamedTuple,
Optional,
Set,
Union,
cast,
)
from ..error import GraphQLError
from ..language import ast
from ..pyutils import inspect, is_collection, is_description, FrozenList
from .definition import (
... |
the-stack_0_1717 | from django.db import migrations, models
def forwards_func(apps, schema_editor):
Beer = apps.get_model("beerfest", "Beer")
for beer in Beer.objects.all():
old_abv = beer.abv
if old_abv is None:
continue # skip null values
new_abv = old_abv / 10
if new_abv >= 100:
... |
the-stack_0_1719 | import collections
import sys
from .compat import recursive_repr, abc
from _pmem import ffi # XXX refactor to make this import unneeded?
# XXX: refactor to allocate this instead of hardcoding it.
LIST_POBJPTR_ARRAY_TYPE_NUM = 30
class PersistentList(abc.MutableSequence):
"""Persistent version of the 'list' ... |
the-stack_0_1720 | # Copyright 2022 Kaiyu Zheng
#
# 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_1722 | # -*- coding: utf-8 -*
PROVINCE_CHOICES = (
('AG', 'Agrigento'),
('AL', 'Alessandria'),
('AN', 'Ancona'),
('AO', 'Aosta'),
('AR', 'Arezzo'),
('AP', 'Ascoli Piceno'),
('AT', 'Asti'),
('AV', 'Avellino'),
('BA', 'Bari'),
('BT', 'Barletta-Andria-Trani'), # active startin... |
the-stack_0_1723 | """ Integral Transforms """
from __future__ import print_function, division
from sympy.core import S
from sympy.core.compatibility import reduce
from sympy.core.function import Function
from sympy.core.numbers import oo
from sympy.core.symbol import Dummy
from sympy.integrals import integrate, Integral
from sympy.int... |
the-stack_0_1724 | #!/usr/bin/env python
from collections import OrderedDict
import json
import numpy
from kernel_tuner import tune_kernel
from tune_utils import get_kernel_path
def tune_expdist():
device = 2
tune_params = OrderedDict()
tune_params["block_size_x"] = [32] #[2**i for i in range(5,10)]
tune_params["bl... |
the-stack_0_1725 | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Libxxf86vm(AutotoolsPackage):
"""libXxf86vm - Extension library for the XFree86-VidMode X ... |
the-stack_0_1726 | from django.contrib import admin
from django.forms.models import ModelForm
import django
from moderation.models import ModeratedObject, MODERATION_DRAFT_STATE,\
MODERATION_STATUS_PENDING, MODERATION_STATUS_REJECTED,\
MODERATION_STATUS_APPROVED
from django.utils.translation import ugettext as _
from moderation... |
the-stack_0_1727 | import sys
import collections
import operator
import itertools
from bisect import bisect_left
import os
import glob
import concurrent.futures
import math
import time
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
import DIcommonfn
import DI... |
the-stack_0_1728 | #!/usr/bin/env python3
# Copyright (c) 2021 The Elixir Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""RPCs that handle raw transaction packages."""
from decimal import Decimal
from io import BytesIO
import rand... |
the-stack_0_1729 | #
# This file is part of the MicroPython project, http://micropython.org/
#
# The MIT License (MIT)
#
# Copyright (c) 2017 SummerGift <zhangyuan@rt-thread.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal... |
the-stack_0_1731 | from unittest.mock import patch
from django.core.management import call_command
from django.db.utils import OperationalError
from django.test import TestCase
class CommandsTestCase(TestCase):
def test_wait_for_db_ready(self):
"""Test waiting for db when db is available"""
with patch('django.db.... |
the-stack_0_1733 | # Copyright 2015 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 required by applica... |
the-stack_0_1734 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
the-stack_0_1735 | #!/usr/bin/env python
# Zed Attack Proxy (ZAP) and its related class files.
#
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
#
# Copyright 2017 ZAP Development Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License... |
the-stack_0_1736 |
# CONFIG -----------------------------------------------------------------------------------------------------------#
# Here are the input and output data paths (Note: you can override wav_path in preprocess.py)
wav_path = '../database/blizzard2013/segmented/small_wavn_lead_trail_silence_removed_16000'
data_path = 'd... |
the-stack_0_1738 | """
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merg... |
the-stack_0_1739 | import logging
import numpy as np
import torch
from torch.utils.data import Dataset, DataLoader
LOGLEVEL = (('debug', logging.DEBUG),
('info', logging.INFO),
('warn', logging.WARN),
('error', logging.ERROR))
LOG = logging.getLogger(__name__)
_train_file = 'dataset/train.npz'
_tes... |
the-stack_0_1741 | import fxcmpy
import pandas as pd
import numpy as np
import datetime as dt
from pyti.simple_moving_average import simple_moving_average as sma
#from pyti.exponential_moving_average import exponential_moving_average as sma
#con = fxcmpy.fxcmpy(config_file='fxcm.cfg')
# Allows for printing the whole data frame
pd.set_op... |
the-stack_0_1742 | #!/usr/bin/python
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Simple client for the Gerrit REST API.
Example usage:
./gerrit_client.py [command] [args]""
"""
from __future__ import print_functio... |
the-stack_0_1743 | #!/usr/bin/env python3
import os
from mowgli.infrastructure import endpoints
def run():
port = os.environ.get('PORT', 8080)
endpoints.APP.run(port=port, debug=True, host='0.0.0.0')
if __name__ == '__main__':
run()
|
the-stack_0_1744 | """
Copyright 2021 the CVXPY developers
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, softw... |
the-stack_0_1746 | # Copyright 2018 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 copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
the-stack_0_1747 | """Union-find data structure."""
# based on https://www.ics.uci.edu/~eppstein/PADS/UnionFind.py
class UnionFind:
"""Union-find data structure."""
def __init__(self, n):
"""Create a new empty union-find structure."""
# we have singletons
self.array = list(range(n))
self.size = ... |
the-stack_0_1750 | from flask import Flask, render_template, session, redirect, url_for, flash
from flask_bootstrap import Bootstrap
from flask_moment import Moment
from flask_wtf import Form
from wtforms import StringField, SubmitField
from wtforms.validators import Required, ValidationError
from datetime import datetime
app = Flask(_... |
the-stack_0_1751 | #!/usr/bin/env python
"""
Copyright (c) 2020 NIDDS developers (https://github.com/prasanthc41m/nidds/)
See the file 'LICENSE' for copying permission
"""
import re
from core.common import retrieve_content
__url__ = "https://cybercrime-tracker.net/all.php"
__check__ = "cp.php?m=login"
__info__ = "malware"
__reference... |
the-stack_0_1752 | import numpy as np
import torch
from torch.utils.data import Dataset
import h5py
def rotate_point_cloud(batch_data):
""" Randomly rotate the point clouds to augument the dataset
rotation is per shape based along up direction
Input:
BxNx3 array, original batch of point clouds
Re... |
the-stack_0_1753 | #!/usr/bin/env python
#
# Use the raw transactions API to spend bitcoins 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 bitcoind or Bit... |
the-stack_0_1756 | # (c) 2016 James Turner <turnerjsm@gmail.com>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
lookup: aws_service_ip_ranges
author:
- Jam... |
the-stack_0_1758 | #!/usr/bin/env python
import sys, traceback
import cv2
import os
import re
import numpy as np
import argparse
import string
import plantcv as pcv
def options():
parser = argparse.ArgumentParser(description="Imaging processing with opencv")
parser.add_argument("-i", "--image", help="Input image file.", requir... |
the-stack_0_1761 | # coding=utf-8
# Copyright 2018 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... |
the-stack_0_1763 | """
spyre.Tools.wfm_writer.py
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tool to write waveform in a .WFM format
Authors: Alexandre Bourassa, Kevin Miao
Date: 20/04/2016
"""
import struct
import numpy as _np
from datetime import datetime as _dt
import time as _t
import sys
def array_to_ieee_block(analog, mark... |
the-stack_0_1765 | import random
top20 = open("../Dataset/Top20.tsv").read().split("\n")
docs = open("../Dataset/Documents.tsv").read().split("\n")
queries = open("../Dataset/queries.tsv").read().split("\n")
OUT = open("../Dataset/finetune_en.tsv",'w')
doc_list = {}
for doc in docs:
if doc != "":
doc_id = doc.split("\t")[0]... |
the-stack_0_1767 | # Copyright 2016 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 copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
the-stack_0_1768 | # -*- coding: utf-8 -*-
# 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, softw... |
the-stack_0_1770 | # Copyright 2021 NVIDIA 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 wr... |
the-stack_0_1772 | # encoding: utf-8
import datetime
__all__ = [
'info',
]
def info():
return {
'birthday': datetime.date(1992, 11, 15),
'class': 1,
'family_name_en': u'minegishi',
'family_name_kana': u'みねぎし',
'first_name_en': u'minami',
'first_name_kan... |
the-stack_0_1775 | import os
from sandbox.rocky.tf.baselines.nn_baseline import NNBaseline
from sandbox.rocky.tf.core.network import ConvNetwork
from sandbox.rocky.tf.policies.gaussian_conv_feature_policy import GaussianConvFeaturePolicy
from sandbox.rocky.tf.policies.gaussian_conv_policy import GaussianConvPolicy
from rllab.baselines.ze... |
the-stack_0_1776 | from flask import Blueprint, render_template, request
from geopy.geocoders import Nominatim
from geopy import distance
import pandas as pd
from shapely.geometry import Polygon
from shapely.geometry import Point
import logging
# Constants
MKAD_LOCATION = (55.8277252, 37.6387268)
# Nominatim geolocation service
geoloca... |
the-stack_0_1778 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# system, numpy
import os
import time
import numpy as np
# pytorch, torch vision
import torch
import torch.optim as optim
import torch.nn as nn
import torch.backends.cudnn as cudnn
from torch.utils.data import DataLoader
import torchvision.transforms as transforms
from torch... |
the-stack_0_1779 | # -*- coding: utf-8 -*-
'''
unit.loader
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Test Salt's loader
'''
# Import Python libs
from __future__ import absolute_import
import inspect
import tempfile
import shutil
import os
import collections
# Import Salt Testing libs
from salttesting import TestCase
from salttesting.... |
the-stack_0_1781 | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... |
the-stack_0_1782 | # -*- coding: utf-8 -*-
"""
Created on Thu Jun 2 09:35:39 2016
@author: bing
"""
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 25 09:42:22 2016
@author: bing
"""
import numpy as np
import scipy
import numba
import sys
bohr_angstrom = 0.52917721092
hartree_wavenumber = 219474.63
#hartree_wavenumber = scip... |
the-stack_0_1785 | """
Modified from https://github.com/allenai/allennlp-models/blob/main/allennlp_models/tagging/models/crf_tagger.py
Removed some features that we don't need.
"""
from typing import Dict, Optional, List, Any, cast
from overrides import overrides
import torch
from allennlp.common.checks import ConfigurationError
from ... |
the-stack_0_1786 | from __future__ import print_function
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from pdb import set_trace as stop
def batch_product(iput, mat2):
result = None
for i in range(iput.size()[0]):
op = torch.mm(iput[i], mat2)
op = op.unsqueeze(0)
if(result is None):
... |
the-stack_0_1792 |
import importlib
import datetime as dt
import xml.etree.ElementTree as ET
from .session import session
# Utility Objects and Functions
NS = {
'ft': 'http://www.epo.org/fulltext',
'ops': 'http://ops.epo.org',
'ex': 'http://www.epo.org/exchange'
}
def etree_els_to_text(els) -> str:
segments = [' '.joi... |
the-stack_0_1794 | """Support for Anthem Network Receivers and Processors."""
import logging
import voluptuous as vol
from homeassistant.components.media_player import (
MediaPlayerDevice, PLATFORM_SCHEMA)
from homeassistant.components.media_player.const import (
SUPPORT_SELECT_SOURCE, SUPPORT_TURN_OFF, SUPPORT_TURN_ON,
SUP... |
the-stack_0_1795 | import os
import string
import random
import tabulate
import numpy as np
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Embedding, GRU
from tensorflow.keras.losses import sparse_categorical_crossentropy
from tensorflow.keras.models import load_model
v... |
the-stack_0_1796 | # -*- coding: utf-8 -*-
"""
mslib.msui.mss_qt
~~~~~~~~~~~~~~~~~
This module helps with qt
This file is part of mss.
:copyright: Copyright 2017-2018 Joern Ungermann, Reimar Bauer
:copyright: Copyright 2017-2020 by the mss team, see AUTHORS.
:license: APACHE-2.0, see LICENSE for details.
... |
the-stack_0_1798 | #!/usr/bin/env python
import sys
import Bio
from Bio import SeqIO, SeqFeature
from Bio.SeqRecord import SeqRecord
import os
# Copyright(C) 2009 Iddo Friedberg & Ian MC Fleming
# Released under Biopython license. http://www.biopython.org/DIST/LICENSE
# Do not remove this comment
def get_interregions(genbank_path,interg... |
the-stack_0_1799 | #!/usr/bin/env python3
"""Discord bot for organizing PUGs (pick-up games).
Built for Neotokyo, but should work for any two-team game with even number
of players total.
Usage:
Commands:
Commands are prefixed with a character defined by the config value
"NTBOT_CMD_PREFIX", by default "!", so... |
the-stack_0_1800 | #!/usr/bin/env python3
import sys
# Read input and output files
infile = sys.argv[1]
outfile = sys.argv[2]
# Create list to store features in
features = []
# Iterate over lines in input Genbank file
for line in open(infile).readlines():
# Store current sequence name
if line.startswith("LOCUS"):
sequ... |
the-stack_0_1801 | import math
import torch
from flambe.metric import MultiLabelCrossEntropy, MultiLabelNLLLoss
def test_cross_entropy_one_hot():
"""Test cross entropy loss when one hot"""
y_pred = torch.tensor([[0.2, 0.8], [0.9, 0.1]])
y_true = torch.tensor([[1, 0], [1, 0]])
loss = MultiLabelCrossEntropy()
assert... |
the-stack_0_1803 | from django.conf import settings
from django.urls import include, path
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic import TemplateView
from django.views import defaults as default_views
urlpatterns = [
path("", TemplateView.as_view(template_name="pages/home... |
the-stack_0_1805 | #!/home/lichess4545/web/www.lichess4545.com/env/bin/python
"""
WSGI config for heltour project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
local_dir = os.path.join(os.... |
the-stack_0_1807 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import boto3
import sure # noqa
from moto import mock_emr
@mock_emr
def test_run_job_flow():
client = boto3.client('emr', region_name='us-east-1')
cluster_id = client.run_job_flow(
Name='cluster',
Instances={
'Maste... |
the-stack_0_1808 | from kivymd.app import MDApp
from kivymd.uix.button import MDFloatingActionButton, MDRectangleFlatButton,MDFlatButton
from kivymd.uix.screen import Screen
from tkinter.filedialog import askdirectory
from tkinter import Tk
from kivymd.uix.dialog import MDDialog
import time
import os
import shutil
from pydrive.auth impor... |
the-stack_0_1810 | # coding=utf-8
# Copyright 2020 The TensorFlow GAN Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... |
the-stack_0_1812 | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# If extensions (or module... |
the-stack_0_1814 | numeros = ('zero', 'um', 'dois', 'tres', 'quatro', 'cinco',
'seis', 'sete', 'oito', 'nove', 'dez', 'onze',
'doze', 'treze', 'catorze', 'quize', 'dezesseis',
'dezesete', 'dezoito','dezenove', 'vinte')
while True:
num = int(input('Digite um número entre 0 e 20: '))
if num <= 20:
... |
the-stack_0_1816 | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
from typing import Any, Tuple, Dict, List, Callable
import sqlalchemy
import pymysql
import traceback
import hashlib
import logging
from sqlalchemy.sql import text
try:
# if integration is using an older image (4.5 ... |
the-stack_0_1818 | # -----------------------------------------------------------------------------
#
# Copyright (c) 2017 Sam Cox, Roberto Sommariva
#
# This file is part of the AtChem2 software package.
#
# This file is covered by the MIT license which can be found in the file
# LICENSE.md at the top level of the AtChem2 distribution.
#... |
the-stack_0_1822 | import os
import sys
import h5py
import numpy as np
import pandas as pd
import tensorflow as tf
from fm_preprocessing import DeepFmData, Dataset
from nn_loss_metrics import get_config
from utils import top_ratio_hit_rate, train_sampling, calc_threshold_vs_depth
from deepFM import DeepFM
from xDeepFM import xDeepFM
fro... |
the-stack_0_1823 | # Copyright (c) 2011-2020 Eric Froemling
#
# 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,... |
the-stack_0_1826 | """
Helper functions for command line utilities.
"""
import argparse
import json
import logging
import logging.handlers
import os
import sys
import threading
import time
import warnings
from smqtk.utils.base_object import SmqtkObject
from smqtk.utils.dict import merge_dict
def initialize_logging(logger, stream_level... |
the-stack_0_1827 | from param import args
import sys
# sys.path.insert(0, '/R2R-EnvDrop/build')
if args.upload:
sys.path.insert(0, '/R2R-Aux/build')
else:
sys.path.insert(0, 'build')
# setup_seed(args.seed)
import torch
import os
import time
import json
import numpy as np
from collections import defaultdict
from speaker impo... |
the-stack_0_1828 | # coding: utf-8
"""
Sentim's Emotion APIs
An emotion recognition api that tells you the emotion of text, and not just the connotation. # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: help@sentimllc.com
Generated by: https://openapi-generator.tech
"""
import pprint
import re #... |
the-stack_0_1829 | # ---------------------------------------------------------------------
# f5.BIGIP.get_interfaces
# ---------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
# Python ... |
the-stack_0_1830 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
class PyAzureMgmtContainerregistry(PythonPackage):
"""Microsoft Azure Container Registry Client Library for Python.""... |
the-stack_0_1831 | # Copyright (c) Nanjing University, Vision Lab.
# Jianqiang Wang (wangjq@smail.nju.edu.cn), Zhan Ma (mazhan@nju.edu.cn); Nanjing University, Vision Lab.
# Last update: 2020.06.06
import numpy as np
import h5py
import os, sys
import torch
import torch.nn as nn
import MinkowskiEngine as ME
import MinkowskiEngine.Minkows... |
the-stack_0_1834 | # Copyright (C) 2017 Google Inc.
#
# 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 writi... |
the-stack_0_1835 | ll_proto = \
"""
node life {
has anchor owner;
can infer.year_from_date;
}
node year {
has anchor year;
can infer.month_from_date;
}
node month {
has anchor month;
can infer.year_from_date;
can infer.week_from_date;
}
node week {... |
the-stack_0_1836 | from SloppyCell.ReactionNetworks import *
# Modifications to SBML...
# Removed function LD, because it used 'ceil' which is not something we can deal
# with
# Replaced variable value_of_LD with light (more descriptive name)
# Replaced calls to LD with light
# Removed timeOfDay and dayLength variables
net = IO.from_SB... |
the-stack_0_1839 | # Copyright (c) 2017-2019 Datasud.
# 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 ... |
the-stack_0_1840 | """
pytoch Edgecortix backend
"""
# pylint: disable=unused-argument,missing-docstring
import os
import torch
import backend
import ip_runtime
import torchvision
import torchvision.transforms as transforms
import tvm
from tvm import relay
from tvm.relay import mera
from tqdm import tqdm
from PIL import Image
from torc... |
the-stack_0_1841 | # kafka_install.py
# TODO: capture/pipe all output of these commands somewhere they can be used for debugging. add more confirmation output.
# resources:
# https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-18-04
# https://askubuntu.com/questions/94060/run-adduser-non-interactively
# http... |
the-stack_0_1842 | class Solution(object):
def twoSum(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: List[int]
"""
dic = {}
for i in range(len(nums)):
if nums[i] in dic:
return [dic[nums[i]], i]
else:
... |
the-stack_0_1844 | import torch
import torch.nn as nn
from models.TransBTS.Transformer import TransformerModel
from models.TransBTS.PositionalEncoding import FixedPositionalEncoding,LearnedPositionalEncoding
from models.TransBTS.Unet_skipconnection import Unet
class TransformerBTS(nn.Module):
def __init__(
self,
img... |
the-stack_0_1846 | # Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
the-stack_0_1848 | # Copyright (c) 2017 Yingxin Cheng
#
# 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 wr... |
the-stack_0_1849 | # coding: utf-8
"""
Selling Partner API for FBA Inventory
The Selling Partner API for FBA Inventory lets you programmatically retrieve information about inventory in Amazon's fulfillment network. # noqa: E501
OpenAPI spec version: v1
Generated by: https://github.com/swagger-api/swagger-codegen.... |
the-stack_0_1850 | import argparse
import time
import statistics
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import brainflow
from brainflow.board_shim import BoardShim, BrainFlowInputParams, BoardIds, LogLevels
from brainflow.data_filter import DataFilter, FilterTypes, AggOperations
def m... |
the-stack_0_1852 | from common_fixtures import * # NOQA
TEST_SERVICE_OPT_IMAGE = 'ibuildthecloud/helloworld'
TEST_SERVICE_OPT_IMAGE_LATEST = TEST_SERVICE_OPT_IMAGE + ':latest'
TEST_SERVICE_OPT_IMAGE_UUID = 'docker:' + TEST_SERVICE_OPT_IMAGE_LATEST
LB_IMAGE_UUID = "docker:sangeetha/testlbsd:latest"
logger = logging.getLogger(__name__)
... |
the-stack_0_1853 | ## MadLib
"""
Create a "MadLib" that asks the user for various pieces of
information. Store the information as strings. Once the
information has been collected, output a story using the
stored information. You can find a template if you don't want to
make one: http://www.madlibs.com/
"""
"""
This one is quite a step u... |
the-stack_0_1855 | import xarray as xr
import numpy as np
import pandas as pd
def distrib_run_build_beam_pointing_vector(dat: list):
"""
Convenience function for mapping build_beam_pointing_vectors across cluster. Assumes that you are mapping this
function with a list of data.
distrib functions also return a processin... |
the-stack_0_1857 | # -*- coding: utf-8 -*-
#
# This file is part of tofbot, a friendly IRC bot.
# You may redistribute it under the Simplified BSD License.
# If we meet some day, and you think this stuff is worth it,
# you can buy us a beer in return.
#
# Copyright (c) 2011 Etienne Millon <etienne.millon@gmail.com>
# M... |
the-stack_0_1858 | from cConstants import cEPAConstants
from cEnum import eEPA
import cPlot3D
class cPlotFrame(cPlot3D.cPlotFrame):
def __init__(self, iParent, **kwargs):
cPlot3D.cPlotFrame.__init__(self, iParent, **kwargs)
def initPanel(self, *args, **kwargs):
self.m_PlotPanel = cPlotPanel(self, **kwargs)
cl... |
the-stack_0_1859 | """Test the permission utils."""
from homeassistant.auth.permissions import util
def test_test_all():
"""Test if we can test the all group."""
for val in (
None,
{},
{'all': None},
{'all': {}},
):
assert util.test_all(val, 'read') is False
for ... |
the-stack_0_1860 | import setuptools
import os
import stat
from setuptools.command.install import install
from distutils import log
with open("README.md", "r") as fh:
long_description = fh.read()
"""
The below code is taken from https://github.com/Uberi/speech_recognition
See README.md for licence information
"""
FILES_TO_MARK_EX... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.