text stringlengths 2 999k |
|---|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: caffe2/proto/metanet.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from g... |
# -*- coding: utf-8 -*-
# Author: XuMing <xuming624@qq.com>
# Brief:
import sys
sys.path.append("../")
import os
from pycorrector.eval import *
pwd_path = os.path.abspath(os.path.dirname(__file__))
bcmi_path = os.path.join(pwd_path, '../pycorrector/data/cn/bcmi.txt')
clp_path = os.path.join(pwd_path, '../pycorrector... |
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'wagtailexample',
'USER': 'mysql-username',
'PASSWORD': 'mysql-password',
'HOST': 'mysql-host',
'PORT': '3306',
}
}
SECRET_KEY = 'the-local-secret-key'
|
# -*- coding: utf-8 -*-
__author__ = """Sudipta Basak"""
__email__ = 'basaks@gmail.com'
__version__ = '0.2.0'
|
import os
import shutil
import tempfile
from unittest import TestCase, mock
from collectors import brew
DEPS = b'''
a:
b: c
c: d
d:
f:
g:
'''
PACKAGE_INFO = b'''
ffmpeg: stable 3.4.2 (bottled), HEAD
Play, record, convert, and stream audio and video
https://ffmpeg.org/
/usr/local/Cellar/ffmpeg/3.4.2 (248 files, 51.... |
from cnn import xceptionNetwork
from feature_extraction import load_data, preprocessing
from sklearn.model_selection import train_test_split
from keras.callbacks import CSVLogger, ModelCheckpoint, EarlyStopping, ReduceLROnPlateau
from keras.preprocessing.image import ImageDataGenerator
batch_size = 32
n_epochs = 1000
... |
# uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\clubs\club_ops.py
# Compiled at: 2015-10-22 00:30:07
# Size of source mod 2**32: 1503 bytes
from clu... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
import os
import re
import sys
PY2 = sys.version_info[0] == 2
OPEN_ARGS = {} if PY2 else {'encoding': 'latin-1'}
def getsection(lines, i, delim):
i += 1
i0 = i
while i < len(lines) and not lines[i].startswith(delim):
i += 1
if i == len(lines):... |
# coding: utf-8
"""
Cloudbreak API
Cloudbreak is a powerful left surf that breaks over a coral reef, a mile off southwest the island of Tavarua, Fiji. Cloudbreak is a cloud agnostic Hadoop as a Service API. Abstracts the provisioning and ease management and monitoring of on-demand clusters. SequenceIQ's Cloud... |
"""This is a generated example file that is supposed to be modified."""
from typing import Optional
from pydantic import BaseModel
class ProductBase(BaseModel):
"""The base product model."""
id: Optional[int]
name: Optional[str]
price: Optional[float]
class ProductCreate(BaseModel):
"""POST r... |
import logging
import csv
import cv2
import numpy as np
import os
from keras.models import Sequential
from keras.layers import Flatten, Dense, Lambda, Activation, MaxPooling2D, Cropping2D, Dropout
from keras.layers import Convolution2D
def create_logger():
logger = logging.getLogger(__name__)
logger.setLevel... |
import logging
import requests
import urllib
class AzkabanScheduler:
def __init__(self, url: str, port: str, environment: str, session_id: str):
self._url = f"https://{url}:{port}/schedule"
self._environment = environment
self._session_id = session_id
self._logger = logging.getLog... |
import cPickle as pickle
import os; import sys; sys.path.append('..')
import gp
import gp.nets as nets
# PATCH_PATH = ('ipmlb')
X_train, y_train, X_test, y_test = gp.Patch.load_small()
print 'Training patches', y_train.shape[0]
print 'Test patches', y_test.shape[0]
cnn = nets.RGBANetPlus()
cnn = cnn.fit(X_train, ... |
import unittest
import os
import pyopenms
class TestSpectraFilter(unittest.TestCase):
def setUp(self):
dirname = os.path.dirname(os.path.abspath(__file__))
self.filename = os.path.join(dirname, "test2.mzML").encode()
self.exp = pyopenms.MSExperiment()
pyopenms.MzMLFile().load(self... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from . import __version__ as app_version
app_name = "mada_app"
app_title = "Mada App"
app_publisher = "beshoyatef31@gmail.com"
app_description = "Employee Applications"
app_icon = "octicon octicon-file-directory"
app_color = "grey"
app_email = "beshoyatef... |
from mayan.apps.appearance.classes import Icon
icon_document_ocr_content = Icon(driver_name='fontawesome', symbol='font')
icon_document_ocr_content_delete = Icon(
driver_name='fontawesome-dual', primary_symbol='font',
secondary_symbol='times'
)
icon_document_page_ocr_content = Icon(driver_name='fontawesome', s... |
# Created by Plutoberth
import subprocess, sys
from pathlib import Path
def enter_to_exit():
input("Enter to exit...")
sys.exit()
def ask_for_file():
file_name = input("filename: ")
print("-------------------------------------------------")
return file_name
def add_headers(fu... |
# MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# 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 without limitation
# the rights to use, copy, ... |
# -*- coding: utf-8 -*-
# Copyright 2020 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 o... |
# uniform content loss + adaptive threshold + per_class_input + recursive G
# improvement upon cqf37
from __future__ import division
import os, scipy.io
import tensorflow as tf
import tensorflow.contrib.slim as slim
import numpy as np
import rawpy
import glob
from scipy import misc
input_dir = './dataset/So... |
from typing import Any, Dict, Optional
import httpx
from ...client import Client
from ...models.action_menu_modules_result import ActionMenuModulesResult
from ...types import Response
def _get_kwargs(
conn_id: str,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/action-menu/{conn_id}/request".form... |
from django.db import DatabaseError
from django.forms import ModelForm, Field, ValidationError, BooleanField
from django.forms.widgets import CheckboxInput
from explorer.models import Query, MSG_FAILED_BLACKLIST
_ = lambda x: x
class SqlField(Field):
def validate(self, value):
"""
Ensure that t... |
# -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
class ScrapyDoubanSpiderMiddleware(object):
# Not all methods need to be defined. If a method is not defined,
# scr... |
# 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
from .. import _utilities, _tables
from ... |
from __future__ import absolute_import
import responses
from exam import fixture
from django.test import RequestFactory
from sentry.testutils import PluginTestCase
from sentry.utils import json
from sentry_plugins.trello.plugin import TrelloPlugin
class TrelloPluginTestBase(PluginTestCase):
@fixture
def pl... |
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2019, Myrtle Software Limited. 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
#
# ... |
from django.contrib import admin
from django import forms
from .models import Contact
class ContactForm(forms.ModelForm):
# name = forms.CharField(widget=CustomWidget())
class Meta:
model = Contact
@admin.register(Contact)
class ContactAdmin(admin.ModelAdmin):
readonly_fields = ('created_at', '... |
from typing import Generator
from app.db.auth import MongoClient as client
async def get_session() -> Generator:
session = await client.start_session()
try:
yield session
finally:
await session.end_session()
|
def http_status(status):
match status:
case 400:
return "Bad request"
case 401:
return "Unauthorized"
case 403:
return "Forbidden"
case 404:
return "Not found"
# output
def http_status(status):
match status:
case 4... |
import datetime
import uuid
from collections import namedtuple
from contextlib import contextmanager
from datetime import timedelta
from decimal import Decimal
from functools import partial
from io import BytesIO
from typing import List, Optional
from unittest.mock import MagicMock, Mock
import graphene
import pytest
... |
import collections
from abc import ABC, abstractmethod
import math
import time
import numpy as np
from scipy.constants import G
import scipy.linalg
from ..common import SystemState, GlobalConfig
from .. import common
def _norm(r):
"""Custom Euler norm calculator for 3-vectors
Seems slightly faster than `sci... |
"""A prompt library for rplugin in Neovim."""
__author__ = 'lambdalisue'
__license__ = 'MIT'
|
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
from keras import backend as K
import tensorflow as tf
import numpy as np
from keras import layers, initializers, regularizers, constraints
from keras.utils import conv_utils
from keras.layers import InputSpec
from keras.utils.conv_utils import conv_output_length
cf = K.image_data_format() == '..'
useGPU = True
def ... |
"""@file scorer_factory.py
contains the Scorer factory"""
from . import equal_error_rate, equal_error_rate_from_ivecs
def factory(scorer):
"""
gets a scorer class
Args:
scorer: the scorer type
Returns:
a scorer class
"""
if scorer == 'eer' or scorer == 'EER':
return ... |
#coding=utf8
from django.shortcuts import render
from django.views import generic
from django.http import HttpResponse, HttpResponseRedirect
from home.models import *
from django.views.decorators.csrf import csrf_exempt
from PIL import Image
from wsgiref.util import FileWrapper
import simplejson
import mimetypes
de... |
import os
import configparser
# Project BaseDIR
config_file_path = os.path.abspath(os.path.join("..", os.getcwd()))
config = configparser.ConfigParser()
config.read(f"{config_file_path}/config.ini")
# DATABASE Settings
DEBUG: bool = (
True if config["DATABASE"].get("DEBUG", False) in ["True", "true"] else False
)... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
# Copyright 2019 Alibaba Cloud Inc. 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 la... |
"""Verbs ported from r-stats"""
from typing import Iterable
from pandas import DataFrame, isna
from pipda import register_verb
from ..core.defaults import NA_REPR
from ..core.grouped import DataFrameGroupBy
@register_verb(DataFrame)
def set_names(obj: DataFrame, names: Iterable[str]) -> DataFrame:
"""Set names ... |
"""
Q062
Unique Paths
Medium
A robot is located at the top-left corner of a m x n grid
(marked 'Start' in the diagram below).
The robot can only move either down or right at any point
in time. The robot is trying to reach the bottom-right
corner of the grid (marked 'Finish' in the diagram below).
How many possible u... |
from concurrent.futures import process
from pymongo import MongoClient
import boto3
from botocore.exceptions import NoCredentialsError
import os
from dotenv import load_dotenv
load_dotenv()
ACCESS_KEY = os.getenv("ACCESS_KEY")
SECRET_KEY = os.getenv("SECRET_KEY")
def s3_upload(processed_file_path, process_code, typ... |
import ped_parser
def parse_ped(ped_file) -> dict:
family = dict()
with open(ped_file, 'r') as ped_handle:
ped_obj = ped_parser.FamilyParser(ped_handle)
family_name, family_obj = list(ped_obj.families.items())[0]
family['family_id'] = family_name
samples = [
{
'sam... |
# coding=utf-8
# Copyright 2020 The TensorFlow Datasets 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 appl... |
import info
class subinfo( info.infoclass ):
def setTargets( self ):
for ver in ["1.4.18"]:
self.targets[ ver ] = f"https://ftp.gnu.org/gnu/m4/m4-{ver}.tar.xz"
self.targetInstSrc[ ver ] = f"m4-{ver}"
self.targetInstallPath[ver] = "dev-utils"
self.targetDigests[... |
# Copyright 2021. FastyBird s.r.o.
#
# 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... |
from algoritmia.problems.sorting.interfaces import IInPlaceSorter, ISorter
from random import randrange
class InPlaceQuickSorter(IInPlaceSorter):#[three
def sort(self, a: "IList<T>"):
def _quicksort(p: "int", r: "int"):
while r - p > 1:
pivot = a[r-1]
i =... |
import os
import requests
from django.conf import settings
from django.apps import AppConfig
from constance import config
import tau.twitchevents.webhook_payloads as webhook_payloads
from .utils import refresh_access_token, setup_ngrok, log_request
class CoreConfig(AppConfig):
name = 'tau.core'
verbose_nam... |
# In the Name of ALLAH
def add_numbers(a,b):
return a + b
if __name__ == '__main__':
print(add_numbers(1,2))
|
# coding=utf-8
# Generated by Django 2.0.7 on 2018-07-27 10:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('forms', '0003_auto_20180522_0820'),
]
operations = [
migrations.AlterField(
model_name='field',
name=... |
# test_increment_decrement_pytest.py
from increment_decrement import decrement
from increment_decrement import increment
def test_increment():
x = 5
expected = 6
actual = increment(x)
assert actual == expected
def test_decrement():
x = 5
expected = 4
actual = decrement(x)
assert actu... |
#To make python 2 and python 3 compatible code
from __future__ import division
from __future__ import absolute_import
#Imports
import sys
if sys.version_info[0] < 3:#e.g python version <3
import cv2
else:
import cv2
from cv2 import cv2
# pylint: disable=E1101
# pylint: disable=E0401
# Disabling linting tha... |
try:
from distributed_single_sentence_classification.model_interface import model_zoo
from distillation import distillation_utils
from loss import loss_utils
except:
from distributed_single_sentence_classification.model_interface import model_zoo
from distillation import distillation_utils
from loss import loss_u... |
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from ... |
# Copyright (c) 2021 AccelByte Inc. All Rights Reserved.
# This is licensed software from AccelByte Inc, for limitations
# and restrictions contact your company contract manager.
#
# Code generated. DO NOT EDIT!
# template file: justice_py_sdk_codegen/__main__.py
"""Auto-generated package that contains models used b... |
#!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt stringdefs so that
they can be picked up by Qt linguist.
'''
from __future__ import division,print_function,unicode_literals
from subprocess import Popen, PIPE
import glob
import operator
import os
import sys
OUT_CPP="qt/onlaxstrings.cpp"... |
if __name__=='__main__':
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import config
import pyautogui
import numpy as np
from config import REGION
import cv2 as cv
screenshot = pyautogui.screenshot(region=REGION)
left, ... |
import asyncio
import decimal
import unittest
def tearDownModule():
asyncio.set_event_loop_policy(None)
class DecimalContextTest(unittest.TestCase):
def test_asyncio_task_decimal_context(self):
async def fractions(t, precision, x, y):
with decimal.localcontext() as ctx:
... |
# 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... |
""" Utilities """
import logging
import os
import re
import time
import unicodedata
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
from distlib.locators import Locator
from distlib.util import split_filename
from distlib.wheel import Wheel
LOG = logging.getLogger(__name__)
ALL_EXTENSIONS = Locat... |
import torch as th
import numpy as np
import networkx as nx
import matplotlib.pyplot as plt
from dgl_transformer.modules.layers import *
from dgl_transformer.modules.functions import *
from dgl_transformer.modules.embedding import *
from dgl_transformer.modules.viz import att_animation, get_attention_map
from dgl_tra... |
from subprocess import Popen, PIPE, DEVNULL, STDOUT
import os
import random
from pathlib import Path
from PIL import Image
import imagehash
from math import ceil, sqrt
import shutil
import tempfile
from os.path import join
from .exceptions import DownloadFailed
# working_temp_dir = join(tempfile.mkdtemp(), "files/")
... |
import os
import pandas as pd
COMPETITION_NAME = "tabular-playground-series-sep-2021"
SUBMISSION_DIR = "."
SUBMISSION_FILE = "sub_stacking_lgb_xbg_cat_imputer_no_imputer_v2_0930_1030_0.81686.gz"
SUBMISSION_MESSAGE = '"Stacking: LGB, XGB, Cat with and without imputation old/new LGBs/XGB/Cat,tsne,LR,mean/median/all L... |
"""Unit tests for reviewboard.accounts.mixins.UserProfileRequiredViewMixin."""
from django.contrib.auth.models import AnonymousUser, User
from django.http import HttpResponse
from django.test.client import RequestFactory
from django.views.generic.base import View
from reviewboard.accounts.mixins import UserProfileReq... |
# Copyright The PyTorch Lightning team.
#
# 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 i... |
from streamlink.plugins.nimotv import NimoTV
from tests.plugins import PluginCanHandleUrl
class TestPluginNimoTV(PluginCanHandleUrl):
__plugin__ = NimoTV
should_match = [
'http://www.nimo.tv/live/737614',
'https://www.nimo.tv/live/737614',
'http://www.nimo.tv/sanz',
'https://w... |
from datetime import datetime, timedelta
import asyncio
import discord
import discord_components
import discordbot.config_discordbot as cfg
import discordbot.helpers
from discordbot.stocks.technical_analysis.ema import ema_command
from discordbot.stocks.technical_analysis.sma import sma_command
from discordbot.stocks... |
from metadrive.component.pgblock.bottleneck import PGBlock
from metadrive.component.pgblock.create_pg_block_utils import CreateAdverseRoad, CreateRoadFrom, ExtendStraightLane
from metadrive.component.pgblock.pg_block import PGBlockSocket
from metadrive.component.buildings.tollgate_building import TollGateBuilding
from ... |
from typing import Optional
from botocore.client import BaseClient
from typing import Dict
from botocore.paginate import Paginator
from datetime import datetime
from botocore.waiter import Waiter
from typing import Union
from typing import List
class Client(BaseClient):
def associate_configuration_items_to_applic... |
''' Desenvolva um programa que leia o primeiro termo e a razão de uma PA.
No final, mostre os 10 primeiros termos dessa progressão.'''
'''final = 0
primeiro = int(input('qual o primeiro termo da progressão? '))
razao = int(input('e qual a razão? '))
for c in range(1, 11):
final = primeiro + razao
primeiro = fi... |
# Copyright (c) 2011 Intel Corporation
# Copyright (c) 2011 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/l... |
#! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
import os,re,sys,shutil
from waflib import Utils,Errors
exclude_regs='''
**/*~
**/#*#
**/.#*
**/%*%
**/._*
**/CVS
**/CVS/**
**/.cvsignore
**/SCCS
**/SCCS/**
**/vssver.scc
**/.svn
**/.svn/**
**/BitKee... |
import ctypes
import multiprocessing as mp
from procgen_adventure.utils.synchronize import RWLock
class AsyncReplayBufferMixin:
"""Mixin class which manages the buffer (shared) memory under a read-write
lock (multiple-reader, single-writer), for use with the asynchronous
runner. Wraps the ``append_sample... |
#!/usr/bin/env python
'''
tag_generator.py
Copyright 2017 Long Qian
Contact: lqian8@jhu.edu
This script creates tags for your Jekyll blog hosted by Github page.
No plugins required.
'''
import glob
import os
post_dir = '_posts/'
tag_dir = 'tag/'
filenames = glob.glob(post_dir + '*md')
total_tags = []
for filenam... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Crawler for [novelplanet.com](https://novelplanet.com/).
"""
import json
import logging
import re
from bs4 import BeautifulSoup
from .utils.crawler import Crawler
logger = logging.getLogger('NOVEL_PLANET')
class NovelPlanetCrawler(Crawler):
@property
def sup... |
# -*- coding: utf-8 -*-
"""Tests for exporter.py"""
import os
from OASDGLDatachecker.tool_quality_checks.exporter import export_checks_from_db_to_gpkg
from OASDGLDatachecker.tool_quality_checks.scripts import SettingsObject
from OASDGLDatachecker.tool_quality_checks.db import (
ThreediDatabase,
create_database... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) IBM Corporation 2018
#
# 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
#
# U... |
from invoke import Collection, Program
from dbt_invoke import properties
from dbt_invoke.internal import _version
ns = Collection()
ns.add_collection(properties)
program = Program(namespace=ns, version=_version.__version__)
|
import unittest
import pickle
from ctypes import *
import _ctypes_test
dll = CDLL(_ctypes_test.__file__)
class X(Structure):
_fields_ = [("a", c_int), ("b", c_double)]
init_called = 0
def __init__(self, *args, **kw):
X.init_called += 1
self.x = 42
class Y(X):
_fields_ = [... |
#!/usr/bin/env python
import rospy
from ros_f9p_driver import ZEDF9P
if __name__ == "__main__":
rospy.init_node('zed-f9p-gps')
port = rospy.get_param('~port', '/dev/gps')
baudrate = rospy.get_param('~baudrate', 460800)
timeout = rospy.get_param('~timeout', 1)
gnssType = rospy.get_param('~gnssType... |
import os
import time
import fero
from fero import FeroError
from typing import Optional, Union
from marshmallow import (
Schema,
fields,
validate,
EXCLUDE,
)
from .common import FeroObject
class DataSourceSchema(Schema):
class Meta:
unknown = EXCLUDE
uuid = fields.UUID(required=True... |
# Copyright 2019 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
'''
Description:
Given head which is a reference node to a singly-linked list. The value of each node in the linked list is either 0 or 1. The linked list holds the binary representation of a number.
Return the decimal value of the number in the linked list.
Example 1:
Input: head = [1,0,1]
Output: 5
Explanati... |
from faceoff import app
if __name__=='__main__':
app.run()
|
"""
========================
Broadcasting over arrays
========================
.. note::
See `this article
<https://numpy.org/devdocs/user/theory.broadcasting.html>`_
for illustrations of broadcasting concepts.
The term broadcasting describes how numpy treats arrays with different
shapes during arithmeti... |
import os
import sys
import urllib.request
from setuptools import Extension, find_packages, setup
from setuptools.command.build_ext import build_ext as _build_ext
COORDIO_BASE = 'https://raw.githubusercontent.com/sdss/coordio/master/'
class getPybindInclude(object):
"""Helper class to determine the pybind11 inc... |
import logging
from typing import Any, Dict, List, TypedDict
from utility import Utility
log: logging.Logger = logging.getLogger(__name__)
class EquipmentIDs(TypedDict):
"""Structure of loot/equipment_ids.csv"""
id: int
ref: str
rarity: int
price: int
salvage: int
license: int
premi... |
import requests#爬虫的请求库
import os#系统的一个库
#http://www.lovewzly.com/api/user/pc/list/search?startage=21&endage=30&gender=2&cityid=52&marry=1&page=1
#http://www.lovewzly.com/api/user/pc/list/search?startage=21&endage=30&gender=2&cityid=52&startheight=161&endheight=170&marry=1&education=10&salary=2&page=1
#查询条件 年龄 性别 ... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.16
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... |
from os import path
from setuptools import setup
# Project
NAME = 'loyverse'
VERSION = '0.1.0'
# Maintainer
MAINTAINER = 'Matteo Berchier'
MAINTAINER_EMAIL = 'maberchier@gmail.com'
# Long description
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'PYPI.md'), encoding='utf-8... |
import abc
from collections import namedtuple, OrderedDict
from itertools import repeat
from textwrap import dedent
from weakref import WeakKeyDictionary
from toolz import first
from zipline.currency import Currency
from zipline.data.fx import DEFAULT_FX_RATE
from zipline.pipeline.classifiers import Classifier, Lates... |
import FWCore.ParameterSet.Config as cms
from FWCore.ParameterSet.VarParsing import VarParsing
process = cms.Process("reader")
process.load("FWCore.MessageLogger.MessageLogger_cfi")
process.MessageLogger.cout.threshold = cms.untracked.string('INFO')
process.MessageLogger.debugModules = cms.untracked.vstring('*')
pro... |
#
# Copyright 2019 The FATE 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 __future__ import unicode_literals
import re
from setuptools import setup, find_packages
def get_version(filename):
content = open(filename).read()
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", content))
return metadata['version']
setup(
name='Mopidy-Podcast-gpodder.net',
version=... |
#!/usr/bin/env python
"""Define converters to convert between Python (numpy) and C++ (std::vecotr, Eigen, etc) types
Implements individual converters along with generic 'convert' function."""
from load import ROOT as R
import numpy as N
from collections import defaultdict
from inspect import getmro
from gna import co... |
from django.test import TestCase, TransactionTestCase
from django.contrib.auth.models import Group, User
from django.http import HttpRequest, QueryDict
from hs_core.hydroshare import resource
from hs_core import hydroshare
from hs_script_resource.models import ScriptSpecificMetadata, ScriptResource
from hs_script_re... |
import os
import re
import sys
import json
#upper import
sys.path.append("../../")
from utils import levenshtein
from utils.io import load_json, write_to
def strQ2B(ustring):
"""全角转半角"""
rstring = ""
for uchar in ustring:
inside_code=ord(uchar)
if inside_code == 12288: ... |
import FWCore.ParameterSet.Config as cms
# filter on trigger type
calibrationEventsFilter = cms.EDFilter("HLTTriggerTypeFilter",
# 1=Physics, 2=Calibration, 3=Random, 4=Technical
SelectedTriggerType = cms.int32(2)
... |
# coding: utf-8
import sys
from setuptools import setup, find_packages
NAME = "mparticle"
VERSION = "0.12.1"
# To install the library, run the following
#
# python setup.py install
#
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python... |
#
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.