text stringlengths 2 999k |
|---|
from launch import LaunchDescription
from launch_ros.actions import Node
from launch.substitutions import LaunchConfiguration
from launch.conditions import IfCondition
def generate_launch_description():
run_example_node = LaunchConfiguration("run_example_node", default="True")
return LaunchDescription([
... |
#!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the RPC HTTP basics."""
from test_framework.test_framework import bitcoinphantomTestFramework
fro... |
"""
Some helper function for dealing with wireless signal transmission.
"""
from math import inf, log, sqrt
def subtract_dbm(dbm1: float, dbm2: float):
"""Adds two decibel values"""
watt1 = dbm_to_watt(dbm1)
watt2 = dbm_to_watt(dbm2)
return watt_to_dbm(watt1 - watt2)
def dbm_to_watt(dbm: float):
... |
import re
from commons.logger import log
class Template(object):
"""
Template class handles:
1. one-to-one variable to value mapping.
2. multi-value variables can be mapped via '...' convention.
3. delimiters can be enabled as configurable in future.
"""
def __init__(self, template_str):
... |
"""
Copyright BOOSTRY Co., 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 law or agreed to in writing,
software distr... |
# 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 ... |
"""
Geometry and colour info.
@author Li Xiao-Tian
"""
class Point2d():
def __init__(self, x, y):
self.x = x;
self.y = y;
COLOURS = {
'u': '#A9A9A9',
'w': '#F9F9F9',
'r': '#D8251A',
'b': '#0194dd',
'g': '#2EFE2E',
'o': '#F0A226',
'y': '#FFFF00',
}
class Col... |
# Copyright 2021 Huawei Technologies Co., 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 law or agreed to... |
class Config:
LOGGING_NAME = "ws_tickers"
ticker_PRIORITY_EXCHANGE = "poloniex" |
# Copyright 2018 The Texar 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 ... |
# coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... |
#
# 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... |
# Copyright (c) 2020, Fabio Muratore, Honda Research Institute Europe GmbH, and
# Technical University of Darmstadt.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source ... |
"""Entry point for our twitoff flask app"""
from .app import create_app
APP = create_app()
# remember - flask_sqlalchemy is what lets us add users from twitter onto our application
|
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.views.generic import TemplateView
from django.views.generic.base import RedirectView
from django.contrib import admin
from .views import (
editions_list,
lemma_detail,
lemma_js... |
import contextlib
import click
from snafu import metadata, versions
from snafu.operations.common import get_active_names
from snafu.operations.link import activate
def get_version_or_none(name):
force_32 = not metadata.can_install_64bit()
with contextlib.suppress(versions.VersionNotFoundError):
retu... |
#!/usr/bin/env python
######################################################################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# ... |
# Copyright (c) 2016 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... |
"""Command line utility for ``eqllib``."""
from __future__ import print_function
import argparse
import json
import re
import sys
import toml
from eql import parse_query, EqlError, Event
from eql.schema import EVENT_TYPE_GENERIC
from eql.utils import stream_stdin_events, stream_file_events
from eql.table import Table... |
"""
Standard recipe to find the lowest common ancestor
"""
def lca(self, root, a, b):
# Standard Recipe to find the lowest-common ancestor
if root is None or root is a or root is b:
return root
left = self.lca(root.left, a, b)
right = self.lca(root.right, a, b)
if left is not No... |
from imagetagger.base.checks import *
|
from collections import namedtuple
from typing import List
import numpy as np
ColorResult = namedtuple("ColorResult", ["name", "ratio"])
class ColorDetectionResult:
def __init__(self, color_list: List[ColorResult], labelled_frame: np.ndarray):
self.color_list = color_list
self.labelled_frame = l... |
import random
class RandomList(list):
def get_random_element(self):
element_index = random.randint(0, len(self) - 1)
element = self[element_index]
self.pop(element_index)
return element
rl = RandomList([1,2,3, 4,5 ,6 ])
while rl:
print(rl.get_random_element()) |
#!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2016, Kentaro Wada.
# 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 ... |
# =============================================================================
# Author: Teerapat Jenrungrot - https://github.com/mjenrungrot/
# FileName: 10894.py
# Description: UVa Online Judge - 10894
# =============================================================================
text = """*... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Documentation for Mako templates:
# http://www.makotemplates.org/docs/syntax.html
import os, sys, re
sys.path.append(os.path.join("codegen", "rabbitmq-codegen"))
from amqp_codegen import *
try:
from mako.template import Template
except ImportError:
print("Mako... |
"""
Django settings for laureats project.
Generated by 'django-admin startproject' using Django 3.0.2.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
... |
"""Implementation of scaled KNX DPT_1_Ucount Values."""
from xknx.exceptions import ConversionError
from .dpt import DPTBase
class DPTScaling(DPTBase):
"""
Abstraction for KNX 1 Octet Percent.
DPT 5.001
"""
value_min = 0
value_max = 100
resolution = 100/255
unit = "%"
payload_le... |
import torch
import torch.nn as nn
from torch.nn import Parameter
from torch_geometric.nn.inits import glorot, zeros
from torch_geometric.utils import scatter_
from .gcn_base_models import NodeModelBase
from .common import activation, softmax
class NodeModelAttention(NodeModelBase):
"""
Multi-head soft atten... |
from __future__ import print_function, division
from sympy.core import S, pi, Rational
from sympy.functions import hermite, sqrt, exp, factorial, Abs
from sympy.physics.quantum.constants import hbar
def psi_n(n, x, m, omega):
"""
Returns the wavefunction psi_{n} for the One-dimensional harmonic oscillator.
... |
import pytest
import medspacy
import spacy
class TestMedSpaCy:
def test_default_build_pipe_names(self):
enable, disable = medspacy.util._build_pipe_names(enable=None, disable=None)
assert enable == {"medspacy_tokenizer", "medspacy_pyrush", "medspacy_target_matcher", "medspacy_context"}
ass... |
# 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... |
from oslo_config import cfg
from oslo_log import log as logging
from oslo_middleware import cors
from oslo_utils import netutils
CONF = cfg.CONF
logging.register_options(CONF)
def set_middleware_defaults():
"""Update default configuration options for oslo.middleware."""
# CORS Defaults
# TODO(krotscheck)... |
#!/usr/bin/env python
#######################################################################################
# The MIT License
# Copyright (c) 2014 Hannes Schulz, University of Bonn <schulz@ais.uni-bonn.de>
# Copyright (c) 2013 Benedikt Waldvogel, University of Bonn <mail@bwaldvogel.de>
# Copyright (c) 2... |
#!/usr/bin/env python
# Copyright (c) 2017 Orange and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
"""Cloudify... |
# Copyright 2008-2013 Software freedom conservancy
#
# 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 ... |
"""
https://www.codewars.com/kata/5254ca2719453dcc0b00027d/train/python
Permutations
In this kata you have to create all permutations of an input string and remove duplicates, if present. This means, you have to shuffle all letters from the input in all possible orders.
Examples:
permutations('a'); # ['a']
permutat... |
from django.conf import settings
from django.urls import path
from django.conf.urls.static import static
from . import views
urlpatterns = [
path('', views.index, name='home'),
path('log-in', views.LogIn, name='log_in'),
path('log-out', views.LogOut, name='log_out'),
path('sign-up', views.signup, name... |
"""
Package for django_photo_gallery.
"""
|
import filecmp
import json
import os
import sys
import textwrap
from enum import Enum
from hashlib import sha1
from pathlib import Path
from typing import Dict
from plumbum import local
from prompt_toolkit.input.ansi_escape_sequences import REVERSE_ANSI_SEQUENCES
from prompt_toolkit.keys import Keys
import copier
fro... |
from project.caretaker import Caretaker
from project.cheetah import Cheetah
from project.keeper import Keeper
from project.lion import Lion
from project.tiger import Tiger
from project.vet import Vet
class Zoo:
def __init__(self, name: str, budget: int, animal_capacity: int, workers_capacity: int):
self.n... |
from vulnman.api.viewsets import ProjectRelatedObjectViewSet
from api.v1 import generics
from api.v1.serializers import vulnerability as serializers
from api.v1.serializers.proofs import ImageProofSerializer, TextProofSerializer
from apps.findings import models
class AgentVulnerabilityViewSet(generics.AgentModelViewS... |
def getNewBytes(conn):
"""Checks a pipe connection for new messages."""
# Check for new messages
readAttempts = 0
receivedData = bytearray()
while readAttempts < 100:
dataAvailable = conn.poll(0)
if dataAvailable:
receivedData += conn.recv_bytes()
else:
... |
import json
from couchdbkit.exceptions import ResourceNotFound
from django.contrib.humanize.templatetags.humanize import naturaltime
from casexml.apps.case.util import iter_cases
from corehq.apps.cloudcare.exceptions import RemoteAppError
from corehq.apps.users.models import CouchUser
from casexml.apps.case.models impo... |
from copy import deepcopy
import sys
class GameBoard():
""" Board represented as a list of list.
Basically this is just a tree node """
def __init__(self, state, parent=None, action=None, score=0):
self.state = state
self.parent = parent
self.depth = self.parent.depth + 1 if self.parent else 0
self.actio... |
from exchanges.bitfinex import Bitfinex
from exchanges.bitstamp import Bitstamp
from exchanges.bitvc import BitVc
from exchanges.coinapult import Coinapult
from exchanges.coindesk import CoinDesk
from exchanges.futures796 import Futures796
from exchanges.huobi import Huobi
from exchanges.kraken import Kraken
from excha... |
import os
import glob
import cv2
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser(
description="Resize raw images to uniformed target size."
)
parser.add_argument(
"--raw-dir",
help="Directory path to raw images.",
default="./data/raw",
... |
#!/usr/bin/python
import handleOS as system
import handleData as hdata
import handleJsonFile as jsonf
import classification as clf
import dictionaryMethods as dictMeth
import database as db
import levenshtein as lev
import ast
def localize(pathToLogFiles, modelsArray, pathToDictionary, thresholdsAndLengths... |
from datetime import datetime
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from itsdangerous import BadSignature, SignatureExpired
from flask import current_app
from app import db, login_manager
from flask_login import UserMixin
@login_manager.user_loader
def load_user(user_id):
return U... |
#coding:utf-8
import argparse
import os
import ast
import paddle.fluid as fluid
import paddlehub as hub
import numpy as np
# yapf: disable
parser = argparse.ArgumentParser(__doc__)
parser.add_argument("--num_epoch", type=int, default=1, help="Number of epoches for fine-... |
from ipaddress import ip_network
from irrexplorer.api.interfaces import (
MessageCategory,
PrefixIRRDetail,
PrefixSummary,
ReportMessage,
)
from irrexplorer.api.report import enrich_prefix_summaries_with_report
from irrexplorer.state import RIR, RPKIStatus
def test_report_good():
summary = Prefix... |
#!/usr/bin/env python
# coding: utf-8
from __future__ import print_function
#get_ipython().run_line_magic('matplotlib', 'inline')
import os
import patsy
import numpy as np
import pandas as pd
import statsmodels.api as sm
import statsmodels.formula.api as smf
from statsmodels.regression.quantile_regression import QuantR... |
#!/usr/bin/env python
# Copyright (C) 2017 Mike Pennisi. All rights reserved.
# This code is governed by the BSD license found in the LICENSE file.
import shutil, subprocess, sys, os, unittest, tempfile
testDir = os.path.dirname(os.path.relpath(__file__))
OUT_DIR = os.path.join(testDir, 'out')
ex = os.path.join(testD... |
def main():
puzzleInput = open("python/day24.txt", "r").read()
# Part 1
# assert(part1("") == 0)
# print(part1(puzzleInput))
# Part 2
# assert(part2("") == 0)
print(part2(puzzleInput))
def part1(puzzleInput):
# Parse input
bridgeSections = []
for i in puzzleInput.split("... |
from setuptools import setup
with open('README.md', 'r') as file:
long_description = file.read()
setup(
name='serverlessplus',
packages=['serverlessplus'],
version='0.0.8',
license='Apache-2.0',
author='chenhengqi',
author_email='ritchiechen@tencent.com',
description='serverless your d... |
from unittest.mock import MagicMock, patch
import numpy as np
import torch
class _TestNN(torch.nn.Module):
def __init__(self, input_size, output_size):
super().__init__()
self.decoder = torch.nn.Linear(input_size, output_size)
self.forward_called = False
def forward(self, nn_input, h... |
"""
All the SAML-specific exceptions this library can throw.
"""
class SAML2Exception(Exception):
"""Base exception for all flask_saml2 exceptions."""
pass
class MessageException(SAML2Exception):
"""An exception with a nicely formatted error message."""
def __init__(self, msg):
self.msg = ms... |
# Copyright (c) 2019 CloudZero, Inc. All rights reserved.
# Licensed under the MIT License. See LICENSE file in the project root for full license information.
from datetime import datetime, timezone
from decimal import Decimal, ROUND_DOWN
import dateutil.parser as parser
from dateutil.tz import tzutc
def isodatetim... |
# 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... |
# 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 u... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
This is search object node.
subscribe "??" topics.
publish '??' topics.
by Moro.
'''
import rospy
from std_msgs.msg import Float32MultiArray
from std_msgs.msg import Int32MultiArray
from enum import IntEnum
class IndexColor(IntEnum):
INDEX_CX = 0
INDEX_CY = 1... |
import os
import time
import json
from struct import pack, unpack
from base64 import b64encode, b64decode
import gw2api
__all__ = ("encode_item_link", "encode_coin_link",
"encode_chat_link", "decode_chat_link")
def mtime(path):
"""Get the modification time of a file, or -1 if the file does not exist... |
import unittest
from quince.components import Card
class TestCard(unittest.TestCase):
def test_info(self):
"""Returns a tuple containing suit and value"""
c = Card(4, "basto")
self.assertEqual(4, c.value)
self.assertEqual("basto", c.suit)
# Check that an error is raised on... |
# -*- coding: utf8 -*-
# Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. 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... |
import subprocess
from typing import List
from flask_restx.errors import abort
from .data_reformatter import ZPOOL_LIST, ZFS_LIST
"""
pyzfs is the pure-Python implementation of interfacing with ZFS through userspace applications
Some extra functionalities that libzfs_core doesn't provide that can be implemented
will ... |
# -*- coding: utf-8 -*-
###############################################################################
#
# GetAccessToken
# Retrieves an Access Token from PayPal.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... |
# -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 ... |
import builtins
import deprecated as _deprecated
from public import install
if not hasattr(builtins, "deprecated"):
setattr(builtins, "deprecated", _deprecated.deprecated)
install()
|
import typing
import strawberry
from strawberry.arguments import UNSET, is_unset
def test_mutation():
@strawberry.type
class Query:
hello: str = "Hello"
@strawberry.type
class Mutation:
@strawberry.mutation
def say(self, info) -> str:
return "Hello!"
schema =... |
#!/usr/bin/env python
# Copyright Singapore-MIT Alliance for Research and Technology
import re
from point import Point
class Polyline(Point):
regexp = re.compile("aimsun::polyline section-id=(\d+), x=(\d+), y=(\d+)")
def __init__(self, x, y, section):
super(Polyline, self).__init__(x, y)
sel... |
# Advent of Code 2019, Day 3
# (c) blu3r4y
from operator import itemgetter
from aocd.models import Puzzle
from funcy import print_calls
from parse import parse
def solve(wires):
touched, steps = set(), dict() # cells touched by 1st wire & number of steps
intersections = set() # crossing points with 2nd wi... |
# coding=utf-8
"""
Implementation of exporting process to CSV functionality, as proposed in article "Spreadsheet-Based Business
Process Modeling" by Kluza k. and Wisniewski P.
"""
from __future__ import print_function
import copy
import pandas as pd
import re
import six
from . import bpmn_python_consts as consts
fro... |
# coding: utf-8
"""
CryptoWeather
The CryptoWeather API allows for access to all of the cryptocurrency data and market forecast services provided. There are two primary categories of routes, `public` and `private`, where `public` routes are accessible to the general public and do not require API authenticatio... |
# -*- coding: utf-8 -*-
import numpy as np
import tensorflow as tf
import pandas as pd
import json
import random
from poke_env.player_configuration import PlayerConfiguration
from poke_env.player.env_player import Gen7EnvSinglePlayer
from poke_env.player.random_player import RandomPlayer
from poke_env.player.frozen_rl... |
'''
Stepik001132ITclassPyсh01p03st03TASK02__20200610.py
Даны три переменные, напиши такую программу, которая используя эти
переменные выведет текст: "Дважды два = четыре" без кавычек.
'''
b = 'два'
a = 'Дважды'
c = 'четыре'
print("{} {} = {}".format(a, b, c)) |
#!/usr/bin/env python3
# Copyright (c) 2016-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the bumpfee RPC.
Verifies that the bumpfee RPC creates replacement transactions successfully when... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
"""
This file contains specific functions for computing losses on the RPN
file
"""
import torch
from torch.nn import functional as F
from .utils import concat_box_prediction_layers
from ..balanced_positive_negative_sampler import BalancedPositiv... |
#!/usr/bin/env python3
# VK-GL-CTS log scrubber
# ----------------------
#
# Copyright (c) 2019 The Khronos Group Inc.
# Copyright (c) 2019 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 Li... |
def create_query_client_func(session, client_model):
"""Create an ``query_client`` function that can be used in authorization
server.
:param session: SQLAlchemy session
:param client_model: Client model class
"""
def query_client(client_id):
q = session.query(client_model)
retur... |
##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2018, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
##########################################################################
import time
from s... |
from twisted.web import server, resource
from twisted.internet import reactor, task, threads
from sys import argv
from Ping import Ping
class StatusResource(resource.Resource):
isLeaf = True
def render_GET(self, request):
request.setHeader("context-type", "text/plain")
return "8.8.8.8,AVAILABLE"
pinger = Pi... |
# -*- coding: utf-8 -*-
import httplib as http
from flask import request
from django.core.exceptions import ValidationError
from framework import forms, status
from framework.auth import cas
from framework.auth.core import get_user, generate_verification_key
from framework.auth.decorators import block_bing_preview, ... |
#!/usr/bin/env python3
import time
import colorsys
import sys
import ST7735
try:
# Transitional fix for breaking change in LTR559
from ltr559 import LTR559
ltr559 = LTR559()
except ImportError:
import ltr559
from bme280 import BME280
from pms5003 import PMS5003, ReadTimeoutError as pmsReadTimeoutError... |
#print "Hello World!"
print "Another Line!" |
# 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... |
# pylint: disable=no-self-use,invalid-name,no-value-for-parameter
import os
from nltk import Tree
import torch
from torch.autograd import Variable
from allennlp.common.testing.model_test_case import ModelTestCase
from allennlp.models.constituency_parser import SpanInformation
class SpanConstituencyParserTest(ModelT... |
# Generated from SqlBase.g4 by ANTLR 4.7.1
# encoding: utf-8
from __future__ import print_function
from antlr4 import *
from io import StringIO
import sys
def serializedATN():
with StringIO() as buf:
buf.write(u"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2")
buf.write(u"\u00dd\u07df\b\1\4\... |
"""Generic socket server classes.
This module tries to capture the various aspects of defining a server:
For socket-based servers:
- address family:
- AF_INET{,6}: IP (Internet Protocol) sockets (default)
- AF_UNIX: Unix domain sockets
- others, e.g. AF_DECNET are conceivable (see <socket.h>
... |
list = ('frango', 30, 'Carne', 35, 'cereal', 15, 'feijao', 8, 'picanha', 100, 'vinho', 80)
print('-'*60)
print(' '*20 + 'LISTA DE PREÇOS')
print('-'*60)
a = -2
b = -1
while True:
a += 2
b += 2
print(f'{list[a]}' + '.'*15 + f'{list[b]}R$ ')
if a == 10 and b == 11:
break
print('-'*60) |
import flask
import os
import base64
from AM_Nihoul_website.visitor.models import UploadedFile
from AM_Nihoul_website.tests import TestFlask
from AM_Nihoul_website import settings
class TestFiles(TestFlask):
def setUp(self):
super().setUp()
self.dir = os.path.dirname(os.path.abspath(__file__))... |
# Copyright (c) 2021 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 appli... |
from matplotlib import cm, rcParams
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import matplotlib as matplotlib
from matplotlib import patheffects
import numpy as np
import math as math
import random as rand
import os, sys, csv
import pandas as pd
# matplotlib.pyplot.xkcd(scale=.5, length=100, r... |
import tensorflow as tf
import os
#from PIL import Image
import random
import numpy as np
from datetime import datetime
from sklearn.metrics import confusion_matrix
from sklearn.metrics import classification_report
slim = tf.contrib.slim
global first
first = True
classnum=12
testnum = tf.placeholder(t... |
# Copyright (c) 2020 Horizon Robotics and ALF Contributors. 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... |
#!/usr/bin/env python2
import re
import os
import glob
import subprocess
import fileinput
os.chdir(os.path.join(os.path.dirname(__file__), '..'))
versions = {
5: '5.6.16',
6: '6.8.0',
7: '7.1.0',
}
file_patterns = [
'*/examples/*/test/goss.y*ml',
'*/examples/*/*.y*ml',
'*/README.md',
'*/v... |
import FWCore.ParameterSet.Config as cms
def customise(process):
# process.dtDataIntegrityUnpacker.inputLabel = cms.untracked.InputTag('rawDataCollector')
# process.DQMOfflineCosmics.remove(process.hcalOfflineDQMSource)
# process.load("FWCore.Modules.printContent_cfi")
# process.myPath1 = cms.Path( pro... |
import numpy as np
import dolfin as df
from finmag import Simulation
from finmag.energies import Exchange, DMI, Demag, Zeeman
from finmag.energies.zeeman import TimeZeemanPython
import matplotlib.pyplot as plt
Rx = 5445
Ry = 60
Nx = 2178
Ny = 24
mesh = df.RectangleMesh(0,0,Rx,Ry,Nx,Ny)
def m_init_fun(pos):
retur... |
# -*- coding: utf-8 -*-
"""
# Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
#
# This file was generated and any changes will be overwritten.
"""
from enum import Enum
class CalendarColor(Enum):
"""The Enum C... |
# 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 matplotlib
matplotlib.use('Agg')
import matplotlib.patches as mpatches
import random
import math
import numpy as np
import matplotlib.pyplot as plt
import itertools
from matplotlib import rcParams
from matplotlib.backends.backend_pdf import PdfPages
N = 20
width = 0.15 # the width of the bars
ind = np.arange(N)... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.