text stringlengths 2 999k |
|---|
# coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... |
import os,rootpath
rootpath.append(pattern='main.py') # add the directory of main.py to PATH
from kivy.app import App
from kivy.lang import Builder
from kivy.properties import DictProperty,StringProperty,ListProperty
from kivy.uix.boxlayout import BoxLayout
from kivy.core.window import Window
from kivy.logger import L... |
#!/usr/bin/env python3
from argparse import ArgumentParser
import glob
import os
import cv2
import numpy as np
try:
from tqdm import tqdm
except ImportError:
# In case tqdm isn't installed we don't use a progressbar.
tqdm = lambda x, desc, smoothing, total: x
print('Tqdm not found, not showing progres... |
"""
Create Wordclouds
Movie Example:
python word.py --path some_movie_count.json --movie YourMovieName --mask some_mask.jpg --pixels 1200
Disney Example:
python word.py --movie Coco --type tfidf --mask coco.jpg --pixels 1200
"""
import os
import argparse
from Reviewer.cloud import WordCloudGenerator
def ... |
def extractLapinetlBlogspotCom(item):
'''
Parser for 'lapinetl.blogspot.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'translated'),
('Loiterous... |
# -*- coding: utf-8 -*-
# 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 "Lic... |
from setuptools import setup, find_packages
version = "1.2.0"
setup(
name="holland.backup.mysqldump",
version=version,
description="MySQLDump Backup/Restore Plugins",
long_description="""\
Plugin support to provide backup and restore functionality
through mysqldump backups
""",
c... |
from .globals import request_context
try:
from django.utils.deprecation import MiddlewareMixin
except ImportError: # Django < 1.10
MiddlewareMixin = object
class RequestContextMiddleware(MiddlewareMixin):
def process_request(self, request):
request_context.init_by_request(request)
def proc... |
# Copyright (c) 2016-2020 Renata Hodovan, Akos Kiss.
#
# Licensed under the BSD 3-Clause License
# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.
# This file may not be copied, modified, or distributed except
# according to those terms.
from ..config import as_list
from . import CallableDecorator
cla... |
"""
This file offers the methods to automatically retrieve the graph Synechococcus sp. WH 7803.
The graph is automatically retrieved from the STRING repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime: 2... |
# coding: utf-8
"""
App Center Client
Microsoft Visual Studio App Center API # noqa: E501
OpenAPI spec version: preview
Contact: benedetto.abbenanti@gmail.com
Project Repository: https://github.com/b3nab/appcenter-sdks
"""
import pprint
import re # noqa: F401
import six
class BuildScripts(o... |
# -*- coding: utf-8 -*-
# %%
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import phd.stats
import phd.viz
import phd.mscl
colors, palette = phd.viz.phd_style()
def compute_mean_sem(df):
n_tot = len(df)
n_surv = np.sum(df['survival'].astype(int))... |
from speakListen import hear
from speakListen import speak
import docx
import fitz
import time
from rich.console import Console # pip3 install Rich
from rich.table import Table
from colorama import Fore
def ms_word():
"""[Print and speak out a ms_word docx file as specified in the path]
"""
... |
import requests
import json
import time
from collections import OrderedDict
from test_framework.test_framework import OpenBazaarTestFramework, TestFailure
class CompleteModeratedWithTimeout(OpenBazaarTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 3
def run_test(self)... |
# Copyright 2016, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... |
import os
import simtk.openmm as mm
class CheckpointReporter():
'''
CheckpointReporter saves periodic checkpoints of a simulation.
The checkpoints will overwrite old files -- only the latest three will be kept.
State XML files can be saved together, in case the checkpoint files are broken.
Parame... |
from scipy.fft import fft
import numpy as np
def estimate_broadband_noise(signal, TR, low_freq_cutoff = 0.2):
'''Function that estimates broadband noise of 1/f like BOLD data
This function calculates the fourier transform of the input signals,
and then estimates the average broadband power as the median... |
#
# This file is part of Brazil Data Cube Collection Builder.
# Copyright (C) 2019-2020 INPE.
#
# Brazil Data Cube Collection Builder is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
#
"""Describe Celery task handling for Landsat produc... |
import pytest
from tartiflette.language.ast import InterfaceTypeExtensionNode
def test_interfacetypeextensionnode__init__():
interface_type_extension_node = InterfaceTypeExtensionNode(
name="interfaceTypeExtensionName",
directives="interfaceTypeExtensionDirectives",
fields="interfaceTypeE... |
from __future__ import absolute_import
import pytest as _pytest
from mock import patch as _patch, MagicMock as _MagicMock
from flytekit.common.exceptions import user as _user_exceptions
from flytekit.common.tasks import task as _task
from flytekit.models import task as _task_models
from flytekit.models.core import id... |
# -*- coding: UTF-8 -*-
from ZUI_MDP_solution import *
from unittest import TestCase
import itertools as it
import numpy as np
import numpy.testing as nptest
# Taken from http://www.neuraldump.net/2017/06/how-to-suppress-python-unittest-warnings/.
def ignore_warnings(test_func):
def do_test(self, *args, **kwargs... |
from dso.client import Client
from jpype import *
from jpype import java
import lithops
import os
dso=os.environ.get('DSO')
def my_function(x):
client = Client(dso)
d = client.getAtomicCounter("cnt")
return d.increment(x)
if __name__ == '__main__':
fexec = lithops.FunctionExecutor(runtime='0track/lit... |
from otp.otpbase.PythonUtil import Functor
from direct.gui.DirectGui import *
from panda3d.core import *
from direct.distributed import ClockDelta
from direct.fsm import StateData
from direct.task.Task import Task
import ClosetGlobals
from toontown.toonbase import TTLocalizer
from toontown.toonbase import ToontownGloba... |
import os
# import matplotlib.pyplot as plt
import numpy as np
from pascal_voc_writer import Writer
import json
import cv2
#%% src path
src_json_path = '/home/peyman/mnt/data/DATA/ouster_data/create_dataset/PixelAnnotationTool/data/anns/'
img_folder = '/home/peyman/mnt/data/DATA/ouster_data/create_dataset/PixelAnnotat... |
# -*- coding: utf-8 -*-
"""
Javelin Web2Py Events Controller
"""
# metadata
__author__ = "Jeremy Jacobson"
__copyright__ = "(c) 2013, Jacobson and Varni, LLC"
__date__ = "7/22/2013"
__email__ = "jjacobson93@gmail.com"
__status__ = "Development"
__data__ = {'name' : 'events', 'label' : 'Events', 'description' : 'Manag... |
from flask import Flask, request, jsonify
from cloudevents.http import from_http
import logging, json
from vcenter import Session
from datetime import date
logging.basicConfig(level=logging.DEBUG,format='%(asctime)s %(levelname)s %(name)s %(threadName)s : %(message)s')
app = Flask(__name__)
@app.route('/', methods=['... |
"""@package docstring
Documentation for this module.
More details.
"""
def func():
"""Documentation for a function.
More details.
"""
pass
class PyClass:
"""Documentation for a class.
More details.
"""
def __init__(self):
"""The constructor."""
self._memVar = 0;
... |
import turtle
window = turtle.Screen()
turtle.reset()
turtle.shape("classic")
turtle.bgcolor("dark slate gray")
turtle.color("alice blue")
turtle.speed(4)
turtle.pensize(2)
for i in 1, 2, 3, 4, 5, 6:
turtle.left(30)
turtle.forward(40)
turtle.left(90)
turtle.forward(40)
turtle.left(90)
turtle... |
from pathlib import Path
import numpy as np
if __name__ == '__main__':
with Path('vocab.words.txt').open(encoding='utf-8') as f:
word_to_idx = {line.strip(): idx for idx, line in enumerate(f)}
with Path('vocab.words.txt').open(encoding='utf-8') as f:
word_to_found = {line.strip(): False for lin... |
CLICKHOUSE_HOST = 'localhost'
VERTICA_CONNECTION_PARAMS = {
'host': '127.0.0.1',
'port': 5433,
'user': 'dbadmin',
'password': '',
'database': 'docker',
'autocommit': True,
}
UPLOAD_BATCH_SIZE = 10_000
NUMBER_OF_BATCHES = 1000
BENCHMARK_ITERATIONS = 10
|
# coding: utf-8
# -----------------------------------------------------------------------------------
# <copyright company="Aspose" file="get_table_cell_request.py">
# Copyright (c) 2021 Aspose.Words for Cloud
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining a copy
... |
import os
import sys
import six
try:
from urllib import urlencode, urlopen
from urllib2 import Request
except ImportError:
from urllib.parse import urlencode
from urllib.request import urlopen, Request
from pandaserver.taskbuffer.TaskBuffer import taskBuffer
from pandaserver.config import panda_config
... |
from controller import Control
import mongomock
from elasticmock import elasticmock
from datetime import datetime
from freezegun import freeze_time
from datetime import datetime
from unittest import TestCase
from service import *
from projects.job import Job
import random
from sqlite3.dbapi2 import Error
class SQLite... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module for topics configuration management
"""
from __future__ import absolute_import, division, print_function
__metaclass__ = type
# Init logging
import logging
import sys
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.StephenSorr... |
# -*- coding: utf-8 -*-
# Copyright (c) 2018, SELCO Foundation and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestVertical(unittest.TestCase):
pass
|
#
# Cython/Python language types
#
from __future__ import absolute_import
import copy
import hashlib
import re
try:
reduce
except NameError:
from functools import reduce
from functools import partial
from Cython.Utils import cached_function
from .Code import UtilityCode, LazyUtilityCode, TempitaUtilityCod... |
r1 = float(input('Digite o valor da primeira reta: '))
r2 = float(input('Digite o valor da segunda reta: '))
r3 = float(input('Digite o valor da terceira reta: '))
if r1 < r2 + r3 and r2 < r1 + r3 and r3 < r1 + r2:
print('Essas três retas formam um triângulo')
else:
print('Essas retas não formam um triângulo!')... |
import unittest
from lpminimk3.__init__ import ButtonEvent
from lpminimk3.match import ButtonMatch
from tests._vlpminimk3 import create_virtual_launchpad
class TestButtonMatch(unittest.TestCase):
def setUp(self):
self.lp = create_virtual_launchpad()
def tearDown(self):
self.lp.close()
de... |
from selenium import webdriver
from time import sleep
driver = webdriver.Chrome()
driver.get('https://web.whatsapp.com/')
name = input('Enter the name of user or group : ')
filepath = input('Enter your filepath (images/video): ')
input('Enter anything after scanning QR code')
user = driver.find_element_by_xpath('//... |
# Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by ap... |
# import python libraries
import os
import pdb
import numpy as np
from copy import deepcopy
import pandas as pd
import pickle
# import functions
import optimizer as O # stochastic gradient descent optimizer
from vi import value_iteration
from maxent_irl import *
from assembly_tasks import *
from import_qualtrics impo... |
import logging
import os
from abc import ABC, abstractmethod
from typing import Optional
from checkov.terraform.module_loading.content import ModuleContent
from checkov.terraform.module_loading.registry import module_loader_registry
# ModuleContent allows access to a directory containing module file via the `path()`... |
# Copyright 2018 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
def swapFileData():
file1 = input("enter files name:- ")
file2 = input("enter files name:- ")
with open(file1, 'r') as a:
data_a = a.read()
with open(file2, 'r') as b:
data_b = b.read()
with open(file1, 'w') as a:
a.write(data_b)
with open(file2, 'w') as b:
b.write(data_a)
swa... |
#!/usr/bin/python
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... |
import feedparser
import datetime
from app import db
from app.models.post import Post
from app.models.feed import Feed, APPROVED
def parseFeed(url):
return feedparser.parse(url)
def getFeed():
urls = Feed.query.filter_by(approved=APPROVED).all()
for url in urls:
feed = parseFeed(ur... |
import time
from reinforcement_learning import gym
import numpy as np
import tensorflow as tf
from reinforcement_learning import logger
from reinforcement_learning.common import explained_variance, tf_util, ActorCriticRLModel, SetVerbosity, TensorboardWriter
from reinforcement_learning.common.policies import ActorCri... |
import pytest
from pathlib import Path
import numpy as np
from types import SimpleNamespace
from dask.delayed import Delayed
import dask
from datacube.testutils import (
mk_test_image,
gen_tiff_dataset,
)
from datacube.testutils.io import native_load, rio_slurp_xarray, rio_slurp
from datacube.utils.cog import ... |
import argparse
import json
import logging
import os
import random
import time
from datasets.factory import DatasetFactory
from rankers.chain_ranker import set_up_experiment, ChainRanker
from tools import utils
logger = logging.getLogger()
class HyperparamSearch:
def __init__(self, config, tokenizer, num_eval):... |
"""
Figure built manually in SVG.
Note, these require the svgwrite package (and optionally, the svglib package to convert to pdf).
"""
from __future__ import print_function
import subprocess
from svgwrite import Drawing
filename = 'scaling_compute_totals_direct.svg'
color_phys = '#85C1E9'
color_scaled = '#EC7063'
ma... |
import collections
#from goodreads import apikey
from goodreads.client import GoodreadsClient
from goodreads.book import GoodreadsBook
from goodreads.author import GoodreadsAuthor
from goodreads.shelf import GoodreadsShelf
class TestBook():
@classmethod
def setup_class(cls):
client = GoodreadsClient(... |
# 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... |
#!/usr/bin/env python
# -*- coding: utf-8 -*
"""UdPyBlog: Multi User Blog Module"""
import os
import jinja2
import hashlib
import hmac
import string
import random
import datetime
import webapp2
import re
import logging
import json
import sys
import cgi
import time
from paging import PagedQuery
from webapp2_extras imp... |
from rip import Rip
Rip().main()
|
"""
Technical Analysis Factors
--------------------------
"""
from __future__ import division
from numpy import (
abs,
average,
clip,
diff,
dstack,
inf,
)
from numexpr import evaluate
from zipline.pipeline.data import USEquityPricing, EquityPricing
from zipline.pipeline.factors import CustomFa... |
"""
:type: nltk.WordNetCorpusReader
:Size: 10.283MB
Model files for wordnet in nltk.
`[page] <http://wordnet.princeton.edu/>`__
"""
from OpenAttack.utils import make_zip_downloader
NAME = "TProcess.NLTKWordNet"
URL = "https://cdn.data.thunlp.org/TAADToolbox/wordnet.zip"
DOWNLOAD = make_zip_downloader(URL)
class Lem... |
import json
from http import HTTPStatus
from typing import Any, List
from httpx import Client
from pydantic import BaseModel
from typing_extensions import Annotated
from hintapi import (
Header,
HintAPI,
HTMLResponse,
HttpRoute,
HttpView,
JSONResponse,
Path,
Routes,
required_method... |
# -*- coding: utf-8 -*-
import copy
import datetime
import json
import os
import six
from bson.objectid import ObjectId
from .model_base import Model
from girder import events
from girder import logger
from girder.constants import AccessType
from girder.exceptions import ValidationException, GirderException
from girde... |
import sys
from common import *
import matplotlib.pyplot as plt
from matplotlib.pyplot import figure
import matplotlib as mpl
series_labels = [kOriginalLabel, kFppLabel, kFsharpLabel,kFoccStandardLabel, kFoccLatestLabel]
def main():
if 1 < len(sys.argv) :
diagram_path = sys.argv[1]
else:
diagr... |
import bluesky
from bluesky.tests.conftest import RE # noqa
from bluesky.plans import count
from bluesky.plan_stubs import trigger_and_read, configure
import event_model
from ophyd.tests.conftest import hw # noqa
import pytest
from .. import UnknownEventType
import warnings
# This line is used to ignore the deprecatio... |
'''Given two arrays, write a function to compute their intersection.
'''
class Solution(object):
def intersect(self, nums1, nums2):
"""
:type nums1: List[int]
:type nums2: List[int]
:rtype: List[int]
"""
m,n=len(nums1),len(nums2)
l=[]
if len(nums1)... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import argparse
import os
import pkg_resources
from colorama import init
from .common_utils import print_error
from .launcher import create_experiment, resume_experiment, view_experiment
from .updater import update_searchspace, update_concurrency... |
# -*- coding: utf-8 -*-
'''
Tests for the salt fileclient
'''
# Import Python libs
from __future__ import absolute_import
import errno
import logging
import os
import shutil
# Import Salt Testing libs
from tests.support.mixins import AdaptedConfigurationTestCaseMixin, LoaderModuleMockMixin
from tests.support.mock imp... |
"""
ORY Oathkeeper
ORY Oathkeeper is a reverse proxy that checks the HTTP Authorization for validity against a set of rules. This service uses Hydra to validate access tokens and policies. # noqa: E501
The version of the OpenAPI document: v0.38.25-beta.1
Contact: hi@ory.am
Generated by: https://o... |
import os
import time
import logging
import threading
from xml.etree import ElementTree
from galaxy import model
from galaxy.util import plugin_config
import galaxy.workflow.schedulers
log = logging.getLogger( __name__ )
DEFAULT_SCHEDULER_ID = "default" # well actually this should be called DEFAULT_DEFAULT_SCHEDU... |
import tensorflow as tf
from tensorflow.contrib.framework.python.ops.variables import get_or_create_global_step
from tensorflow.python.platform import tf_logging as logging
from enet import ENet, ENet_arg_scope
from preprocessing import preprocess
from get_class_weights import ENet_weighing, median_frequency_balancing
... |
import copy
import onnx
import numpy as np
from onnx import numpy_helper
from onnx import TensorProto
from mqbench.utils.logger import logger
class ONNXGraph(object):
def __init__(self, onnx_model_path):
'''Describe onnx graph
args:
input_map[tensor_name] = node which input is tenso... |
import os
"""
Compatibility module
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, yt Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#------------... |
# Copyright (C) 2013 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... |
import logging
import threading
import requests
from kube_hunter.conf import get_config
from kube_hunter.core.types import KubernetesCluster
from kube_hunter.core.types.vulnerabilities import (
GeneralSensitiveInformationTechnique,
ExposedSensitiveInterfacesTechnique,
MountServicePrincipalTechnique,
Li... |
from ..base.twilltestcase import common, ShedTwillTestCase
class BasicToolShedFeatures(ShedTwillTestCase):
'''Test installing a basic repository.'''
def test_0000_initiate_users(self):
"""Create necessary user accounts."""
self.login(email=common.test_user_1_email, username=common.test_user_1... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from util import sample_and_group
from model.pct_module import *
"""
pct分割网络完整版,本文件的pct是分割版pct
"""
class Pct(nn.Module):
"""Pct网络
网络结构(从上到下,从左到右):
Input Embedding module: Neighborhood Embedding i.e. LBR-->SG
Attention modu... |
#!/usr/bin/env python2.7
# Copyright 2018 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import json
import os
import subprocess
import sys
TERM_COLOR_RED = '\033[91m'
TERM_COLOR_END = '\033[0m'
# Updates... |
# XXX like the Mac equivalent, this module is designed to be run independently
# of the rest of CCTBX if necessary, although it will use installed resources
# if found
from __future__ import division
try :
import libtbx.load_env
libtbx_env = libtbx.env
except ImportError, e :
libtbx_env = None
import optparse
i... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Run pdb and capture args.
Oct 06, 2019:
Works as expected!!!
Start IPython and run this as a post-mortem debugger!
Unrelated but who wants to see something I was surprised about.::
from bdb import foo, bar
Yeah those are real functions.::
foo()
""... |
#!/usr/bin/env python
# license removed for brevity
from scapy.all import *
import sys
import os
current_folder = os.path.dirname(os.path.realpath(__file__))
sys.path.append(current_folder)
main_folder = os.path.join(current_folder, "..")
sys.path.append(main_folder)
'''
utils_folder = os.path.join(current_... |
from data.model.filterword import FilterWord
from data.model.guild import Guild
from data.model.tag import Tag
from utils.config import cfg
class GuildService:
def get_guild(self) -> Guild:
"""Returns the state of the main guild from the database.
Returns
-------
Guild
... |
# coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... |
#!/usr/bin/env python3
#
# Copyright (c) 2015-2018, Fabian Greif
# Copyright (c) 2018, Niklas Hauser
# All Rights Reserved.
#
# The file is part of the lbuild project and is released under the
# 2-clause BSD license. See the file `LICENSE.txt` for the full license
# governing this code.
import os
import sys
import en... |
# Copyright 2020 BlueCat Networks (USA) 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 by appli... |
n1 = int(input('Primeiro valor: '))
n2 = int(input('Segundo valor: '))
n3 = int(input('Terceiro Valor: '))
# verificando quem é menor
menor = n1
if n2 < n1 and n2 < n3:
menor = n2
if n3 < n1 and n2 < n3:
menor = n3
print('O menor valor digitado foi {}'.format(menor))
# verificando quem é maior
maior = n1
if n2... |
#!/usr/bin/python3
import sys
import os
import argparse
import backTCP
from utils import *
def parse_args():
parser = argparse.ArgumentParser(description="receive a file from backTCP", epilog="This program is created by iBug")
parser.add_argument('filename', metavar="file", help="the name to save received f... |
from django.contrib import admin
from django import forms
from system.models import Setting, Server, Template
from images.models import stage
import system.forms
serstage = stage.copy()
serstage[0] = 'edit original images'
serstage[7] = 'edit aligned images'
for i in serstage.keys():
if int(i) > 8:
serstage.pop(... |
"""Tests for sharpness_aware_minimization."""
import os
import tensorflow.compat.v2 as tf
from absl.testing import parameterized
import keras
from keras.models import sharpness_aware_minimization
from keras.optimizers.optimizer_experimental import adam
from keras.testing_infra import test_utils
ds_combinations = tf... |
from typing import FrozenSet
from collections import Iterable
from math import log, ceil
from mathsat import msat_term, msat_env
from mathsat import msat_make_constant, msat_declare_function
from mathsat import msat_get_integer_type, msat_get_rational_type, msat_get_bool_type
from mathsat import msat_make_and, msa... |
#!/usr/bin/env python
# coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2016-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 ... |
#!/usr/bin/env python3
import os
# os.path() features a lot of functionalities.
# 1. os.path.basename() prints the end leaf name
print(os.path.basename("/tmp/test.txt"))
# 2. os.path.dirname() prints the directory part
print(os.path.dirname("/tmp/test.txt"))
# 3. os.path.exists() check for the existence of paths
p... |
# from __future__ import annotations
#
#
# class BaseInMemoryRepository:
# def __init__(self):
# self._data = {}
#
# def clear(self):
# self._data.clear()
#
# def is_empty(self):
# return len(self._data) == 0
from __future__ import annotations
|
#!/usr/bin/python2.7
import sys
import os
sys.path.insert(0, os.path.dirname(__file__))
if os.path.exists(os.path.join(os.path.dirname(__file__), 'vpy', 'bin', 'activate_this.py')):
activate_this = os.path.join(os.path.dirname(__file__), 'vpy', 'bin', 'activate_this.py')
execfile(activate_this, dict(__file__=... |
# coding:utf-8
from app.user.user import (
UserProfileHandler,
UserProfileEditHandler,
UserAvatarEditHandler,
UserNotificationHandler,
UserFollowerHandler,
UserOptHandler,
WebsocketChatHandler
)
urlprefix = r''
urlpattern = (
(r'/user/(\d+)', UserProfileHandler),
(r'/user/edit', U... |
# 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... |
from flask import Flask
from string import Template
import requests
def is_url_ok(url):
return 200 == requests.head(url).status_code
IFRAME_TEMPLATE = Template("""
<h2>
YouTube video link:
<a href="https://www.youtube.com/watch?v=${youtube_id}">
${youtube_id}
</a>
</... |
# -*- coding: utf-8 -*-
from pytrol.model.action.Action import Action
from pytrol.model.action.Actions import Actions
class SendingMessageAction(Action):
def __init__(self, _message: str, _agt_id: int):
r"""
Args:
_message (str):
_agt_id (int):
"""
Action.... |
from kutana import Plugin, t
plugin = Plugin(name=t("Echo"), description=t("Sends your messages back (.echo)"))
@plugin.on_commands(["echo"])
async def __(msg, ctx):
await ctx.reply("{}".format(ctx.body or '(/)'), attachments=msg.attachments, disable_mentions=0)
|
"""
Probabilistic Detectron Inference Script
"""
import json
import os
import sys
from shutil import copyfile
import torch
import tqdm
import core
# This is very ugly. Essential for now but should be fixed.
sys.path.append(os.path.join(core.top_dir(), "src", "detr"))
from detectron2.data import MetadataCatalog, bui... |
# This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
import os
from collections import defaultdict
from itertools impo... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from .multi_night_plots import *
from .aij_plots import *
|
"""This module contains the general information for InitiatorLunEp ManagedObject."""
import sys, os
from ...ucsmo import ManagedObject
from ...ucscoremeta import UcsVersion, MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class InitiatorLunEpConsts():
BOOTABLE_FALSE = "false"
BOOTABLE_NO = "no"
... |
"""
Optimizations addressing the ops in nnet root directory
"""
import theano
from theano import compile, gof
from theano.compile import optdb
from theano.gof.opt import (
LocalMetaOptimizerSkipAssertionError,
copy_stack_trace,
local_optimizer,
)
from theano.tensor.nnet.abstract_conv import (
AbstractC... |
from __future__ import unicode_literals, absolute_import, print_function
from django.contrib.syndication.views import Feed
from django.shortcuts import get_object_or_404
from biostar.apps.posts.models import Post
from biostar.apps.users.models import User
from biostar.apps.messages.models import Message
from biostar.a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.