text stringlengths 1 927k |
|---|
#!/usr/bin/python
# -*- coding: latin-1 -*-
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is d... |
# -*- 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... |
from django.urls import path
from django.views.generic import TemplateView, RedirectView
from . import views
urlpatterns = [
path('', views.index),
path('model.json', RedirectView.as_view(url='http://rickyhan.com/static/crepe_model_full/model.json', permanent=True)),
] |
import contextlib
from contextlib import contextmanager
import inspect
import os
import sys
from typing import List
import pytest
import ddtrace
from ddtrace import Span
from ddtrace import Tracer
from ddtrace.compat import httplib
from ddtrace.compat import parse
from ddtrace.compat import to_unicode
from ddtrace.co... |
import falcon
from falcon_pagination_processor import PaginationProcessor
from tests.falcon.resources import TestResourceCollection
api = falcon.API(middleware=[PaginationProcessor()])
api.add_route(TestResourceCollection.route, TestResourceCollection()) |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Author: Niccolò Bonacchi
# @Date: Friday, October 30th 2020, 10:42:49 am
import unittest
import ibllib.io.extractors.ephys_passive as passive
import numpy as np
class TestsPassiveExtractor(unittest.TestCase):
def setUp(self):
pass
def test_load_passive... |
import functools
import itertools
import logging
from collections import defaultdict
from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Union
import numpy
import pandas
from pydantic import Field, root_validator, validator
from scipy.optimize import linear_sum_assignment
from typing_extensions import Liter... |
"""Initialize Migration
Revision ID: 9ede8d2d7089
Revises:
Create Date: 2020-09-28 00:25:38.033227
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '9ede8d2d7089'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands au... |
from sparkdq.analytics.states.State import DoubleValuedState
class ModeState(DoubleValuedState):
def __init__(self, mode_value):
self.mode_value = mode_value
def metric_value(self):
return self.mode_value
# def sum(self, other):
# return ModeState(max(self.mode_value, other.mode... |
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 14 16:03:32 2022
@author: dariu
"""
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 7 12:43:25 2021
@author: dariu
"""
import numpy as np
import pandas as pd
import os
from tqdm import tqdm
import pacmap
import matplotlib.pyplot as plt
from sklearn.manifold import TSNE... |
import skimage.io
import numpy as np
import pandas as pd
import sys
from pathlib import Path
import pickle
import argparse
import cv2
parser = argparse.ArgumentParser()
parser.add_argument("--base_dir", default='G:/Datasets/panda', required=False)
parser.add_argument("--out_dir", default='D:/Datasets/panda', required... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-08-21 06:47
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mooring', '0039_admissionsbooking'),
]
operations = [
migrations.AddField(
... |
from future import print_function
import readdata
dd = readdata.Dexcom.FindDevice()
dr = readdata.Dexcom(dd)
meter_records = dr.ReadRecords('METER_DATA')
print('First Meter Record = ')
print(meter_records[0])
print('Last Meter Record =')
print(meter_records[-1])
insertion_records = dr.ReadRecords('INSERTION_TIME')
p... |
from pathlib import Path
def release(data: dict, outfile: Path) -> None:
with open(outfile, "w") as fh:
fls = [dd["flags"] for dd in data["data"]]
fh.write("|".join(fls))
def main() -> None:
from . import parser
infile = Path("sources/rout.txt")
outfile = Path("releases/latest/windo... |
# The isBadVersion API is already defined for you.
# @param version, an integer
# @return a bool
# def isBadVersion(version):
class Solution(object):
def firstBadVersion(self, n):
"""
:type n: int
:rtype: int
"""
low, high = 1, n
while True:
if isBadVersi... |
from typing import Tuple, FrozenSet
from pysmt.environment import Environment as PysmtEnv
from pysmt.fnode import FNode
import pysmt.typing as types
from utils import symb_to_next
from hint import Hint, Location
def transition_system(env: PysmtEnv) -> Tuple[FrozenSet[FNode], FNode, FNode,
... |
v = int(input('\033[4;33;42mDigite a velocidade do carro: \033[m'))
lim = 80
m = 7
km = (v-lim)
if v > lim:
print('\033[1;30;41mVocê será multado em R${:.2f}.\033[m'.format(km*m))
else:
print('Parabéns você dirige com atenção!') |
from __future__ import absolute_import
from .__init__ import _
from Components.config import config
import time
PLUGIN_BASE = "KiddyTimer"
PLUGIN_VERSION = "1.3"
DAYNAMES = (_("Sunday"),
_("Monday"),
_("Tuesday"),
_("Wednesday"),
_("Thursday"),
_("Friday"),
... |
"""
Tax-Calculator functions that calculate payroll and individual income taxes.
These functions are imported into the Calculator class.
Note: the parameter_indexing_CPI_offset policy parameter is the only
policy parameter that does not appear here; it is used in the policy.py
file to possibly adjust the price inflat... |
from volttron.platform.vip.pubsubservice import PubSubService, ProtectedPubSubTopics
from mock import Mock, MagicMock
import pytest
@pytest.fixture(params=[
dict(has_external_routing=True),
dict(has_external_routing=False)
])
def pubsub_service(request):
moc... |
# coding: utf-8
"""
Package resource API
--------------------
A resource is a logical file contained within a package, or a logical
subdirectory thereof. The package resource API expects resource names
to have their path parts separated with ``/``, *not* whatever the local
path separator is. Do not use os.path opera... |
import uuid
from collections import defaultdict
from itertools import combinations
from typing import Any, Dict, List, Tuple
from dagster import OutputDefinition, pipeline, solid
from tinydb import Query
from food_ke.labelstudio import (
LSAnnotationResult,
LSAnnotationValue,
LSPreAnnotation,
LSPredic... |
# 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 numpy as np
import os
import argparse
import pylab as pl
import subprocess as sp
import astropy.io.fits as pyfits
import pandas as pd
import scipy.special as ss
import om10_lensing_equations as ole
data_dir = os.path.join(os.environ['SIMS_GCRCATSIMINTERFACE_DIR'], 'data')
twinkles_data_dir = os.path.join(os.env... |
from PyQt5 import QtWidgets
from PyQt5.QtCore import Qt
from .gui_rename_dialog import Ui_Dialog
class RenameDialog(QtWidgets.QDialog, Ui_Dialog):
# static variables
is_opened = False
_instance = None
int32_max = 2147483647
def __init__(self, expression='', offset=0, c_mult_facotr=1,
... |
import sys
sys.stdin = open("19238.txt")
from collections import deque
N,M,oil = map(int, input().split())
jido = [0]+[[0]+list(map(int, input().split())) for _ in range(N)]
tay, tax = map(int, input().split())
cst = [list(map(int, input().split())) for _ in range(M)]
dx = [0, -1,1,0]
dy = [-1, 0,0,1]
for i in r... |
import os
import sys
import pandas as pd
data_set = ["results/H-RTCF-degree-0.csv",
"results/H-RTCF-degree-1.csv",
"results/H-RTCF-degree-2.csv",
"results/H-RTCF-degree-3.csv"]
for data in data_set:
if not os.path.exists(data):
print("Cannot find data file '%s'" % data... |
# -*- 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/stable/config
# -- Path setup ------------------------------------------------------------... |
from __future__ import absolute_import
from django.core.urlresolvers import reverse
from sentry.integrations.issues import IssueBasicMixin
from sentry.integrations.exceptions import ApiError, IntegrationFormError
ISSUE_TYPES = (
('bug', 'Bug'), ('enhancement', 'Enhancement'), ('proposal', 'Proposal'), ('task', 'T... |
import pytest
import json
import jsonpickle
import os.path
import importlib
from fixture.application import Application
from fixture.db import DbFixture
fixture = None
target = None
def load_config(file):
global target
if target is None:
config_file = os.path.join(os.path.dirname(os.path.abspath(__fi... |
# qubit number=4
# total number=42
import cirq
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2
import numpy as np
import networkx as nx
def bitwise_... |
import os
import logging
import time
from selenium.webdriver.common.by import By
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.keys import Keys
from ocs_ci.ocs import constants
from ocs_ci.ocs.exceptions import ACMClusterDeployException
from ocs_ci.ocs.ui.base_ui import BaseUI
... |
"""Auto-generated file, do not edit by hand. KG metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_KG = PhoneMetadata(id='KG', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='[14]\\d{2,3}', possible_number_pattern=... |
from flask import Flask
from flask_mail import Message, Mail
from app.lazy import lazy_async
class MailAgent:
def __init__(self, app: Flask):
self.mail = Mail(app)
self.app = app
@lazy_async
def _async_mail(self, msg: Message):
with self.app.app_context():
self.mail.se... |
import scrapy
from os import path
INDEX_PATH = './resources/index'
RECORD_PATH = './resources/record'
class NewsSpider(scrapy.Spider):
name = "index"
start_urls = ['http://fund.10jqka.com.cn/smxw_list/index_1.shtml']
def parse_record(self, response):
filename: str = response.url.split('/')[-1]
... |
# Support for python2
from __future__ import print_function
import sys
from ctypes import *
from os import path
import numpy as np
from . import plotutils, utils, platform_specifics
if utils.gcc_major_version_greater_than(7):
c_len_type = c_size_t # c_size_t on GCC > 7
else:
c_len_type = c_int
class thermop... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Modified to ignore SSL verification, since I can't currently
# get it to accept proper SSL connections from the Omni CA
import os
import requests
import urllib3
# Silence the SubjectAltNameWarning that our self-signed CA gives
urllib3.disable_warnings(urllib3.exceptio... |
from abc import abstractmethod
from typing import Any, Dict
import pandas as pd
from .metric_test import MetricTest
from overrides import overrides
from munch import Munch
from expanded_checklist.checklist.utils import \
DataShape, is_2d_list, ACCUMULATED_STR
pd.options.display.float_format = "{:,.2f}".format
cla... |
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
from itertools import product
import torch
from fvcore.common.benchmark import benchmark
from pytorch3d.ops.interp_face_attrs import (
interpolate_face_attributes,
interpolate_face_attributes_python,
)
def _generate_data(N, S, K, F, D, ... |
# Chap02/twitter_hashtag_frequency.py
import sys
from collections import Counter
import json
def get_hashtags(tweet):
entities = tweet.get('entities', {})
hashtags = entities.get('hashtags', [])
return [tag['text'].lower() for tag in hashtags]
if __name__ == '__main__':
fname = sys.argv[1]
with op... |
from __future__ import absolute_import, unicode_literals
# from time import sleep
import binascii
import os
from celery import shared_task
from django.conf import settings
# Django
from django.core.cache import cache
from django.core.mail import send_mail
from django.template.loader import render_to_string
# local... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import django
try:
import pytz
except ImportError:
pytz = None
from collections import OrderedDict
from django import forms
from django.conf import settings
from django.contrib import admin
from django.utils import timezone
fro... |
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""
Map URL prefixes to WSGI applications. See ``URLMap``
"""
import re
import os
import cgi
try:
# Python 3
from collections import MutableM... |
import Inline
import Core
import web
info = {
"friendly_name": "Attachment",
"example_template": "pagename:attachmentname",
"summary": "Links to an attachment of this (or another, named) page.",
"details": """
<p>If invoked as [attachment some.filename], it will either embed (if
the attachment... |
"""List primitive ops."""
from typing import List
from mypyc.ir.ops import ERR_MAGIC, ERR_NEVER, ERR_FALSE, EmitterInterface
from mypyc.ir.rtypes import (
int_rprimitive,
short_int_rprimitive,
list_rprimitive,
object_rprimitive,
bool_rprimitive,
)
from mypyc.primitives.registry import (
name_r... |
# Copyright 2014 Rackspace
# 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 app... |
from __future__ import print_function
import FWCore.ParameterSet.Config as cms
maxevents=10
isMC=False
#isMC=True
process = cms.Process('TEST')
#process.load('JetMETAnalysis.PromptAnalysis.ntuple_cff')
process.load('Configuration.StandardSequences.Services_cff')
process.load('Configuration/StandardSequences/Geomet... |
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 26 15:15:55 2018
@author: Madhur Kashyap 2016EEZ8350
"""
import os
import sys
import logging
from keras.optimizers import Adam
prog = os.path.basename(__file__)
codedir = os.path.join(os.path.dirname(__file__),"..","code")
sys.path.append(codedir)
from Utils import ini... |
# Copyright 2018, The TensorFlow Federated 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... |
'''
Conduct Sentiment Analysis
Chun Hu, Yimin Li, Tianyue Niu
'''
import os
import json
import re
import pandas as pd
import nltk
nltk.download('punkt')
nltk.download('wordnet')
nltk.download('stopwords')
from nltk import word_tokenize, sent_tokenize
from nltk.corpus import stopwords
from nltk.stem import WordNetLemma... |
#! /usr/bin/env python
from pygments.lexer import RegexLexer
from pygments.token import *
class CapnpLexer(RegexLexer):
name = "Cap'n Proto lexer"
aliases = ['capnp']
filenames = ['*.capnp']
tokens = {
'root': [
(r'#.*?$', Comment.Single),
(r'@[0-9a-zA-Z]*', Name.Decor... |
# Copyright 2013 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.
{
'targets': [
{
'target_name': 'memconsumer',
'type': 'none',
'dependencies': [
'memconsumer_apk',
],
},
{
... |
import os
from glob import glob
from setuptools import setup
package_name = 'ros2_sub'
setup(
name=package_name,
version='0.0.0',
packages=[package_name],
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + package_name, ['p... |
from unittest import mock
import pytest
from oauthlib.common import Request as OAuthRequest
from h.oauth.tokens import BearerToken
class TestBearerToken:
@pytest.mark.parametrize(
"attr",
[
"request_validator",
"token_generator",
"expires_in",
"ref... |
#!/usr/bin/env python
# core modules
import datetime
import flask_babel
# 3rd party modules
from flask import Flask, flash, render_template
from flask_babel import Babel, _
def format_datetime(value, format="medium"):
import flask_babel
if format == "full":
format = "EEEE, d. MMMM y 'at' HH:mm"
... |
from typing import Optional
import pytorch_lightning as pl
import torchvision
import torchvision.transforms as transforms
from torchvision.datasets import CIFAR10
from torch.utils.data import DataLoader, random_split
class CIFARDataModule(pl.LightningDataModule):
def __init__(self, data_dir: str = "./data", batch... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-20 23:29
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('outreach', '0001_initial'),
]
operations = [
... |
import six
from chainer.functions.pooling import pooling_nd_kernel
from chainer.utils import conv_nd_kernel
class MaxPoolingNDKernelForward(pooling_nd_kernel.PoolingNDKernelForward):
def name(self):
# max_pool_{N}d_fwd
return 'max'
def out_params(self):
# T out, S indexes
re... |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
CLASSIFIERS = [
'Development Status :: 1 - Planning',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Prog... |
import os
import subprocess
import re
import sys
import shutil
import siliconcompiler
####################################################################
# Make Docs
####################################################################
def make_docs():
'''
The OpenFPGALoader is a universal utility for program... |
from abc import ABC, abstractmethod
from typing import List
from sqlalchemy.engine import CursorResult, Inspector
from sqlalchemy.orm.scoping import ScopedSession
from .database import _ALLOWED_DRIVERS
from .exceptions.api_manager import ColumnNotExist, ConfigError
class Repository(ABC):
""" """
def __init... |
# 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... |
"""
Tests for Series cumulative operations.
See also
--------
tests.frame.test_cumulative
"""
from itertools import product
import numpy as np
import pytest
import pandas as pd
import pandas.util.testing as tm
def _check_accum_op(name, series, check_dtype=True):
func = getattr(np, name)
tm.assert_numpy_arr... |
#行缓冲打开
file=open("3.txt",'wb',buffering=10)
while True:
data=input("<<")
if not data:
break
file.write((data+"\n").encode())
# file.flush() #刷新缓冲
file.close() |
"""
Module for Serialization and Deserialization of a KNX Disconnect Request information.
Connect requests are used to disconnect a tunnel from a KNX/IP device.
"""
from xknx.exceptions import CouldNotParseKNXIP
from .body import KNXIPBody
from .hpai import HPAI
from .knxip_enum import KNXIPServiceType
class Discon... |
"""
Ibutsu API
A system to store and query test results # noqa: E501
The version of the OpenAPI document: 1.13.4
Generated by: https://openapi-generator.tech
"""
from datetime import date, datetime # noqa: F401
import inspect
import io
import os
import pprint
import re
import tempfile
from dateut... |
import time
import board
import neopixel
import threading
from flask import Flask
# Choose an open pin connected to the Data In of the NeoPixel strip, i.e. board.D18
# NeoPixels must be connected to D10, D12, D18 or D21 to work.
pixel_pin = board.D21
# The number of NeoPixels
num_pixels = 137
# The order of the pix... |
'''
Several testcases around <Flags> and <Flag>.
'''
import sys
sys.path.append("c:/peach")
from Peach.Generators.dictionary import *
from Peach.Generators.static import *
import unittest
import utils
import struct
def suite():
suite = unittest.TestSuite()
suite.addTest(FlagsInputTestCase())
suite.addTest(FlagsOu... |
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from pants.backend.codegen import export_codegen_goal
from pants.backend.docker.goals.tailor import rules as tailor_rules
from pants.backend.docker.rules import rules as docker_rules
from ... |
import copy
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from sklearn.mixture import GaussianMixture
from sklearn.cluster import KMeans
# Importing the dataset
data = pd.read_csv("ex.csv")
print("Input Data and Shape:")
print(data.head(3))
print("Shape:", data.shape)
# Getting the value... |
# -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
# Please remember to run "make -C docs html" after update "desc" attributes.
import argparse
import copy
import grp
import inspect
import os
import pwd
import re
import shlex
import ssl
impor... |
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Vantiv eCommerce
#
# 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, ... |
# Copyright 2017 The Forseti Security 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 ap... |
from __future__ import absolute_import
import sys
import difflib
from six.moves import range
def equal_strings(text1, text2, _cache=set()):
if text1==text2:
return True
d = difflib.Differ()
l = list(d.compare(text1.splitlines(1), text2.splitlines(1)))
d = {}
for i in range(len(l)):
i... |
# Copyright 2014-2015 Canonical Limited.
#
# 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 ... |
# Copyright 2021 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... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
'''
Pentestdb, a database for penetration test.
Copyright (c) 2015 alpha1e0
=====================================================================
字典管理。将字典加入到数据库中去重、对重复项加权打分;从数据库导出字典文件
'''
import os
import argparse
from libs.commons import Output
from libs.commons import W... |
'''
This is a script to train a model with a variety of estimators
'''
import pickle
import pandas as pd
from sklearn.neural_network import MLPRegressor
from config import Config
# Creating a path to save our model
Config.models_path.mkdir(parents=True, exist_ok=True)
# Loading the training and testing features into ... |
# coding: utf-8
import yaml
from unittest import TestCase, main
from hamcrest import assert_that, equal_to, starts_with
from pattern_matcher.interface import Interface
class MakeInterface(TestCase):
def test_str_should_succeed(self):
assert_that(str(Interface()), starts_with('interface anonymous_'))
... |
import cv2
import numpy as np
import matplotlib.pyplot as plt
# We will use the function implemented in the last quiz
# Find best match
def find_best_match(patch, strip):
# TODO: Find patch in strip and return column index (x value) of topleft corner
best_id = None
min_diff = np.inf
strip_n, patch_n =... |
# -*- coding: utf8 -*-
"""
exmail.apis.contact.
~~~~~~~~~~~~~~~~~~~~~~~
Contact apis.
"""
from exmail import exceptions
from exmail.apis.base import ExmailClient
from exmail.helpers import required_params
class UserApi(ExmailClient):
"""Contact apis."""
@required_params('userid', 'name', 'department', 'pa... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
#
# RMG Website - A Django-powered website for Reaction Mechanism Generator
#
# Copyright (c) 2011 Prof. William H. Green (whgreen@mit.edu) and the
# RMG Team (rmg_dev@mit.edu)
#
# Permission ... |
# 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
__al... |
import mmcv
def wider_face_classes():
return ['face']
def voc_classes():
return [
'aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus', 'car', 'cat',
'chair', 'cow', 'diningtable', 'dog', 'horse', 'motorbike', 'person',
'pottedplant', 'sheep', 'sofa', 'train', 'tvmonitor'
]
... |
from functools import partial
import pyarrow.parquet as pq
import dask.dataframe as dd
from dask.dataframe.io.parquet.arrow import ArrowEngine
import cudf
from cudf.core.column import build_categorical_column
class CudfEngine(ArrowEngine):
@staticmethod
def read_metadata(*args, **kwargs):
meta, sta... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import dask.dataframe as ddf
import pandas as pd
import time
from sklearn.neighbors.kde import KernelDensity
from scipy.optimize import curve_fit
import numpy as np
def infer_distribution_from_contig(contacts, K, K0):
"""
"""
longest_contig_name = contacts.loc[... |
index = 0
for item in ['ab', 'cd', 'ef']:
print("{0}: {1}".format(index, item))
index += 1 |
import pandas as pd
import sys
peak_calling=pd.read_excel(str(sys.argv[1]), str(sys.argv[4]))
peak_calling['Length'] = peak_calling['End'] - peak_calling['Start']
peak_calling1=pd.read_excel(str(sys.argv[1]), str(sys.argv[3]))
peak_calling1['Length'] = peak_calling1['End'] - peak_calling1['Start']
peak_calling2=pd... |
import requests
from requests.structures import CaseInsensitiveDict
from urllib.parse import urlparse
import json
import wget
import os
# Переменные программы
repo_link = str()
repo_segment = str()
branch = int()
branches_link = str()
branches_list = []
branch_link = str()
# Заголовки для запроса
headers = CaseInsens... |
import pytest
from pytest_mock import MockerFixture
from aerich.ddl.mysql import MysqlDDL
from aerich.ddl.postgres import PostgresDDL
from aerich.ddl.sqlite import SqliteDDL
from aerich.exceptions import NotSupportError
from aerich.migrate import Migrate
from aerich.utils import get_models_describe
old_models_describ... |
import pytest
from sovereign.utils.weighted_clusters import fit_weights
@pytest.mark.parametrize(
"weights,normalized",
[
pytest.param([1, 2, 3], [16, 33, 51] , id='1, 2, 3'),
pytest.param([20, 25, 1], [43, 54, 3] , id='20, 25, 1'),
pytest.param([20, 10, ... |
"""
Implements wrapper class and methods to work with Brightcove's EPG API.
See: https://apis.support.brightcove.com/epg/getting-started/overview-epg-api.html
"""
from requests.models import Response
from .Base import Base
from .OAuth import OAuth
class EPG(Base):
"""
Class to wrap the Brightcove EPG API calls. In... |
from fcntl import ioctl
import socket
class HCIConfig(object):
'''
This class allows to easily configure an HCI Interface.
'''
@staticmethod
def down(index):
'''
This class method stops an HCI interface.
Its role is equivalent to the following command : ``hciconfig hci<index> down``
:param index: index ... |
# Generated by Django 3.0.5 on 2020-11-17 02:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('webapi', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='products',
name='capacities',
... |
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.auth.models import User, Group
from .models import Vehicle
from .models import VehicleLicense
from .models import Violation
from .models import UserProfile
from .models import DriverLicense
from .models... |
#!/usr/bin/env python3
# Copyright (c) 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 HD Wallet keypool restore function.
Two nodes. Node1 is under test. Node0 is providing transactions an... |
#!/bin/sh
# -*- mode: 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.... |
import importlib
import logging
import re
import time
from datetime import datetime
from dateutil.parser import parse as parse_date, ParserError
from pprint import pformat
from robot.libraries.BuiltIn import BuiltIn, RobotNotRunningError
from robot.utils import timestr_to_secs
from cumulusci.robotframework.utils impor... |
# type: ignore
import os
from logging.config import fileConfig
from alembic import context
from sqlalchemy import engine_from_config, pool
from learning.entities import Base
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret th... |
#!/usr/bin/env python
"""
Copyright (c) 2017 Alex Forencich
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, modify, merg... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.