text stringlengths 2 999k |
|---|
#from {{appname}}.handlers.base import BaseHandler
from {{appname}}.handlers.powhandler import PowHandler
from {{appname}}.config import myapp
from {{appname}}.models.{{model_type}}.{{handler_name}} import {{handler_model_class_name}} as Model
from {{appname}}.config import myapp, database
from {{appname}}.application ... |
import json
import os
from time import sleep
from quart import abort
import requests
from requests.exceptions import ConnectionError
from src.utils.array_utils import get_nested_value
headers = {
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) "
"AppleWebKit/537.36 (KHTML, like Gecko) "
"Ch... |
# -*- coding:utf-8 -*-
# db.log.aggregate([{$group: {_id: "$time", count: {$sum: 1}}}])
import json
from bson import json_util
from pymongo import MongoClient
conn = MongoClient("localhost", 27017)
db = conn['log_vis']
def get_json():
projects = db.log.aggregate([{"$group" : {"_id" : "$time", "count" : {"$sum" :... |
# coding: utf-8
"""
Ed-Fi Operational Data Store API
The Ed-Fi ODS / API enables applications to read and write education data stored in an Ed-Fi ODS through a secure REST interface. *** > *Note: Consumers of ODS / API information should sanitize all data for display and storage. The ODS / API provides reas... |
# -*- coding: utf-8 -*-
# DO NOT EDIT THIS FILE!
# This file has been autogenerated by dephell <3
# https://github.com/dephell/dephell
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
# built-in
import os.path
readme = ''
here = os.path.abspath(os.path.dirname(__file__... |
from flask_settings import GEOTIFF_FULL_PATH
import sys
import traceback
sys.path.append('../')
import numpy as np
import json
from datetime import timedelta
from functools import update_wrapper
from pextant.EnvironmentalModel import GDALMesh
from pextant.explorers import Astronaut
from pextant.analysis.loadWaypoints... |
#!/usr/bin/env python
#
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import os
from typing import Tuple, Type, TypeVar
from urllib.parse import urlparse
from uuid import uuid4
from azure.keyvault.secrets import KeyVaultSecret
from onefuzztypes.models import SecretAddress, SecretData
from ... |
from django.contrib import admin
from django.urls import path
from django.conf.urls import include
from rest_framework.authtoken.views import obtain_auth_token
urlpatterns = [
path('admin/', admin.site.urls),
path('api/', include('api.urls')),
path('auth/', obtain_auth_token),
]
|
# SPDX-License-Identifier: MIT
# Copyright (C) 2020 The Pybricks Authors
"""
:class:`RFCOMMServer` can be used to communicate with other Bluetooth RFCOMM
devices that don't support the EV3 mailbox protocol.
It is based on the standard library ``socketserver`` module and attempts to
remain a strict subset of that impl... |
from django.contrib import admin
# Register your models here.
from website.core.models import New, Channel, Sugestao
admin.site.register(Channel)
admin.site.register(New)
admin.site.register(Sugestao) |
'''
Utils for utilize RLLAB
'''
import gym
def rllab_env_from_name(env):
if env == 'swimmer':
from rllab.envs.mujoco.swimmer_env import SwimmerEnv
return SwimmerEnv
elif env == 'ant':
from rllab.envs.mujoco.ant_env import AntEnv
return AntEnv
elif env == 'half_cheetah':... |
#!/usr/bin/env python3
import pygame
# Each game controller axis returns a value in the closed interval [-1, 1]. We
# limit the number of decimal places we use with the PRECISION constant. This is
# done for a few reasons: 1) it makes the numbers more human-friendly (easier to
# read) and 2) it reduces the number of... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('openstack', '0011_add_floating_ip_tenant'),
]
operations = [
migrations.AlterField(
model_name='floatingip',
... |
from django.test import TestCase
# Create your tests here.
# from django import forms
|
#!/programas/python3.5/bin/python3
'''
Created on 08/10/2017
@author: ernesto
'''
import sys
import logging
from bisect import bisect_left
from functools import reduce
from operator import mul,truediv,mod
from math import gcd,pow
nivel_log = logging.ERROR
#nivel_log = logging.DEBUG
logger_cagada = None
def calc_b(a,... |
import subprocess, re, os, shutil, sys, time
import os.path as op
from datetime import datetime
COMMAND_W_DT = '{NOW\+(.*)}'
NOW = datetime.now()
class TestFunction():
def run_test(self, func):
for args, expected in self.cases:
result = func(*args)
self.assertEqual(result, expected)
def parse_trace(trac... |
from .dist_utils import *
from .misc import *
from .center_utils import *
from .circle_nms_jit import * |
import argparse
from src.roamers.joy_habitat_roamer import JoyHabitatRoamer
def main():
# parse input arguments
parser = argparse.ArgumentParser()
parser.add_argument("--launch-file-path", default="launch/teleop.launch", type=str)
parser.add_argument(
"--hab-env-node-path", default="src/nodes/... |
# ---------------------------------------- IMPORT HERE ----------------------------------------
from custom_timer import RepeatedTimer
from flask import Flask, request, make_response
import docker, os, re, requests
# ---------------------------------------- CONFIGS ----------------------------------------
timerapp =... |
import json
import requests
from django.contrib.auth import get_user_model
from rest_framework.exceptions import ValidationError
from config.settings.production import secrets
User = get_user_model()
class KakaoBackend:
def authenticate(self, request, access_token):
# def get_access_token(code):
... |
# -*- coding: utf-8 -*-
'''
@Description: code
@Author: MiCi
@Date: 2020-03-07 22:46:46
@LastEditTime: 2020-03-12 10:47:55
@LastEditors: MiCi
'''
import matplotlib.pyplot as plt
import numpy as np
def basic_label_2():
x = np.linspace(-3, 3, 50)
y1 = x*2 + 1
y2 = x**2
# label属性设定 图例名称
plt.plot(x, ... |
# Prerequisites:
# 1. Initialize the SDK
# 2. Login as either a Client or a User
def example_create_achievement():
from accelbyte_py_sdk.api.achievement import admin_create_new_achievement
from accelbyte_py_sdk.api.achievement.models import ModelsAchievementRequest
from accelbyte_py_sdk.api.achievement.mo... |
"""Tests for pytd.py."""
import itertools
import pickle
import textwrap
from pytype.pyi import parser
from pytype.pytd import pytd
from pytype.pytd import visitors
from six.moves import cPickle
import unittest
class TestPytd(unittest.TestCase):
"""Test the simple functionality in pytd.py."""
PYTHON_VERSION = (... |
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
import csv
csv_file = open('reencoded-tweets.csv', 'r', encoding='utf-8')
csv_reader = csv.reader(csv_file, delimiter=';' )
csv_out = open('scored-tweets.csv', 'w', encoding='utf-8', newline='')
csv_writer = csv.writer(csv_out, delimiter=';' )
csv_wri... |
import unittest
from datetime import date
from trompace import make_parameters, StringConstant, _Neo4jDate
class TestMakeParameters(unittest.TestCase):
"""Test the encoding of trompace.mutations.make_parameters"""
def test_make_parameters(self):
"""A regular set of parameters"""
params = {"... |
from behaviors.time_wasting import *
from behaviors.walk import * |
import json
from enum import Enum
import numpy as np
import pandas as pd
import string
from typing import Dict, Any, List, Union, Optional
from mlflow.exceptions import MlflowException
from mlflow.utils.annotations import deprecated
def _pandas_string_type():
try:
return pd.StringDtype()
except Attr... |
# ----------------------------------------------------------------------
# Copyright (c) Microsoft Corporation.
# All rights reserved.
# ----------------------------------------------------------------------
from typing import Optional
import os
import json
import asyncio
from collections import OrderedDict
from cdm... |
from funcserver import Server, BaseHandler, Client
from funcserver import make_handler, tag, mime, raw
|
#!/usr/bin/env python
# -*- noplot -*-
from __future__ import print_function
"""
This provides examples of uses of interactive functions, such as ginput,
waitforbuttonpress and manual clabel placement.
This script must be run interactively using a backend that has a
graphical user interface (for example, using GTKAgg... |
"""
@package mi.instrument.sunburst.sami2_pco2.pco2b.test.test_driver
@file marine-integrations/mi/instrument/sunburst/sami2_pco2/pco2b/driver.py
@author Kevin Stiemke
@brief Test cases for pco2b driver
USAGE:
Make tests verbose and provide stdout
* From the IDK
$ bin/test_driver
$ bin/test_driver -u... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... |
# -*- coding: utf-8 -*-
"""
------ What is this file? ------
This script targets one file:
- geographic_distribution_of_htourism_centers.shp
The script produces a small-multiples scatterplot visualization of htourism center count
per distict.
Returns a small multiples view of two scatterplots related to htou... |
import operator
import pickle
import sys
from contextlib import suppress
from distutils.version import LooseVersion
from textwrap import dedent
import numpy as np
import pandas as pd
import pytest
import xarray as xr
import xarray.ufuncs as xu
from xarray import DataArray, Dataset, Variable
from xarray.core import du... |
from jadi import interface
class Package(object):
def __init__(self, manager):
self.manager = manager
self.id = None
self.name = None
self.version = None
self.description = None
self.is_installed = None
self.is_upgradeable = None
self.installed_versi... |
"""
Re-export of Bazel rules with repository-wide defaults
"""
load("@rules_pkg//:pkg.bzl", "pkg_tar")
load("@build_bazel_rules_nodejs//:index.bzl", _pkg_npm = "pkg_npm")
load("@io_bazel_rules_sass//:defs.bzl", _sass_binary = "sass_binary", _sass_library = "sass_library")
load("@npm//@angular/bazel:index.bzl", _ng_m... |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
# Copyright 2018 The HuggingFace Inc. 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/licen... |
#!/usr/bin/env python3
"""
Copyright 2017 by the contributors
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 appl... |
import json
import logging
import re
import traceback
import altair as alt
import pandas as pd
from great_expectations.core.expectation_configuration import ExpectationConfiguration
from great_expectations.core.expectation_validation_result import (
ExpectationValidationResult,
)
from great_expectations.data_cont... |
import os
import pandas
import csv
dirname = os.path.dirname(__file__)
state_file = os.path.join(dirname, '50_states.csv')
state_coors = pandas.read_csv(state_file)
state='ohio'
state_info = state_coors[state_coors.state.str.lower() == state]
# state_name = state_info.values[0,0].lower()
# state_x = state_info.value... |
#!/usr/bin/python3
import shutil
import os
import base64
from time import sleep
import flask
import requests.exceptions
import blueprint
from flask_cors import CORS
from confhttpproxy import ProxyRouter, ProxyRouterException
from flask import Flask, jsonify
import rest_routes
from lmsrvcore.utilities.migrate import... |
from django.contrib.auth.models import AbstractUser
from django.db import models
from gifcol_app.models import Meme
from gifcol_proj.base_models import TimeStamped
class Account(AbstractUser, TimeStamped):
description = models.TextField(
max_length=250,
verbose_name='Обо мне',
null=True,
... |
from durable.lang import *
with ruleset('replacetoken'):
# antecedent
@when_all(count(1), m.word.imatches(".*today.*"))
def match_today(c):
c.s.replace_str = "today"
c.s.replace_with = datetime.datetime.now().strftime('%d:%m:%Y')
# consequent
print('Hello {0}'.format(c.m.wor... |
import json
from django.shortcuts import get_object_or_404
from django.contrib.auth.decorators import permission_required
from wagtail.wagtailadmin.modal_workflow import render_modal_workflow
from wagtail.wagtailsnippets.views.snippets import get_content_type_from_url_params, get_snippet_type_name
@permission_requ... |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module contains some utility functions and classes that are used in the chemenv package.
"""
__author__ = "David Waroquiers"
__copyright__ = "Copyright 2012, The Materials Project"
__credits__ = "Geo... |
# Generated by Django 2.1.4 on 2019-03-19 20:59
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="A",
fields=[
(
"id",
... |
# Generated by Django 2.0.8 on 2018-09-12 13:04
from django.db import migrations
import wagtail.core.fields
class Migration(migrations.Migration):
dependencies = [
('content', '0041_auto_20180912_1149'),
]
operations = [
migrations.AddField(
model_name='kbrootpage',
... |
#!/usr/bin/python
# 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 in writi... |
from django import forms
from django.core import validators
class RegisterForm(forms.Form):
email = forms.EmailField(min_length=5, max_length=254)
password = forms.CharField(widget=forms.PasswordInput, min_length=8, max_length=254)
password_confirmation = forms.CharField(widget=forms.PasswordInput)
class ... |
# 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=utf8
# Copyright 2018 JDCLOUD.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 the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... |
#!/usr/bin/env python
import rospy
import json
from flexbe_core import EventState, Logger
from sara_msgs.msg import Entity, Entities
import requests
'''
Created on 18.03.2019
@author: Philippe La Madeleine
'''
class CheckMisplacedObjects(EventState):
'''
Keep all improperly placed objects from a list of e... |
import os
import sys
import tqdm
import csv
import shutil
input_dir = sys.argv[1]
output_dir = sys.argv[2]
fileset = set()
with open('files.csv') as file:
input_file = csv.DictReader(file)
for row in input_file:
fileset.add(row['filename'])
for folder in os.listdir(input_dir):
if not os.path.isd... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/... |
import tweepy #https://github.com/tweepy/tweepy
import csv
import json
import os
#Twitter API credentials
config = json.load(open('config.json', 'rb'))
consumer_key = config['consumer_key']
consumer_secret = config['consumer_secret']
access_key = config['access_key']
access_secret = config['access_secret']
# Cargamo... |
import logging
from pypirepo.config import CONFIG
logging.basicConfig(
level=CONFIG['logging']['level'].strip().upper(),
datefmt=CONFIG['logging']['datefmt'].strip(),
format=CONFIG['logging']['format'].strip(),
)
from pypirepo.workflow import *
__all__ = [
'perform_update',
]
|
from rest_framework.pagination import PageNumberPagination
class DefaultPageNumberPagination(PageNumberPagination):
page_size = 5
page_size_query_param = "page_size"
max_page_size = 50
def get_paginated_response(self, data):
response = super().get_paginated_response(data)
response.dat... |
"""Monkey-patch the evaluate_filter_node method of ldap3's MockBaseStrategy.
This function is extracted from ldap3 with a small change in the
`node.tag == MATCH_SUBSTRING` branch. See:
ldap3/strategy/mockBase.py line 822 for ldap3 version 2.3
"""
from __future__ import absolute_import
from __future__ import division
... |
import os
import pytest
from etcetra import EtcdClient, HostPortPair
@pytest.fixture
def etcd_addr():
env_addr = os.environ.get('BACKEND_ETCD_ADDR')
if env_addr is not None:
return HostPortPair.parse(env_addr)
return HostPortPair.parse('localhost:2379')
@pytest.fixture
async def etcd(etcd_addr)... |
def test_import():
# just try to import some packages that use namespace
import google.cloud.language
import azure.storage.blob
import dateutil
def test_xgboost():
import xgboost.training
def test_numpy():
import numpy
import tests._test
|
fruits = ["grapes", "berries"]
my_fruits = ["grapes", "berries"]
fav_fruits = fruits
print(fruits is fav_fruits)
fruits = ["grapes", "berries"]
my_fruits = ["grapes", "berries"]
fav_fruits = fruits
print(fruits is fav_fruits) |
import random
import sre_parse
DEFAULT_MAX_REPEATS = 100
def randre(re_text):
pattern = sre_parse.parse(re_text)
return Generator().gen_pattern(pattern)
class Generator:
def __init__(self, max_repeats=DEFAULT_MAX_REPEATS):
self.groups = {}
self.max_repeats = max_repeats
def gen_pat... |
import uuid
from django.db import models
from django.utils.translation import gettext_lazy as _
class Rating(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False,
help_text=_("ID único seguindo o padrão UUID4."))
note = models.ForeignK... |
import importlib.util
import os
import py_compile
import shutil
import stat
import sys
import tempfile
import unittest
from test import support
class PyCompileTests(unittest.TestCase):
def setUp(self):
self.directory = tempfile.mkdtemp()
self.source_path = os.path.join(self.directory, '_test.py'... |
from ._captured_text import CapturedText # noqa: F401
from ._code_block import CodeBlock # noqa: F401
from ._component import Component, DisplayMode # noqa: F401
from ._composite import Composite # noqa: F401
from ._content_box import ContentBox # noqa: F401
from ._custom_text import CustomText # noqa: F401
from ... |
#####################################################################
# #
# /experiment_queue.py #
# #
# Copyright 2013, Monash Univ... |
import time
import datetime
import json
import redis
from .control import Control
import RPi.GPIO as GPIO
r = redis.Redis(host='127.0.0.1', port=6379)
class ButtonControl(Control):
def __init__(self, pin, name=None, key=None, resistor=None, edge_detection=None, debounce=None, topic=None, redis_conn=None):
super()... |
"""
Imitation Learning
@author: Ehsan
"""
import numpy as np
import pandas as pd
import tensorflow as tf
import os
import general_functions
import network_functions
#%% set parameters
measure_path = r'...\All_measurements_truncated.csv'
image_dir = r'...\images'
weights_path = r'...\model_weights.ckpt'
... |
# -*- coding:utf-8 -*-
"""
flskapp/helper.py
~~~~~~~~~~~~~~
Flask框架帮助方法
"""
import os
from random import randint
import traceback
import urllib2
from sharper.util.string import random_number
from flask import get_flashed_messages, request, jsonify, current_app, logging, session
import sys
from ..lib.error ... |
from milp_mespp.core import extract_info as ext, plot_fun as pf
from milp_sim.risk.src import r_plotfun as rpf
import pickle
from igraph import *
class MyHazard:
"""Define class of Hazard
Class is defined with variables for smoke, but its the same for fire!
Properties:
type: fire (f), smoke (z)
"... |
from ProcessData.Skeleton import Skeleton
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import torch
from typing import Tuple
from HighFrequency.LossType import HighFrequencyLossType
from HighFrequency.DataBase import DataBase
from ProcessData.Utils import *
import Format
... |
#!/usr/bin/python
# encoding: utf-8
#pylint: disable=R0904
""" The annotation test class """
# upconvert.py - A universal hardware design file format converter using
# Format: upverter.com/resources/open-json-format/
# Development: github.com/upverter/schematic-file-converter
#
# Copyright 2011 Upverter, Inc.
#... |
"""
Tests for RunCommand
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
# TODO: include builtin libraries for the appropriate Python
# try:
# import __builtin__
# except ImportError:
# # Python 3
# import builtins as __builtin__
import os
... |
#! /usr/bin/python3
# -*- coding: utf-8 -*-
# check_async_code.py
# A simple script to identify a common error which causes silent failures under
# MicroPython (issue #3241).
# This is where a task is declared with async def and then called as if it were
# a regular function.
# Copyright Peter Hinch 2017
# Issued under... |
"""
This module represents a UNet experiment and contains a class that handles
the experiment lifecycle
"""
import os
import time
import numpy as np
import torch
import torch.optim as optim
import torch.nn.functional as F
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
from ... |
import numpy as np
from deepnet.data.preprocess import Transformations
from deepnet.data.dataloader import data_loader
class BaseDataset:
def __init__(
self, cuda=False, batch_size=1, num_workers=1, path=None,
pad_dim=(0,0), random_crop_dim=(0,0), resize=(0,0),
horizontal_flip=0.0, vertica... |
# Generated by Django 4.0.3 on 2022-03-25 04:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('games', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='gameplayer',
name='is_accepted',
... |
from typing import Union, TextIO, Optional, List, BinaryIO
import numpy as np
from pathlib import Path
from .frame import DataFrame
from .series import Series
from .lazy import LazyFrame
import pyarrow as pa
import pyarrow.parquet
import pyarrow.csv
import pyarrow.compute
import builtins
import urllib.request
import io... |
# 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... |
for:
pass
|
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2020 junyi <junyi@Junix>
#
# Distributed under terms of the MIT license.
"""
rename
"""
import re
import os
os.chdir(r'~/Desktop/rename_file')
old_names = os.listdir(os.getcwd())
###################################
def file_rename(text... |
from math import pi
import numpy as np
from numpy.linalg import norm, pinv
import pinocchio as se3
from pinocchio.utils import cross, zero, rotate, eye
from display import Display
class Visual(object):
'''
Class representing one 3D mesh of the robot, to be attached to a joint. The class contains:
* the ... |
from dataclasses import dataclass, field
from enum import IntEnum, Enum, auto
from typing import List, Iterator
class AX25StateType(Enum):
Disconnected = auto()
AwaitingConnection = auto()
Connected = auto()
AwaitingRelease = auto()
TimerRecovery = auto()
def __repr__(self):
return se... |
"""
Macro handling passes
Macros are expanded on block-by-block
"""
from __future__ import absolute_import, print_function, division
from numba import ir
class MacroError(Exception):
'''
An exception thrown during macro expansion
'''
pass
def expand_macros(blocks):
'''
Performs macro expans... |
#!/usr/bin/env python
import os
import tempfile
import shutil
import unittest
import commands
from ignition import ProjectCreator
from ignition import common
from ignition.django import DjangoCreator
from ignition.flask import FlaskCreator
from random import Random
import string
class ProjectCreatorTestCase(unittest.T... |
#!/usr/bin/python
# Copyright (c) 2015-2020 Avere Systems, Inc. All Rights Reserved.
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE in the project root for license information.
import unittest
import time
import logging
import random
import uuid
import vFXT.s... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'mainwindow.ui'
#
# Created by: PyQt5 UI code generator 5.12.3
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_mainWindow(object):
def setupUi(self, mainWindow):
mai... |
"""Const file for the BMW Connected Drive integration."""
from homeassistant.const import (
LENGTH_KILOMETERS,
LENGTH_MILES,
VOLUME_GALLONS,
VOLUME_LITERS,
)
ATTRIBUTION = "Data provided by BMW Connected Drive"
ATTR_DIRECTION = "direction"
CONF_ALLOWED_REGIONS = ["china", "north_america", "rest_of_wo... |
import unittest
from mock import Mock
from docker.errors import APIError
from compose import legacy
from compose.project import Project
from .testcases import DockerClientTestCase
class UtilitiesTestCase(unittest.TestCase):
def test_has_container(self):
self.assertTrue(
legacy.has_container(... |
import logging
import os
import sys
from dataclasses import dataclass, field
from pathlib import Path
from typing import Dict, List, Optional
from transformers import HfArgumentParser, TrainingArguments
from utils.file import read_yaml
logger = logging.getLogger(__name__)
logging.basicConfig(
format="%(asctime)s... |
import logging
from wsgiref.util import FileWrapper
from braces.views import CsrfExemptMixin
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.urls import reverse
from django.db.models import Q
from django.http import (
Http404, HttpResponse, HttpResponseBadRequest,... |
# Generated by Django 3.2.10 on 2021-12-11 07:21
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='user',
... |
from django.urls import path, re_path
from . import views
app_name = 'accounts'
urlpatterns = [
path('signup/', views.SignUp.as_view(), name='signup'),
re_path(r'^activate/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9a-z-]+)/$', views.activate, name='activate'),
path('login/', views.Login.as_view(), name='lo... |
# Copyright 2015 The Chromium 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 os
import sys
CATAPULT_PATH = os.path.dirname(os.path.dirname(os.path.dirname(
os.path.abspath(__file__))))
CATAPULT_THIRD_PARTY_PATH = os.path.... |
# 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 in writing, software
# d... |
# 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 use ... |
"""JMESPath text terminal."""
import os
import sys
import json
import argparse
import urwid
import jmespath
import pygments.lexers
import collections
__version__ = '0.2.2'
SAMPLE_JSON = {
'a': 'foo',
'b': 2,
'c': {
'd': 'baz',
'e': [1, 2, 3]
},
"d": True,
"e": None,
"f":... |
"""
The MIT License (MIT)
Copyright (c) 2015-2021 Rapptz
Copyright (c) 2021-present Disnake Development
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 limi... |
import torch
import itertools
from util.image_pool import ImagePool
from .base_model import BaseModel
from . import networks
from torch.autograd import Variable
import numpy as np
from .modules import loss
from util.util import gaussian
class CycleGANSemanticModel(BaseModel):
#def name(self):
# return 'Cycl... |
from telegram.error import BadRequest
def badrequest(update, context, exception: BadRequest):
pass
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.