text stringlengths 2 999k |
|---|
from .bgg import Bgg
from .family_items import FamilyItem
from .forrum_list import ForumList
from .forrum_list import Forum
from .geeklist import GeekList
from .hot_item import HotItem
from .search import Search
from .thing import Thing
from .thread import Thread
from .user_collection import UserCollection
from .user i... |
import os
from conans.client.build.cppstd_flags import cppstd_default
from conans.errors import ConanException
from conans.model.env_info import EnvValues
from conans.model.options import OptionsValues
from conans.model.ref import PackageReference
from conans.model.values import Values
from conans.paths import CONANIN... |
"""
Copyright (c) Microsoft Corporation.
Licensed under the MIT license.
This code is modified by Linjie Li from Jin-Hwa Kim's repository.
https://github.com/jnhwkim/ban-vqa
MIT License
"""
from __future__ import print_function
import os
import json
import pickle
import numpy as np
import utils
import h5py
import torc... |
from django.test import TestCase
from risk_profile.insurance import InsuranceCalculate, Profile
class InsuranceTest(TestCase):
def setUp(self):
self.payload = {
"age": 35,
"dependents": 2,
"house": {"ownership_status": "owned"},
"income": 0,
"m... |
import urllib.request
import sys
import os
def update():
print("Updating database...")
url = "https://raw.githubusercontent.com/MrPotatoBobx/FetchCord/master/fetch_cord/testing.py"
urllib.request.urlretrieve(url, os.path.dirname(__file__) + "/testing.py")
sys.exit(0)
|
import time
class servo_switch(): #舵机直接设角度 (180度伺服)
def __init__(self):
pass
def set_angle(self,channel,angle = 0):
print("set channel {} angle = {}".format(channel,angle))
def read_angle(self): #可以通过读LED0_ON_H,LED0_ON_L知道当前角度,倒也没啥用
pass
class servo_360(): #360°电机
... |
# Maciej Izydorek
# Check if a number is prime.
# The primes are 2, 3, 5, 7, 11, 13 ...
p = 347
m = 2
isprime = True
#while m < p:
# if p % m == 0:
# print(m, "divides", p, "and therefore", p, "is not a prime.")
# isprime = False
# break
# m = m + 1
for m in range(2, p-1):
if p % m == 0:
... |
# mininode.py - Dolmen P2P network half-a-node
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# This python code was modified from ArtForz' public domain half-a-node, as
# found in the mini-node branch of http://github.co... |
import os
import sys
from telethon.sessions import StringSession
from telethon import TelegramClient
from var import Var
from pylast import LastFMNetwork, md5
from logging import basicConfig, getLogger, INFO, DEBUG
from distutils.util import strtobool as sb
from pySmartDL import SmartDL
from dotenv import load_dotenv
f... |
import numpy as np
from tifffile import tifffile
from cellfinder.detect.filters.plane_filters.classical_filter import (
enhance_peaks,
)
from cellfinder.detect.filters.plane_filters.tile_walker import TileWalker
class MpTileProcessor(object):
def __init__(self, thread_q, ball_filter_q):
self.thread_q... |
import copy
import logging
import tkinter as tk
import numpy as np
from gui.operations import computer_vision
from gui.operations.matlib_template import MatLibTemplate
from gui.tabpicture import TabPicture
from img_utils.EntryTable import EntryTable
class Morphology(MatLibTemplate):
"""
Dictionary to hold al... |
#!/usr/bin/env python
#
# PatchLength.py
#
import sys
def ReadField(file):
data = file.read(4)
return ord(data[0]) | (ord(data[1]) << 8) | (ord(data[2]) << 16) | (ord(data[3]) << 24)
def EncodeInt(x):
return chr(x&0xff) + chr((x>>8)&0xff) + chr((x>>16)&0xff) + chr((x>>24)&0xff)
def Patch(inFileName, se... |
# Configuration file for jupyter-notebook.
import os
from IPython.lib import passwd
c = get_config()
c.NotebookApp.ip = '0.0.0.0'
c.NotebookApp.port = int(os.getenv('JUPYTER_PORT', 8888))
c.NotebookApp.open_browser = False
c.NotebookApp.notebook_dir = '/root/volume'
c.NotebookApp.base_url = os.getenv("JUPYTER_BASEURL... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Data PreProcessing Utility Functions.
Pandas DataFrame manipulations
* data_frame_subsetter
* data_frame_supersetter
* column_splitter
* aggregates_column_values
* data_frame_grouper
* normalizes_source_codes
Dictionary manipulations
* merge_dictionaries
Mapping Res... |
import copy
import torch
import deepspeed
import deepspeed.ops.transformer as transformer_inference
from .replace_policy import HFBertLayerPolicy, HFGPT2LayerPolicy, HFGPTJLayerPolicy
from .replace_policy import replace_policies
from ..constants import INFERENCE_GENERIC_MODE, INFERENCE_SPECIALIZED_MODE
from ..runtime.w... |
# Generated by Django 2.1.2 on 2019-02-19 22:35
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... |
from netapp.vserver_peer_transition.vserver_peer_transition_info import VserverPeerTransitionInfo
from netapp.netapp_object import NetAppObject
class VserverPeerTransitionDestroyIterInfo(NetAppObject):
"""
Information about the deletion operation that was
attempted/performed against vserver-peer-transition... |
#!/usr/bin/python
#
# Copyright 2011 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 ap... |
# coding: utf-8
"""
Wavefront REST API
<p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the Wavefront REST ... |
from .base_async_keywords import BaseAsyncKeywords
from .ialert_async import iAlertAsync
from .ibrowsermanagement_async import iBrowserManagementAsync
from .idropdown_async import iDropdownAsync
from .ielement_async import iElementAsync
from .iformelement_async import iFormElementAsync
from .ijavascript_async import iJ... |
from torch.optim.lr_scheduler import _LRScheduler
from torch.optim.lr_scheduler import ReduceLROnPlateau
class GradualWarmupScheduler(_LRScheduler):
""" Gradually warm-up(increasing) learning rate in optimizer.
Proposed in 'Accurate, Large Minibatch SGD: Training ImageNet in 1 Hour'.
Adapted from https:/... |
"""
This is the Django template system.
How it works:
The Lexer.tokenize() function converts a template string (i.e., a string containing
markup with custom template tags) to tokens, which can be either plain text
(TOKEN_TEXT), variables (TOKEN_VAR) or block statements (TOKEN_BLOCK).
The Parser() class takes a list ... |
# Copyright (c) 2020 HOOMD-TF Developers
import unittest
class test_imports(unittest.TestCase):
def test_load_hoomd(self):
import hoomd
def test_load_htf(self):
import hoomd.htf
def test_load_tf(self):
import tensorflow as tf
class test_op(unittest.TestCase):
def test_op_lo... |
'''
Created on July 24, 2015
@author: bomj8
'''
import unittest
import pyodbc
import os
class WellmanConnection():
def __init__(self,well_project_fname=None):
""" Here we define sql statements that create tables, queries, etc. """
self.odbc_connection_string = 'DRIVER={SQL Server Native Client 11.... |
# Copyright (c) OpenMMLab. All rights reserved.
import copy as cp
import os
from abc import ABCMeta
import numpy as np
from torch.utils.data import Dataset
from mmpose.datasets.pipelines import Compose
class MeshBaseDataset(Dataset, metaclass=ABCMeta):
"""Base dataset for 3D human mesh estimation task. In 3D hu... |
from copy import deepcopy
from math import degrees
from naoqi import ALProxy
from sklearn.decomposition import PCA
from sklearn.preprocessing import StandardScaler
from torch import nn
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import torch
from Human import HumanInterface
from io_routines... |
# -*- coding: utf-8 -*-
from typing import List
import numpy as np
import pandas as pd
from spyns.data import SimulationData
def compute_running_average(trace_df: pd.DataFrame, estimator_name: str) -> None:
"""Compute running average for a series of estimator samples.
:param trace_df: Trace history data f... |
#
# OtterTune - utils.py
#
# Copyright (c) 2017-18, Carnegie Mellon University Database Group
#
'''
Created on Jul 8, 2017
@author: dvanaken
'''
import json
import logging
import string
from collections import OrderedDict
from random import choice
import numpy as np
from django.utils.text import capfirst
from djcele... |
from dissononce.processing.handshakepatterns.handshakepattern import HandshakePattern
class XK1HandshakePattern(HandshakePattern):
def __init__(self, ):
super(XK1HandshakePattern, self).__init__(
'XK1',
responder_pre_message_pattern=('s',),
message_patterns=(
... |
INCREMENT = "INCR"
DECREMENT = "DECR"
MULTIPLY = "MUL"
DIVIDE = "DIV"
|
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from django.utils.text import slugify
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'ProjectType.slug'
d... |
import pytest
from conftest import get_api_data
from assemblyline.odm.random_data import create_users, wipe_users, create_services, wipe_services
@pytest.fixture(scope="module")
def datastore(datastore_connection):
try:
create_users(datastore_connection)
create_services(datastore_connection)
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('mail', '0014_attachmentblacklist'),
]
operations = [
migrations.AddField(
model_name='attachmentblacklist',
... |
#!/usr/bin/env python
from __future__ import print_function
import skimage as skimage
from skimage import transform, color, exposure
from skimage.viewer import ImageViewer
import random
from random import choice
import numpy as np
from collections import deque
import time
import json
from keras.models import model_fr... |
"""
DiCoDiLe on text images
=======================
This example illustrates pattern recovery on a noisy text image using
DiCoDiLe algorithm.
""" # noqa
import matplotlib.pyplot as plt
import numpy as np
from dicodile import dicodile
from dicodile.data.images import fetch_letters_pami
from dicodile.update_d.update_... |
import os
import errno
from hashlib import md5
def ensure_directory(path):
"""
Gracefully make a directory (and its parents), if it does not exist.
"""
try:
os.makedirs(path)
except OSError as e:
if e.errno != errno.EEXIST:
raise
def get_md5sum(filename):
""" Retu... |
from celery import shared_task
@shared_task
def sample_task():
print("The sample task just ran.")
|
import matplotlib.pyplot as plt
import numpy as np
import pandas
import argparse
import io
import base64
def main():
parser = argparse.ArgumentParser()
parser.add_argument('-f', '--file', required=True, type=str,
help='Configuration file for this simulation')
args = parser.parse_arg... |
# 给定一个整数数组,你需要寻找一个连续的子数组,如果对这个子数组进行升序排序,那么整个数组都会变为升序排序。
# 你找到的子数组应是最短的,请输出它的长度。
class Solution(object):
def findUnsortedSubarray(self, nums: list) ->int:
temp = nums[:]
temp.sort()
i, j = 0, len(temp) - 1
while i < len(nums) and nums[i] == temp[i]:
i += 1
whil... |
import os
import sys
from glob import glob
import numpy as np
import math
import matplotlib as mpl
import matplotlib.pyplot as plt
import collections as cl
import json
args = sys.argv
if len(args) == 2:
JSON_FILE = args[1]
elif len(args) == 1:
loss_log_dir = os.path.join(os.getcwd(), "loss_log/")
target ... |
# Time: O(n)
# Space: O(1)
# Given an array of integers, 1 <= a[i] <= n (n = size of array),
# some elements appear twice and others appear once.
# Find all the elements that appear twice in this array.
# Could you do it without extra space and in O(n) runtime?
#
# Example:
# Input
#
# [4,3,2,7,8,2,3,1]
#
# Output
#
... |
class RebarBendData(object,IDisposable):
"""
The values in this class provide a summary of information taken from the RebarBarType,RebarHookType,and RebarStyle.
RebarBendData(barType: RebarBarType,hookType0: RebarHookType,hookType1: RebarHookType,style: RebarStyle,hookOrient0: RebarHookOrientation,hookOrient... |
from collections.abc import Mapping
from . import box
from .highlighter import ReprHighlighter
from .pretty import Pretty
from .table import Table
def tabulate_mapping(mapping: Mapping, title: str = None) -> Table:
"""Generate a simple table from a mapping.
Args:
mapping (Mapping): A mapping object... |
import cklib.logging
import socket
from pprint import pformat
from retrying import retry
from typing import Callable, List, Dict, Type, Union
from cklib.baseresources import BaseResource
from cklib.graph import Graph
from cklib.args import ArgumentParser
from cklib.utils import except_log_and_pass
from prometheus_clien... |
from flask.ext.testing import TestCase
from project import app, db
from project.models import User, BlogPost
class BaseTestCase(TestCase):
"""A base test case."""
def create_app(self):
app.config.from_object('config.TestConfig')
return app
def setUp(self):
db.create_all()
... |
import logging
import random
import sys
import traceback
from time import time
from typing import Any, Callable, List, Union
from typing_extensions import final
import gevent
from gevent import GreenletExit
from locust.exception import InterruptTaskSet, RescheduleTask, RescheduleTaskImmediately, StopUser, MissingWait... |
#!/usr/bin/env python
"""
gui/toraw
~~~~~~~~~~~~~~~~~~~~
Graphical user interface for converting movies to raw files
:author: Joerg Schnitzbauer, 2015
:copyright: Copyright (c) 2015 Jungmann Lab, Max Planck Institute of Biochemistry
"""
import sys
import os
import os.path
from PyQt4 import QtCore... |
N, Q = map(int, input().split())
ab = [tuple(map(int, input().split())) for _ in range(N - 1)]
cd = [tuple(map(int, input().split())) for _ in range(Q)]
connect = [[] for _ in range(N)]
for a, b in ab:
connect[a - 1].append(b - 1)
connect[b - 1].append(a - 1)
INF = 10**10
cost = [INF] * N
from collections im... |
'''
Exercise 3:
Write a function save_to_log(entry, logfile) that takes two parameters, a string
entry to be written at the end of the text file named logfile (also a string). The previous
content of the logfile MUST NOT be erased
'''
def save_to_log(entry, logfile):
with open(logfile,'a') as x:
print(entry... |
from __future__ import unicode_literals
import sys
# sys.path.append('~/documents/meetup/find_group_ids')
import psycopg2
from config import Config
import requests
import json
import time
import codecs
import datetime
UTF8Writer = codecs.getwriter('utf8')
sys.stdout = UTF8Writer(sys.stdout) |
#!/usr/bin/env python3
import rospy
from dwb_msgs.msg import LocalPlanEvaluation
def eval_cb(msg):
print('\n\n=========================================================\n\n')
for heading, i in zip(['best trajectory', 'worst trajectory'], [msg.best_index, msg.worst_index]):
print('### {}\n'.format(headi... |
from setuptools import setup
__version__ = '4.0.0'
setup(name='drudge_parser',
version=__version__,
description='Naive parser for the Drudge Report',
author='Matt Rasband',
author_email='matt.rasband@gmail.com',
maintainer='Matt Rasband',
maintainer_email='matt.rasband@gmail.com'... |
import xadmin
from xadmin.views import BaseAdminPlugin, CreateAdminView, UpdateAdminView
from mdeditor.fields import MDTextField
from mdeditor.widgets import MDEditorWidget
class XadminMDEditorWidget(MDEditorWidget):
def __init__(self, **kwargs):
self.mdeditor_options = kwargs
self.Media.js = None... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import optim
from torch.utils.data import DataLoader, TensorDataset
import sklearn.datasets as datasets
import math
import os
import time
import argparse
import pprint
from functools import partial
import ipdb
import matplotlib
matplotlib.u... |
# coding: utf-8
from fastapi.testclient import TestClient
def test_contest_effect_list(client: TestClient):
"""Test case for contest_effect_list
"""
params = [("limit", 56), ("offset", 56)]
headers = {
}
response = client.request(
"GET",
"/api/v2/contest-effect/",
... |
# -*- coding: utf-8 -*-
# Auto-generated by Stone, do not modify.
# @generated
# flake8: noqa
# pylint: skip-file
from __future__ import unicode_literals
from stone.backends.python_rsrc import stone_base as bb
from stone.backends.python_rsrc import stone_validators as bv
class CameraUploadsPolicyState(bb.Union):
"... |
#-------------------------------------------------------------------------------
# Name: Construction.py
# Purpose: Green Scale Tool Construction Module (Class for "Constructions")
#
# Author: Holly Tina Ferguson
#
# Created: 15/09/2013
# Copyright: (c) Holly Tina Ferguson 2013
# Licence: ... |
#!/usr/bin/env python
"""MAGeCK test module
Copyright (c) 2014 Wei Li, Han Xu, Xiaole Liu lab
This code is free software; you can redistribute it and/or modify it
under the terms of the BSD License (see the file COPYING included with
the distribution).
@status: experimental
@version: $Revision$
@author: Wei Li
@con... |
# 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... |
import argparse
import gym
import d4rl
import numpy as np
from rlkit.envs import ENVS
import rlkit.torch.pytorch_util as ptu
from rlkit.data_management.env_replay_buffer import EnvReplayBuffer
from rlkit.envs.wrappers import NormalizedBoxEnv
from rlkit.launchers.launcher_util import setup_logger
from rlkit.samplers.da... |
expected_output = {
"main": {
"chassis": {
"ASR-920-24SZ-IM": {
"descr": "Cisco ASR920 Series - 24GE and 4-10GE- Modular PSU and IM",
"name": "Chassis",
"pid": "ASR-920-24SZ-IM",
"sn": "CAT1902V19M",
"vid": "V01",
... |
import torch
from torch.utils.data import Dataset
from .data_utils import get_tokenizer, natural_sort, skip, FixedSizeOrderedDict
import random
import glob
import tensorflow as tf
import re
import logging
from itertools import cycle
import os
import subprocess
import simdjson as json
import hub
class HubAdapter(torch.... |
"""DSM 7 SYNO.API.Info data."""
DSM_7_API_INFO = {
"data": {
"SYNO.API.Auth": {"maxVersion": 7, "minVersion": 1, "path": "entry.cgi"},
"SYNO.API.Auth.Key": {
"maxVersion": 7,
"minVersion": 7,
"path": "entry.cgi",
"requestFormat": "JSON",
},
... |
import os
import re
import random
import discord
import pandas as pd
import numpy as np
import praw
from praw.models import MoreComments
import openpyxl
from datetime import date
from yahoo_fin import stock_info as si
from yahoo_fin import options as oi
import requests
import sqlite3
# changes "... |
{"filter":false,"title":"urls.py","tooltip":"/uvaschedule_me/urls.py","ace":{"folds":[],"scrolltop":0,"scrollleft":0,"selection":{"start":{"row":0,"column":12},"end":{"row":0,"column":12},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":{"row":61,"mode":"ace/mo... |
# 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... |
# -*- coding: utf-8 -*-
#
# Copyright 2020. Huawei Technologies Co., Ltd. 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.... |
n = int(input())
def sums(n):
if n == 1:
return(1)
elif n == 2:
return(2)
elif n == 3:
return(4)
else:
return sums(n-1) + sums(n-2) + sums(n-3) #규칙을 찾아내는게 중요!
for i in range(n):
a = int(input())
print(sums(a)) |
# Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
from numpy.testing import assert_array_almost_equal
from mmpose.core import (affine_transform, flip_back, fliplr_joints,
fliplr_regression, get_affine_transform, rotate_point,
transform_preds)
def tes... |
import numpy as np
import torch
import torch.nn as nn
class StringsModel(nn.Module):
def forward(self, x, y):
return {"out": np.array([f + " " + s for f, s in zip(x, y)])}
def get_model(_):
return StringsModel()
|
# The functions working on uv data.
#
#
import numpy as np
def average_uvdata(vis, datacolumn, uvbins, units="klambda", axis="real",
tmp_key="DATA_DESC_ID=0", verbose=False):
"""
Get the averaged uv data as a function of uv distance.
Use visstat() in casa.
Parameters
----------
... |
from .criterion import get_criterion
from .optimizer import get_optimizer
from .lr_scheduler import get_lr_scheduler
from .data_provider import get_data_provider
from .utils import version, init_device, get_device, set_device, get_dev_mem_used, model_summary,\
clear_bn_running_statistics, recompute_bn_running_stati... |
import sys
sys.stdin = open('brackets.in', 'r')
sys.stdout = open('brackets.out', 'w')
n = int(input())
def gen(cop, ccl, build):
if cop + ccl == 2 * n:
for i in range(2 * n):
print(build[i], end='')
print()
else:
if cop < n:
nb = [x for x in build]
... |
from flask import Flask, request, g, Response
from auth import requires_auth
import datetime, json, msgpack, os.path, sqlite3
app = Flask(__name__)
app.config.from_object('config')
insert_query = '''INSERT INTO utmp (host, user, uid, rhost, line, time, updated)
VALUES (:host, :user, :uid, :rhost, ... |
#!/usr/bin/env python
import urllib
import json
import os
from flask import Flask
from flask import request
from flask import make_response
# Flask app should start in global layout
app = Flask(__name__)
@app.route('/webhook', methods=['POST'])
def webhook():
req = request.get_json(silent=True, force=True)
... |
"""Test the dtool summary command."""
import os
import json
from click.testing import CliRunner
from . import SAMPLE_DATASETS_DIR
lion_dataset_uri = "file://" + os.path.join(SAMPLE_DATASETS_DIR, "lion")
def test_dataset_summary_functional():
from dtool_info.dataset import summary
# Create expected outpu... |
def Intersect(rect1, rect2):
'''Return the intersecting rectangle or None.'''
l1, t1, r1, b1 = rect1
l2, t2, r2, b2 = rect2
left = max(l1, l2)
top = max(t1, t2)
right = min(r1, r2)
bottom = min(b1, b2)
if left >= right or top >= bottom:
return None
return (left, top, right, bottom)
def Area(r... |
# -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
class PoliticscrawlerSpiderMiddleware(object):
# Not all methods need to be defined. If a method is not defined,
... |
import sys
import math
from collections import defaultdict
import matplotlib.pyplot as plt
# Benford's law percentages for leading digits 1-9
BENFORD = [30.1, 17.6, 12.5, 9.7, 7.9, 6.7, 5.8, 5.1, 4.6]
def load_date(filename):
"""Open a text file & return a list of strings."""
with open(filename) as f:
... |
import datetime
import email.utils
import http.client
import io
import mimetypes
import os
import posixpath
import time
import urllib.parse
import socket
import sys
import json
from dataclasses import dataclass
from typing import Dict, Union # TODO change to serverlib ? httplib ?
from src import Status
# References:... |
"""Implementation of Rule L003."""
from typing import List, Optional, Sequence, Tuple
from sqlfluff.core.parser import WhitespaceSegment
from sqlfluff.core.parser.segments import BaseSegment, RawSegment
from sqlfluff.core.rules.functional import rsp, sp, Segments
from sqlfluff.core.rules.base import BaseRule, LintResu... |
import os
from operator import itemgetter
from os import listdir
import numpy as np
import pandas as pd
from keras.models import load_model
from general_helper import coeff_determination
from processor import sdf_to_csv
from rdkit import Chem
from sklearn.externals import joblib
import sklearn
print(sklearn.__versio... |
# type: ignore
# -*- coding: utf-8 -*-
#
# ramstk.analyses.prediction.Inductor.py is part of the RAMSTK Project
#
# All rights reserved.
# Copyright 2007 - 2017 Doyle Rowland doyle.rowland <AT> reliaqual <DOT> com
"""Inductor MIL-HDBK-217F Constants and Calculations Module."""
# Standard Library Imports
from mat... |
"""
Copyright (c) 2016-2020 Keith Sterling http://www.keithsterling.com
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, m... |
# -*- coding: utf-8 -*-
import torch
import torch.nn as nn
from torch.nn import functional as F
from my_package.FilterInterpolation import FilterInterpolationModule
from my_package.FlowProjection import FlowProjectionModule #,FlowFillholeModule
from my_package.DepthFlowProjection import DepthFlowProjectionModule
fr... |
from .autoavatar import AutoAvatar
async def setup(bot) -> None:
cog = AutoAvatar(bot)
bot.add_cog(cog)
__red_end_user_data_statement__ = "This cog does not store any end user data."
|
# 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, modify,... |
__all__ = ('Achievement',)
from ..bases import DiscordEntity, IconSlot
from ..utils import DATETIME_FORMAT_CODE
from ..http import urls as module_urls
class Achievement(DiscordEntity):
"""
Represents a Discord achievement created at Developer portal.
Attributes
----------
id : `int`
The... |
import copy
from typing import Dict, List, Tuple
import cv2
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from vinbigdata import BoxesMeta
from vinbigdata.preprocess import ImageMeta, convert_bboxmeta2arrays
COLOR_MAP: Dict[str, Tuple[int, int, int]] = {}
def plot_bboxes(img: np.array,
... |
from burp import IBurpExtender
from burp import IIntruderPayloadGeneratorFactory
from burp import IIntruderPayloadGenerator
import re
extendedTests = False
class BurpExtender(IBurpExtender, IIntruderPayloadGeneratorFactory):
def registerExtenderCallbacks(self, callbacks):
self._callbacks = callbacks
self._helpe... |
class InsertableObject(ElementType,IDisposable):
""" A base class you all types that are insertable. """
def Dispose(self):
""" Dispose(self: Element,A_0: bool) """
pass
def getBoundingBox(self,*args):
""" getBoundingBox(self: Element,view: View) -> BoundingBoxXYZ """
pass
def ReleaseUnmanagedResour... |
# coding=utf-8
# Copyright 2019 The Trax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
# File: awsiam_connector.py
# Copyright (c) 2018-2021 Splunk Inc.
#
# Licensed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt)
import json
import hmac
import hashlib
import datetime
import collections
import sys
from collections import OrderedDict
import requests
import xmltodict
from bs4 import Bea... |
# Copyright 2020 Christophe Bedard
# Licensed under the Apache License, Version 2.0
from glob import glob
import os
from pathlib import Path
from shutil import copy2
import subprocess
from colcon_core.logging import colcon_logger
from colcon_core.plugin_system import satisfies_version
from colcon_core.task import Tas... |
# Copyright 2014 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 or agreed to in writing, ... |
from __future__ import annotations
import argparse
import math
import os
import subprocess
from typing import Sequence
from pre_commit_hooks.util import added_files
from pre_commit_hooks.util import zsplit
def filter_lfs_files(filenames: set[str]) -> None: # pragma: no cover (lfs)
"""Remove files tracked by gi... |
from music21 import converter, instrument, note, chord, stream, midi#多乐器是否可行
import time
import numpy as np
import pandas as pd
import os
import random
import sys
import pretty_midi
from pretty_midi import PrettyMIDI, Note, Instrument
import copy
import itertools
import collections
# Melody-RNN Format is a sequence of... |
# Code generated by protoc-gen-twirp_python v5.5.2, DO NOT EDIT.
# source: service.proto
try:
import httplib
from urllib2 import Request, HTTPError, urlopen
except ImportError:
import http.client as httplib
from urllib.request import Request, urlopen
from urllib.error import HTTPError
import json
f... |
"""The pyang library for parsing, validating, and converting YANG modules"""
import os
import string
import sys
import zlib
import re
import io
from . import error
from . import yang_parser
from . import yin_parser
from . import grammar
from . import util
from . import statements
from . import syntax
__version__ = '... |
#!/usr/bin/python
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.