text stringlengths 2 999k |
|---|
"""
Convenience class for common use-case for __instancecheck__; namely,
simple type-checking based on whether abstract-methods have been implemented.
"""
import six
from . import valuemeta
from ..ducktype import meets
@six.add_metaclass(valuemeta.ValueMeta)
class InterfaceType(object):
"""
Provides simple ch... |
#!/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 -alertnotify, -blocknotify and -walletnotify options."""
import os
from test_framework.test_f... |
# -*- coding: utf-8 -*-
import base64
import hashlib
from .sequences import normalize_sequence
from .vmc_digest import vmc_digest
def seq_seqhash(seq, normalize=True):
"""Converts sequence to 24-byte Truncated Digest.
Args:
seq (str): A sequence.
normalize (bool, optional): Whether to norma... |
# from gohtml import *
from helper import *
from outer import *
from h import *
from const import *
def addcbox(h,q,which,tex):
ach='''<script type="text/javascript">
function ftest{which}(q) {
x=document.querySelectorAll("dd.{which}")
for(var i=0;i<x.length;i++){
if (x[i].style.display ==="none")... |
#--
# Copyright (c) 2012, Sebastian Tello
# 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 list of c... |
# Copyright 2016 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the 'license' file accompa... |
"""
Django settings for pims project.
Generated by 'django-admin startproject' using Django 2.0.5.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref/settings/
"""
import os
# Bu... |
##!/usr/bin/python
# Copyright 2014 Google, Inc.
# Routines for talking to the TestEquity 115 (Watlow F4) controller
# Author: Eric Schlaepfer (ejs@)
# Requires minimalmodbus library, available from:
# https://pypi.python.org/pypi/MinimalModbus/0.6
import minimalmodbus
import time
class WatlowF4(minimalmodbus.Instru... |
from sanic import Sanic
from .routes import movies_bp
app = Sanic()
app.blueprint(movies_bp)
|
from django.contrib.auth.decorators import login_required
from django.db.models import Q
from django.conf import settings
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.template import Context
from django.template.loader import select_template
from django.urls import reverse, reverse_la... |
import numpy as np
from numba import njit
from numba import types
from numba.typed import Dict
import pudb
'''
This file contains transformation functions. These
are all static functions so that numba can be used
efficiently.
Definition of each plane:
disk: Face-on view of the galactic disk, no inclination angl... |
# -*- coding: utf-8 -*-
"""Top-level package for napari-aicsimageio."""
__author__ = "Jackson Maxfield Brown"
__email__ = "jacksonb@alleninstitute.org"
# Do not edit this string manually, always use bumpversion
# Details in CONTRIBUTING.md
__version__ = "0.4.1"
def get_module_version() -> str:
return __version_... |
from fastapi import FastAPI, File, UploadFile
from fast_image_classification.predictor import ImagePredictor
app = FastAPI()
predictor_config_path = "config.yaml"
predictor = ImagePredictor.init_from_config_url(predictor_config_path)
@app.post("/scorefile/")
def create_upload_file(file: UploadFile = File(...)):
... |
# -*- coding: utf-8 -*-
# pylint: disable-msg=
"""
Created on Fri Jun 1 11:55:41 2012
This module contains the definition of all the domain observables related with
the segmentation of the ECG signal in components.
@author: T. Teijeiro
"""
from kardioml.segmentation.teijeiro.model import Observable, EventObservable... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
Copyright (C) 2017-2019 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... |
#! /root/anaconda3/bin/python
def hi():
return "hi yasoob!"
def doSomethingBeforeHi(func):
print("I am doing some boring work before executing hi()")
print(func) # <function hi at 0x7f0ea36a61f0>
print("func", func.__name__) # hi
doSomethingBeforeHi(hi)
print()
print(hi.__name__) # hi
print(do... |
import textwrap
from tests.test_pip import reset_env, run_pip, write_file
from tests.path import Path
def test_download_if_requested():
"""
It should download (in the scratch path) and not install if requested.
"""
env = reset_env()
result = run_pip('install', 'INITools==0.1', '-d', '.', expect_e... |
from functools import partial
from flask import (
abort,
flash,
jsonify,
redirect,
render_template,
request,
url_for,
)
from flask_login import current_user
from notifications_python_client.errors import HTTPError
from notifications_utils import LETTER_MAX_PAGE_COUNT, SMS_CHAR_COUNT_LIMIT
f... |
import os
import sys
import zipfile
output_folder = sys.argv[1]
zip_path = sys.argv[2]
build_path = os.path.join(output_folder, 'build.xml')
anim_path = os.path.join(output_folder, 'animation.xml')
image_list_path = os.path.join(output_folder, 'images.lst')
z = zipfile.ZipFile(zip_path, 'w')
z.write(build_path, "buil... |
from decouple import config
# Scrapy settings for items_list_spider project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# https://docs.scrapy.org/en/latest/topics/settings.html
# https://docs.scrapy.org... |
import datetime
from decimal import Decimal
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test import TestCase
from pycon.finaid.models import STATUS_REJECTED, STATUS_SUBMITTED, \
FinancialAidMessage, FinancialAidReviewData, FinancialAidApplicationPeriod
from pycon.fina... |
# Copyright 2015 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07.
# 2019, SMART Health IT.
import os
import io
import unittest
import json
from . import chargeitemdefinition
from .fhirdate import FHIRDate
class ChargeItemDefinitionTests(unittest.TestCase):
def instantiate_f... |
from power.com.signals import Signal
from power.com.powersocketserver import PowerSocketServer
__all__ = ['Signal', 'PowerSocketServer']
|
"""
For simplicity early on, let's only handle the interaction part
"""
import sys
sys.path.append('../')
import argparse
import glob
import random
import os
from collections import defaultdict
parser = argparse.ArgumentParser(description='SCRAPE!')
parser.add_argument(
'-data_path',
dest='data_path',
def... |
from __future__ import unicode_literals
import hashlib
from copy import copy
from random import random
from moto.core import BaseBackend, BaseModel
from moto.ec2 import ec2_backends
from moto.ecr.exceptions import ImageNotFoundException, RepositoryNotFoundException
from botocore.exceptions import ParamValidationErro... |
#!/usr/bin/env python3
# Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
#
# This python script creates a source path mapping in a C++ source file from
# a C... |
# !/usr/bin/python3
# Mini Program
# Version : 0.0.1
# Date : 7/2/2021
items = [0, 'Communication', 'Daily_use', 'Stationary']
Communication = ["Handset", "Keypad", "PC", "Laptop", "Radio"]
Daily_use = ["HandWatch", "T-shirt", "style-pant", "Cap", "Hat", "Shoes", "Slippers"]
Stationary = ["Ball-pen", "Pencil", "Eraser... |
"""
Author: Zehua Wei (nanoric)
"""
from vnpy.event import EventEngine
from vnpy.trader.constant import Exchange, Interval
from vnpy.trader.engine import MainEngine
from vnpy.trader.ui import QtCore, QtWidgets
from ..engine import APP_NAME
class CsvLoaderWidget(QtWidgets.QWidget):
""""""
def __init__(self,... |
import logging
from typing import Any, Dict, Optional, List
from mlagents.tf_utils import tf
from mlagents_envs.timers import timed
from mlagents_envs.base_env import BatchedStepResult
from mlagents.trainers.brain import BrainParameters
from mlagents.trainers.models import EncoderType
from mlagents.trainers.models im... |
# This file is execfile()d with the current directory set to its containing dir.
#
# 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
#
# All configuration values have a default; values that are comme... |
import os
import json
import pickle
import sys
import signal
import traceback
import re
import flask
import torch
from fast_bert.prediction import BertNERPredictor
from fast_bert.utils.spellcheck import BingSpellCheck
from pathlib import Path
import warnings
warnings.filterwarnings("ignore", message="numpy.dtype si... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-08 02:10
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):
dependencies = [
migrations.swappable_depende... |
from sympy import *
from ignition.dsl.int_gen import *
select_quad_rule(num_pts=2, name="Gauss")
u = DiscFunc("u")
x = Symbol("x")
cos_x = Func(cos(x), x)
sin_x = Func(sin(x), x)
dx = Dom(x, 0, 1)
integral = (cos_x * u + sin_x) * dx
gen_file("ex1", [integral], ["eval_gen"], ['u'])
|
from google.appengine.ext import ndb
# Keep the details of articles
class Article(ndb.Model):
# The parent of an Entry is Account
dateCreated = ndb.DateProperty()
lastEdited = ndb.DateProperty(indexed = True) # indexed = True is only useful for changing previous indexed = False
content = ndb.TextProperty()
titl... |
import time
import logging
from threading import Thread
from queue import Queue
from typing import List, Optional, Type, Union, Callable, TYPE_CHECKING
import angr
from angr.block import Block
from angr.knowledge_base import KnowledgeBase
from angr.analyses.disassembly import Instruction
from .jobs import CFGGenerati... |
import unittest
from autotx.auth.account import Account
from autotx.auth.auth import Auth, checkAccount
from autotx.auth.collect import CollectAccount, CollectValidators
from autotx.module.sn import SNGenerator
class TestAuth(unittest.TestCase):
def setUp(self):
self.sn = SNGenerator(1, 0)
def test_C... |
from pal.transform.abstract_transform import AbstractTransform
class RemoveCoprocessorAM(AbstractTransform):
@property
def description(self):
d = "removing coprocessor access mechanisms"
return d
def do_transform(self, reg):
reg.access_mechanisms["mrc"] = []
reg.access_mec... |
from wtforms import (
StringField, SelectField, HiddenField, validators
)
from wtforms.widgets import TextArea
from webapp.home.forms import EDIForm
class MaintenanceForm(EDIForm):
description = StringField('Description *', widget=TextArea(), validators=[])
update_frequency = SelectField('Maintenance Up... |
# -*- coding: utf-8 -*-
import random
import string
import sys
import pytest
import functools
import textwrap
from pypy.interpreter.baseobjspace import W_Root
from pypy.interpreter.pyparser import pyparse
from pypy.interpreter.pyparser.error import SyntaxError
from pypy.interpreter.error import OperationError
from pypy... |
"""
HX711 Load cell amplifier Python Library
Original source: https://gist.github.com/underdoeg/98a38b54f889fce2b237
Documentation source: https://github.com/aguegu/ardulibs/tree/master/hx711
Adapted by 2017 Jiri Dohnalek
This program is free software; you can redistribute it and/or modify
it under the terms of the GN... |
from __future__ import absolute_import, division, print_function
from enum import auto
import torch
import torch.nn.functional as F
from torch import nn
from torch.cuda.amp import GradScaler, autocast
from torchreid import metrics
from torchreid.losses import AsymmetricLoss, AMBinaryLoss
from torchreid.metrics.accura... |
#!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Run regression test suite.
This module calls down into individual test cases via subprocess. It will
f... |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="geo_garry",
version="1.2.3",
author="Sergey Retivykh",
author_email="s.retivykh@redmadrobot.com",
description="Geocoding and reverse geocoding, distance calculations. Google Maps implement... |
# -*- coding:utf-8 _*-
"""
@file: pdf_image.py
@time: 2020/09/17
@site:
@software: PyCharm
# code is far away from bugs with the god animal protecting
I love animals. They taste delicious.
┏┓ ┏┓
┏┛┻━━━┛┻┓
┃ ☃ ┃
┃ ┳┛ ┗┳ ┃
┃ ┻ ... |
from talon import Context
# Context matching
ctx = Context()
ctx.matches = r"""
app: amazon
browser.host: www.amazon.com
"""
# --- Implement lists ---
ctx.lists["user.amazon_page"] = {
"front": "",
"cart": "gp/cart/view.html",
"wishlist": "wishlist",
"deals": "events/epicdeals",
"orders": "gp/css/... |
#!/usr/bin/env python3
from binascii import unhexlify, hexlify
import socket
import time
def until(sock, delim):
if type(delim) == str:
delim = delim.encode('utf-8')
out = bytearray()
while delim not in out:
c = sock.recv(512)
if len(c) == 0:
raise Exception()
... |
from .base_options import BaseOptions
class TrainOptions(BaseOptions):
def initialize(self):
BaseOptions.initialize(self)
self.parser.add_argument('--display_freq', type=int, default=100, help='frequency of showing training results on screen')
self.parser.add_argument('--display_single_pan... |
from insights.parsers.tags import Tags
from insights.parsers.tests import skip_exception_check
from insights.tests import context_wrap
tags_json_content = """
{"zone": "east", "owner": "test", "exclude": "true", "group": "app-db-01"}
""".strip()
def test_tags_json():
ctx = context_wrap(tags_json_content)
ctx... |
import socket
from testutils import assertRaises
MESSAGE_A = b'aaaa'
MESSAGE_B= b'bbbbb'
# TCP
listener = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
listener.bind(("127.0.0.1", 0))
listener.listen(1)
connector = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
connector.connect(("127.0.0.1", listener.getsoc... |
import typing
from datetime import datetime
from ..schema import BaseTransformer
class Transformer(BaseTransformer):
"""Transform Tennessee raw data for consolidation."""
postal_code = "TN"
fields = dict(
company="Company",
location=lambda row: row["City"] or f"{row['County']} County",
... |
"""todo_project 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('', views.home, name='home')
Class-... |
# 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... |
from django.test import TestCase
from . import views
class TestViewTest(TestCase):
def test_test_view(self):
self.assertEqual(views.test_func(), True)
|
import boto3
import sys
from datetime import datetime
"""
Class S3WriterOperator: writes an extracted file on a S3 bucket.
-> PARAMS:
- extraction_file: path of the file extracted on your script
- extraction_name: name of the file extracted who will be written
- extraction_source: name... |
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 18 23:29:40 2019
@author: Hanif Amrullah
"""
import pandas as pnd
class HanifAmrullah () :
whs = pnd.read_csv('kelas_2b/hanif.csv')
print (whs) |
from collections import defaultdict
import itertools
import logging
import typing
from typing import Any, Dict, Hashable, List, Optional, Set, Text, Tuple, Type, Iterable
import rasa.utils.train_utils
from rasa.exceptions import MissingDependencyException
from rasa.nlu.constants import COMPONENT_INDEX
from rasa.shared... |
from django.contrib import admin
from .models import Treasure
# Register your models here.
admin.site.register(Treasure) |
from .binary_size import BinarySizeCollector
from .compile_time import CompileTimeCollector
from .memory_on_start import MemoryOnStartCollector
|
import numpy as np
import numba
@numba.jit(nopython=True)
def ssr(y, X, beta):
return np.sum((y - np.dot(X, beta))**2)
@numba.jit(nopython=True)
def mse(y, X, beta):
return np.mean((y - np.dot(X, beta))**2)
@numba.jit(nopython=True)
def rmse(y, X, beta):
return np.sqrt(np.mean((y - np.dot(X, beta))**2... |
# pylint: disable=R0201
"""Output classes"""
import sys
import json
import uuid
import bumblebee.store
def scrollable(func):
def wrapper(module, widget):
text = func(module, widget)
if not text: return text
width = widget.get("theme.width", module.parameter("width", 30))
widget.s... |
import functools
def fn_bavard(f):
@functools.wraps(f)
def f_interne(*p, **k):
print('debut de f_interne()')
f(*p, **k)
print('fin de f_interne()')
print('dans fn_bavard')
return f_interne
def deprecated(f):
@functools.wraps(f)
def new_func(*args, **kwargs):
pr... |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
"""
Driver of graph construction, optimization, and linking.
"""
from __future__ import print_function
import copy
from six import string_types, iteritems, iterkeys
from six.moves import xrange
import six.moves.copyreg as copyreg
import six.moves.cPickle as pickle
from itertools import chain
import time
import warnin... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2014-08-08 20:40:53
import config
import logging
import umsgpack
class RedisDB(object):
def __init__(self, host=config.redis.host, port=config.redis.p... |
#!/usr/bin/python
# encoding: utf-8
#
# Copyright 2017 Greg Neagle.
#
# 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 ... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache 2.0 License.
import os
import time
import paramiko
import logging
import getpass
from contextlib import contextmanager
import infra.remote
from glob import glob
from loguru import logger as LOG
DBG = os.getenv("DBG", "cgdb")
cla... |
import os
import json
from bioid_evaluation import BioIDBenchmarker
HERE = os.path.dirname(os.path.abspath(__file__))
data_path = os.path.join(HERE, 'data')
try:
with open(os.path.join(data_path, 'equivalences.json')) as f:
equivalences = json.load(f)
except FileNotFoundError:
equivalences = {}
benc... |
import random
import textwrap
from typing import Dict, Set
import pandas as pd
import pytest
from pandas import DataFrame
from sqlalchemy import column, Float, String
from rabbitai import db
from rabbitai.connectors.sqla.models import SqlaTable, SqlMetric
from rabbitai.models.dashboard import Dashboard
from rabbitai.... |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import contextlib
from telemetry.internal.results import page_test_results
from telemetry.testing import page_test_test_case
from measurements import tab_sw... |
# coding=UTF-8
from Statut import *
from Voiture import *
class Pilote(object):
"""
:version:1.0
:author:BlackAllSun
"""
""" ATTRIBUTES
idPilote (private)
nom (private)
prenom (private)
age (private)
statut (private)
voiture (private)
"""
def __init__(self,idPilote,nom,prenom,age,statut,voit... |
#
# Copyright (c) 2015 Midokura SARL, 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 ... |
# cython: language_level=3
from config import GlobalConfig
import numpy as np
from numpy.core.numeric import indices
from .foundation import AlgorithmConfig
from ..commom.traj import TRAJ_BASE
import copy
from UTILS.colorful import *
from UTILS.tensor_ops import __hash__, my_view, np_one_hot, np_repeat_at, np_softmax, ... |
# Copyright 2018 The TensorFlow Probability 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 o... |
t = int(input())
a = int(input())
print("{0:.3f}".format(t*a/12.0))
|
import itertools
import math
import string
import sys
from bisect import bisect_left as bi_l
from bisect import bisect_right as bi_r
from collections import Counter, defaultdict, deque
from functools import lru_cache, reduce
from heapq import heapify, heappop, heappush
from operator import or_, xor
sys.setr... |
"""
sphinx.util.inspect
~~~~~~~~~~~~~~~~~~~
Helpers for inspecting Python modules.
:copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import builtins
import enum
import inspect
import re
import sys
import typing
import warnings
from functo... |
"""
Module: 'errno' on esp8266 v1.9.3
"""
# MCU: (sysname='esp8266', nodename='esp8266', release='2.0.0(5a875ba)', version='v1.9.3-8-g63826ac5c on 2017-11-01', machine='ESP module with ESP8266')
# Stubber: 1.1.2 - updated
from typing import Any
EACCES = 13
EADDRINUSE = 98
EAGAIN = 11
EALREADY = 114
EBADF = 9
ECONNABOR... |
from vncdotool import command
import unittest
from . import mock
class TestBuildCommandList(unittest.TestCase):
def setUp(self):
super(TestBuildCommandList, self).setUp()
self.isolation = mock.isolate.object(command.build_command_list)
self.isolation.start()
self.factory = mock... |
import sys
def open_file(file_name):
with open(file_name) as f:
team_list = f.readlines()
for i in range(len(team_list) - 1):
if i < len(team_list) - 1:
team_list[i] = team_list[i][:-1]
for i in range(len(team_list)):
team_list[i] = team_list[i].split(",")
... |
import logging
import time
import mock
import pytest
import ddtrace
from ddtrace.profiling import collector
from ddtrace.profiling import event
from ddtrace.profiling import exporter
from ddtrace.profiling import profiler
from ddtrace.profiling.collector import memalloc
from ddtrace.profiling.collector import stack
f... |
from app import index
def test_index():
assert index() == "Hello World" |
"""Time offset classes for use with cftime.datetime objects"""
# The offset classes and mechanisms for generating time ranges defined in
# this module were copied/adapted from those defined in pandas. See in
# particular the objects and methods defined in pandas.tseries.offsets
# and pandas.core.indexes.datetimes.
# ... |
import os
from time import gmtime, strftime
from requests import get
from datetime import datetime, timedelta
from json import loads
from pprint import pprint
KEY = 'f16f71ea347b7edc2b755bc39228f56b'
CITY_ID = 3104323
# {
# "id": 3104323,
# "name": "Provincia de Zaragoza",
# "country": "ES",
# "coord":... |
'''
Problem description:
A bookseller has lots of books classified in 26 categories labeled A, B, ... Z.
Each book has a code c of 3, 4, 5 or more characters. The 1st character of a code
is a capital letter which defines the book category.
In the bookseller's stocklist each code c is followed by a space and by a pos... |
# 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 ... |
#!/usr/bin/python2.4
#
# Copyright 2008 Google 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 o... |
#-
# Copyright (c) 2014 Michael Roe
# Copyright (c) 2019 Nathaniel Filardo
# All rights reserved.
#
# This software was developed by SRI International and the University of
# Cambridge Computer Laboratory (Department of Computer Science and
# Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the
#... |
#!/usr/bin/env python
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
def draw_event(widget, ctx):
ctx.set_line_width(6)
ctx.set_tolerance(.1)
ctx.select_font_face('sans-serif')
ctx.set_font_size(48)
(x, y, width, height, dx, dy) = ctx.text_extents('Hello World')
ct... |
#!/usr/bin/env python
# coding: utf-8
import numpy as np
import pandas as pd
import sys
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
# local packages
import sys
sys.path.append('../')
import semiclass
import semitorchclass
import semitorchstocclass
i... |
from django.core.management.base import BaseCommand
from optparse import make_option
from orcamentos.crm.models import Person, Seller
from orcamentos.proposal.models import Entry, Work
class Command(BaseCommand):
help = ''' Cria entrada. '''
option_list = BaseCommand.option_list + (
make_option('--pri... |
# 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... |
"""
Toothpick noise model assumes that every photometric band is independent
from the others.
The :class:`MultiFilterASTs` assumes that all AST information is compiled
into on single table, in which one entry corresponds to one artificial star
and recovered values
Method
------
The noise model is computed in equally ... |
#!/usr/bin/env python
"""A script to release a new version of TUI from a git working copy
If run on a unix box it exports the current version of TUI and then zips that.
If run on MacOS X it also tries to build the Mac binary.
Not intended for use on Windows.
To use:
./releaseNewVersion.py
"""
import os
import re... |
from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Title(_BaseLayoutHierarchyType):
# class properties
# --------------------
_parent_path_str = "layout.scene.xaxis"
_path_str = "layout.scene.xaxis.title"
_valid_props = {"font", "text"}... |
__copyright__ = "Copyright (c) 2020 Jina AI Limited. All rights reserved."
__license__ = "Apache-2.0"
import inspect
from typing import Dict
from .. import BaseExecutor
from ...helper import typename
class BaseCrafter(BaseExecutor):
"""A :class:`BaseCrafter` transforms the content of `DocumentProto` or `Chunk`.... |
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... |
# Copyright (c) 2020, NVIDIA CORPORATION.
import functools
import warnings
from collections import OrderedDict
import cupy
import numpy as np
import pandas as pd
from pandas.api.types import is_dtype_equal
import cudf
from cudf import _lib as libcudf
from cudf._lib.nvtx import annotate
from cudf.core.column import as... |
# Copyright 2013 dotCloud 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 t... |
import _plotly_utils.basevalidators
class HovertextValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name='hovertext', parent_name='bar', **kwargs):
super(HovertextValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.