text stringlengths 2 999k |
|---|
#FLM: Export selected glyphs to UFO
"""
Dump the selected glyph to a .glif as part of a UFO.
It saves the .glif through a GlyphSet and updates the contents.plist.
EvB 08
"""
from robofab.glifLib import GlyphSet
from robofab.world import CurrentFont, CurrentGlyph
from robofab.interface.all.dialogs ... |
# -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: 57
Author : anglemiku
Eamil : anglemiku.v@gmail.com
date: 2020/1/9
-------------------------------------------------
Change Activity: 2020/1/9:
---------------------------------... |
"""Class to apply Shift Registration to functional data"""
# Pablo Marcos Manchón
# pablo.marcosm@protonmail.com
from scipy.integrate import simps
from sklearn.utils.validation import check_is_fitted
import numpy as np
from ... import FData, FDataGrid
from ..._utils import constants, check_is_univariate
from .base ... |
#!/usr/bin/env python
#
# Electrum - lightweight DECENOMY Standard Wallet
# Copyright (C) 2012 thomasv@gitorious
#
# 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,
# inclu... |
# Copyright (c) 2020 PaddlePaddle 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 applic... |
#!/usr/bin/python
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the directory tha... |
# built-in
import json
import pickle
from pathlib import Path
from time import time
# app
from .config import config
from .utils import cached_property
class BaseCache:
ext = ''
def __init__(self, *keys, ttl: int = -1):
self.path = Path(config['cache']['path'], *keys)
if self.ext:
... |
# Copyright 2018 Rob Moorman
#
# 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, ... |
# Generated by Django 4.0 on 2021-12-10 13:21
import django.contrib.auth.models
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
('tourism', '0003_remove_comment_beginn... |
import os
import re
import subprocess
from pathlib import Path
from setuptools import setup # type: ignore
with open('README.md') as f:
long_description = f.read()
version_re = re.compile('^Version: (.+)$', re.M)
package_name = 'rest-framework-smoke'
def get_version():
"""
Reads version from git statu... |
def set_profile_ST5909L3008(lib, id):
worst_result = Result.Ok
result = Result.Ok
feedback_settings = feedback_settings_t()
feedback_settings.IPS = 2000
class FeedbackType_:
FEEDBACK_ENCODER_MEDIATED = 6
FEEDBACK_NONE = 5
FEEDBACK_EMF = 4
FEEDBACK_ENCODER = 1
fe... |
from rest_framework import viewsets
from .serializers import (
CollectionSerializer, TextSerializer, SourceSerializer,
UriSerializer, TempEntityClassSerializer)
from .models import Collection, Text, Source, Uri, TempEntityClass
class CollectionViewSet(viewsets.ModelViewSet):
queryset = Collection.objects.... |
pessoas = {'nome': 'jonatan', 'sexo': 'M', 'idade': 39}
print('---'*15)
print(pessoas)
print(pessoas['idade'])
print(f'O {pessoas["nome"]} tem {pessoas["idade"]} anos')
print(pessoas.keys())
print(pessoas.values())
print(pessoas.items())
print('---'*15)
for k in pessoas.keys():
print(k)
print('---'*15)
for v in ... |
# -*- coding: utf-8 -*-
import sys
import os
#for mupif&&micress import
mupif_dir=os.path.abspath(os.path.join(os.getcwd(), "../"))
micress_api=os.getcwd()
sys.path.append(mupif_dir)
sys.path.append(micress_api)
from mupif import *
import Physics.PhysicalQuantities as PQ
from shutil import copyfile
# MICRESS inter... |
# -*- coding: utf-8 -*-
import os
import sys
from scrapy.cmdline import execute
os.chdir(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
execute(['scrapy', 'crawl', 'auto_login']) |
# Copyright (C) 2022, Arijit Das.
# Code adapted from doctr and huggingface
# This program is licensed under the Apache License version 2.
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.
import csv
import os
from pathlib import Path
from typing import Any, Dict, List,... |
import unittest
from graphs.p4_8 import Node
from graphs.p4_8 import get_common_ancestor
class TestGetCommonAncestor(unittest.TestCase):
def setUp(self) -> None:
"""
Binary Tree
5
/ \\
3 8
/ \\ | ... |
# coding=utf-8
from OTLMOW.OTLModel.Datatypes.KeuzelijstField import KeuzelijstField
from OTLMOW.OTLModel.Datatypes.KeuzelijstWaarde import KeuzelijstWaarde
# Generated with OTLEnumerationCreator. To modify: extend, do not edit
class KlBeheerGrazigeVegetatie(KeuzelijstField):
"""De verschillende soorten van behee... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Tool to export shot files to be used in the shot builder tool
"""
from __future__ import print_function, division, absolute_import
__author__ = "Tomas Poveda"
__license__ = "MIT"
__maintainer__ = "Tomas Poveda"
__email__ = "tpovedatd@gmail.com"
import os
import sys... |
from .database import Database
from .column import Int, Str, EnumCol
from .constraints import AutoNum, PrimaryKey, NeverEmpty, CheckIf
from .keywords import *
__all__ = [
"Database",
"Int",
"Str",
"EnumCol",
"AutoNum",
"PrimaryKey",
"NeverEmpty",
"CheckIf",
"ASCENDING",
"ASC"... |
from datetime import datetime
def strip_parentheses(date): # deleting parentheses
return date.split('(')[0].strip()
def convert_date(date):
if isinstance(date, list): # checking if there are double or more dates
date = date[0]
date_str = strip_parentheses(date)
fmts = ['%B %d, %Y', '%d %... |
"""
A simple example of using the wmr_cba CBA4 python library.
For more information about the wmr_cba package, drivers and documentation, see
the GitHub repo at:
https://github.com/da66en/python_wmr_cba
Will connect to first available CBA4, draw 150mA for 10 seconds and then stop.
While it is drawing curren... |
import numpy as np
from keras.preprocessing import sequence
# For getting English word vectors
from get_word_vectors import get_word_vector, get_sentence_vectors
import codecs
class DataHandler():
"""
Class for handling all data processing and preparing training/testing data"""
def __init__(self, datapath):
# D... |
import argparse
import logging
import os
import sys
import zipfile
from . import __version__ as current_version
from .lib import extent
from .lib import helpfunctions as hf
logging.basicConfig(level=logging.WARNING)
logger = logging.getLogger("geoextent")
help_description = '''
geoextent is a Python library for extra... |
#!/usr/bin/env python3
import numpy as np
import multiprocessing as mp
import sys
import os
import petar
import getopt
if __name__ == '__main__':
filename_prefix='data'
average_mode='sphere'
read_flag=False
ftid_file_flag=False
n_cpu=0
write_option='w'
def usage():
print("A tool ... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2022-02-01 23:18
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='User'... |
"""invoicegen_backend URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
... |
from functools import wraps
def singleton(cls):
"""装饰器,被装饰的类为单例模式"""
instances = {}
@wraps(cls)
def getinstance(*args, **kw):
if cls not in instances:
instances[cls] = cls(*args, **kw)
return instances[cls]
return getinstance
|
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.preprocessing import LabelEncoder
import re
from sklearn.feature_extraction import DictVectorizer
from sklearn.model_selection import train_test_split
import xgboost as xgb
from sklearn.cluster import MiniBatchKMeans
def process_am... |
import shutil
from glob import glob
from pathlib import Path
import pytest
_HERE = Path(__file__).parent
@pytest.fixture()
def test_data_folder():
return _HERE / 'data'
@pytest.fixture(scope='session')
def product_dir(tmp_path_factory):
prod = tmp_path_factory.mktemp('S1A_IW_20150621T120220_DVP_RTC10_G_sa... |
#!/usr/bin/env python
"""
parse-fmt - A class to parse FMT files generated by CASTEP (densities,
potentials, etc.)
"""
# Python 2-to-3 compatibility code
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# The next line is removed because it causes issues in i... |
import argparse
import json
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import keras
from keras import layers
from keras import backend as K
import tensorflow as tf
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import PCA
from sklearn.manifo... |
"""
These test starts the application but not with the main function,
so the qtbot is usable to inspect gui objects.
"""
import os
import tempfile
from pathlib import Path
from test.conftest import TEST_REF
import conan_app_launcher.app as app
from conan_app_launcher.settings import *
from conan_app_launcher.settings.... |
from django.test import TestCase
from users.models import User
class UserIsActiveTest(TestCase):
def setUp(self):
self.valid_email = "test@example.com"
self.valid_password = "test_password"
self.user = User.objects.create_user(
email = self.valid_email,
password = s... |
from __future__ import print_function
from __future__ import division
# ------------------------------------------------------------------------------------------------
# Copyright (c) 2016 Microsoft Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
# ass... |
import unittest
import os
import tweepy
import datetime
import seadaIngest
from seadaIngest import config_twitter_api
from twitterAccount import TwitterAccount
class TestConfigTwitter(unittest.TestCase):
def setUp(self):
self.consumer_key = os.environ['CONSUMER_KEY']
self.consumer_secret = os.en... |
# Copyright 2012 OpenStack Foundation
#
# 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 a... |
# -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# 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 above copyright notice, this
# ... |
#--------------------Name Errors -------------------#
################### Example 1 ########################
#NameError: name 'message' is not defined
#Cause: the variable "message" was never created before this point
print "I have a message for all my classmates!"
print "My message is that IIPP is an awesome ... |
# 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 may ... |
#
# Copyright 2016 The BigDL 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 law or agreed to in ... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2019-01-11 07:12
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('oauth', '0001_initial'),
]
operations = [
migrations.AlterField(
... |
# vim: set fileencoding=utf-8:
#
# GPIO Zero: a library for controlling the Raspberry Pi's GPIO pins
#
# Copyright (c) 2016-2021 Dave Jones <dave@waveform.org.uk>
# Copyright (c) 2019 Ben Nuttall <ben@bennuttall.com>
# Copyright (c) 2018 Rick Ansell <rick@nbinvincible.org.uk>
# Copyright (c) 2016 Andrew Scheller <githu... |
import asyncio
import websockets
from django.conf import settings
from django.core.management.base import BaseCommand
from django_private_chat import channels, handlers
from django_private_chat.utils import logger
class Command(BaseCommand):
help = 'Starts message center chat engine'
def handle(self, *args, ... |
#
# Copyright (c) 2009-2021 fem2ufo
#
# Python stdlib imports
from __future__ import annotations
#from typing import NamedTuple
#import pickle
# package imports
#from steelpy.trave3D.preprocessor.assemble import Rmatrix
#from steelpy.trave3D.processor.operations import zeros, trns_3Dv, zeros_vector
#from steelpy.proc... |
from nose.tools import assert_equal, assert_raises
class TestSolution(object):
def test_find_busiest_period(self):
solution = Solution()
assert_raises(TypeError, solution.find_busiest_period, None)
assert_equal(solution.find_busiest_period([]), None)
data = [
Data(3, 2... |
import pathlib
from shutil import copyfile
import os
import sys
import io
import lxml.etree as ET
from sql_gen.app_project import AppProject
from sql_gen.emproject import EMProject
from sql_gen.ui.utils import select_string_noprompt
PurePosixPath = pathlib.PurePosixPath
def parse_doctype(xml):
lines = xml.sp... |
####
# commands.py:
#
# This file provides the API for the commands Gds interface for use with the Gds Flask server. This
# API should provide the following HTML API behaviors:
#
# GET /commands: list all commandsi history available to the GUI. Note: this also prvides a full
# command listing.
# PUT /... |
"""An interface for extending pandas with custom arrays.
.. warning::
This is an experimental API and subject to breaking changes
without warning.
"""
import numpy as np
import operator
from pandas.errors import AbstractMethodError
from pandas.compat.numpy import function as nv
from pandas.compat import set_f... |
# -*- coding: utf-8 -*-
{
'name': "My Library", # Module title
'summary': "Manage books easily", # Module subtitle phrase
'description': """
Manage Library
==============
Description related to library.
""", # Supports reStructuredText(RST) format
'author': "Parth Gajjar",
'website': "http://... |
from heltour.tournament.models import *
from heltour.tournament import lichessapi, slackapi, pairinggen, \
alternates_manager, signals, uptime
from heltour.celery import app
from celery.utils.log import get_task_logger
from datetime import datetime
from django.core.cache import cache
from heltour import settings
im... |
# coding=utf-8
from __future__ import absolute_import, unicode_literals
from django import apps
class AppConfig(apps.AppConfig):
label = 'googleanalytics'
name = 'thecut.googleanalytics'
|
import argparse
import logging
import os
from pathlib import Path
import pandas as pd
ARGS = None
logging.basicConfig(level=logging.INFO)
log = logging.getLogger(__name__)
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
CLASSIFY_COMMANDS_PATH = os.path.join(str(Path.home()), 'classify-commands.txt')
CSV_H... |
# Names that are used as options when running the plotter.
from shared.configuration_constants import OVERSHOOT_DIRECTION_IN, OVERSHOOT_DIRECTION_OUT, CONVECTIVE_ZONE_CORE, CONVECTIVE_ZONE_ENVELOPE, CONVECTIVE_ZONE_SHELL
variables_for_plotting = {
'j': {
'description': 'Mesh point',
},
'm_msun': {
... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
@author: Elena Colomo
@contact: ecolomo@esa.int
European Space Astronomy Centre (ESAC)
European Space Agency (ESA)
Created on 3 Sept 2019
"""
import re
from ...utils.tap.core import TapPlus
from ...query import BaseQuery
import shutil
import cgi
f... |
import os
import time
import tensorflow as tf
import numpy as np
from numpy import sin, cos
NO_REDUCTION = tf.losses.Reduction.NONE
class Trainer():
def __init__(self, sess, config, real_images,
g_builder, d_builder, cp_builder, zp_builder,
coord_handler, patch_handler):
... |
import numpy as np
from prob import VRPDGLDataset
from dgl.dataloading import GraphDataLoader
import torch
from attention_model.attention_utils.functions import load_routing_agent
from solver.absolver import ABSolver
class amVRP:
def __init__(self, size=20, method="greedy"):
"""
args:
... |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
import abc
class My_ABC_Class(metaclass=abc.ABCMeta):
@abc.abstractmethod
def set_val(self, val):
return
@abc.abstractmethod
def get_val(self):
return
class MyClass(My_ABC_Class):
def set_val(self, input):
self.val = input
def hello(self):
print("\nCalli... |
"""
Django settings for BFPWebApp2 project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
from django.core.urlresolvers import reverse_lazy
from os.path import di... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('auth', '0006_require_contenttypes_0002'),... |
# noinspection SpellCheckingInspection
"""tools URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('',... |
# Copyright 2015 NEC Corporation. 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 b... |
# parseActions.py
#
# A sample program a parser to match a date string of the form "YYYY/MM/DD",
# and return it as a datetime, or raise an exception if not a valid date.
#
# Copyright 2012, Paul T. McGuire
#
from datetime import datetime
import pyparsing as pp
from pyparsing import pyparsing_common as ppc
... |
# flake8: noqa
from demoparser.entities.base import BaseEntity
from demoparser.entities.game_rules import GameRules
from demoparser.entities.player import Player
from demoparser.entities.team import Team
from demoparser.entities.weapon import Weapon
from demoparser.entities.entity_list import EntityList
|
import FWCore.ParameterSet.Config as cms
process = cms.Process("CompareGeometryTest")
process.source = cms.Source("EmptySource")
process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(1)
)
process.MessageLogger = cms.Service(
"MessageLogger",
statistics = cms.untracked.vstring('c... |
import os
import sys
from clint.textui import puts, colored
import conf
def display_intro():
print_message('''
__ ____ ____ ___ _____ __ ___ _______ __
/ / / ___|| _ \\ / _ \\_ _| \\ \\ |_ _| ___\\ \\ / /
| | \\___ \\| |_) | | | || | | | | || |_ \\ V /
| | ___) | __/| |_| || | | | | ... |
#!/usr/bin/env python
#
# Copyright (c) 2014 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... |
# interfaces to other interpreters
from __future__ import absolute_import
from sage.misc.lazy_import import lazy_import
from .frobby import frobby
from .four_ti_2 import four_ti_2
from .axiom import Axiom, axiom
from .fricas import FriCAS, fricas
from .gap import gap, gap_reset_workspace, set_gap_memory_pool_size, G... |
"""Test cases for IR generation."""
import os.path
from mypy.test.config import test_temp_dir
from mypy.test.data import DataDrivenTestCase
from mypy.errors import CompileError
from mypyc.common import TOP_LEVEL_NAME
from mypyc.ops import format_func
from mypyc.test.testutil import (
ICODE_GEN_BUILTINS, use_cust... |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... |
# 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 --------------------------------------------------------------
# If ex... |
import FWCore.ParameterSet.Config as cms
from Configuration.EventContent.EventContent_cff import *
from JetMETAnalysis.METSkims.sumET_EventContent_cff import *
RECOSIMSumETEventContent = cms.PSet(
outputCommands = cms.untracked.vstring()
)
RECOSIMSumETEventContent.outputCommands.extend(RECOSIMEventContent.outputCo... |
import os
class ConfigurationService:
"""Class used to read and write application service configuration"""
""" Below the existing configuration """
"""{ "name":"APP_VERSION", "value":"${APP_VERSION}"}, """
"""{ "name":"PORT_HTTP", "value":"${APP_PORT}"},"""
"""{ "name":"WEBSITES_PORT", "value":"$... |
import datetime
import argparse
import imutils
import time
import cv2
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
cap = cv2.VideoCapture(0)
while True:
ret, img = cap.read()
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
faces = face_cascade.detectMultiScale(gray, 1.3, 5)
... |
# 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, overload
from ... import _utilities
fro... |
import os
import io
import json
from asyncio import Semaphore
from itertools import product
import related
from . import Method, Namespace, Profile, get_logger, utils
class Iterator(Namespace):
def __init__(self, *args, **kwargs):
if len(args) == 1 and isinstance(args[0], str) and not kwargs:
... |
# coding: utf-8
# ----------------------------------------------------------------------------
# <copyright company="Aspose" file="test_folder_api.py">
# Copyright (c) 2019 Aspose Pty Ltd. All rights reserved.
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining ... |
import argparse
import joblib
import os
import numpy as np
from scipy.sparse import save_npz, load_npz
import yaml
from src.ranking.model import LambdaMART
def train_model(config_path):
config = yaml.safe_load(open(config_path))
n_trees = config['train']['max_depth']
max_depth = config['train']['max... |
"""
Built-in plug-ins.
"""
from . import enclosure_dedupe
from . import entry_dedupe
from . import mark_as_read
from . import ua_fallback
_PLUGINS = {
'reader.enclosure_dedupe': enclosure_dedupe.init_reader,
'reader.entry_dedupe': entry_dedupe.init_reader,
'reader.mark_as_read': mark_as_read.init_reader,... |
import pyshader as ps
import numpy as np
import kp
def test_logistic_regression():
@ps.python2shader
def compute_shader(
index = ("input", "GlobalInvocationId", ps.ivec3),
x_i = ("buffer", 0, ps.Array(ps.f32)),
x_j = ("buffer", 1, ps.Array(ps.f32)),
y ... |
"""
Module: 'errno' on pyboard 1.13.0-95
"""
# MCU: (sysname='pyboard', nodename='pyboard', release='1.13.0', version='v1.13-95-g0fff2e03f on 2020-10-03', machine='PYBv1.1 with STM32F405RG')
# Stubber: 1.3.4
EACCES = 13
EADDRINUSE = 98
EAGAIN = 11
EALREADY = 114
EBADF = 9
ECONNABORTED = 103
ECONNREFUSED = 111
ECONNRESE... |
"""Added watchlist table
Revision ID: 573029c13b1a
Revises: 67e97402fd6b
Create Date: 2021-01-12 01:01:34.967150
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '573029c13b1a'
down_revision = '67e97402fd6b'
branch_labels = None
depends_on = None
def upgrade()... |
# 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 ... |
# coding:utf-8
import os
import logging
from logging import handlers
os.environ['NLS_LANG'] = 'SIMPLIFIED CHINESE_CHINA.UTF8'
class Logger(object):
# https://www.cnblogs.com/nancyzhu/p/8551506.html
# 日志级别关系映射
level_relations = {
'debug': logging.DEBUG,
'info': logging.INFO,
'warni... |
import os, sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import unittest
import mock
from datetime import datetime, timedelta, timezone
from mock import call
from rules import nvidia_smi_latency_rule
from rules.nvidia_smi_latency_rule import NvidiaSmiLatencyRule
from utils import k8s... |
import io
import os
import re
from setuptools import find_packages, setup
VERSION_RE = re.compile(r"__version__\s*=\s*\"(.*?)\"")
HERE = os.path.abspath(os.path.dirname(__file__))
def read(*args):
"""Reads complete file contents."""
return io.open(os.path.join(HERE, *args), encoding="utf-8").read()
def g... |
# 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... |
from molsysmt._private.digestion import digest_item as _digest_item
from molsysmt._private.digestion import digest_structure_indices as _digest_structure_indices
from molsysmt._private.digestion import digest_box as _digest_box
from molsysmt import puw as _puw
## System
def set_box_to_system(item, structure_indices='... |
from pydpm._sampler import Basic_Sampler
import numpy as np
def debug_sampler_and_plot():
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import scipy.stats as stats
from collections import Counter
sampler = Basic_Sampler('gpu')
# gamma
output... |
import __init__
import torch
import torch.optim as optim
import statistics
from dataset import OGBNDataset
from model import DeeperGCN
from args import ArgsInit
import time
import numpy as np
from ogb.nodeproppred import Evaluator
from utils.ckpt_util import save_ckpt
from utils.data_util import intersection, process_i... |
import re, sys
from stackexchange.core import *
LaterClass = lambda name: LaterClassIn(name, sys.modules[__name__])
#### Revisions #
class RevisionType(Enumeration):
SingleUser = 'single_user'
VoteBased = 'vote_based'
class PostRevision(JSONModel):
transfer = ('body', 'comment', 'is_question', 'is_rollb... |
##############################################################################
#
# Copyright (c) 2007 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... |
from django.db import models
# Create your models here.
class StoreData(models.Model):
event = models.CharField(max_length=100)
uiud = models.CharField(max_length=100)
starttime = models.CharField(max_length=100)
topic = models.CharField(max_length=500)
email = models.CharField(max_length=100)
... |
import pytest
from tests.resources.MutationGenerator import MutationGenerator
class TestCreateStrand:
# TODO: Break out creating strands as superuser vs regular user after v0.3
@pytest.mark.django_db
def test_unauthenticated(self, client, strand_factory, user_factory, team_factory):
saver = user... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from datetime import datetime
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
default_args = {'owner': 'afroot04'}
dag = DAG('sync_kd_event',
default_args=default_args,
schedule_interval='*/30 * * * *',
catchup... |
# -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2020: TelelBirds
#
#
#########################################################################
from django.contrib import admin
from apps.chicks.models import Chicks,Mortality,ChicksSold,ChicksAvailable
... |
#!/usr/bin/env python2.7
# lt3.py -- HiLink network mode switcher
#
# Copyright (C) 2016 Damian Ziemba
#
# This software may be modified and distributed under the terms
# of the MIT license. See the LICENSE file for details.
#
import argparse
import BeautifulSoup
import requests
BASE_URL = "http://192.168.8.1/api/"... |
# coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 9
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_2_2
from i... |
#!/usr/bin/env python
# Copyright (c) 2013 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Use the raw transactions API to spend bitcoins received on particular addresses,
# and send any change back ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.