text stringlengths 2 999k |
|---|
# 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.
# -----------------------------------------------------... |
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 25 14:11:59 2021
@author: Tom Cunningham
This module uses the drunk_functions module to track how many moves it takes
all drunks to get home at a range of drunk levels. The module will produce a
boxplot of the results.
"""
import drunk_functions
import matplotlib
impor... |
#!/usr/bin/env python3
import json
import os
import shutil
import zipfile
from os.path import join
import init
from utils import file_utils
from utils import process_utils
VERSION_FILE = 'version.txt'
BUILD_FOLDER = 'build'
class BuildInfo():
def __init__(self):
self.files = set()
def include(sel... |
def call_simulator(simu, action):
output = simu(action)
if hasattr(output, '__len__') and len(output) == 2:
t = output[0]
x = output[1]
else:
t = output
x = None # self.Cnb_test.X[action, :]
return t, x
|
# O(N) where n is len of string
def get_str_zig_zagged(s, numRows):
if numRows == 1:
return s
ret = ''
n = len(s)
cycle_len = numRows*2 - 2
for i in range(numRows):
j = 0
while j +i < n:
ret += s[j+i]
if (i != 0 and i != numRows -1 and j + cycle_len -i... |
# -*- coding: utf-8 -*-
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
#
# Cryptography documentation build configuration file, created by
# sphinx-quickstart on Tue Aug 6 19:19:14 201... |
import typing
from ._split import BaseCrossValidator
from ._split import KFold
from ._split import GroupKFold
from ._split import StratifiedKFold
from ._split import TimeSeriesSplit
from ._split import LeaveOneGroupOut
from ._split import LeaveOneOut
from ._split import LeavePGroupsOut
from ._split import LeavePOut
fr... |
from bitmovin.errors import FunctionalityNotAvailableError
from bitmovin.resources.models import RTMPInput
from ..rest_service import RestService
class RTMP(RestService):
BASE_ENDPOINT_URL = 'encoding/inputs/rtmp'
def __init__(self, http_client):
super().__init__(http_client=http_client, relative_url... |
"""
Water buckets problem (generalized) in cpmpy.
From http://www.dis.uniroma1.it/~tmancini/index.php?currItem=research.publications.webappendices.csplib2x.problemDetails&problemid=018
'''
Problem description
This is a generalization of the CSPLib specification, which is as follows:
Given an 8 pint bucket of water, a... |
# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from nav_msgs/GetMapActionResult.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
import geometry_msgs.msg
import nav_msgs.msg
import genpy
import actionlib_msgs.msg
import... |
# Copyright 2022 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... |
import os
filename = 'seg-0_0_0.npz'
outputdir = os.getcwd() + os.sep + 'inferred_segmentation'
inputdir = os.getcwd()
import numpy as np
import h5py
import PIL
import PIL.Image
import cv2
import png
def save_tif8(id_data, filename):
cv2.imwrite(filename, id_data.astype('uint8'))
def save_tifc(id_data, fil... |
from __future__ import print_function, division
import unittest, numpy as np
from pyscf import gto, scf
from pyscf.nao import gw as gw_c
mol = gto.M( verbose = 1, atom = '''He 0.0 0.0 0.0''', basis = 'aug-cc-pvtz', spin = 0, )
gto_mf = scf.UHF(mol)
e_tot = gto_mf.kernel()
class KnowValues(unittest.TestCase):
def t... |
from dynamic_stack_decider.abstract_action_element import AbstractActionElement
from tf2_geometry_msgs import PoseStamped
import rospy
class GoToDefensePosition(AbstractActionElement):
def __init__(self, blackboard, dsd, parameters=None):
super(GoToDefensePosition, self).__init__(blackboard, dsd, paramete... |
"""
Check that a Writer can be assigned to sys.stdout.
"""
import support
from java import io
import sys
o = io.FileWriter("test004.out")
sys.stdout = o
print "spam",
f = open("test004.out", "r")
s = f.read(-1)
f.close()
if s != "spam":
raise support.TestError('Wrong redirected stdout ' + `s`)
|
from mnist import MNIST
from utils import *
from six.moves.urllib.request import urlopen
import gzip, tarfile
from shutil import move
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
SOURCE_URL_MNIST = 'http://yann.lecun.com/exdb/mnist/'
SOURCE_URL_CIFAR10 = 'https://... |
import os
import shutil
import torch
import logging
import numpy as np
from scipy.ndimage import gaussian_filter1d
from scipy.signal.windows import triang
class AverageMeter(object):
def __init__(self, name, fmt=':f'):
self.name = name
self.fmt = fmt
self.reset()
def reset(self):
... |
import sys
sys.path.insert(0, '../..')
from domonic.html import *
from domonic.CDN import CDN_CSS
MARGIN = 3
# set some data
keyboard = [
['q','w','e','r','t','y','u','i','o','p'],
['a','s','d','f','g','h','j','k','l'],
['shift','z','x','c','v','b','n','m','backspace'],
['numerals','comma','space','p... |
from django.contrib import messages
from django.test import RequestFactory, TestCase
class DummyStorage(object):
"""
dummy message-store to test the api methods
"""
def __init__(self):
self.store = []
def add(self, level, message, extra_tags=''):
self.store.append(message)
clas... |
'''
A library for creating SVG files or just drawings that can be displayed in
iPython notebooks
Example:
```
d = draw.Drawing(200, 100, origin='center')
d.append(draw.Lines(-80, -45,
70, -49,
95, 49,
-90, 40,
clos... |
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import absolute_import
from capsul.api import StudyConfig, Pipeline
from capsul.attributes.completion_engine import ProcessCompletionEngine
from capsul.attributes.fom_completion_engine \
import FomProcessCompletionEngine, FomPathComplet... |
import examplemod
examplemod.ex('test')
|
# coding: utf-8
"""
CRM Imports
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v3
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from h... |
# coding: utf-8
"""
Selling Partner API for Finances
The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You ... |
from typing import Iterable, List, Type, Optional
import numpy as np
from scipy.optimize import fmin_l_bfgs_b
import logging
from .base_classes import SurrogateModel, AcquisitionFunction, ScoringFunction, LocalOptimizer
from ..datatypes.common import Candidate
from ..datatypes.tuning_job_state import TuningJobState
l... |
import os
from jinja2 import lexer, nodes
from jinja2.ext import Extension
from jinja2.filters import do_mark_safe
__all__ = ['IncludeBlockExtension']
class IncludeBlockExtension(Extension):
tags = {'include_block'}
fields = {'template', 'block_name'} # block_name is optional
def template_contents(sel... |
import datetime
from functools import wraps
from typing import Callable
from PyViCare import Feature
# This decorator handles access to underlying JSON properties.
# If the property is not found (KeyError) or the index does not
# exists (IndexError), the requested feature is not supported by
# the device.
def handl... |
# Copyright 2017 ProjectQ-Framework (www.projectq.ch)
#
# 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 app... |
import json
import logging
import os
# from botocore.vendored import requests
import random
import string
import time
import boto3
import requests
from botocore.exceptions import ClientError
logger = logging.getLogger()
logger.setLevel(logging.INFO)
SUCCESS = "SUCCESS"
FAILED = "FAILED"
def cfnresponse_send(event,... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... |
description = 'IPC Motor bus device configuration'
group = 'lowlevel'
instrument_values = configdata('instrument.values')
tango_base = instrument_values['tango_base']
devices = dict(
nokbus3 = device('nicos.devices.vendor.ipc.IPCModBusTango',
tangodevice = tango_base + 'test/ipcsms_c/bio',
visibil... |
# -*- coding: utf-8 -*-
"""Dask workflow for generating model data for the SIP example ICAL workflow.
This is code based on the test ICAL pipeline notebook from ARL.
"""
import logging
import pickle
import os
import sys
import json
import numpy
from astropy import units as u
from astropy.coordinates import SkyCoord
... |
from pyspark import SparkContext
sc = SparkContext("local", "First App")
print("--------- Start : SparkApplication ---------")
|
#!/usr/bin/env python
version = "0.5"
|
#!/usr/bin/env python3
import os
sway = False
i3 = None
ipc_data = None
outputs = {}
outputs_num = 0
windows_list = []
taskbars_list = []
scratchpads_list = []
workspaces_list = []
controls_list = []
config_dir = ""
app_dirs = []
name2icon_dict = {}
commands = {
"light": False,
"pamixer": False,
"pactl... |
# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from laser_assembler/AssembleScansRequest.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
import genpy
class AssembleScansRequest(genpy.Message):
_md5sum = "b341004f74e... |
from random import randint
import discord
def rollen_k(variable, user):
liste_rollen = ["Member","Jahrgang 5","Jahrgang 6","Klasse 7a","Klasse 7b","Klasse 7c","Klasse 7d","Jahrgang 7",
"Klasse 8a","Klasse 8b","Klasse 8c","Klasse 8d","Jahrgang 8","Klasse 9a","Klasse 9b","Klasse 9c",
... |
import asyncio
import time
import json
from telethon import TelegramClient, events
from telethon.sessions import StringSession
from telethon.tl.functions.account import GetAuthorizationsRequest
from telethon.tl.functions.contacts import GetContactsRequest
from telethon.tl.types import Channel, User, Chat
import confi... |
from flask import Flask, current_app as app, request
import requests
from datetime import datetime
from twilio.twiml.messaging_response import MessagingResponse
from src.utils import *
import random
# get list of supported regions
@app.route("/", methods=["POST"])
def main():
incoming_msg = request.values.get(... |
import numpy as np
import sys, os
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
import pickle
import glob
import time
import torch as tc
from torch import nn, optim
import torch.tensor as T
import torch.nn.functional as F
class Calibrati... |
"""
ASGI config for ChadProject project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_S... |
from kivy.app import App
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from kivy.uix.checkbox import CheckBox
from kivy.uix.label import Label
from kivy.uix.widget import Widget
from electrum_vtc.gui.kivy.i18n import _
Builder.load_string('''
<Question@Popup... |
import sqlite3
class DBManager (object):
def __init__(self):
self.docsetDBLocation = 'Docsets/docsets.db'
self.connection = None
self.SetupDocsetDB()
def SetupDocsetDB(self):
self.connection = sqlite3.connect(self.docsetDBLocation)
c = self.connection.cursor()
c.execute('CREATE TABLE IF NOT EXISTS doc... |
import math
import requests
def calc_dist(lat1, lon1, lat2, lon2):
lat1 = math.radians(lat1)
lon1 = math.radians(lon1)
lat2 = math.radians(lat2)
lon2 = math.radians(lon2)
h = math.sin( (lat2 - lat1) / 2 ) ** 2 + \
math.cos(lat1) * \
math.cos(lat2) * \
math.sin( (lon2 - lon1) / 2 ... |
#!/usr/bin/env python3
#encoding=utf-8
# Copyright (c) 2019 The Monero Project
#
# 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 cop... |
r"""
Cluster algebras
This file constructs cluster algebras using the Parent-Element framework.
The implementation mainly utilizes structural theorems from [FZ2007]_.
The key points being used here are these:
- cluster variables are parametrized by their g-vectors;
- g-vectors (together with c-vectors) provide a se... |
# -*- coding: utf-8 -*-
"""
:codeauthor: Shane Lee <slee@saltstack.com>
"""
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Libs
import salt.config
# Import 3rd Party Libs
import salt.ext.six as six
import salt.loader
import salt.states.win_lgpo as win_lgpo
... |
# Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
#
"""Userbot module for managing events. One of the main components of the userbot."""
import inspect
import re
import s... |
"""GaussianMLPModule."""
import abc
import torch
from torch import nn
from torch.distributions import Normal
from torch.distributions.independent import Independent
from garage.torch.distributions import TanhNormal
from garage.torch.modules.mlp_module import MLPModule
from garage.torch.modules.multi_headed_mlp_module... |
# # Unity ML-Agents Toolkit
# ## ML-Agent Learning
"""Launches trainers for each External Brains in a Unity Environment."""
import os
import logging
import shutil
import sys
if sys.platform.startswith('win'):
import win32api
import win32con
from typing import *
import numpy as np
import tensorflow as tf
from... |
import numpy as np
import numpy.testing as npt
import pytest
from openscm_units import unit_registry as ur
from scmdata import ScmRun
from test_model_integration_base import TwoLayerVariantIntegrationTester
from openscm_twolayermodel import ImpulseResponseModel
class TestTwoLayerModel(TwoLayerVariantIntegrationTeste... |
from typing import Tuple
import pytest
from flake8_annotations.error_codes import Error
from testing.helpers import check_is_empty, check_is_not_empty, check_source
from testing.test_cases.overload_decorator_test_cases import (
OverloadDecoratorTestCase,
overload_decorator_test_cases,
)
class TestOverloadDe... |
# model settings
temperature = 0.01
with_norm = True
model = dict(
type='UVCTrackerV2',
backbone=dict(
type='ResNet',
pretrained=None,
depth=18,
out_indices=(3, ),
strides=(1, 2, 1, 1),
norm_eval=False,
zero_init_residual=True),
cls_head=dict(
... |
from utils_test import eval_test
import pytest
import control_de_flujo
d = {
'naturales': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, ... |
import info
class subinfo(info.infoclass):
def setTargets(self):
self.versionInfo.setDefaultValues()
self.description = "the KDE terminal emulator"
self.defaultTarget = 'master'
def setDependencies(self):
self.buildDependencies["virtual/base"] = None
self.buildDepende... |
# -*- coding: utf-8 -*-
'''
Routines to set up a minion
'''
# Import python libs
from __future__ import absolute_import, print_function, with_statement, unicode_literals
import os
import re
import sys
import copy
import time
import types
import signal
import random
import fnmatch
import logging
import threading
import ... |
# Copyright 2019 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... |
# Copyright 2009-2017 Ram Rachum.
# This program is distributed under the MIT license.
'''Defines mixins for `ContextManager`.'''
from .decorating_context_manager_mixin import _DecoratingContextManagerMixin |
# coding: utf-8
# In[4]:
import numpy as np
import pandas as pd
from pandas import DataFrame
# In[7]:
def moving_average(values, period):
"""
็งปๅๅนณๅใ่จ็ฎใใใฎใงใใ
* values: ่ชฟๆดๅพ็ตๅคใๆๅฎใใใฎใงใใ
* period: ๆ้ใชใฎใงใใ
"""
return DataFrame(values).rolling(period).mean()
# In[8]:
if __name__ == '__main__':
... |
# -*- coding: utf-8 -*-
"""
User-interface related functions for building bots.
This module supports several different bot classes which could be used in
conjunction. Each bot should subclass at least one of these four classes:
* L{BaseBot}: Basic bot class in case where the site is handled differently,
like workin... |
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 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... |
"""
mbed CMSIS-DAP debugger
Copyright (c) 2006-2015 ARM Limited
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 ... |
#
# See top-level LICENSE file for Copyright information
#
# -*- coding: utf-8 -*-
"""
desitarget.train.train_test_RF
==============================
Tools for RF training QSO targets selection.
"""
|
"""Use this for tasks that can be obtained from NLP without further/special processing"""
import jiant.scripts.download_data.utils as download_utils
import jiant.utils.python.io as py_io
# Note to future selves: beware of circular imports when refactoring
from jiant.tasks.retrieval import (
ColaTask,
MrpcTask... |
#
# Copyright 2013 Intel Corp.
# Copyright 2014 Red Hat, Inc
#
# Authors: Yunhong Jiang <yunhong.jiang@intel.com>
# Eoghan Glynn <eglynn@redhat.com>
#
# 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 ... |
#!/usr/bin/env python3
"""Converts from Sigma Studio XML files to a JSON equivalent for cheap dsp"""
# Copyright 2022 Andrew Selle
#
# 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:... |
from .version import __version__
__all__ = ["__version__"]
|
# Lint as: python3
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
c={"โ ":{'๐โ ', '๐โ ', '๐โ ', '๐โ ', '๐โ ', '๐โ ', '๐โ ', '๐โ ', '๐โ ', '๐โ ', '๐๐โ ', '๐โ ', '๐โ ', '๐โ '}, "โฃ":{'๐โฃ', '๐โฃ', '๐โฃ', '๐โฃ', '๐โฃ', '๐โฃ', '๐โฃ', '๐โฃ', '๐โฃ', '๐โฃ', '๐๐โฃ', '๐โฃ', '๐โฃ', '๐โฃ'}, "โฆ":{'๐โฆ', '๐โฆ', '๐โฆ', '๐โฆ', '๐โฆ', '๐โฆ', '๐โฆ', '๐โฆ', '๐โฆ', '๐โฆ', '๐๐โฆ', '๐โฆ', '๐โฆ', '๐โฆ'}... |
#!/usr/bin/env python
# Lint as: python3
"""Server startup routines."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import logging
import os
import platform
import prometheus_client
from grr_response_core import config
from grr_response_core.config i... |
import os
from abc import ABCMeta, abstractmethod, abstractproperty
from collections import namedtuple
from six import add_metaclass
MigrationPhase = namedtuple("MigrationPhase", ["name", "alembic_revision", "flags"])
@add_metaclass(ABCMeta)
class DataMigration(object):
@abstractproperty
def alembic_migrati... |
from vmthunder.common import wsgi
from vmthunder import computeapi
class ComputeRouter(wsgi.Router):
"""WSGI router for VMThunder Instance requests"""
def __init__(self, mapper):
compute_resource = computeapi.create_resource()
mapper.connect("/list",
control... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.osv.query import Query
from odoo.tests.common import BaseCase
class QueryTestCase(BaseCase):
def test_basic_query(self):
query = Query()
query.tables.extend(['"product_product"', '"produc... |
import pytest
import cv2
import numpy as np
from matplotlib.figure import Figure
from plantcv.plantcv.visualize import pseudocolor
from plantcv.plantcv import params
@pytest.mark.parametrize("debug,axes", [["print", True], ["plot", False], [None, False]])
def test_pseudocolor(debug, axes, tmpdir, visualize_test_data)... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import Any, Dict
import torch.optim
from classy_vision.generic.util import is_pos_float
from torch.optim i... |
from __future__ import print_function, absolute_import, division
import os, sys, getopt
import json
from collections import namedtuple
# get current date and time
import datetime
import locale
# A point in a polygon
Point = namedtuple('Point', ['x', 'y'])
from abc import ABCMeta, abstractmethod
# Image processing
f... |
"""
distance_sensor_118X.py
Provides and interface to the micro-epsilon optoNCDT ILR 118X laser distance
sensors.
Usage Examples:
sensor = DistanceSensor('/dev/ttyUSB0', baudrate=9600)
sensor.open()
value = sensor.getDistance() # Single shot measurement
# Stream data from sensor
sensor.startTra... |
__author__ = 'jroy'
from mi.core.log import get_logger
log = get_logger()
from mi.idk.config import Config
import unittest
import os
from mi.dataset.driver.wc_wm.cspp.wc_wm_cspp_recovered_driver import parse
from mi.dataset.dataset_driver import ParticleDataHandler
class DriverTest(unittest.TestCase):
def s... |
# This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load
import numpy as np
import pandas as pd
import os
import librosa
import librosa.display
impo... |
# 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... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-10-09 20:46
from __future__ import unicode_literals
from django.db import migrations, models
import habitat.timezone.models.martian_standard_time
class Migration(migrations.Migration):
dependencies = [
('sensors', '0001_initial'),
]
o... |
import os
import mimetypes
import sys
from io import UnsupportedOperation
from .exceptions import UnknownExtension, UnknownFormat
from .lib import Image, ImageFile, StringIO, string_types
RGBA_TRANSPARENCY_FORMATS = ['PNG', 'WEBP']
PALETTE_TRANSPARENCY_FORMATS = ['PNG', 'GIF']
DEFAULT_EXTENSIONS = {
'JPEG': '.jpg... |
import logging
import os
import networkx as nx
import copy
import re
from enum import Enum
from IPython import embed
from fnmatch import fnmatch
from android.dac import Cred, AID_MAP, AID_MAP_INV
from android.sepolicy import SELinuxContext
from android.capabilities import Capabilities
log = logging.getLogger(__name__... |
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 23 16:17:32 2019
@author: dykua
architectures for the network
"""
from keras.layers import Input, Conv2D, Conv2DTranspose, Reshape, Lambda, MaxPooling2D, UpSampling2D, Dropout, concatenate, multiply, add, BatchNormalization, PReLU, GaussianNoise, ZeroPadding2D
from keras... |
from __future__ import absolute_import
sitename = 'abc'
from astrometry.net.settings_common import *
ALLOWED_HOSTS += ['abc.astrometry.net']
from astrometry.net.settings_social2 import *
ENABLE_SOCIAL2 = True
INSTALLED_APPS += SOCIAL_INSTALLED_APPS
AUTHENTICATION_BACKENDS = SOCIAL_AUTH_BACKENDS + AUTHENTICATION_BACK... |
import json
from collections import OrderedDict
from datetime import timedelta
from django.db import models
from django.utils.functional import cached_property
from django.utils.timezone import now
from jsonfield import JSONField
from openwisp_utils.base import TimeStampedEditableModel
from rest_framework.utils.encode... |
import copy
import os
import random
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
class PolicyNetwork(nn.Module):
def __init__(self, state_size, action_size, hidsize1=128, hidsize2=128):
super(PolicyNetwork, self).__init__()
self.fc1 = nn.Linear(state_size... |
import unittest
import timeout_decorator
from gradescope_utils.autograder_utils.decorators import weight
import numpy as np
import os
import open3d as o3d
from pydrake.all import RigidTransform
# Store X_lst_target as global for testing all the functions
# yapf: disable
X_lst_target = np.array([ # noqa
[[-0.2093... |
from history import history
from ls import ls
from pwd import pwd
from cd import cd
from exit import exit
from cp import cp
from cat import cat
from clear import clear
from grep import grep
from mkdir import mkdir
|
from random import shuffle
from src.implementations.sorting.basic_sorts import insertion_sort
from src.implementations.helpers.partition import three_way_partition
def quicksort(arr: list) -> list:
"""Sorts arr in-place
by implementing https://en.wikipedia.org/wiki/Quicksort
"""
shuffle(arr) # shuff... |
import sys
import os, os.path as osp
import datetime as dt
def pardir(path, level = 1):
for _ in range(level):
path = osp.dirname(path)
return path
BASEDIR = osp.abspath(pardir(__file__, 3))
DOCSDIR = osp.join(BASEDIR, "docs")
SRCDIR = osp.join(BASEDIR, "src")
NOW = dt.datetime.now()
sys.path.in... |
from __future__ import unicode_literals
from .models import emr_backends
from ..core.models import MockAWS, base_decorator
emr_backend = emr_backends['us-east-1']
mock_emr = base_decorator(emr_backends)
|
"""
Class Features
Name: drv_data_ecmwf_geo
Author(s): Fabio Delogu (fabio.delogu@cimafoundation.org)
Date: '20200210'
Version: '1.0.0'
"""
#######################################################################################
# Library
import logging
from os import makedirs, remove
from... |
import os
from tqdm import tqdm
from mmdet.apis import init_detector, inference_detector
import numpy as np
import torch
import mmcv
import cv2
import json
import PIL
testset_dir = '/home/xiekaiyu/ocr/dataset/ICDAR2019ArT/test_task13'
output_dir = '/home/xiekaiyu/ocr/dataset/ICDAR2019ArT/output/preds'
model_name = '... |
# Generated by Django 2.2.13 on 2020-08-24 13:16
import django.db.models.deletion
import parler.fields
import parler.models
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="... |
# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from geometry_msgs/TransformStamped.msg. Do not edit."""
import codecs
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
import geometry_msgs.msg
import std_msgs.msg
class TransformStamped(genp... |
#!/usr/bin/python3
from psycopg2 import connect
conn = connect(host="localhost", user="car_portal_app", dbname="car_portal")
with conn.cursor() as cur:
new_make = "Ford"
new_model = "Mustang"
query = "INSERT INTO car_portal_app.car_model (make, model) " \
"VALUES (%s, %s)"
cur.execute(que... |
import numpy as np
import torch
import torch.nn.functional as F
from tensorboardX import SummaryWriter
from torch import optim
from torch.autograd import Variable
from tqdm import tqdm
from .datasets import MNISTSummation, MNIST_TRANSFORM
from .networks import InvariantModel, SmallMNISTCNNPhi, SmallRho
from ... |
'''
Faรงa um programa que leia um ano qualquer e mostre se ele รฉ bissexto.
'''
from datetime import date
ano = int(input('Que ano vocรช quer analisar? Coloque 0 para analisar o ano atual: '))
if ano == 0:
ano = date.today().year
if ano % 4 == 0 and ano % 100 != 0 or ano % 400 == 0:
print('O ano de {} รฉ BISSEXTO'... |
""":mod:`wand.cdefs.magick_property` --- Magick-Property definitions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. versionadded:: 0.5.0
"""
from ctypes import (POINTER, c_void_p, c_char_p, c_size_t, c_ubyte, c_uint,
c_int, c_ulong, c_double, c_bool, c_ulonglong)
from wa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.