text stringlengths 1 927k |
|---|
# -*- coding: utf-8 -*-
import os
class Config(object):
DEBUG = True
HOST = '0.0.0.0'
PORT = os.getenv('TESLA_PORT', 8000)
SECRET_KEY = (
'\xc85\x95\x9a\x80\xc1\x93\xd0\xe9\x95\x08\xfb\xbe\x85'
'\xd0\x1aq\xd3\x95\xc9\xad \xc0\x08'
)
#http://docs.timdorr.apiary.io/#reference/aut... |
import asyncio
import sys
import pytest
import yaml
import aiohttp.web
from conftest import TEST_FOLDER
from connexion import AioHttpApp
try:
import ujson as json
except ImportError:
import json
@pytest.fixture
def aiohttp_app(aiohttp_api_spec_dir):
app = AioHttpApp(__name__, port=5001,
... |
import csv
from urllib.parse import quote
import webbrowser
from . import geocoder_googs as geocoder
GOOGLE_STATIC_MAPS_ENDPOINT = (
'https://maps.googleapis.com/maps/api/staticmap?size=1280x720&markers=')
# Compute the max number of markers I can safely add before hitting the Static Map API char limit.
# String... |
lives_visual_dict = {
0: """
___________
| / |
|/ ( )
| /|\\
| / \\
|
""",
1: """
___________
| / |
|/ ( )
... |
from dataclasses import dataclass
from datetime import datetime
import datazimmer as dz
import pandas as pd
from colassigner import ColAssigner, get_all_cols
class NoStops(Exception):
pass
@dataclass
class DaySetup:
work_start: int
work_end: int
home_arrive: int
home_depart: int
class Coordin... |
# coding: utf-8
from __future__ import unicode_literals
from django.http import HttpResponse
from django.utils.encoding import smart_str, smart_bytes
class FileResponse(HttpResponse):
"""
DRF Response to render data as a PDF File.
kwargs:
- pdf (byte array). The PDF file content.
- file_n... |
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'fileshare.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Impo... |
#!/bin/env python
"""
series of integration/unit tests for the pdb api
"""
import pytest
import copy
import unittest
import uuid
import random
import re
import time
import datetime
import json
from twentyc.rpc import (
RestClient,
PermissionDeniedException,
InvalidRequestException,
NotFoundException,
)... |
# Copyright 2019 Intelligent Robotics Lab
#
# 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 channels.routing import route
from channels import include
from products.consumers import ws_connect, ws_message, ws_disconnect
channel_routing = [
route("websocket.connect", ws_connect,
path=r"^/(?P<room_name>[a-zA-Z0-9_]+)/$"),
route("websocket.receive", ws_message,
path=r"^/(?P<roo... |
"""
Created May 08, 2014
@author Stephen
written for Python 2.7
requires: PyVISA, Numpy, numutil
Written using: Anaconda
-Updated as of April 20 2018
Quotation marks were causing errors, specifically in the *IDN? command. Use single quotations, not double.
"""
#Define Class Keithley
class K2602():
#Connnects ... |
from django.shortcuts import render
from listings.models import Listings
from listings import choices
from realtors.models import Realtor
def index(request):
lisitngs = Listings.objects.order_by(
'-is_data'
).filter(is_published=True)[:3]
context = {
'listings': lisitngs,
'sta... |
from fastapi import APIRouter, Form
from fastapi.responses import ORJSONResponse
from Deployment.ConsumerServices.DummyService import DummyService4Task, DummyService1Task, DummyService2Task, \
DummyService3Task
from Utils.DAG import DAG
from Utils.ServiceUtils import wait_and_compose_all_task_result
router = APIR... |
from ctypes.wintypes import *
from wintypes_extended import *
from winapi_error import *
from user32 import *
import ctypes
class ListViewMessage(enum.IntEnum):
FIRST = 0x1000
GETITEMA = FIRST + 5
INSERTITEMA = FIRST + 7
GETNEXTITEM = FIRST + 12
GETITEMTEXTA = FIRST + 45
INSERTITEMW = FIRST +... |
# Copyright 2017-2021 TensorHub, Inc.
#
# 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 writ... |
# -*- coding: utf-8 -*-
"""
test_threaded_cache_property.py
----------------------------------
Tests for `cached-property` module, threaded_cache_property.
"""
from time import sleep
from threading import Thread, Lock
import unittest
from cached_property import threaded_cached_property
class TestCachedProperty(un... |
#!/usr/bin/env python
# coding: utf-8
"""
tests
~~~~~
Provides the tests for opts.
:copyright: 2010 by Daniel Neuhäuser
:license: BSD, see LICENSE for details
"""
import unittest
import sys
from decimal import Decimal
from StringIO import StringIO
from opts import (Node, Option, BooleanOption, In... |
from .configuration import with_credentials
from .configuration import jira_url
from jira import JIRA
from jira.exceptions import JIRAError
import logging
@with_credentials(service='Jira')
def in_review(issue_id, _usr, _pwd):
if _usr is None or _pwd is None:
logging.error('Jira username or password unset.... |
"""
Reader module for CASTEP pdos_bin
Written based on the example `pdos_bin.f90` file in open-source OptaDos code
"""
from enum import Enum, unique
import numpy as np
from scipy.io import FortranFile
@unique
class SpinEnum(Enum):
"""
Enum type for Spin. Only up and down.
Usage: Spin.up, Spin.down.
... |
from hlwtadmin.models import Artist, GigFinderUrl, GigFinder, ConcertAnnouncement, Venue, Location, Organisation, Country, Concert, RelationConcertConcert, RelationConcertOrganisation, RelationConcertArtist, Location
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
de... |
# -----------------------------------------------------------
# Functions to generate JSON files in a desired format
# from the functions inside functions.py
# -----------------------------------------------------------
def question_json_maker(question_id, question, answer, answer_index=1, question_type='MC', difficu... |
# -*- coding: utf-8 -*-
"""
Profile: http://hl7.org/fhir/StructureDefinition/MessageDefinition
Release: R4
Version: 4.0.1
Build ID: 9346c8cc45
Last updated: 2019-11-01T09:29:23.356+11:00
"""
import typing
from pydantic import Field, root_validator
from pydantic.error_wrappers import ErrorWrapper, ValidationError
from ... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1.18.20
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re #... |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import ast
import glob
import re
def list_functions(source_glob):
"""
List all of the funct... |
import inspect
import os
from collections import OrderedDict
from datetime import datetime
from typing import Any, Callable, Type, Generator, Tuple
from warnings import warn
from django.contrib import admin
from django.db import models
from django.utils.translation import gettext_lazy as _
from etc.toolbox import impo... |
from typing import Optional, Union
import logging
import numpy as np
import tensorflow as tf
from .configuration_performer_attention import PerformerAttentionConfig
from .modeling_utils import (
find_pruneable_heads_and_indices,
prune_linear_layer
)
KERNEL_CALLABLES = {
'cosh': lambda x, h: tf.concat((tf... |
# Generated by Django 3.0.4 on 2020-03-12 11:13
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('posts', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='event',
name='channel',
),
mig... |
#!/usr/bin/env python
# pylint: disable=invalid-name
"""The container launcher script that launches DMLC with the right env variable."""
import glob
import sys
import os
import subprocess
def unzip_archives(ar_list, env):
for fname in ar_list:
if not os.path.exists(fname):
continue
if f... |
import argparse
from enum import Enum
from random import random
import re
import input
import debug
import math
import util
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from solve import Premise
def display_start() -> None:
p = argparse.ArgumentParser()
p.add_argument("--file", help="Parse from a fil... |
from django_filters.views import FilterView
from django_tables2.views import SingleTableMixin
from django_tables2 import tables, TemplateColumn
from django.contrib.auth.models import Group
from guardian.mixins import LoginRequiredMixin
from profiles.filters.group_filter import GroupFilter
class GroupTable(tables.Tab... |
"""
Copyright 2020 The OneFlow 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 law or agr... |
"""
You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you need to make up that amount. If that amount of money cannot be made up by any combination of the coins, return -1.
You may assume that you have an infinite number of ea... |
"""Support for monitoring OctoPrint 3D printers."""
import logging
import time
from aiohttp.hdrs import CONTENT_TYPE
import requests
import voluptuous as vol
from homeassistant.components.discovery import SERVICE_OCTOPRINT
from homeassistant.const import (
CONF_API_KEY,
CONF_BINARY_SENSORS,
CONF_HOST,
... |
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
from __future__ import print_function
from builtins import range
import... |
# coding: utf-8
import chainer
import chainer.links as L
# Network definition
class A(chainer.Chain):
def __init__(self):
super(A, self).__init__()
with self.init_scope():
self.l0 = L.Linear(7)
self.l1 = L.Linear(5)
def g(self, y):
return self.l1(y)
def... |
from __future__ import print_function
import readline
import json
import re
from .config.config import read_from_user
from intent_schema import IntentSchema
from argparse import ArgumentParser
def print_description(intent):
print ("<> Enter data for <{intent}> OR Press enter with empty string to move onto next in... |
#读写点云,网格,图片文件
import numpy as np
import open3d as o3d
pcd=o3d.io.read_point_cloud("data/rs1.pcd")
print(pcd) #打印点云数量
#可视化一下
o3d.visualization.draw_geometries([pcd])
#下采样
downpcd = pcd.voxel_down_sample(voxel_size=0.05)
o3d.visualization.draw_geometries([downpcd])
#计算法向量
downpcd.estimate_normals(search_param... |
from django.contrib.gis.db.backends.base.features import BaseSpatialFeatures
from django.db.backends.postgresql.features import (
DatabaseFeatures as Psycopg2DatabaseFeatures,
)
class DatabaseFeatures(BaseSpatialFeatures, Psycopg2DatabaseFeatures):
supports_geography = True
supports_3d_storage = True
... |
import robosoc2d
sim_handle = robosoc2d.build_simpleplayer_simulator([], 4, [], 4)
while robosoc2d.simulator_step_if_playing(sim_handle):
print(robosoc2d.simulator_get_state_string(sim_handle))
print(robosoc2d.simulator_get_state_string(sim_handle))
robosoc2d.simulator_delete_all()
class MyPlayer:
def __init__... |
from rest_framework.serializers import ModelSerializer, StringRelatedField
from v1.addresses.models.addresses import Address
class AddressSerializer(ModelSerializer):
province = StringRelatedField()
district = StringRelatedField()
ward = StringRelatedField()
class Meta:
model = Address
... |
#!/usr/bin/env python2.7
import os
import lib
env = lib.init()
print("\nCopying all project files to staging directory...\n")
lib.call([
"rsync", "--archive", "--delete", "--quiet",
env.project_root + os.sep, # Need trailing / to make rsync not create a subdir
env.staging_path
]) |
#
# This source file is part of the FabSim software toolkit, which is distributed under the BSD 3-Clause license.
# Please refer to LICENSE for detailed information regarding the licensing.
#
# This file contains common routines to transform and modify 2D data files.
import numpy as np
def smooth_data(x,window_len=... |
from unittest import TestCase
import simplejson as json
class TestUnicode(TestCase):
def test_encoding1(self):
encoder = json.JSONEncoder(encoding='utf-8')
u = u'\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}'
s = u.encode('utf-8')
ju = encoder.encode(u)
js = en... |
"""call.py unit tests."""
import logging
import pytest
from pypyr.context import Context
from pypyr.errors import Call
from pypyr.steps.call import run_step
from tests.common.utils import patch_logger
def test_call_step_dict_with_all_args():
"""Dict with all values set."""
with pytest.raises(Call) as err:
... |
"""
WSGI config for asx_data project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
import sys
sys.path.append('/var/www/axs_data/')
sys.path.append('/anaconda3/lib/pytho... |
from Sensors import Sensor
import cv2
class CVSensor(Sensor):
stream = None
def __init__(self, videoSource):
self.stream = cv2.VideoCapture(videoSource)
def __del__(self):
self.stream.release()
def getFrame(self):
if not self.stream.isOpened():
return None
... |
from __future__ import absolute_import
import pickle
import datetime
from django.test import TestCase
from .models import Group, Event, Happening
class PickleabilityTestCase(TestCase):
def assert_pickles(self, qs):
self.assertEqual(list(pickle.loads(pickle.dumps(qs))), list(qs))
def test_related_f... |
# coding: utf-8
"""
IIMMPACT API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 2020-09-14T13:01:14Z
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: ... |
# encoding=utf8
# This is temporary fix to import module from parent folder
# It will be removed when package is published on PyPI
import sys
sys.path.append('../')
# End of fix
import random
import logging
from NiaPy.algorithms.other import MultipleTrajectorySearchV1
from NiaPy.benchmarks.utility import TaskConvPrint... |
import unittest
import json
import time
import grpc
from vald.v1.agent.core import agent_pb2_grpc
from vald.v1.vald import insert_pb2_grpc
from vald.v1.vald import search_pb2_grpc
from vald.v1.vald import update_pb2_grpc
from vald.v1.vald import upsert_pb2_grpc
from vald.v1.vald import remove_pb2_grpc
from vald.v1.val... |
from pkg_resources import DistributionNotFound, get_distribution
try:
__version__ = get_distribution("localtileserver").version
except DistributionNotFound:
# package is not installed
__version__ = None |
# Generated by Django 3.1.4 on 2021-12-19 04:35
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('problem', '0005_auto_20210129_2145'),
]
operations = [
migrations.CreateModel(
... |
import numpy as np
from analyses_utils import read_json_list, subset_voxels_for_batches_of_subjects, average_subset_voxels_with_leave_one_subject_out, get_matrix_with_average_for_each_voxel_with_leave_one_subject_out
# Memory constraints of HPC required subsetting of voxels and participants to eventually obtain featur... |
#!/usr/bin/python
###############################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# #
# Licensed under the Apache License Version 2.0 (the "License"). Y... |
from django.contrib import admin
from .models import Jobs
# Register your models here.
admin.site.register(Jobs) |
import logging
import string
import pytest
import sqlalchemy
from streamsets.testframework.decorators import stub
from streamsets.testframework.markers import category, sdc_min_version
from streamsets.testframework.utils import get_random_string
logger = logging.getLogger(__name__)
pytestmark = [pytest.mark.sdc_m... |
from conding_htm import *
fileuh = "markdown.md"
fichier = "markdown.md"
# The fonction read...just read the file
def readeuh(fileuh):
with open(fileuh , "r") as markdown:
global contents
contents = markdown.readlines()
return contents
# The function say the level of the title
def a_title... |
from __future__ import absolute_import
import abc
import math
import os
import socket
import struct
from future.utils import with_metaclass
from boofuzz.connections import itarget_connection
def _seconds_to_sockopt_format(seconds):
"""Convert floating point seconds value to second/useconds struct used by UNIX ... |
from spoklient.onedrive.base_item import BaseItem
from spoklient.runtime.resource_path_entity import ResourcePathEntity
class DriveItem(BaseItem):
"""The driveItem resource represents a file, folder, or other item stored in a drive. All file system objects in
OneDrive and SharePoint are returned as driveItem ... |
# This file was auto generated; Do not modify, if you value your sanity!
import ctypes
try: # 14
from can_settings import can_settings
from canfd_settings import canfd_settings
from iso9141_keyword2000_settings import iso9141_keyword2000_settings
from s_text_api_settings import s_text_api_settings
... |
import io
import os
from jinja2 import Environment, FileSystemLoader
import sys
name = sys.argv[1]
prog_dir = os.path.abspath(os.path.dirname(__file__))
env = Environment(loader=FileSystemLoader(prog_dir), trim_blocks=True, lstrip_blocks=True)
template = env.get_template('TemplateCreated.java.txt')
output = template... |
import io
import zipfile
from django.core.cache import cache
from django.utils.translation import ugettext as _
from soil import DownloadBase
from corehq.apps.hqmedia.models import (
CommCareAudio,
CommCareImage,
CommCareVideo,
)
class BaseMultimediaStatusCache(object):
upload_type = None
cache... |
################################################################################
# The Neural Network (NN) based Speech Synthesis System
# https://svn.ecdf.ed.ac.uk/repo/inf/dnn_tts/
#
# Centre for Speech Technology Research
# University of Edinburgh, UK
# ... |
from output.models.nist_data.atomic.decimal.schema_instance.nistschema_sv_iv_atomic_decimal_pattern_2_xsd.nistschema_sv_iv_atomic_decimal_pattern_2 import NistschemaSvIvAtomicDecimalPattern2
__all__ = [
"NistschemaSvIvAtomicDecimalPattern2",
] |
# coding:utf-8
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, String, Integer, Float, DateTime
# 创建对象的基类:
Base = declarative_base()
class lianjia_transaction(Base):
# 表的名字:
__tablename__ = 'lianjia_transaction'
# 表的结构:
id = Column(Integer, primary_key=True)
... |
from collections import deque
class Vertex:
def __init__(self,value):
self.value = value
class Edge:
def __init__(self,vertex,weight):
self.vertex = vertex
self.weight = weight
class Queue:
def __init__(self):
self.dq = deque()
def enqueue(self, value):
s... |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
import s... |
from azure.cognitiveservices.vision.face import FaceClient
from msrest.authentication import CognitiveServicesCredentials
from pprint import pprint
import os
# Do not worry about this function, it is for pretty printing the attributes!
def pretty_print(klass, indent=0):
print(' ' * indent + type(klass).__name__ ... |
import os
import unittest
class NamedExpressionInvalidTest(unittest.TestCase):
def test_named_expression_invalid_01(self):
code = """x := 0"""
with self.assertRaisesRegex(SyntaxError, "invalid syntax"):
exec(code, {}, {})
def test_named_expression_invalid_02(self):
code ... |
from . import utils
from . import data_prep
from . import seq2seq
from . import word2vec |
import discord
import modules.nosferatu.globals as globals
class ReactionMessage:
def __init__(self, _cond, _effect, **kwargs):
self.check = kwargs["check"] if "check" in kwargs else lambda r, u: True
self.update_function = kwargs["update"] if "update" in kwargs else None
self.temporary = ... |
from transformers import LongformerTokenizer, EncoderDecoderModel
from .base_single_doc_model import SingleDocSummModel
class LongformerModel(SingleDocSummModel):
# static variables
model_name = "Longformer"
is_extractive = False
is_neural = True
def __init__(self):
super(LongformerModel... |
'''
Training script with ramdom splitting dev set
'''
__author__ = 'Maosen'
import torch
from model import Model, Wrapper
import utils
from utils import Dataset
import argparse
import pickle
import numpy as np
from tqdm import tqdm
import logging
import os
import random
torch.backends.cudnn.deterministic = True
def ... |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for implementations of L{IReactorTCP} and the TCP parts of
L{IReactorSocket}.
"""
from __future__ import division, absolute_import
__metaclass__ = type
import socket, errno
from zope.interface import implementer
from twisted.python.... |
import requests, argparse, os, asyncio, concurrent.futures
from termcolor import colored
from bs4 import BeautifulSoup
def parse_args():
p = argparse.ArgumentParser()
p.add_argument("-d", dest="directory", required=False, help="destination where all images will be saved")
p.add_argument("-u", dest="url", ... |
from smartva.rules import drowning_adult as drowning
from smartva.data.constants import *
VA = Adult
def test_pass():
row = {
VA.DROWNING: YES,
VA.INJURY_DAYS: 0,
}
assert drowning.logic_rule(row) is True
def test_fail_drowning():
row = {
VA.DROWNING: NO,
}
assert ... |
import sys
# get ready to import local modules
# define the path to the modules and append it to the system path
module_path = '//spatialfiles2.bcgov/work/FOR/VIC/HTS/ANA/Workarea/TOOLS/python/PythonLib/Production'
# module_path = 'C:/Data/training_201806/python/lib'
sys.path.append(module_path)
# continue importing ... |
# -*- coding: UTF-8 -*-
import hashlib
import hmac
import string
import datetime
AUTHORIZATION = "authorization"
BCE_PREFIX = "x-bce-"
DEFAULT_ENCODING = 'UTF-8'
# AK/SK Storage Class
class BceCredentials(object):
def __init__(self, access_key_id, secret_access_key):
self.access_key_id = access_key_id
... |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/wearables/boots/shared_boots_s05.iff"
result.attribute_template_id ... |
from mmcv.cnn import build_conv_layer, build_norm_layer
from mmcv.runner import load_checkpoint, force_fp32
from torch import nn as nn
import torch
import numpy as np
from mmdet.models import BACKBONES
from mmdet3d.utils.soft_mask import SoftMask
@BACKBONES.register_module()
class SECOND_RAN(nn.Module):
"""Backbo... |
import random
import string
class ShuffledShiftCipher:
"""
This algorithm uses the Caesar Cipher algorithm but removes the option to
use brute force to decrypt the message.
The passcode is a a random password from the selection buffer of
1. uppercase letters of the English alphabet
2. lowercas... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen
https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.14.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... |
import torch
from mmaction.models import build_recognizer
from ..base import generate_recognizer_demo_inputs, get_recognizer_cfg
def test_tsn():
config = get_recognizer_cfg('tsn/tsn_r50_1x1x3_100e_kinetics400_rgb.py')
config.model['backbone']['pretrained'] = None
recognizer = build_recognizer(config.mod... |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "polynize.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the... |
import socket
from abc import abstractmethod
from io import IOBase
from ipaddress import IPv4Address, IPv6Address
from socket import AddressFamily
from types import TracebackType
from typing import (
Any,
AsyncContextManager,
Callable,
Collection,
Dict,
List,
Mapping,
Optional,
Tuple... |
# Attack the door!
# It will take many hits, so use a "while-true" loop.
while True:
hero.attack("Door") |
#!/usr/bin/env python3
# coding: utf-8
from __future__ import unicode_literals
# Allow direct execution
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
# Various small unit tests
import io
import itertools
import json
import xml.etree.ElementTree
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2021 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" Worktree """
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import prin... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# n(net) o(oil) h(hang) r(rust) 检测模块
import os
import sys
current_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(current_dir)
from mmdet.models import build_detector
import mmcv
import torch
import cv2
import time
import json
from mmcv.runner import load... |
#!/usr/bin/env python3
import re
from html.parser import HTMLParser
import inquirer
import requests
MODUS_KEY = "d6c5855a62cf32a4dadbc2831f0f295f"
HEADERS = {"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"}
# IDs of CONFIG VARIABLES
CONFIG_VARIABLES = [
"f_id_kommune",
"f_id_bezirk",
"f_id_str... |
"""
This file is to cache the classes and super classes of given entities
"""
import os
import json
from util.util_kb import query_complete_classes_of_entity
# file to save
cache_file = 'cache_classes.json'
# read the input entities
ents = list()
cache_ents = json.load(open('cache_ents_T2D_Limaye.json'))
for v in cac... |
#!/usr/bin/python
#
# Copyright (C) Mellanox Technologies Ltd. 2017-. ALL RIGHTS RESERVED.
#
# See file LICENSE for terms.
#
import sys
import subprocess
import os
import re
import commands
from distutils.version import LooseVersion
#expected AM transport selections per given number of eps
mlx4_am = {
2 : ... |
from sys import argv, exit
import csv
import matplotlib.pyplot as plt
import os
def readCSV(file):
with open(file) as csvFile:
csvReader = csv.reader(csvFile, delimiter=',')
data = []
for i, row in enumerate(csvReader):
if(i == 0):
continue
else:
data.append(row)
return data
if __name__ == ... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: deploy_strategy.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.prot... |
#!/usr/bin/env python
"""
@@TR: This code is pretty much unsupported.
MondoReport.py -- Batching module for Python and Cheetah.
Version 2001-Nov-18. Doesn't do much practical yet, but the companion
testMondoReport.py passes all its tests.
-Mike Orr (Iron)
TODO: BatchRecord.prev/next/prev_batches/next_batches/query,... |
from django.conf.urls import include, patterns, url
from django.conf import settings
from django.views.i18n import javascript_catalog
from django.views.decorators.cache import cache_page
from django.views.generic.base import RedirectView
import authority
import badger
from waffle.views import wafflejs
# Note: This m... |
# -*- coding: utf-8 -*-
import click
import logging
from dotenv import find_dotenv, load_dotenv
from src.data.calculate_norm.calculate_norm import calculate_norm
from src.utils.split import Split, ALL_SPLITS, DEV_SPLITS
@click.command()
@click.option('-e', '--example', is_flag=True)
@click.option('-i', '--partition_... |
#!/home/wecode/Desktop/my-gallery/virtual/bin/python
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line() |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
# Copyright (C) 2018 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Model-related exceptions and related logic."""
import re
from logging import getLogger
from sqlalchemy.exc import IntegrityError
logger = getLogger(__name__)
def field_lookup(field_string):
"""Find... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.