content
stringlengths
5
1.05M
import tkinter as tk from tkinter import ttk ''' ------------------- Metodos ------------------- ''' def metodo_enviar(): print('Enviar') print(entrada_uno.get()) print(entrada_dos.get()) print(entrada_tres.get()) print(entrada_cuatro.get()) boton_uno.config(text=entrada_uno.get()) # selecc...
import unittest from huobi.rest.client import HuobiRestClient import os from os.path import join, dirname from dotenv import load_dotenv dotenv_path = join(dirname(dirname(dirname(dirname(__file__)))), '.env') load_dotenv(dotenv_path) class TestAccountEndpoint(unittest.TestCase): def setUp(self): acces...
""" MultiCall - a class which inherits its methods from a Tkinter widget (Text, for example), but enables multiple calls of functions per virtual event - all matching events will be called, not only the most specific one. This is done by wrapping the event functions - event_add, event_delete and event_info. MultiCall r...
from typing import TypeVar, Any, Generic from amino import List, _, __ from amino.do import do, Do from amino.case import Case from ribosome.nvim.io.state import NS from ribosome.compute.prog import Prog, ProgBind, ProgPure, ProgError, ProgExec from ribosome.compute.wrap_data import ProgWrappers from ribosome.data.pl...
#!/usr/bin/env python # # Objective: # Fetch open data from Taiwan EPA, and publish the measurement data # to the MQTT of LASS # # Note: # This source code is for reference only. Please do NOT run it unless # you change the MQTT server settings (we don't want to have too many # duplicate messages on LASS server :p) # ...
# The arduino accepts commands in 1/10 millimeters UNIT = 10 class Line: def __init__(self, x1, y1, x2, y2): self.x1 = float(x1) self.y1 = float(y1) self.x2 = float(x2) self.y2 = float(y2) def __eq__(self, other): return isinstance(other, self.__class__) \ a...
from dolfin import * import petsc4py import sys petsc4py.init(sys.argv) from petsc4py import PETSc from PackageName import PETScFunc from PackageName.GeneralFunc import common def StokesMatrixSetup(FS, A, nu): u = TrialFunction(FS['Velocity']) v = TestFunction(FS['Velocity']) p = TrialFunction(FS['Pres...
""" In this script we have implemented functions to calculate and plot the mean number of hourly trips for the lowpass- and highpass-filtered data. """ import pandas as pd import numpy as np import matplotlib.pyplot as plt import bikeshare as bs def trips_pr_hour_filter(days, df): """ Calculates the mean am...
# -*- coding: UTF8 -*- # -------------------------------------------------------------- # Copyright (c) 2015, Nicolas VERDIER (contact@n1nj4.eu) # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: # #...
import asyncio import logging from dataclasses import dataclass, field from typing import Callable, Coroutine, List, Optional from urllib.parse import urljoin import aiohttp from aiohttp import ClientResponseError, StreamReader from aiohttp.client import ClientSession, ClientTimeout from aiohttp_socks import ProxyConn...
#!/usr/bin/env python # Third party from setuptools import setup setup( install_requires=["gym>=0.2.3", "pandas", "cfg_load"], )
# import the necessary packages import video_stream import body_detect import imutils import cv2 vs = video_stream.Video_stream().start() body = body_detect.Body_detect() while True: # Grab the frame from the threaded video stream and resize it # to have a maximum width of 400 pixels frame = vs.read() frame...
import numpy as np import pandas as pd import os import fnmatch import re import math import matplotlib.pyplot as plt import decimal if __name__ == "__main__": regexp = re.compile(r'meson([-.0-9-e]+)') regexp1 = re.compile(r'real=\[ *([-.0-9-e]+)') regexp2 = re.compile(r'([-.0-9-e]+),') regexp3 = re.co...
import discord from discord.ext import commands from discord.utils import get class c23(commands.Cog, name="c23"): def __init__(self, bot: commands.Bot): self.bot = bot @commands.command(name='Qrescent_Temporal_Balance', aliases=['c23','Temporal_14']) async def example_embed(self, ctx): em...
# -*- coding: utf-8 -*- # Copyright (c) 2008, Konstantin Merenkov <kmerenkov@gmail.com> # 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 abov...
import threading from contextlib import contextmanager import sqlalchemy as sa from sqlalchemy import exc from pgfire.engine.storage.postgres import PostgresJsonStorage, BaseJsonDb TEST_DB_NAME = 'test_pgfire' def get_test_db_settings(): return { "db": TEST_DB_NAME, "username": "postgres", ...
temp = [] done = "notDOne" while done!="done": done = input() if done!="done": temp.append(done) print(temp)
import numpy as np import tensorflow as tf from PIL import Image import Algorithmia import os from uuid import uuid4 import time from src import label_map_util # This is code for most tensorflow object detection algorithms # In this example it's tuned specifically for our open local_image_input_paths data example. v...
import os import pprint import signal import socket import socketserver import sys import threading import time import traceback import pickle as pickle try: import readline # Imported to _enable_ command line editing except ImportError: pass import select import queue from guppy.heapy.RemoteConstants impor...
# ------------------------------------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. # -------------------------------------------------------------------...
from iconservice import * from ..utils.utils import * TAG = 'BattleBombRoyale' class InvalidAccountName(Exception): pass class Account: # ================================================ # Constants # ================================================ _NAME_MIN_CHARACTERS = 3 _NAM...
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-07-19 12:38 from django.db import migrations from oscar.models import fields def benefit_to_proxy_classes(apps, schema_editor): Benefit = apps.get_model("offer", "Benefit") mapping = { "Percentage": "oscar.apps.offer.benefits.PercentageDiscou...
"""Simple GaussianMLPRegressor for testing.""" import numpy as np import tensorflow as tf from garage.tf.regressors import StochasticRegressor from tests.fixtures.models import SimpleGaussianMLPModel class SimpleGaussianMLPRegressor(StochasticRegressor): """Simple GaussianMLPRegressor for testing. Args: ...
import json import logging from pprint import pprint import config as cfg import modules.parser.cdi_parser as parser import modules.zabbix.send_device as send_device import modules.zabbix.send_smart as send_smart logger = logging.getLogger(__name__) if __name__ == '__main__': if (cfg.LOG_LEVEL.upper() == "ERR...
# -*- coding: utf-8 -*- import os from django.http import Http404, HttpResponseRedirect from django.shortcuts import render from django.utils.translation import ugettext as _ from seaserv import seafile_api from seahub.dtable.models import Workspaces, DTables from seahub.utils import normalize_file_path, render_error...
# -*- coding: utf-8 -*- # # Tencent is pleased to support the open source community by making QTA available. # Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved. # Licensed under the BSD 3-Clause License (the "License"); you may not use this # file except in compliance with the License. You may ...
""" obtain the static field from a set of charges and dipoles at polarizable points. """ import numpy from .tensor import T from .mulmom import MulMom as M def get_static_field_from_file(potential, filename): f = open(filename, 'r') field = [] for i, line in enumerate(f): d = line.split() ...
import json import requests from dateutil import parser from datetime import datetime from .consts import Consts from .commandfailederror import CommandFailedError class LoginToken: def __init__(self, email, api_key): self.Email = email self.ApiKey = api_key def getAccessToken(self): ...
import torch from torch import Tensor def feature_align(raw_feature: Tensor, P: Tensor, ns_t: Tensor, ori_size: tuple, device=None): """ Perform feature align from the raw feature map. :param raw_feature: raw feature map :param P: point set containing point coordinates :param ns_t: number of exact...
# V0 # V1 # https://nifannn.github.io/2018/09/14/%E7%AE%97%E6%B3%95%E7%AC%94%E8%AE%B0-Leetcode-821-Shortest-Distance-to-a-Character/ class Solution: def shortestToChar(self, S, C): """ :type S: str :type C: str :rtype: List[int] """ ans = [float('inf')] for...
""" ecam Apr18 Id. length of pendulum """ import time #For seeding import sys #Handles command line arguments import numpy as np #Load param if needed. import pmh #Parallel Metropolis Hastings from prior3 import prior #Prior from logl import logl from path import path #Path to save the results. from param import p...
import pytest from pytest import param as p from anglicize import anglicize, build_mapping @pytest.mark.parametrize( "text, expected", [ p("Abc 123", "Abc 123", id="noop"), p("ĂaÂâÎîȘșȚț", "AaAaIiSsTt", id="romanian"), p("ĄąĆćĘꣳŃńŹźŻż", "AaCcEeLlNnZzZz", id="polish"), p("ÁáÉ...
# Commented out IPython magic to ensure Python compatibility. #@test {"skip": true} # tensorflow_federated_nightly also bring in tf_nightly, which # can causes a duplicate tensorboard install, leading to errors. # !pip uninstall --yes tensorboard tb-nightly # !pip install --quiet --upgrade tensorflow-federated # !pip...
import random import os import numpy as np import torch from tqdm import tqdm import pandas as pd import argparse from transformers import T5Tokenizer, top_k_top_p_filtering, AutoModelForCausalLM import torch import torch.nn as nn from utils.utils import logger def set_seed(seed=42): random.seed(seed) np.ran...
from loadInput import loadInput from findGiftWeight import findGiftWeight import numpy as np import pandas as pd def processInput( fileName ): giftList = loadInput( fileName ) nGifts = len(giftList) giftList['GiftType'] = giftList.GiftId.apply(lambda x: x.split('_')[0]) giftList['GiftWeight'] = np...
class bcolors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKCYAN = '\033[96m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' BOLD = '\033[1m' UNDERLINE = '\033[4m' print("Programa que comprueba si un año es bisiesto o no") print("Ingrese el año") year...
from systemofrecord import app from commitbuffer import IngestQueueConsumer from systemofrecord.services import ingest_queue if __name__ == '__main__': IngestQueueConsumer( queue_key=app.config.get("INGEST_QUEUE_NAME"), queue=ingest_queue, poll_interval=app.config.get('INGEST_QUEUE_POLL...
""" This is the fitsverify module. It provides a python interface to the fitsverify command. The fitsverify_bin string contains the path to the fitsverify executable """ import subprocess import os import re # the path to the fitsverify binary #FITSVERIFY_BIN = '/opt/fitsverify/fitsverify' FITSVERIFY_BIN = 'fitsveri...
# Generated by Django 2.1.2 on 2018-11-14 03:30 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('users', '0005_profile_hash'), ] operations = [ migrations.AlterField( model_name='profile', name='status', ...
import click import jikken.api as api from .setups import ExperimentSetup, MultiStageExperimentSetup from .data_formater import PrintExperiment @click.group(context_settings={'help_option_names': ['-h', '--help']}) @click.version_option(version='0.1.0') def jikken_cli(): """Run the jikken application""" pass ...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import os.path import uuid import time import shutil import signal import select import random import tempfile import datetime import multiprocessing import numpy import borg logger = borg.get_logger(__name__, default_level = "INFO") def random_seed(): """Ret...
import time import math import sqlite3 import re from flask import url_for class FDataBase: def __init__(self, db): self.__db = db self.__cur = db.cursor() def getMenu(self): sql = '''SELECT * FROM mainmenu''' try: self.__cur.execute(sql) res = sel...
from setuptools import setup import setuptools with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read() extrafiles =['data/tables/GKSPCPapTable1_Final.txt.gz', 'data/tables/BolMag_interpolations.models', 'data/tables/Cheops_Quad_LDs.txt', 'data/table...
from . import ApiTestCase from hackathon.constants import HACK_NOTICE_EVENT, HACK_NOTICE_CATEGORY from hackathon.hmongo.models import HackathonNotice USER_ONE_USERNAME = "test_one" USER_ONE_ENCODE_PASSWORD = '0b92d6bab65b9b4cbd746a3effc516a7' class TestUserLoginApi(ApiTestCase): def test_login(self, user1): ...
for line in open('test.txt'): print(line)
import logging import tornado.gen import bokeh.plotting import weakref import threading class LoggingHandler(logging.Handler): widgets = weakref.WeakValueDictionary() current_document = threading.local() @classmethod def register_widget(cls, widget): docid = id(widget.document) cls.w...
""" Author: C. Grima (cyril.grima@gmail.com) """
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function from flask import request, g from . import Resource from .. import schemas from flask_jwt_extended import jwt_required, get_jwt_identity import sqlite3 class Tags(Resource): @jwt_required def get(self): data = [] ...
import shamiko.gdb.wrapper import shamiko.simple_rpc.server def create_server(socket_path, session_dir): # type: (str, str) -> shamiko.simple_rpc.server.RPCServer server = shamiko.simple_rpc.server.RPCServer(socket_path) server.register(shamiko.gdb.wrapper.GdbWrapper) server.register(shamiko.gdb.wrap...
import time import re import pyperclip import pyautogui pyautogui.FAILSAFE = True COMPONENT_TYPES = { "0": "NexWaveform", # Waveform "1": "NexSlider", # Slider "51": "NexTimer", # Timer "52": "NexVariable", # Variable "53": "NexDSButton", # Dual / Dual-state Button ...
from utils import load_poses_from_txt import argparse import numpy as np parser = argparse.ArgumentParser(description='KITTI evaluation') parser.add_argument("--input", help="as kitti formate that 12 dof", default="./10001000_poses/p1_.txt" #default="./custom...
import re import os import sys import clean.csvwParser as csvwParser import schema_generation.creation_sql_alters as function import selection.resourcesFromSparql as resourcesFromSparql #IndexTrigger is the minimum selectivity value required to create an index indexTrigger = 0.70 # return true if there is a join in t...
import unittest from pycq.q import Q class Reduce(unittest.TestCase): def test_with_initializer(self): data = (1, 2, 3) ret = Q(data).reduce([], lambda a, b: a + [b]) self.assertSequenceEqual(data, ret) def test_without_initializer(self): data = (1, 2, 3) ret = Q(dat...
from contextlib import contextmanager from sqlalchemy.orm import sessionmaker from db import Base class DatabaseManager(object): """testでfactoryの設定に使う 設定の参考は http://momijiame.tumblr.com/post/108317509611/ TODO: 本当はget_sql_session()なんかもこちらに寄せた方がよさそう。時間と相談 """ def __init__(self, test_engine): ...
from datetime import datetime import torch from load_yaml import load_yamls from register import CenterNetCFG, YOLOv3CFG, SSDCFG, YOLOxSCFG, YOLOxMCFG, YOLOxLCFG, YOLOxXCFG def get_time_format(): now = datetime.now() return now.strftime("%Y-%m-%d_%H-%M-%S") if __name__ == '__main__': model = SSDCFG ...
import pygame from pygame.locals import * from macros import * import random from utils import * import math class Ball: def __init__(self): self.dx = 0 self.dy = 0 self.x = display_width/2 self.y = display_height/2 self.accel = BALL_INITIAL_ACCELERATION self.radius ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from detectron.core.config import cfg from detectron.utils.c2 import const_fill from detectron.utils.c2 import gauss_fill from detectron.utils.net import get_group_gn imp...
from __future__ import print_function, unicode_literals import json from sys import argv, exit from os import path from random import randint, choice, sample from time import sleep CFG = dict() BASEPATH = "cfg_dir" def generate_random_cfg(name, num_airports, num_airplanes, num_boxes, min_goal): """Generate a ran...
import torch import torch.nn as nn import pandas as pd from torch.utils.data import Dataset,DataLoader import pickle def get_datas(file = "datas\\translate.csv",nums = None): all_datas = pd.read_csv(file) en_datas = list(all_datas["english"]) ch_datas = list(all_datas["chinese"]) if nums == None: ...
import serial import sys io = serial.Serial(port=sys.argv[1], baudrate="9600") if io.is_open: io.close() io.open() #io.write([0x02, 0x01, 0xF1, 0x0A]) io.write([0x02]) io.write([0x0]) io.write([0x55]) #io.write([0x0A]) io.flush() while(not io.inWaiting()): pass print(io.read(1)) while(not io.inWaiting()):...
from django.apps import AppConfig class ForensicsConfig(AppConfig): name = "forensics"
from keras_flops import flops_calculation import matplotlib.pyplot as plt import numpy as np import collections def compare_sparsity_FT(): flops_acc_ori = np.load("result_energy.npy", allow_pickle=True).item() flops_acc_ft = np.load("result_energy_ft.npy", allow_pickle=True).item() x_axis = [] y_axis...
from __future__ import annotations from collections.abc import Iterable import csv from io import StringIO import pathlib import socket import subprocess import urllib.request HERE = pathlib.Path(__file__).parent.resolve() REGISTERD_PORTS = (22,) + tuple(range(1024, 49151)) HOSTS_CSV = "https://scrapbox.io/api/tabl...
''' Script for plotting approximation errors due to X_cor ''' from collections import OrderedDict as OD from matplotlib import pyplot as plt import numpy as np import pandas as pd import pickle from scipy import stats from X_corr import * import X_corr_seita from plot_path import path def plot_fig4(filename_res=None...
from functools import lru_cache from os import getenv from pathlib import Path from pydantic import BaseModel from yaml import safe_load class ModmailConfig(BaseModel): token: str prefix: str = "!" @lru_cache() def get_config() -> ModmailConfig: data = safe_load(Path(getenv("CONFIG_LOCATION", "./config...
from django.conf import settings from django.contrib.auth import models from django.contrib.auth.decorators import login_required, permission_required from django.contrib.auth.tests.test_views import AuthViewsTestCase from django.contrib.auth.tests.utils import skipIfCustomUser from django.core.exceptions import Permis...
def strNone(input): if isinstance(input,type(None)): return '' else: return str(input)
from pygpconnect.gpconnect import GPConnect
# -*- coding: utf-8 -*- """ Supporting code. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from functools import partial from zope.interface import implementer from relstorage._compat import wraps from .interfaces import IStaleAware def storage_me...
import flask import time from flask_restful import Resource from flask_sqlalchemy_session import current_session from cirrus import GoogleCloudManager from cirrus.config import config as cirrus_config from fence.auth import require_auth_header from fence.auth import current_token from fence.models import GoogleServic...
# -*- coding: utf-8 -*- """ Created on Fri Apr 10 01:01:10 2020 @author: pdesa """ #DATOS CATEGÓRICOS import numpy as np import matplotlib.pyplot as plt import pandas as pd #Importar dataset dataset = pd.read_csv('Data.csv') #Separar variables dependientes de independientes X = dataset.iloc[:, :-1].values y = data...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- #!/usr/bin/env python2 # -*- coding: utf-8 -*- # ---------------------------------------------------------------------------------------------------------------------- # ROS-MAGNA # -----------------------------------------------------------------------------------------...
#import sys import kmlbase from pylibkml import * import unittest ''' This class contains examples shown on the Adding Custom Data page of the KML Developer's Guide http://code.google.com/apis/kml/documentation/extendeddata.html ''' def main(): ''' This test creates the KML shown under the "Adding Un...
import random as rn import numpy as np class Triangle(object): ''' Triangle Class A triangle is defined by its vertex coordinates, background color and alpha component. ''' def __init__(self, *args): # Define parameters for triangle generation if len(args) == 3:...
import mock from nose.tools import eq_ import amo.tests import mkt from mkt.developers.cron import exclude_new_region, send_new_region_emails from mkt.webapps.models import AddonExcludedRegion class TestSendNewRegionEmails(amo.tests.WebappTestCase): @mock.patch('mkt.developers.cron._region_email') def test...
from django.conf import settings from django.contrib import admin from django.urls import path, include urlpatterns = [ path('', include('app.marketing.urls')), path('blog/', include('app.blog.urls')), path('core/', include('app.core.urls')), path('slack/', include('app.slack.urls')), path('admin/...
#!/usr/bin/python # # # Revised to match fig BT-01164_Huge.png # from BT-Hmm proposal May 18 import os as os # b3 class modified by BH, local version in current dir import b3 as b3 # behavior trees import random as random import math as m import numpy as np #import abt_constants from abtclass impo...
import torch import torch.nn as nn import torch.backends.cudnn as cudnn import torch.optim import os import sys import argparse import time sys.path.append('..') import CocoFolder import Mytransforms from utils import adjust_learning_rate as adjust_learning_rate from utils import AverageMeter as AverageMeter from util...
#!/usr/bin/pypy from sys import * from random import * T, n = map(int, argv[1:]) print T for i in xrange(T): print n print ' '.join(str(randrange(0, 2**30)) for j in xrange(n)) print ' '.join(str(randrange(0, 2**30)) for j in xrange(n))
""" Handler for Cisco IOS-XR device specific information. Note that for proper import, the classname has to be: "<Devicename>DeviceHandler" ...where <Devicename> is something like "Default", "Nexus", etc. All device-specific handlers derive from the DefaultDeviceHandler, which implements the generic information...
import re from collections import defaultdict from io import StringIO from itertools import groupby from operator import itemgetter from typing import Union, Optional, Tuple, List, TextIO, BinaryIO, Set, Dict import pandas as pd import numpy as np from mavehgvs import MaveHgvsParseError, Variant from fqfa.util.transla...
""" pinq.tests ~~~~~~~~~~~~ Loads all tests for pinq and runs them. """ from os import walk import unittest if __name__ == "__main__": tests = unittest.TestSuite() for _, _, filenames in walk("./tests"): for filename in filenames: if ".py" in filename and ".pyc" not in filename: ...
#!/usr/bin/env python # pull info about an activity (start date, end date) # get all songs for user around that activity date # print out list of songs # update activity description # a simple proof on concept import requests import json import datetime import time import dateutil.parser import calendar import os # pu...
import pymel.core as pm from mtoa.ui.ae.shaderTemplate import ShaderAETemplate UI = { 'float': pm.attrFieldSliderGrp, 'rgb': pm.attrColorSliderGrp, } class Param: name = '' label = '' annotation = '' ptype = '' presets = None precision = 4 def __init__(self, n, l, ...
"""Test for nx_itertools.recipes.tabulate""" from itertools import islice from nx_itertools.recipes import tabulate def test_normal(): """Test tabulate.""" # tabulate with default: 0 res = tabulate(lambda x: 'A' + str(x)) assert next(res) == 'A0' assert list(islice(res, 4)) == ['A1', 'A2', 'A3', '...
# An annotation toolkit is a collection of annotation types that can be applied to annotations # This could include Rating Definitions or DefinedTermSets from demo.definedterm import fixed_vocabulary, motivation_collection from trompace.mutations import definedterm, annotation, itemlist, rating def main(print_queries...
import torch import triton confs = [ triton.testing.Benchmark( x_names = ['N'], x_vals = [128, 256, 512, 1024, 2048, 3072, 4096, 6144, 8192], line_arg = 'provider', line_vals = ['triton', 'torch'], line_names = ['Triton', 'Torch'], ...
"""Constants used by aioautomatic.""" EVENT_WS_ERROR = 'error' EVENT_WS_CLOSED = 'closed' AUTH_URL = 'https://accounts.automatic.com/oauth/access_token' BASE_API_URL = 'https://api.automatic.com' DEVICES_URL = '{}/device'.format(BASE_API_URL) DEVICE_URL = '{}/device/{{}}'.format(BASE_API_URL) OAUTH_URL = 'https://acc...
# Generated by Django 2.2.13 on 2020-08-30 16:04 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('products', '0058_auto_20200830_1803'), ] operations = [ migrations.AlterField( model_name='chapter', name='icon_sty...
import logging from PyQt5 import QtWidgets # from PyQt5.QtCore import QTimer import sys # import time # from threading import Event from pid import PidFile from pid import PidFileError from Keithley6221_ControlClient import Keithley6221GUI if __name__ == "__main__": logger = logging.getLogger() logger.setL...
import os def test_no_file_exe(style_checker): """Check behavior when file is missing """ # The way we do this is by changing the PATH to something # that does not exist, thus leaving us with no effective PATH, # and then call the style_checker_exe through the current # python executable. ...
import os from django.contrib.auth import authenticate from django.utils.encoding import force_str from django.utils.http import urlsafe_base64_decode from django.contrib.auth.tokens import PasswordResetTokenGenerator from rest_framework import serializers from rest_framework.exceptions import AuthenticationFailed fr...
from __future__ import absolute_import, print_function, unicode_literals from builtins import dict, str import os import logging import requests logger = logging.getLogger(__name__) # If the protmapper resource directory does not exist, try to create it home_dir = os.path.expanduser('~') resource_dir = os.path.join...
from django.urls import path from nomadgram.users.views import ( explore_users, follow_user, un_follow_user, user_profile, user_followers, user_following, search_user, follow_view, ) app_name = "users" urlpatterns = [ path("explore/", view=explore_users, name="explore_users"), ...
# Generated by Django 3.1.6 on 2021-02-28 19:17 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('library_app', '0002_auto_20210225_0441'), ] operations = [ migrations.AddField( model_name='bor...
# Lint as: python3 # Copyright 2019 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 ...
from al_services.alsvc_frankenstrings.frankenstrings import FrankenStrings
import torch torch.backends.cudnn.benchmark = True import torch.nn.functional as F from torch.distributions import Normal, Categorical import os import numpy as np from .ppo import PPO from core.network import Network from core.optimizer import Optimizer class ICM_PPO(PPO): """Intrinsic Curiosity Module (ICM) w...
# -*- encoding: utf-8 -*- from bs4 import BeautifulSoup from enum import Enum class UberSlipType(Enum) : NewMain = 0 OldMain = 1 Rental = 2 class UberSlip: def __init__(self, messageId, title, body) : self.titlemessageId = messageId self.body = body self.title = title self.soup = BeautifulSoup(self.body...
from kivy.clock import Clock from kivy.properties import OptionProperty, ObjectProperty, NumericProperty, \ ReferenceListProperty, BooleanProperty, ListProperty, AliasProperty, \ StringProperty from kivy.config import Config from kivy.metrics import sp from functools import partial from kivy.animation import An...