filename stringlengths 13 19 | text stringlengths 134 1.04M |
|---|---|
the-stack_0_10025 | import ibm_boto3
from ibm_botocore.client import Config, ClientError
class CloudObjectStore:
DEFAULT_ENDPOINT = \
'https://s3.us-east.cloud-object-storage.appdomain.cloud'
DEFAULT_AUTH_ENDPOINT = \
'https://iam.cloud.ibm.com/identity/token'
'''
Interface to IBM Cloud Object Store, t... |
the-stack_0_10030 | # Copyright 2015 OpenStack LLC.
# 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 b... |
the-stack_0_10031 | import warnings
import numpy as np
from vispy.color import Colormap as VispyColormap
from vispy.scene.node import Node
from ..utils.translations import trans
from .image import Image as ImageNode
from .utils_gl import fix_data_dtype
from .vispy_base_layer import VispyBaseLayer
from .volume import Volume as VolumeNode... |
the-stack_0_10033 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# 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 with... |
the-stack_0_10034 | import unittest
from tri.delaunay.helpers import ToPointsAndSegments
from grassfire import calc_skel, calc_offsets
from grassfire.events import at_same_location
from grassfire.test.intersection import segments_intersecting
from grassfire.vectorops import dist
import fixtures
def all_tests():
"""Find all functi... |
the-stack_0_10035 | from typing import Callable, List, Tuple
from outdated_item_selection_strategy.no_update import *
from outdated_item_selection_strategy.oldest_chunks_update import *
from outdated_item_selection_strategy.last_n_chunks_update import *
from outdated_item_selection_strategy.regular_interval_update import *
from outdated_... |
the-stack_0_10037 | import pytest
from src.project.risks import Risk
from src.project.risks.helpers import RiskCounterMeasure, RiskImpact, RiskProbabilty, RiskScore
from tests.faker import faker
@pytest.fixture
def risk():
yield Risk(risk_name="Fake Risk Name", probability=50, impact=100)
def test_create_Risk_object_directly(monk... |
the-stack_0_10042 | # Author: Hamzeh Alsalhi <ha258@cornell.edu>
#
# License: BSD 3 clause
import numpy as np
import scipy.sparse as sp
import array
from . import check_random_state
from ._random import sample_without_replacement
__all__ = ["sample_without_replacement"]
def _random_choice_csc(n_samples, classes, class_pro... |
the-stack_0_10043 | # Development specific settings
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'postgres',
'USER': 'postgres',
'HOST': 'db',
'PORT': 5432,
}
}
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
ALLOWED_HOSTS = ['0.0.0.0']
|
the-stack_0_10046 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
post_ongoing_update.py
Script to post an ongoing books update on tumblr.
"""
import datetime
import json
import random
import sys
import traceback
from optparse import OptionParser
from twitter import TwitterHTTPError
from gluon import *
from applications.zcomx.modul... |
the-stack_0_10047 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import date
from workalendar.core import WesternCalendar, ChristianMixin
from ..registry_tools import iso_register
@iso_register('NL')
class Netherlands(WesternCalendar, ChristianMixin):
'Netherlands'
include_good_friday = True
... |
the-stack_0_10048 | """I/O format for MongoDB
This plugin is designed with data monitoring in mind, to put smaller
amounts of extracted data into a database for quick access. However
it should work with any plugin.
Note that there is no check to make sure the 16MB document size
limit is respected!
"""
import strax
import numpy as np
fr... |
the-stack_0_10049 | import numpy as np
import matplotlib.pyplot as plt
print("Running plot_runtime script..")
maindir = 'res/runtime/'
filename = 'runtime_results.csv'
file = maindir + filename
print("Reading input data from " + file + "..")
data = np.genfromtxt(file, delimiter=',', skip_header=1)
print("Input completed..")
kind = [... |
the-stack_0_10050 | """Gunicorn configuration file."""
import multiprocessing
import environ
from koku.feature_flags import UNLEASH_CLIENT
from koku.probe_server import BasicProbeServer
from koku.probe_server import start_probe_server
ENVIRONMENT = environ.Env()
SOURCES = ENVIRONMENT.bool("SOURCES", default=False)
CLOWDER_PORT = "80... |
the-stack_0_10051 | import requests
import time
class Facebook:
def __init__(self, config, permutations_list):
# 1000 ms
self.delay = config['plateform']['facebook']['rate_limit'] / 1000
# https://facebook.com/{username}
self.format = config['plateform']['facebook']['format']
# facebook userna... |
the-stack_0_10052 | # TODO nits:
# Get rid of asserts that are the caller's fault.
# Docstrings (e.g. ABCs).
import abc
from abc import abstractmethod, abstractproperty
import collections
import functools
import re as stdlib_re # Avoid confusion with the re we export.
import sys
import types
try:
import collections.abc as collection... |
the-stack_0_10053 | # -*- coding: utf-8 -*-
#
# John C. Thomas 2021 gpSTS
import torch
import torch.nn as nn
import torch.utils.data as dataloader
import torchvision
from torchvision.datasets import DatasetFolder
import torch.nn.functional as F
import matplotlib.pyplot as plt
import numpy as np
import Config
import Config as conf
def m... |
the-stack_0_10054 | import os
import numpy as np
from matplotlib import pyplot as plt
import figlatex
import hist2d
import colormap
commands = [
'-m 100000 -L 15250 -U 15850 darksidehd/merged_000886.root:53',
'-m 100000 -L 750 -v 750 -l 8900 darksidehd/nuvhd_lf_3x_tile53_77K_64V_6VoV_1.wav',
'-m 100000 -L 750 -v 750 -l 8900... |
the-stack_0_10056 | ### Team6 main.py ###
### author: tanahashi, kurita, ito ###
import os
import eel
import csv
import datetime
from datetime import datetime as dt
import numpy
import random
import matplotlib.pyplot as plt
import japanize_matplotlib # グラフの日本語表示に必要
from typing import Counter
# import importer
# import exporter
# P000の初... |
the-stack_0_10059 | import random
rock = """
_______
---' ____)
(_____)
(_____)
(____)
---.__(___)
"""
paper = """
_______
---' ____)____
______)
_______)
_______)
---.__________)
"""
scissors = """
_______
---' ____)____
______)
__________)
(___... |
the-stack_0_10062 | #!/usr/bin/env python
# Copyright 2019 Jian Wu
# License: Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import io
import os
import subprocess
import numpy as np
import soundfile as sf
import scipy.signal as ss
from kaldi_python_io import Reader as BaseReader
from typing import Optional, IO, Union, Any, No... |
the-stack_0_10064 | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... |
the-stack_0_10065 | # -*- coding: utf-8 -*-
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('authentication', '0008_auto_20151014_2027'),
]
operations = [
migrations.AlterField(
model_name='position',
name='committee',
f... |
the-stack_0_10067 | from django.shortcuts import render
# pdf
from django.http import FileResponse
import io
from reportlab.pdfgen import canvas
from reportlab.lib.units import inch
from reportlab.lib.pagesizes import letter
import os
from django.conf import settings
# Create your views here.
def get_pdf_name(request):
pdf_dir... |
the-stack_0_10070 | #!/usr/bin/python
#
# CLI compiler for bcmd's new model description language
#
import sys
import argparse
import bcmd_yacc
import os
import decimal
import string
import pprint
import logger
import ast
import codegen
import info
# default compiler configuration
# (this is effectively a template whose details
# may be ... |
the-stack_0_10071 | import os
import sys
sys.path.insert(0, ".")
sys.path.insert(1, "..")
from praw import __version__
copyright = "2020, Bryce Boe"
exclude_patterns = ["_build"]
extensions = ["sphinx.ext.autodoc", "sphinx.ext.intersphinx"]
html_static_path = ["_static"]
html_theme = "sphinx_rtd_theme"
html_theme_options = {"collapse_n... |
the-stack_0_10072 | import filecmp
import logging
import os
import textwrap
import uuid
from pathlib import Path
from unittest import mock
import pytest
from dvc.cli import main
from dvc.dependency.base import DependencyIsStageFileError
from dvc.dvcfile import DVC_FILE_SUFFIX
from dvc.exceptions import (
ArgumentDuplicationError,
... |
the-stack_0_10074 | from rdkit import Chem
from rdkit.Chem import AllChem, Draw
from rdkit.Chem import rdMolDescriptors
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image, ImageFilter
#please check the rdkit manual drawing chemical fragments
#https://www.rdkit.org/docs/GettingStartedInPython.html#drawing-molecules
... |
the-stack_0_10075 | # MIT License
#
# Copyright (c) 2020 Arkadiusz Netczuk <dev.arnet@gmail.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
# in the Software without restriction, including without limitation the rights
# t... |
the-stack_0_10076 | # Copyright 2014 Mellanox Technologies, 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 t... |
the-stack_0_10077 | import pathlib
import warnings
import functools
from typing import Dict
from contextlib import contextmanager
from urllib.parse import urlparse
from sunpy.util.exceptions import SunpyUserWarning
from sunpy.util.util import hash_file
__all__ = ['DataManager']
class DataManager:
"""
This class provides a remo... |
the-stack_0_10078 | """Emoji
Available Commands:
.emoji shrug
.emoji apple
.emoji :/
.emoji -_-"""
from telethon import events
import asyncio
@borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True))
async def _(event):
if event.fwd_from:
return
animation_interval = 3
animation_ttl = range(0, 18)
... |
the-stack_0_10079 | import itertools
import logging
from pint import pi_theorem
from pint.testsuite import QuantityTestCase
class TestPiTheorem(QuantityTestCase):
def test_simple(self, caplog):
# simple movement
with caplog.at_level(logging.DEBUG):
assert pi_theorem({"V": "m/s", "T": "s", "L": "m"}) == ... |
the-stack_0_10081 | import sys
from setuptools import find_packages, setup
from setuptools.command.test import test as TestCommand
class NoseTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
import no... |
the-stack_0_10083 | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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 applicab... |
the-stack_0_10084 | #!/usr/bin/env python
#################################################################
##
## Script: pyttt.py
## Author: Premshree Pillai
## Description: Tic-Tac-Toe game in Python
## Web: http://www.qiksearch.com/
## http://premshree.resource-locator.com/
## Created: 19/03/04 (dd/mm/yy)
##
## (C) 2004 Premshree ... |
the-stack_0_10085 | import os
import time
import string
import argparse
import re
import torch
import torch.backends.cudnn as cudnn
import torch.utils.data
import torch.nn.functional as F
import numpy as np
from nltk.metrics.distance import edit_distance
from utils import CTCLabelConverter, AttnLabelConverter, Averager
from dataset impo... |
the-stack_0_10086 | # Copyright (c) OpenMMLab. All rights reserved.
import argparse
import os
import os.path as osp
import pickle
import time
import warnings
import mmcv
from mmcv import Config, DictAction
from mmcv.runner import get_dist_info, init_dist
from mmcv.utils import get_git_hash
from mmdet import __version__
from mmdet.apis i... |
the-stack_0_10088 | from invmonInfra.enum import InventoryLastStatusEnum
from invmonService import FirefoxDriverService, HtmlParser, BasicLoggerService
from invmonInfra.base import JobsInventoryBase
from invmonInfra.domain import JobsInventoryInterface, DriverInterface, LoggerInterface
from invmonInfra.models import InventorySqlModel
cl... |
the-stack_0_10091 | #!/usr/bin/python3
# all arguments to this script are considered as json files
# and attempted to be formatted alphabetically
import json
import os
from sys import argv
files = argv[1:]
for file in files[:]:
if os.path.isdir(file):
files.remove(file)
for f in os.listdir(file):
files.a... |
the-stack_0_10092 | from aces import Aces
class sub(Aces):
def submit(self):
opt=dict(
units="metal",
species="graphene_knot",
method="nvt",
nodes=1,
procs=4,
queue="q1.4",
runTime=500000
,runner="strain"
)
for T in range(100,300,20):
app=dict(vStrain=True,reverseStrain=True,equTime=200000,T... |
the-stack_0_10093 | #!/usr/bin/python
# Copyright (c) 2014 Wladmir J. van der Laan
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the directory ... |
the-stack_0_10096 | # 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 may ... |
the-stack_0_10098 | import cv2
import numpy as np
from .utils import load_json, load_value_file
def get_video_names_and_annotations(data, subset):
"""Selects clips of a given subset from the parsed json annotation"""
video_names = []
annotations = []
for key, value in data['database'].items():
this_subset = val... |
the-stack_0_10099 |
import smtplib
import typing
import flask
import flask_mail
from ... import mail
from . import core
from ...models import BackgroundTask, BackgroundTaskStatus
def post_send_mail_task(
subject: str,
recipients: typing.List[str],
text: str,
html: str,
auto_delete: bool = True
... |
the-stack_0_10101 | from cirq_qaoa.cirq_max_cut_solver import define_grid_qubits, solve_maxcut
def main():
size = 2
steps = 2
qubits = define_grid_qubits(size=size)
qubit_pairs = [(qubits[0], qubits[1]), (qubits[0],
qubits[2]), (qubits[1], qubits[2])]
... |
the-stack_0_10104 | # -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2022 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the t... |
the-stack_0_10106 | from telethon.tl.functions.account import UpdateProfileRequest
from telethon.tl.functions.photos import DeletePhotosRequest, UploadProfilePhotoRequest
from telethon.tl.functions.users import GetFullUserRequest
from telethon.tl.types import InputPhoto
from userbot import CMD_HELP, LOGS, STORAGE, bot
from userbot.events... |
the-stack_0_10111 |
import tensorflow as tf
import os
import time
from tqdm import tqdm
from src.utils import get_cli_params, process_cli_params, \
order_param_settings
from src.lva import build_graph, measure_smoothness, VERBOSE
from src.train import evaluate_metric_list, update_decays, evaluate_metric
import numpy as np
def main... |
the-stack_0_10113 | # Time: O(|V| + |E|)
# Space: O(|V| + |E|)
import collections
class Solution(object):
def possibleBipartition(self, N, dislikes):
"""
:type N: int
:type dislikes: List[List[int]]
:rtype: bool
"""
adj = [[] for _ in xrange(N)]
for u, v in disl... |
the-stack_0_10115 | def process(uri: str):
f = open(uri, 'r')
stack = [int(x) for x in f.readline().replace('\n', '').strip().split('\t')]
prev_sets = []
steps = 0
while str(stack) not in prev_sets:
prev_sets.append(str(stack))
maxb = max(stack)
index = stack.index(maxb)
stack[index] = 0... |
the-stack_0_10117 | #!/usr/bin/python
import sys
from typing import Any, Dict
from requests.api import get
import semver
import requests
repo: str = 'groovy-guru'
owner: str = 'DontShaveTheYak'
def do_action(action, version):
function = getattr(version, action)
new_version = function()
print(f'{version} {action} to {new... |
the-stack_0_10118 | # -----------------------------------------------------------------------------------------
# Code taken from https://github.com/iwantooxxoox/Keras-OpenFace (with minor modifications)
# -----------------------------------------------------------------------------------------
import tensorflow as tf
import numpy as np
... |
the-stack_0_10120 | import jax.numpy as jnp
import numpy as np
import netket as nk
import flax.linen as nn
class test(nn.Module):
@nn.compact
def __call__(self, x):
nothing = self.param("nothing", lambda *args: jnp.ones(1))
if len(x.shape) != 1:
return jnp.array(x.size * [1.0])
return 1.0
c... |
the-stack_0_10121 | # pylint: disable=g-bad-file-header
# Copyright 2016 The Bazel 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
... |
the-stack_0_10122 | """
Commands for home spaces/rooms.
"""
from evennia import CmdSet
from commands.base import ArxCommand
from django.conf import settings
from world.dominion.models import LIFESTYLES
from django.db.models import Q
from evennia.objects.models import ObjectDB
from world.dominion.models import AssetOwner, Organization, Cr... |
the-stack_0_10127 | #
# Copyright 2013 eNovance
#
# Author: Julien Danjou <julien@danjou.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/licenses/LICENSE-2.0
#
# Unless requi... |
the-stack_0_10128 | from dataLoader import *
import tensorflow as tf
from tensorflow.keras.callbacks import ModelCheckpoint
from tensorflow import keras
from tensorflow.keras import metrics
from ModelUtil import *
import configparser
import sys
import numpy as np
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
tf.config.experimental.... |
the-stack_0_10129 | # 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_10130 | from rainworms import *
import random
class Bot():
def __init__(self):
self.game: RainWorms = None
@staticmethod
def in_roll_take_phase(possible_actions: List[PlayerAction]) -> bool:
return any([
action for action in possible_actions
if action.action_type == PlayerA... |
the-stack_0_10131 | # Copyright 2021 solo-learn development team.
# 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, publ... |
the-stack_0_10132 | # Copyright 2022 The KerasCV 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
the-stack_0_10133 |
from __future__ import absolute_import
import re
import os
import time
import math
import toolz
import click
import pprint
import logging
import inspect
import warnings
import itertools
import functools
import subprocess
from jrnr._compat import exclusive_open
FORMAT = '%(asctime)-15s %(message)s'
logger = logging... |
the-stack_0_10138 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thrusday 08 Feb 2018
Testing suite for topopy Flow class
@author: J. Vicente Perez
@email: geolovic@hotmail.com
"""
import unittest
import sys
import numpy as np
# Add to the path code folder and data folder
sys.path.append("../")
from topopy import Grid, F... |
the-stack_0_10139 | #!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
#
# 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... |
the-stack_0_10141 | import logging
import os
import tempfile
from contextlib import contextmanager
from typing import TYPE_CHECKING, Optional
from funcy import cached_property, first
from dvc import fs
from dvc.exceptions import DvcException
from dvc.utils import dict_sha256, relpath
from dvc_data.transfer import _log_exceptions
if TYP... |
the-stack_0_10142 | # -*- coding: utf-8 -*-
import getopt
import sys
import matplotlib.pyplot as plt
from simulation import Simulation
def main(argv):
population_size = 20
individual_size = 8
delta = 0.005
cross_point_count = 1
verbose = False
try:
opts, args = getopt.getopt(argv, 'hvp:i:c:d:', [
... |
the-stack_0_10143 | from proteus import *
from twp_navier_stokes_p import *
from dambreak_Ubbink_coarse import *
if timeDiscretization=='vbdf':
timeIntegration = VBDF
timeOrder=2
stepController = Min_dt_cfl_controller
elif timeDiscretization=='flcbdf':
timeIntegration = FLCBDF
#stepController = FLCBDF_controller_sys
... |
the-stack_0_10144 | # Copyright 2019 The Cirq 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
the-stack_0_10146 | """Config flow for HVV integration."""
import logging
from pygti.auth import GTI_DEFAULT_HOST
from pygti.exceptions import CannotConnect, InvalidAuth
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_HOST, CONF_OFFSET, CONF_PASSWORD, CONF_USERNAME
from homeassistan... |
the-stack_0_10148 | # Copyright 2019 The Shaderc 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 applicable... |
the-stack_0_10152 | from fuzzysearch import find_near_matches
from . import x_execer, filepath, x_env
import subprocess
def f_search(keyword: str, paths: [str]):
res = []
for p in paths:
if find_near_matches(keyword, p, max_l_dist=0) != []:
# ヒット
res.append(p)
return res
def interactive(l: [st... |
the-stack_0_10153 | import random
import argparse
from functools import partial
import numpy as np
import paddle
import paddle.distributed as dist
from paddle.io import DataLoader, DistributedBatchSampler, BatchSampler
from paddlenlp.data import Pad
# yapf: disable
def parse_args():
parser = argparse.ArgumentParser(__doc__)
pa... |
the-stack_0_10155 | #!/usr/bin/python
#
# Copyright 2015 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 b... |
the-stack_0_10157 | # Copyright 2012 Red Hat, Inc.
# Copyright 2013 IBM Corp.
# 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.... |
the-stack_0_10158 | #!/usr/bin/env python
import sys
import os.path
from os.path import join as PJ
import re
import json
import numpy as np
from tqdm import tqdm
import igraph as ig
import louvain
import math
import jgf
import graph_tool as gt;
import graph_tool.inference as gtInference;
# import infomap
def isFloat(value):
if(value i... |
the-stack_0_10159 | #!/usr/bin/env python
#
# Copyright (c) 2009-2013, Luke Maurits <luke@maurits.id.au>
# All rights reserved.
# With contributions from:
# * Chris Clark
# * Klein Stephane
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:... |
the-stack_0_10160 | import logging
import time
from collections import defaultdict
from queue import Queue
from threading import Thread
from kube_hunter.conf import get_config
from kube_hunter.core.types import ActiveHunter, HunterBase
from kube_hunter.core.events.types import Vulnerability, EventFilterBase, MultipleEventsContainer
logg... |
the-stack_0_10162 | from cConstants import cEPAConstants, cPlotConstants
from cEnum import eEPA
import cPlot2D
import cPlotEPA
import sys
sys.path.append("../")
import bayesact
import wx
class cPlotFrame(cPlotEPA.cPlotFrame):
def __init__(self, iParent, **kwargs):
cPlot2D.cPlotFrame.__init__(self, iParent, **kwargs)
def... |
the-stack_0_10163 | from os import error
import threading
from threading import Thread
from multiprocessing import Process
import json
import sys
from put import split
from cat import cat
from remove import remove
from ls import listallfiles
from mapreduce import mapreduce
#change path to this file accordingly
dfs_setup_config = "/users... |
the-stack_0_10164 |
#python main.py --env-name "HalfCheetah-v2"
# --algo ppo
# --use-gae
# --log-interval 1
# --num-steps 2048
# --num-processes 1
# --lr 3e-4
# --entropy-coef 0
# --value-loss-coef 0.5
# --ppo-epoch 10
# --num-mini-batch 32
# --gamma 0.99
# --gae-lambda 0.95
# --num-env-steps 10000000
# --use-linear-lr-decay
# --use-pro... |
the-stack_0_10166 | import collections
import random
import threading
import time
import weakref
import sqlalchemy as tsa
from sqlalchemy import event
from sqlalchemy import pool
from sqlalchemy import select
from sqlalchemy import testing
from sqlalchemy.engine import default
from sqlalchemy.testing import assert_raises
from sqlalchemy.... |
the-stack_0_10168 | # -*- coding: utf-8 -*-
# Authors: Mark Wronkiewicz <wronk@uw.edu>
# Yousra Bekhti <yousra.bekhti@gmail.com>
# Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD-3-Clause
from collections.abc import Iterable
import numpy as np
from ..event import _get_stim_channel
from .._ola import _Interp2
fr... |
the-stack_0_10169 | import copy
import json
import logging
import os
import torch
from torch.utils.data import TensorDataset
from utils import get_intent_labels, get_slot_labels
logger = logging.getLogger(__name__)
class InputExample(object):
"""
A single training/test example for simple sequence classification.
Args:
... |
the-stack_0_10170 | from __future__ import division
import numpy as np
import chainer
from chainer.functions import dropout
from chainer.functions import max_pooling_2d
from chainer.functions import relu
from chainer.functions import softmax
from chainer.initializers import constant
from chainer.initializers import normal
from chainer.... |
the-stack_0_10171 | from shapely.geometry import Polygon
from rtree import index
import copy
import uuid
from collections import Counter
class Box:
def __init__(self):
self.box= {}
self.box['boundingBox'] = {'vertices':[{'x':0,'y':0} ,{'x':0,'y':0},{'x':0,'y':0},{'x':0,'y':0}]}
self.box['identifier'] = str(uu... |
the-stack_0_10172 | load(":known_shas.bzl", "FILE_KEY_TO_SHA")
load("//rust/platform:triple_mappings.bzl", "system_to_binary_ext", "system_to_dylib_ext", "system_to_staticlib_ext", "triple_to_constraint_set", "triple_to_system")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
load("@bazel_tools//tools/build_defs/repo:http.b... |
the-stack_0_10173 | """
lml.plugin
~~~~~~~~~~~~~~~~~~~
lml divides the plugins into two category: load-me-later plugins and
load-me-now ones. load-me-later plugins refer to the plugins were
loaded when needed due its bulky and/or memory hungry dependencies.
Those plugins has to use lml and respect lml's design pri... |
the-stack_0_10176 | """
Imports the various compute backends
"""
from typing import Set
from ..exceptions import InputError, ResourceError
from .cfour import CFOURHarness
from .dftd3 import DFTD3Harness
from .entos import EntosHarness
from .gamess import GAMESSHarness
from .molpro import MolproHarness
from .mopac import MopacHarness
fro... |
the-stack_0_10177 | # Copyright 2014 Diamond Light Source 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 t... |
the-stack_0_10178 | import boto3
import botocore
import os
import io
import json
import time
import sys
from google.protobuf import text_format
from tensorflow.python.training.checkpoint_state_pb2 import CheckpointState
import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger("SageS3Client")
class SageS3Clien... |
the-stack_0_10181 | from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from ..models.grupo import Grupo
from ..models.trecho import Trecho
from ..models.viagem import Viagem
from ..types import UNSET, Unset
T = TypeVar("T", bound="PurchaseEventIn")
@attr.s(auto_attribs=True)
class PurchaseEventIn:
"""
Attrib... |
the-stack_0_10184 | '''
This module has utilities1 for the arithmetic functions.
The parameters are of variable length.
'''
__author__ = 'vinay'
__version__ = "alpha_1"
def myvsum(*args):
'''
function which takes in variable count of numbers
and returns their sum
'''
s = 0
for n in args:
s = s + n
re... |
the-stack_0_10186 | import logging
from typing import List, Optional, Sequence
import telebot
from quiz_bot.entity import (
AnswerEvaluation,
AnyChallengeInfo,
ChallengeSettings,
CheckedResult,
ContextChallenge,
ContextParticipant,
ContextUser,
EvaluationStatus,
PictureModel,
QuizState,
Regular... |
the-stack_0_10188 | # 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 Apache License, Version 2.0 (the
# "License"); you may not u... |
the-stack_0_10191 | # Copyright The Linux Foundation and each contributor to CommunityBridge.
# SPDX-License-Identifier: MIT
import pytest
import cla
import pynamodb
from unittest.mock import Mock, patch, MagicMock
from cla.models.dynamo_models import GitHubOrg, GitHubOrgModel
from cla.utils import get_github_organization_instance
from ... |
the-stack_0_10195 | # messageBox.py
import ctypes
user_handle = ctypes.WinDLL("User32.dll") # Handle to User32.dll
kernel_handle = ctypes.WinDLL("kernel32.dll") # Handle to Kernel32.dll
# WinAPI: MessageBoxW
hWnd = None
lpText = "Message Box"
lpCaption = "Pop Up"
uType = 0x00000001
response = user_handle.MessageBoxW(hWnd, lpTe... |
the-stack_0_10198 | # -*- coding: utf-8 -*-
# Copyright (c) 2019 - 2020 Simon Kern
# Copyright (c) 2015 - 2020 Holger Nahrstaedt
# Copyright (c) 2011, 2015, Chris Lee-Messer
# Copyright (c) 2016-2017 The pyedflib Developers
# <https://github.com/holgern/pyedflib>
# See LICENSE for license details.
import numpy as ... |
the-stack_0_10199 | import pytest
from galaxy.config import BaseAppConfiguration
from galaxy.config.schema import AppSchema
from galaxy.exceptions import ConfigurationError
# When a config property 'foo' has an attribute 'path_resolves_to', that attribute is a reference to
# another property 'bar'. Together, these two properties form a... |
the-stack_0_10200 | # -*- 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 o... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.