text stringlengths 2 999k |
|---|
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'postgresql_project.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
r... |
"""
Input and output specification dictionaries for FreeSurfer's recon_all_ script.
.. _recon_all:
https://surfer.nmr.mgh.harvard.edu/fswiki/recon-all
"""
from django.conf import settings
from django_analyses.models.input.definitions import (BooleanInputDefinition,
... |
import datetime
import unittest
import pytest
from elasticsearch import NotFoundError
class IdxMgmt(unittest.TestCase):
def __init__(self, client, index):
self._client = client
self._index = index if index != '' and index != '*' else 'mockbeat'
def needs_init(self, s):
return s == ''... |
"""
Demonstrate file io using unicode paths and unicode content.
"""
import tempfile
import os
import codecs
import shutil
# Strings for the file content
TEXT_STR = 'Text String: Hello!\n'
UNI_TEXT_STR = u'Unicode String: 女時代'
# Get the current working folder
CURRENT_DIR = os.getcwd()
# Create Unicode directory ... |
# coding=utf-8
from OTLMOW.OEFModel.EMObject import EMObject
# Generated with OEFClassCreator. To modify: extend, do not edit
class ANPR(EMObject):
"""AUTOMATISCHE NUMMERPLAAT HERKENNING"""
typeURI = 'https://lgc.data.wegenenverkeer.be/ns/installatie#ANPR'
label = 'ANPR'
def __init__(self):
... |
"""
Copyright (c) 2018-2019 Vincenzo Palazzo vicenzopalazzodev@gmail.com
Distributed under the Apache License Version 2.0 software license,
see https://www.apache.org/licenses/LICENSE-2.0.txt
"""
import logging
import os
from interface import implements
from .command_interface import ICommand
from persistence.dao_json ... |
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
import time
from machine import SoftI2C, Pin
import micropython_mlx90393
i2c = SoftI2C()
SENSOR = micropython_mlx90393.MLX90393(i2c, gain=micropython_mlx90393.GAIN_1X)
while True:
MX, MY, MZ = SENSOR.magnetic
print(... |
# coding: utf-8
import requests
from bs4 import BeautifulSoup
import re
import json
import os
from xml.etree import ElementTree
import time
import io
import pandas as pd
from gotoeat_map.module import getLatLng, checkRemovedMerchant
def main():
merchantFilePath = os.path.dirname(
os.path.abspath(__file__)... |
import os.path as op
import array
import colorsys
import math
import random
import pynodegl as ngl
from pynodegl_utils.misc import scene
@scene(xsplit=scene.Range(range=[0, 1], unit_base=100),
trilinear=scene.Bool())
def lut3d(cfg, xsplit=.3, trilinear=True):
'''Lookup Table 3D using a Texture3D'''
lev... |
import sys
from concurrency.thread.safety import SafeCounter, UnsafeCounter, eval_counter
MAX_THREADS = 5
INC_LIMIT = 100000
sys.setswitchinterval(0.0005)
def test_thread_unsafety():
unsafe_counter = UnsafeCounter(limit=INC_LIMIT)
result = eval_counter(unsafe_counter, n_threads=MAX_THREADS)
assert result... |
import numpy as np
import torch as th
import os
from dgl.data.utils import *
import spacy
from tqdm import tqdm
nlp = spacy.load('en')
_urls = {
'wmt': 'https://s3.us-east-2.amazonaws.com/dgl.ai/dataset/wmt14bpe_de_en.zip',
'scripts': 'https://s3.us-east-2.amazonaws.com/dgl.ai/dataset/transformer_scripts.zip'... |
"""
@Author: Kumar Nityan Suman
@Date: 2019-06-25 03:01:24
Copyright (c) 2018 The Python Packaging Authority
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 withou... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
@Auther :liuyuqi.gov@msn.cn
@Time :2018/7/9 7:54
@File :cpu_opt.py
'''
import pandas as pd
def getWij():
global machine_resources
# Wij矩阵表示第i个instance实例部署到j主机上
Wij_size = np.zeros((68219, 6000))
Wij = np.zeros_like(Wij_size)
# inst_26195, app_147,... |
import sys
def get_listed(fn):
modules = set()
for line in file(fn).readlines():
modules.add(line.split()[1])
return modules
def get_dependencies(fn):
t = eval(file(fn).read())
modules = set()
depgraph = t['depgraph']
for mod, deps in depgraph.iteritems():
if mod != '__mai... |
import numpy as np
import matplotlib as mpl
from matplotlib.testing.decorators import image_comparison
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import ImageGrid
# The original version of this test relied on mpl_toolkits's slightly different
# colorbar implementation; moving to matplotlib's own co... |
import tempfile
from datetime import datetime, timedelta
from pathlib import Path
from textwrap import dedent
from tests.cli_utils import CliRunner
def test_repo_init() -> None:
"""
This test simply makes sure that you can run `feast apply && feast materialize` on
the repo created by "feast init" without... |
if __name__ == '__main__' and __package__ is None:
import sys
from os import path
sys.path.append(path.dirname(path.dirname(path.dirname(path.abspath(__file__)))))
import mxnet as mx
from utct.MXNet.trainer import Trainer
from common.MXNet.optimizer import Optimizer
from common.train_config import TrainCo... |
#!/usr/bin/env python
#encoding: utf-8
import os
lpath = []
slpath = ""
for osdir in os.walk("plymgf"):
for fich in osdir[2]:
if fich.split('.')[-1] == "py":
lpath.append(osdir[0])
break
for path in lpath:
slpath = slpath+os.path.join(path,"*.py")+" "
lpath = []
for osdi... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import argparse
import os
import ssl
from contextlib import contextmanager
from typing import List, Optional, Tuple
from PIL import Image
from torch.utils.data import DataLoader
from torchvision.datasets.utils import download_url, extract_archive
... |
# To create a validation set
import os
import shutil
import numpy as np
import random
image_dir ="H:/Python Space/Hard_Hat _Detection/images"
label_dir= "H:/Python Space/Hard_Hat _Detection/labels"
destination1 = "/val"
destination2 = "/train"
img_list= []
label_list= []
for file in os.listdir(image_dir):
if o... |
# Copyright 2015 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... |
# Copyright 2019 PerfKitBenchmarker 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 appli... |
import unittest
from plugins.lyrics import lyrics
# TODO: add tests for PyLyricsClone
class Lyrics_Test(unittest.TestCase):
def setUp(self):
self.song_name = "everybody dies"
self.artist_name = "ayreon"
self.complete_info = "everybody dies-ayreon"
self.wrong_info = "everybody die... |
# Generated by Django 3.2.12 on 2022-05-25 22:16
import ckeditor.fields
import django.contrib.gis.db.models.fields
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('inca', '0001_initial'),
]
operations = [
mig... |
"""Vary regularization parameter (lambda) and check against validation set"""
import numpy
import random
import matplotlib.pyplot as plt
import nn
# load training, validatin, and test data
# train: m=50000 images of n=28x28=784 pixels each
# valid: m=10000 images of n=28x28=784 pixels each
# test: m=10000 images of n... |
#!/usr/bin/env python3
import sys
import warnings
import tcod
import g
import states.mainmenu
def main() -> None:
screen_width = 720
screen_height = 480
tileset = tcod.tileset.load_tilesheet(
"data/cp437-14.png", 32, 8, tcod.tileset.CHARMAP_CP437
)
with tcod.context.new_window(
... |
from __future__ import unicode_literals
import vmraid
from vmraid.chat.util import filter_dict, safe_json_loads
from vmraid.sessions import get_geo_ip_country
@vmraid.whitelist(allow_guest = True)
def settings(fields = None):
fields = safe_json_loads(fields)
dsettings = vmraid.get_single('Website Set... |
#!/usr/bin/env python3
import os
import sys
import logging
import argparse
import platform
import subprocess
import glob
import hashlib
os.environ["PYTHONUNBUFFERED"] = "y"
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(ZULIP_PATH)
from scripts.lib.zulip_too... |
from exceptions import GeneratorModelError, ModelError, PowerLineError, PowerNetworkError
from helper_functions import check_method_exists_and_callable, impedance_admittance_wrangler, set_initial_conditions, set_parameter_value, generate_n_colors
from model_components.buses import Bus, PQBus, PVBus
from model_compone... |
from collections import OrderedDict
import re
from dockerfile_parse import DockerfileParser
from dockerfile_parse.constants import COMMENT_INSTRUCTION
# class CheckovDockerFileParser(DockerfileParser)
from checkov.common.comment.enum import COMMENT_REGEX
def parse(filename):
dfp = DockerfileParser(path=filename... |
#!/usr/bin/env python3
# Copyright 2020 Canonical 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 la... |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import serialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import... |
from django.contrib import admin
# Register your models here.
from .models import Image,Category,Location
# Register your models here.
# class ArticleAdmin(admin.ModelAdmin):
# filter_horizontal =('tags',)
admin.site.register(Image)
admin.site.register(Category)
admin.site.register(Location) |
import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
@pytest.mark.parametrize("sort", [True, False])
def test_factorize(index_or_series_obj, sort):
obj = index_or_series_obj
result_codes, result_uniques = obj.factorize(sort=sort)
constructor = pd.Index
if is... |
# Copyright © 2019 Province of British Columbia
#
# 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... |
#!/usr/bin/env python
# script to apply anomaly SMB field to our base SMB
from __future__ import absolute_import, division, print_function, unicode_literals
import netCDF4
import numpy as np
f = netCDF4.Dataset('SMB_NorESM_2.6_1995-2100.nc','r+')
nt = len(f.dimensions['Time'])
smb = f.variables['sfcMassBal']
fbase ... |
from abc import abstractmethod
from typing import TYPE_CHECKING
from thelper.train.base import Trainer
if TYPE_CHECKING:
from typing import AnyStr, Callable, Optional, Type # noqa: F401
import thelper.typedefs # noqa: F401
def make_tester_from_trainer(trainer):
# type: (Type[Trainer]) -> Callable
... |
# -*- coding: utf-8 -*-
import os
import zipfile
import shutil
from project.config import BaseConfig
from project.common.dataPreprocess import getStrTime
from project.common.filePreprocess import writeLog
def zipDir(dirpath,outFullName):
"""
压缩指定文件夹
:param dirpath: 目标文件夹路径
:param outFullName: 压缩文件保存路... |
import os
from setuptools import setup
def readfile(*paths):
"""Build a file path from *paths* and return the contents."""
with open(os.path.join(*paths), 'r') as f:
return f.read()
setup(
name = 'scholarly',
py_modules = ['scholarly'],
version = '0.2.3',
description = 'Simple access t... |
import asyncio
import logging
import sys
from rsocket.extensions.helpers import route, composite, authenticate_simple
from rsocket.extensions.mimetypes import WellKnownMimeTypes
from rsocket.payload import Payload
from rsocket.request_handler import BaseRequestHandler
from rsocket.rsocket_client import RSocketClient
f... |
from flask import Blueprint, render_template, abort
"""
Github Webhook Endpoint
Also see
https://bitbucket.org/atlassianlabs/webhook-listener/src/master/listener.py
"""
github_route = Blueprint('github_route', __name__)
@github_route.route('/github')
def github():
"""Endpoint for receiving github webhooks.... |
# -*- coding: utf-8 -*-
import os
import sys
from datetime import date
from sphinx_scylladb_theme.utils import multiversion_regex_builder
sys.path.insert(0, os.path.abspath(".."))
# -- General configuration ------------------------------------------------
# Build documentation for the following tags and branches
TA... |
# -*- coding: utf-8 -*-
from __future__ import print_function
from collections import OrderedDict
from pylib.odict import odict
from pylib.pyver import *
import pytest
KEYS = ['zero', 'One', 'TwO', 'Three', 'fOUr', 'fivE', 'sIx', 'seven', 'eigHT', 'nInE']
VALUES = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
TEST_DICT = OrderedDic... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2018-12-05 00:40
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrati... |
# Generated by Django 2.1.7 on 2019-02-22 18:11
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('surveys', '0008_questionresponse_contact'),
]
operations = [
migrations.AddField(
model_name='s... |
from datetime import date, timedelta
import io
import os
import json
import shutil
import random
import string
import unittest
from unittest import mock
import tempfile
import responses
from sqlalchemy import Column, Table, Unicode, create_engine
from cumulusci.core.exceptions import BulkDataException, TaskOptionsErr... |
import time
import numpy as np
import torch
from torch.autograd import Variable
from torch.utils.data.sampler import SubsetRandomSampler
from archived.s3.get_object import get_object
from archived.s3 import clear_bucket
from archived.sync import reduce_epoch, delete_expired_merged_epoch
from archived.old_... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `dmriprep` package."""
import pytest
from click.testing import CliRunner
from dmriprep import cli
@pytest.fixture
def response():
"""Sample pytest fixture.
See more at: http://doc.pytest.org/en/latest/fixture.html
"""
# import requests
... |
# Generate from nngen.j2
from __future__ import absolute_import
from __future__ import print_function
import os
import sys
import functools
import math
import argparse
#import yaml
from collections import OrderedDict
# the next line can be removed after installation
sys.path.insert(0, os.path.dirname(os.path.dirnam... |
"""
Django settings for TODO project.
Generated by 'django-admin startproject' using Django 3.1.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from pathlib impo... |
from unittest import mock
import pytest
from django.test import override_settings
from django.urls import reverse
from oauthlib.oauth2.rfc6749.errors import TokenExpiredError
from sso.middleware import AuthenticationMiddleware
@override_settings(LOGIN_URL='/test/login/url/')
@pytest.mark.parametrize(
'path,expe... |
from datetime import time
from pandas.tseries.holiday import Holiday, GoodFriday, EasterMonday, AbstractHolidayCalendar
from pytz import timezone
from .common_holidays import (
new_years_day,
epiphany,
european_labour_day,
ascension_day,
midsummer_eve,
christmas_eve,
christmas,... |
from setuptools import setup, find_packages
classifiers = [
'Development Status :: 4 - Beta',
'Intended Audience :: Education',
'License :: OSI Approved :: MIT License',
"Operating System :: Unix",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
'Programm... |
class Email:
"""A model representing an email.
Attributes:
subject: The subject line of the email.
text: The plain text of the email. Currently, the only allowed HTML
element in here is <br>.
"""
def __init__(self, contents):
"""Creates an email from the contents of... |
__author__ = 'patras'
from domain_exploreEnv import *
from timer import DURATION
from state import state, rv
DURATION.TIME = {
'survey': 5,
'monitor': 5,
'screen': 5,
'sample': 5,
'process': 5,
'fly': 3,
'deposit': 1,
'transferData': 1,
'take': 2,
'put': 2,
'move': 10,
'... |
from __future__ import absolute_import
from tests.test_can_call import *
|
#!/usr/bin/env python
# coding: utf-8
import os
import warnings
import numpy as np
from numpy import random
from pandas.util._decorators import cache_readonly
import pandas.util._test_decorators as td
from pandas.core.dtypes.api import is_list_like
from pandas import DataFrame, Series
import pandas.util.testing as... |
from abc import ABCMeta, abstractmethod
from os import path
from stix_shifter_utils.utils import logger
from stix_shifter_utils.utils.file_helper import read_json
class BaseQueryTranslator(object, metaclass=ABCMeta):
def __init__(self, options, dialect, basepath):
self.options = options
self.dial... |
# Copyright 2021-present Kensho Technologies, LLC.
import logging
import os
import re
import pandas as pd
from kwnlp_preprocessor import argconfig
from kwnlp_preprocessor import utils
logger = logging.getLogger(__name__)
def main(wd_yyyymmdd: str, data_path: str = argconfig.DEFAULT_KWNLP_DATA_PATH) -> None:
... |
import unittest
import checksieve
class TestIndex(unittest.TestCase):
def test_index(self):
sieve = '''
# Implement the Internet-Draft cutoff date check assuming the
# second Received: field specifies when the message first
# entered the local email infrastructure.
require ["date", "re... |
"""agent config table
Revision ID: 571892d95516
Revises: 7d9abd1be32c
Create Date: 2019-02-12 15:56:16.843184
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "571892d95516"
down_revision = "7d9abd1be32c"
branch_labels = None
depends_on = None
def upgrade():
... |
from .models import ARX, ConstantMean, HARX, LS, ZeroMean
|
from dataset.dataset import Im2LatexDataset
import os
import sys
import argparse
import logging
import yaml
import numpy as np
import torch
from torchtext.data import metrics
from munch import Munch
from tqdm.auto import tqdm
import wandb
from Levenshtein import distance
from models import get_model, M... |
# call this script with `python -m evaluation.evaluate_poselines_globalaction`
import os
import numpy as np
import datetime
from tqdm import tqdm
from . import eval_utils
import pickle
import copyreg
import cv2
from .compare_deepfeatures import negative_cosine_dist_flatten, eucl_dist_flatten
from .compare_sift import ... |
# ---------------------------------------------------------------------
# HP.ProCurve.get_version
# ---------------------------------------------------------------------
# Copyright (C) 2007-2021 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
# Python... |
"""Sphinx configuration."""
from datetime import datetime
project = "ViewDOM"
author = "Paul Everitt"
copyright = f"{datetime.now().year}, {author}"
extensions = [
"myst_parser",
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
]
autodoc_typehints = "description"
html_theme = "furo"
myst_enable_extensions = [... |
# -*- coding: utf-8 -*-
import collections
import csv
import sys
import types
from pymongo import MongoClient
if __name__ == '__main__':
prefix = sys.argv[1]
db = MongoClient().aliexpress
store_coll = db['{}store'.format(prefix)]
product_coll = db['{}product'.format(prefix)]
order_coll = db['{... |
'''This program calculates the Chebyshev/Herman orientation parameters
from simulated intensity distribution data.
Code developed by Dr. A. Kaniyoor,
Macromolecular Materials Laboratory,University of Cambridge, Cambridge, UK
2020-2021
Reference Publication: Quantifying Alignment in Carbon Nanotube Yarns and Si... |
import os
import datetime
import binascii
from twisted.internet.defer import inlineCallbacks, returnValue
from flask_restful import fields, marshal
from floranet.models.model import Model
class FileTextStore(Model):
"""File text storage application server interface
This appserver interface saves data re... |
from setuptools import setup, find_packages
import pathlib
VERSION = '0.0.2'
# The directory containing this file
HERE = pathlib.Path(__file__).parent
# The text of the README file
README = (HERE / "README.md").read_text()
# Setting up
setup(
name="autosel",
version=VERSION,
author="Giri",
... |
from .base import PipBaseRecipe
class SphinxContribWebSupportRecipe(PipBaseRecipe):
def __init__(self, *args, **kwargs):
super(SphinxContribWebSupportRecipe, self).__init__(*args, **kwargs)
self.sha256 = '9de47f375baf1ea07cdb3436ff39d7a9' \
'c76042c10a769c52353ec46e4e8fc3b9'
... |
"""This file is provided as a starting template for writing your own unit
tests to run and debug your minimax and alphabeta agents locally. The test
cases used by the project assistant are not public.
"""
import unittest
import isolation
import game_agent
from importlib import reload
class IsolationTest(unittest.... |
"""
Resources for Pyramid traversal.
Root resources are reusable components that can handle things like looking up a
model object in the database, raising :py:exc:`KeyError` if the object doesn't
exist in the database, and checking whether the request has permission to
access the object.
In this app we use combined t... |
#!/usr/bin/env python3
"""Combine logs from multiple bitcoin nodes as well as the test_framework log.
This streams the combined log output to stdout. Use combine_logs.py > outputfile
to write to an outputfile.
If no argument is provided, the most recent test directory will be used."""
import argparse
from collection... |
# Generated by Django 2.1 on 2019-10-08 21:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hcat', '0019_auto_20191008_1351'),
]
operations = [
migrations.CreateModel(
name='PreservationMethod',
fields=[
... |
import logging
from typing import Dict, List, Optional
from goji.consensus.block_record import BlockRecord
from goji.consensus.blockchain_interface import BlockchainInterface
from goji.types.blockchain_format.sized_bytes import bytes32
from goji.types.blockchain_format.sub_epoch_summary import SubEpochSummary
from goj... |
def dev_cors_middleware(get_response):
"""
Adds CORS headers for local testing only to allow the frontend, which is served on
localhost:3000, to access the API, which is served on localhost:8000.
"""
def middleware(request):
response = get_response(request)
if request.META['HTTP_HOS... |
import base64
import collections
import itertools
import logging
import os
import sys
import queue
import random
import requests
import threading
import time
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple
import wandb
from wandb import util
from wandb import env
from ..lib import file_stream_utils... |
"""Module provides generic interface to running Galaxy tools and workflows."""
import json
import os
import sys
import tempfile
import time
import traceback
import bioblend
import requests
from bioblend.util import attach_file
from galaxy.tool_util.client.staging import (
StagingInterace,
)
from galaxy.tool_util.... |
from test.parser.pattern.nodes.base import PatternTestBaseClass
from programy.parser.exceptions import ParserException
from programy.parser.pattern.nodes.that import PatternThatNode
from programy.parser.pattern.nodes.root import PatternRootNode
class PatternThatNodeTests(PatternTestBaseClass):
def test_init(sel... |
# coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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 applicab... |
"""A Jupyter server extension for managing Dask clusters."""
from jupyter_server.utils import url_path_join
from . import config
from .clusterhandler import DaskClusterHandler
from .dashboardhandler import DaskDashboardCheckHandler, DaskDashboardHandler
from ._version import get_versions
__version__ = get_versions... |
'''
dependencies:
linux: wget lsof
'''
import os,subprocess,time,shutil
test_link= 'https://dn3.freedownloadmanager.org/5/5.1-latest/fdm5_x64_setup.exe'
test_git_link='https://github.com/myhub/tr'
def shell_cmd(cmd):
p=subprocess.Popen(cmd,shell=True)
p.wait()
return p.returncode
def chmod(mode,dst):
r... |
import matplotlib; matplotlib.use("Agg")
import torch
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
import glob
import os
import shutil
import time
import sys
import collections
pjoin = os.path.join
class LogPrint():
def __init__(self, file, ExpID, print_to_screen):
... |
import time
import globus_sdk
from globus_cli.login_manager import (
LoginManager,
get_client_login,
internal_auth_client,
is_client_login,
token_storage_adapter,
)
from globus_cli.parsing import command
from globus_cli.termio import formatted_print, print_command_hint
@command(
"show",
... |
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... |
import os
import traceback
from PIL import Image, ImageEnhance, ImageFont, ImageDraw
import time
import sys
from ImageCreator.core.utils import *
from ImageCreator.core import assets_directory
sys.path.append(assets_directory)
try:
from Assets.fonts._fonts import *
except ModuleNotFoundError:
pass
class Cr... |
from config import MONGO_CONNECTION_URL,MONGO_DB_SCHEMA
from pymongo import MongoClient
from anuvaad_auditor.loghandler import log_info, log_exception
from utilities import AppContext
from flask import g
client = MongoClient(MONGO_CONNECTION_URL)
def get_db():
log_info("Establishing connection with mongo", AppCon... |
# simulate helical magnetization in an iron film on Si
# to create simulated data along with the simulation
# from the command line:
# refl1d simulation.py --edit --simulate --noise=1
# where noise=1 corresponds to 1% errorbars
################################################################
# Code originally from Bri... |
# coding=utf-8
# # Copyright 2018 The TF-Agents 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 applicable l... |
# -*- coding: utf8 -*-
from sqlalchemy import Table, MetaData, Column, ForeignKey, Integer, String
from sqlalchemy.orm import mapper
class Style(List):
__mapper_args__ = {
'polymorphic_identity':'style'
}
|
list1=[12,24,35,24,88,120,155]
list1.remove(24)
list1.remove(24)
print(list1)
|
import logging
import os
from pathlib import Path
from typing import Any
from typing import List
from typing import Mapping
def check_args(
path: str,
exclude: List[str],
below: int,
above: int,
verbose: int,
only_fuzzy: bool,
offline: bool,
hide_reserved: bool,
counts: bool,
j... |
from django.shortcuts import render
# Create your views here.
from django.views.generic import CreateView
from .models import MyModel
class MyCreateView(CreateView):
model = MyModel
fields = ["somefile"]
|
__all__ = ["open", "Segy", "StructuredSegy"]
from pathlib import PurePath
from typing import Optional, Union
import urlpath
import tiledb
from .structured import StructuredSegy
from .unstructured import Segy
URI = Union[str, PurePath]
def open(uri: URI, config: Optional[tiledb.Config] = None) -> Segy:
uri = ... |
"""Class to hold all thermostat accessories."""
import logging
from pyhap.const import CATEGORY_THERMOSTAT
from homeassistant.components.climate import (
ATTR_CURRENT_TEMPERATURE, ATTR_MAX_TEMP, ATTR_MIN_TEMP,
ATTR_OPERATION_LIST, ATTR_OPERATION_MODE,
ATTR_TARGET_TEMP_HIGH, ATTR_TARGET_TEMP_LOW,
DEFAU... |
from ..schema.nexusphp import VisitHR
from ..utils.net_utils import NetUtils
class MainClass(VisitHR):
URL = 'https://ccfbits.org/'
SUCCEED_REGEX = '欢迎回到CCFBits'
USER_CLASSES = {
'uploaded': [5497558138880],
'downloaded': [322122547200],
'share_ratio': [2],
'days': [224]
... |
import pandas as pd
import hiquant as hq
class StrategyLongHold( hq.BasicStrategy ):
symbol_max_value = {}
symbol_cost = {}
def __init__(self, fund):
super().__init__(fund, __file__)
self.max_stocks = 10
self.max_weight = 1.0
fund.set_name('耐心持有策略')
def schedule_task(s... |
# -*- coding: utf-8 -*-
"""Top-level package for Async AWS SDK for Python."""
import logging
from aioboto3.session import Session
__author__ = """Terry Cain"""
__email__ = 'terry@terrys-home.co.uk'
__version__ = '0.0.0'
# Set up logging to ``/dev/null`` like a library is supposed to.
# http://docs.python.org/3.3/ho... |
#!/usr/bin/env python
#####################################################################################
#
# Copyright 2022 Quantinuum
#
# 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 htt... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.