text stringlengths 2 999k |
|---|
from PyQt5 import QtCore
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from GUI.tabs.perfomance_tabs_.performance_table_tab import performance_table_tab
from Utils.database import database
class performance_table_dialog(QDialog):
def __init__(self):
super().__init__()
self.layout = QFo... |
#
# This file is part of pyasn1-modules software.
#
# Copyright (c) 2005-2020, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
import sys
import unittest
from pyasn1.codec.der.decoder import decode as der_decoder
from pyasn1.codec.der.encoder import encode as der_encoder
from pya... |
"""Module to Keeps the log of multiple things."""
# ba_meta require api 6
# (see https://ballistica.net/wiki/meta-tag-system)
from __future__ import annotations
from typing import TYPE_CHECKING
from dataclasses import dataclass, field
import os
import datetime
import threading
import setting
import _ba
if TYPE_CHE... |
from enum import Enum
class TokenType(Enum):
INTEGER = 'INTEGER'
PLUS = 'PLUS'
MINUS = 'MINUS'
EOF = 'EOF'
class Token():
def __init__(self, type: TokenType, value: object) -> None:
self.type = type
self.value = value
def __str__(self) -> str:
return f'Token({self.ty... |
import numpy as np
import random
import pandas as pd
class Data:
def __init__(self, sources, destinations, timestamps, edge_idxs, labels, game_ids, batch_idx):
self.sources = sources
self.destinations = destinations
self.timestamps = timestamps
self.edge_idxs = edge_idxs
self.labels = labels
... |
#!/usr/bin/env python3
"""
gftools lang
Adds sample text for a given language using the specified UDHR translation.
Usage:
# Standard usage. Output lang metadata to a dir. Does not overwrite existing data.
gftools lang-sample-text -l ./languages/en.textproto ./udhr_translations/en.xml
"""
from absl import app
from... |
#!/usr/bin/python
import sys
import re
threshold = float(sys.argv[1])
tp = 0
fp = 0
fn = 0
typePr = {}
for line in sys.stdin:
if re.search(r'^\d', line):
fields = line.rstrip('\n').split(' ')
gold = fields[1]
(predicted, conf) = fields[2].split(':')
print "%s\t%s\t%s" % (gold, p... |
def test_abs1():
assert abs(-42) == 42, "Should be absolute value of a number"
if __name__ == "__main__":
test_abs1()
print("All tests passed!")
|
import logging
from math import sqrt
import sys
import pysam
import numpy
from advntr.settings import *
from advntr.utils import get_chromosome_reference_sequence, get_gc_content
class CoverageBiasDetector:
"""Find the coverage distribution based on GC content."""
def __init__(self, alignment_file='origina... |
import click
from subprocess import call
from virl.api import VIRLServer, CachedLab
from virl.helpers import (
generate_sim_id,
check_sim_running,
store_sim_info,
get_cml_client,
safe_join_existing_lab,
safe_join_existing_lab_by_title,
check_lab_cache,
cache_lab,
set_current_lab,
... |
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
# --------------------------------------------------------
# Reorganized... |
#
# @lc app=leetcode id=771 lang=python3
#
# [771] Jewels and Stones
#
# https://leetcode.com/problems/jewels-and-stones/description/
#
# algorithms
# Easy (82.77%)
# Total Accepted: 234.4K
# Total Submissions: 282.4K
# Testcase Example: '"aA"\n"aAAbbbb"'
#
# You're given strings J representing the typ... |
"""Entrada de dados"""
nome = input('Digite seu nome: ') # Inserção de dados em uma variável
print('Prazer em te conhecer,', nome) # Apresentação dos dados
|
#
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
#
from datetime import datetime
from typing import Any, Iterator, List, Mapping, MutableMapping, Tuple
from airbyte_cdk import AirbyteLogger
from airbyte_cdk.models import AirbyteMessage, ConfiguredAirbyteCatalog, ConnectorSpecification, DestinationSyncMode
f... |
# 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 ... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Radim Rehurek <me@radimrehurek.com>
#
# This code is distributed under the terms and conditions
# from the MIT License (MIT).
#
"""
These are tests that test the deprecated smart_open.smart_open function.
They mostly duplicate tests in test_smart_open.py and are here to gu... |
"""Newton's law of universal gravitation."""
import matplotlib.pyplot as plt
def draw_graph(x, y):
"""Draw relation between gravitational force & distance between bodies."""
plt.plot(x, y, marker='o')
plt.xlabel('Distance in Meters')
plt.ylabel('Gravitational Force in Newtons')
plt.title('Gravita... |
# coding: utf-8
from __future__ import unicode_literals
import re
import itertools
from .common import InfoExtractor
from ..utils import (
clean_html,
dict_get,
ExtractorError,
float_or_none,
get_element_by_class,
int_or_none,
parse_duration,
parse_iso8601,
try_get,
unescapeHTM... |
# 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)
from spack import *
class Canfail(Package):
"""Package which fails install unless a special attribute is set"""
... |
#!/usr/bin/env python
# encoding: utf-8
# The MIT License (MIT)
# Copyright (c) 2016-2019 CNRS
# 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 limita... |
from bs4 import BeautifulSoup, NavigableString
import re
import six
convert_heading_re = re.compile(r'convert_h(\d+)')
line_beginning_re = re.compile(r'^', re.MULTILINE)
# whitespace_re = re.compile(r'[\r\n\s\t ]+')
# Heading styles
ATX = 'atx'
ATX_CLOSED = 'atx_closed'
UNDERLINED = 'underlined'
SETEXT = UNDERLINED
... |
# https://adventofcode.com/2019/day/10
import sys
from math import copysign
def read_input_file(file_name):
input_map = list()
with open(file_name) as f_in:
for line in f_in.readlines():
input_map.append(line.strip())
return input_map
class Asteroid:
"""
Represent an asteroid... |
#
# 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... |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from pubs.models import Pub
class Event(models.Model):
name = models.CharField(_('name'), max_length=256)
start_date = models.DateTimeField(_('start date'))
end_date = models.DateTimeField(_('end date'), blank=True, null=... |
from dials.algorithms.refinement.restraints.restraints_parameterisation import (
RestraintsParameterisation,
)
__all__ = ["RestraintsParameterisation"]
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 22 15:03:22 2019
@author: davidzhou
"""
import time
import cv2
import numpy as np
import os
import json
def image_string(image):
image_encode=cv2.imencode('.jpg',image)[1]
imagelist=image_encode.tolist()
image_string=json.dumps(imagelis... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
class ExampleData(object):
def __init__(
self,
question: str = None,
is_multi_select: bool = False,
option1: str = None,
option2: str = None,
option3: str = None,
):
... |
# Create by Packetsss
# Personal use is allowed
# Commercial use is prohibited
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QVBoxLayout, QHBoxLayout, QGroupBox, \
QRadioButton, QDialog, QLabel, QLineEdit, QSpinBox
from PyQt5.QtGui import QIcon, QFont
from PyQt5.QtCore import QSize
cl... |
# -*- coding: utf-8 -*-
""" General utilities file for exploits and mikrodb """
import fnmatch
import ipaddress
import linecache
import os
import socket
import struct
import tracemalloc
from binascii import hexlify
from pwn import remote, log
from lib.defines import MAGIC_SIZE, SQUASHFS_MAGIC, SQUASHFS_OFFSET
print_... |
# -*- coding: utf-8 -*-
# Copyright 2020 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... |
from django.contrib.messages import get_messages
from django.test import TestCase
from django.urls import reverse
from oscar.apps.basket import views
from oscar.test import factories
from oscar.test.testcases import WebTestCase
from tests.fixtures import RequestFactory
from tests.functional.checkout import CheckoutMix... |
# Copyright 2019 The TensorTrade 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 applicable law or agreed to... |
# Copyright (c) 2017, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
from ._tree_ensemble import convert_tree_ensemble as _convert_tree_ensemble
from ..._deps import _HAS_S... |
from django.core.urlresolvers import reverse
from django.db import models
from django.db.models.signals import post_save
from django.utils.text import slugify
# Create your models here.
class Category(models.Model):
title = models.CharField(max_length=120 , unique=True)
slug = models.SlugField(unique=True)
descri... |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: core.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflecti... |
# Copyright 2013-2014 The Meson development 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 agree... |
import logging
from rest_framework import serializers
from activity.models import Activity
from headlines.models import HeadlinesCategory, HeadlinesNews, NewsComment, UserAttention, NewsCollection
from questions.models import Question, Tag
from talks.models import Talks
from users.models import User
class UserSerial... |
"""
The aim of this project is to predict the scores head-to-head matches of world cup 2018 in Russia.
In particular, we work under the Bayesian framework, using the Poisson regression likelihood with a normalised Gaussian prior. Our 3
approximations will be the:
- Laplace approximation,
- Metropolis-Hastings and
-... |
from fastapi import FastAPI, Request
from fastapi.middleware.gzip import GZipMiddleware
from fastapi.staticfiles import StaticFiles
from fastapi.templating import Jinja2Templates
from fastapi.responses import HTMLResponse
application = FastAPI(
docs_url=None,
redoc_url=None,
)
application.mount('/static'... |
import os
import time
import traceback
from twisted.internet import reactor, defer
from twisted.internet.threads import deferToThread
from twisted.web.server import NOT_DONE_YET
from twisted.web.resource import Resource
from twisted.web.static import File as FileResource, NoRangeStaticProducer, SingleRangeStaticProduc... |
# -*- coding: utf-8 -*-
__author__ = "Paul Schifferer <dm@sweetrpg.com>"
"""
exceptions.py
- API exceptions
"""
|
"""
##################################################################################################
# Copyright Info : Copyright (c) Davar Lab @ Hikvision Research Institute. All rights reserved.
# Filename : tps_transformation.py
# Abstract : Implementations of the TPS transformation
# Current... |
pi = 3.14159
linha1 = input().split()
A = float(input[0])
B = float(input[1])
C = float(input[2])
triangulo = (A * C)/2
print('TRIANGULO: %.3f' % triangulo)
pi = 3.14159
circulo = pi * (C**2)
print('CIRCULO: %.3f' % circulo)
trapezio = (A + B) * C/2
print('TRAPEZIO: %.3f' % trapezio)
quadrado = B **2
print('QU... |
import numpy as np
from scipy.stats.mstats import pearsonr
from sciunit import scores
from sciunit import errors
from cognibench.capabilities import PredictsLogpdf, ReturnsNumParams
from overrides import overrides
from cognibench.utils import negloglike
class BoundedScore(scores.FloatScore):
@overrides
def __... |
# Copyright (c) 2013 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 ... |
from cv2 import line
from manim import *
from manim_ml.neural_network.layers.convolutional_2d import Convolutional2DLayer
from manim_ml.neural_network.layers.parent_layers import ConnectiveLayer
class Convolutional2DToConvolutional2D(ConnectiveLayer):
"""2D Conv to 2d Conv"""
input_class = Convolutional2DLayer... |
from aiogram.dispatcher.filters.state import StatesGroup, State
class Mailing(StatesGroup):
stage1 = State()
stage2 = State()
stage3 = State() |
# This is an automatically generated file.
# DO NOT EDIT or your changes may be overwritten
import base64
from enum import IntEnum
from xdrlib import Packer, Unpacker
from ..__version__ import __issues__
from ..type_checked import type_checked
__all__ = ["ManageBuyOfferResultCode"]
@type_checked
class ManageBuyOffe... |
s = "We The People, In order for form a more perfect union"
pos = s.index("The")
print ( "index of 'The' = {}".format(pos) )
pos = s.index("more")
print ( "index of 'more' = {}".format(pos) )
try:
pos = s.index("xyz")
print ( "index of 'xyz' = {}".format(pos) )
except:
print ( "not found" )
|
import argparse
import math
import sys
import cv2
import numpy as np
def make_image_strip(samples=16, flipy=False):
"""
Creates a list containing the image data in a strip format.
:param samples: The number of samples, should be 16, 32 or 64
:type samples: int
:param flipy: Flip the image vertic... |
#!/usr/bin/env python3
import os
import numpy as np
import matplotlib.pyplot as plt
from scipy import signal
fs = 1000 # sampling frequency
fc = 6 # cut-off frequency
t = np.arange(1000)/fs
sga = np.sin(2*np.pi*2*t) # signal with f = 2
sgb = np.sin(2*np.pi*10*t) # signal with f = 10
sgo = sga + sgb #+ (np.rando... |
#!/usr/bin/env python
#
# Copyright (c) 2016, 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
# notic... |
# black=\033[30m
# red=\033[31m
# green=\033[32m
# orange=\033[33m
# blue=\033[34m
# purple=\033[35m
# cyan=\033[36m
# lightgrey=\033[37m
# darkgrey=\033[90m
# lightred=\033[91m
# lightgreen=\033[92m
# yellow=\033[93m
# lightblue=\033[94m
# pink=\033[95m
# lightcyan=\033[96m
# BOLD = \033[1m
# FAINT = \033[2m
# ITALIC ... |
# -*- coding:utf-8 -*-
# date:2018-03-14 17:22
# auther:yang
from selenium.webdriver.support.ui import WebDriverWait
class BasePageElement(object):
"""Base page class that is initialized on every page object class."""
def __set__(self, obj, value):
"""Sets the text to the value supplied"""
d... |
"""
This file contains primitives for multi-gpu communication.
This is useful when doing distributed training.
"""
import functools
import pickle
import sys
import time
from getpass import getuser
from socket import gethostname
import torch
import torch.distributed as dist
from det3d import torchie
def get_host_inf... |
import json
import datetime
from copy import copy
from pigeon.exceptions import *
import pigeon.redcap_errors as redcap_errors
class UploadStrategy(object):
def __init__(self, strategy, api):
"""
Strategies are
'full'
'batch'
'single'
"""
self.strategy = st... |
class Difference:
def __init__(self, a):
self.__elements = a
# Add your code here
def __init__(self, __element):
self.__elements = a
def computeDifference(self):
self.maximumDifference = max(a) - min(a)
# End of Difference class
_ = input()
a = [int(e) for e ... |
from flask import render_template, request
from .. import assets, responses
from ..util import (build_maintenance_notice, build_script_tags,
build_style_tags, parse_user_data)
def configure(bp, config, db):
@bp.route("/stats/")
def stats():
wikis = db.campaigns.wikis()
ret... |
#!/usr/bin/env python
import sys
import os
import wx
import random
import datetime
import math
import operator
import wx.lib.mixins.listctrl as listmix
import wx.lib.colourdb as cdb
import wx.lib.colourselect as csel
import wx.lib.colourutils as cutils
from wx.lib.embeddedimage import PyEmbeddedImage
import images
... |
# 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... |
'''
l4zyc0d3r /// 1629 /// Sun Oct 25, 2020
'''
class Solution:
def slowestKey(self, R: List[int], K: str) -> str:
k, t = None, 0
st = 0
for i, x in enumerate(K):
if i==0: k, t = x, R[i]
elif R[i] -R[i-1]>t:
k = x
t = R[i] -R[i-1]
... |
"""
Author:
Create date:
Description: modules for django orm
Version Date Description(of Changes)
1.0 Created
"""
from django.db import models
class AddressComponents():
pobox_type = models.TextField(blank=True, null=True)
pobox_number = models.... |
import discord
from discord.message import MessageType
import os.path
# Importing libraries
import imaplib, email
from imap_tools import MailBox
user = 'eadbotifsp@gmail.com'
password = 'ifsp1918'
imap_url = 'imap.gmail.com'
con = imaplib.IMAP4_SSL(imap_url)
con.login(user, password)
con.select('Inbox'... |
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/master/LICENSE
from __future__ import absolute_import
import pytest # noqa: F401
import numpy as np # noqa: F401
import awkward as ak # noqa: F401
to_list = ak._v2.operations.convert.to_list
def test_BitMaskedArray():
content = ak._v... |
"""
test/__init__.py
Initialization module for the apa102_gpiod tests.
See LICENSE.txt for details.
"""
|
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... |
# 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 ... |
"""
Script to copy a reference dataset into a new dataset
with fewer conformers per species.
"""
import os
import argparse
import json
import pdb
from tqdm import tqdm
from nff.data import Dataset
from nff.utils import fprint
from nff.utils.confs import trim_confs
def main(from_model_path,
to_model_path,
... |
import os
import subprocess
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--profiling', type=str, default='NO', help='Run with profiler? - (YES/NO)')
parser.add_argument('--case_start', type=str, default='0', help='Testing range starting case # - (0-84)')
parser.add_argument('--case_end', typ... |
from __future__ import annotations
from logging import Logger
from typing import Dict, List
from flask_injector import request
from injector import inject
from husky_directory.models.enum import AffiliationState, SearchType
from husky_directory.models.pws import (
ListPersonsInput,
ListPersonsOutput,
Lis... |
# coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2017-2019 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to d... |
"""
Transformer
=================================
This example shows how to implement the Transformer model with GluonNLP Toolkit.
@inproceedings{vaswani2017attention,
title={Attention is all you need},
author={Vaswani, Ashish and Shazeer, Noam and Parmar, Niki and Uszkoreit, Jakob and Jones,
Llion and ... |
from django.shortcuts import get_object_or_404, render
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.views import generic
from django.utils import timezone
from .models import Choice, Question
class IndexView(generic.ListView):
template_name = 'polls/index.html'
cont... |
import logging
from django.contrib.auth.models import User
from django.core.cache import cache
from rest_framework.decorators import api_view, permission_classes, action
from rest_framework import permissions, viewsets, status
from rest_framework.views import APIView
from rest_framework.response import Response
from re... |
import json
import pymongo
import csv
import re
input_folder = '/home/nata/Study/hig/master/data/raw/sentiment/'
def save_to_mongo(t_id, t_info, tweets):
db = pymongo.MongoClient().tweets
to_save = {'t_id': t_id, 't_name': t_info['name'], 'tweets': tweets, 'desc': t_info['desc']}
db.topics.insert(to_save... |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import torch
import torch.nn as nn
import torch.nn.functional as F
from crlapi.core import CLModel
from crlapi.sl.clmodel... |
from asgiref.sync import async_to_sync
from channels.generic.websocket import WebsocketConsumer, AsyncWebsocketConsumer
import json
import asyncio
from django_tools.middlewares import ThreadLocal
class SubmissionConsumer(WebsocketConsumer):
def connect(self):
self.profile_id = self.scope['url_route']['kwa... |
# NEON AI (TM) SOFTWARE, Software Development Kit & Application Framework
# All trademark and other rights reserved by their respective owners
# Copyright 2008-2022 Neongecko.com Inc.
# Contributors: Daniel McKnight, Guy Daniels, Elon Gasper, Richard Leeds,
# Regina Bloomstine, Casimiro Ferreira, Andrii Pernatii, Kiril... |
from distutils.core import setup
from setuptools import find_packages
NAME = 'softlearning'
VERSION = '0.0.1'
DESCRIPTION = (
"Softlearning is a deep reinforcement learning toolbox for training"
" maximum entropy policies in continuous domains.")
setup(
name=NAME,
packages=find_packages(
exc... |
# -*- coding: utf-8 -*-
import os
from setuptools import setup, find_packages
long_desc = '''
sphinxcontrib-jsmath is a sphinx extension which renders display math in HTML
via JavaScript.
'''
extras_require = {
'test': [
'pytest',
],
'lint': [
'flake8',
'mypy',
'types-setup... |
"""
Find the largest rectangular area possible in a given histogram where the largest rectangle can be made of a number of contiguous bars.
For simplicity, assume that all bars have same width and the width is 1 unit.
For example, consider the following histogram with 7 bars of heights {6, 2, 5, 4, 5, 2, 6}.
The large... |
###############################################################################
##
## Copyright (C) 2014-2016, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## ... |
"""
Given a 2D grid, each cell is either a wall 'W',
an enemy 'E' or empty '0' (the number zero),
return the maximum enemies you can kill using one bomb.
The bomb kills all the enemies in the same row and column from
the planted point until it hits the wall since the wall is too strong
to be destroyed.
Note that you ca... |
from setuptools import setup, find_packages
# read the contents of your README file
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name="chili-python-json-logger",
versio... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from zs3.modeling.sync_batchnorm.batchnorm import SynchronizedBatchNorm2d
class _ASPPModule(nn.Module):
def __init__(self, inplanes, planes, kernel_size, padding, dilation, BatchNorm):
super().__init__()
self.atrous_conv = nn.Conv... |
#!/usr/bin/env python
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# 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 us... |
"""Base class for all the objects in SymPy"""
from __future__ import print_function, division
from collections import defaultdict
from itertools import chain
from .assumptions import BasicMeta, ManagedProperties
from .cache import cacheit
from .sympify import _sympify, sympify, SympifyError
from .compatibility import ... |
# Copyright 2018 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... |
# Douglas Myers-Turnbull wrote this for the Kokel Lab, which has released it under the Apache Software License, Version 2.0
# See the license file here: https://gist.github.com/dmyersturnbull/bfa1c3371e7449db553aaa1e7cd3cac1
# The list of copyright owners is unknown
# This was originally copied from https://gist.githu... |
# -*- coding: utf-8 -*-
# Copyright 2020 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... |
import csv
import json
import logging
import os
import random
import requests
import shutil
import tempfile
import time
import uuid
import yaml
import zipfile
from os.path import basename, isfile, join
from django.conf import settings
from django.contrib.auth.hashers import make_password
from django.contrib.auth.mode... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('details', '0003_auto_20180207_1228'),
]
operations = [
migrations.AlterField(
model_name='schoolinfo',
... |
from collections import deque
import collections
from prettytable import PrettyTable
import utils
import heapq
#the goal for this module here is to use a graph and implement bfs dfs and ufs in python
class Node:
#attributes also don't have to be declared when they are used in construct
#in python only one co... |
import discord
import asyncio
from discord.ext import commands, tasks
from discord.ext.commands.cooldowns import BucketType
import random
from itertools import cycle
import time
bot = commands.Bot(command_prefix = ["/", '@'])
bot.remove_command('help')
case_insensitive = True
bot_version = 'Version 0.1.8.3... |
# Copyright 2020 Huawei Technologies Co., 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... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
@author: adele
"""
from __future__ import unicode_literals
import os
import logging
import cPickle as cpk
import pandas as pd
from bioservices import KEGG
import numpy as np
from utils import *
#Setting logging preferences
logging.basicConfig(level=logging.INFO)
l... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... |
# -*- coding: utf-8 -*-
#
# test documentation build configuration file, created by
# sphinx-quickstart on Sun Jun 26 00:00:43 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All ... |
"""
Django settings for my_website project.
Generated by 'django-admin startproject' using Django 3.2.9.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
import os
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.