text stringlengths 2 999k |
|---|
"""
A Python library for NFL Game Pass
"""
import uuid
import sys
import json
import logging
import time
import xml.etree.ElementTree as ET
try:
from urllib.parse import urlencode
except ImportError: # Python 2.7
from urllib import urlencode
try:
from datetime import datetime, timezone
except ImportError: ... |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import sys
import os
def welcome():
"""
Perform a bunch of sanity tests to make sure the Add-on SDK
environ... |
"""
Readability OAuth1 backend, docs at:
https://python-social-auth.readthedocs.io/en/latest/backends/readability.html
"""
from .oauth import BaseOAuth1
READABILITY_API = 'https://www.readability.com/api/rest/v1'
class ReadabilityOAuth(BaseOAuth1):
"""Readability OAuth authentication backend"""
name = 'r... |
import argparse
from time import strptime
from datetime import date, timedelta
import os
import pandas as pd
from jellypy.pyCIPAPI.interpretation_requests import access_date_summary_content, get_interpreted_genome_for_case, \
get_interpretation_request_list
def parser_args():
"""Parse arguments from the comma... |
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.contrib.auth.models import User
from .models import CustomUser
# from cmdbox.core.models import Profile
# def create_user_profile(sender, instance, created, **kwargs):
# if created:
# Profile.objects.create(use... |
#!/usr/bin/python
# coding=utf-8
"""Test file saved to specified location. Clean up after tests run.
:usage:
To be run with every commit
:authors
MD at 28/09/20
"""
import os
import shutil
from src.save_results import SaveResults
def test_save_results_nofolder(df_analysis, save_folder, save_file):
"""Che... |
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'krbsite.settings')
try:
from django.core.management import execute_from_command_line
except Impo... |
from datetime import date
from typing import Dict
from pyspark.sql import SparkSession, Column, DataFrame
# noinspection PyUnresolvedReferences
from pyspark.sql.functions import col
from pyspark.sql.functions import coalesce, to_date
from spark_auto_mapper.automappers.automapper import AutoMapper
from spark_auto_mapp... |
from __future__ import (
annotations,
)
from typing import (
TYPE_CHECKING,
)
from .abc import (
Model,
)
if TYPE_CHECKING:
from typing import (
Set,
Generator,
Tuple,
Any,
Callable,
)
from uuid import UUID
from .trips import Trip
from .routes i... |
input = """
% This is a meta-interpreter by Axel Polleres, originally split over several
% files, which detected a problem with our extraction of unfounded sets from
% model candidates. Fixed by revision 1.20 of satz.C.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 2qbf_5_5_20c.check... |
from rest_framework.response import Response
from rest_framework.viewsets import ModelViewSet
from django.contrib.auth.models import Group,Permission
from apps.meiduo_admin.serializer.group import GroupSerializer,PermissionGroupSerializer
from apps.meiduo_admin.utils import PageNum
class GroupView(ModelViewSet):
... |
import numpy as np
from math import *
import pymultinest
import sys
sys.path.insert(0, '/home/kochenma/pysb')
from pysb.integrate import Solver
import csv
import datetime
import time as tm
from model_6 import model
from pysb.pathfinder import set_path
set_path('bng', '/home/kochenma/BioNetGen')
data_object = []
with... |
from . import pandas
from . import numpy
from . import filesys
from . import plotting
from . import sklearn
from . import joblib
|
from __future__ import absolute_import, division, print_function
import os
import numpy as np
import glob
import ast
import json
import time
import matplotlib.pyplot as plt
import matplotlib
from PIL import Image
import cv2
from ..datasets import GOT10k
from ..utils.metrics import rect_iou
from ..utils.viz import sho... |
# Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
from blinker import Namespace
class Signals():
signals = Namespace()
status_change = signals.signal(
'Status Changed',
"""
This is used to signal any listeners of any changes in model ob... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
import logging, logging.config, sys
import i18n
from PyQt5.QtWidgets import QApplication
from control.rs_window import RsMainWindow
from model.config import Configuration
logging.config.fileConfig('logging.conf')
logger = logging.getLogger(__name__)
logger.debug("Con... |
# -*- coding: utf-8 -*-
from scout.commands import cli
def test_update_genes_wrong_omim_key(mock_app):
"""Tests the CLI that updates genes in database"""
runner = mock_app.test_cli_runner()
assert runner
# Test CLI base, provide non-valid API key
result = runner.invoke(cli, ['update', 'genes',
... |
# dksalaries/setup.py
# -*- coding: utf-8 -*-
# Copyright (C) 2021 Eric Truett
# Licensed under the MIT License
from setuptools import setup, find_packages
PACKAGE_NAME = "dksalaries"
def run():
setup(name=PACKAGE_NAME,
version="0.3",
description="python library for getting/parsing DK salar... |
# 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 ... |
import http.client
from enum import Enum
from typing import Any, Dict, List, Optional, Sequence, Set, Tuple, Type, Union, cast
from fastapi import routing
from fastapi.dependencies.models import Dependant
from fastapi.dependencies.utils import get_flat_dependant, get_flat_params
from fastapi.encoders import jsonable_e... |
# coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 4
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class CreateJobJobResponse(objec... |
import os
from pathlib import Path
import json
import logging
from typing import Any, Text, Dict
import pytest
import rasa.shared.utils.io
import rasa.utils.io
from rasa.core.test import (
_create_data_generator,
_collect_story_predictions,
test as evaluate_stories,
FAILED_STORIES_FILE,
CONFUSION_... |
from flask import Flask
from instance.config import DevConfig
# Initializing application
app = Flask(__name__)
# Setting configuration
app.config.from_object(DevConfig)
from app import view
|
from ..snooper import BaseSolrSnooper
from tokens.models import Provider
class DropboxSnooper(BaseSolrSnooper):
def __init__(self, user):
self.user = user
self.provider_name = Provider.NAME_DROPBOX
self.extra_query_args = {
'fl': 'id,title,bytes,mime_type,content_type,remote_pa... |
# Copyright 2020 The AutoKeras 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 agreed to i... |
"""
Argo Workflows API
Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/ # noqa: E501
The version of the OpenAPI document: VERSION
Generated by: https://openapi-g... |
#!/usr/bin/env python3
# coding: utf-8
# Example 12 カラー Lチカ
port_R = 17 # 赤色LED用 GPIO ポート番号
port_G = 27 # 緑色LED用 GPIO ポート番号
port_B = 22 # 青色LED用 GPIO ポート番号
ports = [port_R, port_G, port_B]
colors= ['消灯','赤色','緑色','黄色','青色','赤紫色','藍緑色'... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from .. import base
from ..base.fields import Text, Date, Array
# Module API
class Record(base.Record):
# Config
table = 'icdcm'
... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import torch
from torch import nn
from maskrcnn_benchmark.structures.bounding_box import BoxList
from .roi_mask_feature_extractors import make_roi_mask_feature_extractor
from .roi_mask_predictors import make_roi_mask_predictor
from .inference imp... |
import os
import unittest
from conans.paths import CONANFILE
from conans.test.utils.tools import TestClient
from conans.util.files import load
class OrderLibsTest(unittest.TestCase):
def setUp(self):
self.client = TestClient()
def private_order_test(self):
# https://github.com/conan-io/cona... |
from ..serializers import OrdenSubestatusSerializer
from ..models import Orden_Subestatus
class ControllerOrdenSubestatus:
serializer_class = OrdenSubestatusSerializer
def crearordensubestatus(request):
datosOrdenSubestatus = request.data
ordenSubestatusNuevo = Orden_Subestatus()
... |
from collections import namedtuple
from typing import Tuple
from enum import Enum
def main():
list = [1, 2, 3, 4, 5]
dict = {"one": 1, "two": 2}
sets = set([2, 3, 4, 2])
bool = True or False
str = "nim_is_awesome"
integer: int = 1
floats: float = 1.2
PI = 3.14
Point: Tuple[int, int... |
#!usr/bin/env python
#encoding: utf-8
__author__="luzhijun"
'''
upload_download test
'''
from externals.simple_oss import SimpleOss
import os,tarfile,time
from batchcompute import (
Client, JobDescription, TaskDag, TaskDescription, ResourceDescription,ClientError
)
import config as cfg
oss_clnt = SimpleOss(cfg.OSS_... |
# 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 use ... |
#!/usr/bin/python
# Independent set algos
# E is represented by a adjacency matrix
# V is represented by an array
import csv
import numpy as np
class item:
def __init__(self):
# E = np.zeros(shape=(n,n), dtype=np.int)
self.set = set()
chosen=set()
# To read input
def read(file):
wi... |
import os
import Load_Saved_Model
import make_json
from flask import Flask, request
from werkzeug.utils import secure_filename
app = Flask(__name__)
@app.route('/upload', methods=['GET', 'POST'])
def upload_file():
print("1 Something is coming!!")
if request.method == 'POST':
if 'upload' not in reque... |
#!/usr/bin/env python
# encoding: utf-8
from collections import defaultdict, OrderedDict
from math import sqrt
from operator import itemgetter
from spacy.tokens import Doc
import graphviz
import json
import logging
import networkx as nx
import os
import os.path
import re
import spacy
import string
import sys
import ti... |
#!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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, merge, publish,
... |
# base16-qutebrowser (https://github.com/theova/base16-qutebrowser)
# Base16 qutebrowser template by theova and Daniel Mulford
# iA Dark scheme by iA Inc. (modified by aramisgithub)
base00 = "#1a1a1a"
base01 = "#222222"
base02 = "#1d414d"
base03 = "#767676"
base04 = "#b8b8b8"
base05 = "#cccccc"
base06 = "#e8e8e8"
base... |
# -*- coding: utf-8 -*-
# #----------------------------------------------------------------------
# Cisco.NXOS.get_chassis_id
# ---------------------------------------------------------------------
# Copyright (C) 2007-2018 The NOC Project
# See LICENSE for details
# ----------------------------------------------------... |
#------------------------------------------------------------------------------
# Copyright 2016, 2017, Oracle and/or its affiliates. All rights reserved.
#
# Portions Copyright 2007-2015, Anthony Tuininga. All rights reserved.
#
# Portions Copyright 2001-2007, Computronix (Canada) Ltd., Edmonton, Alberta,
# Canada. Al... |
"""Simple example showing several generations of spans in a trace.
"""
import argparse
import sys
import time
import traceback
import opentracing
import splunktracing.tracer
def sleep_dot():
"""Short sleep and writes a dot to the STDOUT.
"""
time.sleep(0.05)
sys.stdout.write('.')
sys.stdout.flush(... |
import komand
from .schema import ForwardMessageInput, ForwardMessageOutput
# Custom imports below
import re
import socket
from komand_syslog_forwarder.util import utils
class ForwardMessage(komand.Action):
def __init__(self):
super(self.__class__, self).__init__(
name="forward_message",
... |
from flow.controllers.base_lane_changing_controller import \
BaseLaneChangeController
class SumoLaneChangeController(BaseLaneChangeController):
"""A controller used to enforce sumo lane-change dynamics on a vehicle."""
def __init__(self, veh_id):
super().__init__(veh_id, lane_change_params={})
... |
config-cli.py |
from numba import cuda
from numba import *
import numpy as np
from PIL import Image, ImageDraw, ImageFont
from constants import palette
import json
import sys
import math
targetObject = sys.argv[1]
#load calibration JSON from standard
with open("calibration.json", 'r') as f:
calibration = json.load(f)
#load target m... |
import logging
import argparse
from pathlib import Path
from src.preprocess import get_valid_modules
from src.util.config import load_config
logging.basicConfig(level=logging.INFO,
format='[%(levelname)s] %(asctime)-s %(name)s - %(message)s')
logger = logging.getLogger(__name__)
def get_args(val... |
# -*- coding: utf-8 -*-
# Author: XuMing <xuming624@qq.com>
# Brief:
def init_c1(data_set_dict, min_support):
c1 = []
freq_dic = {}
for trans in data_set_dict:
for item in trans:
freq_dic[item] = freq_dic.get(item, 0) + data_set_dict[trans]
# 优化初始的集合,使不满足最小支持度的直接排除
c1 = [[k] for... |
from django import forms
from .models import BillingDetails
class BillingForm(forms.ModelForm):
class Meta:
model = BillingDetails
fields = [
'first_name',
'last_name',
'email',
'phone_number',
'company_name',
'country',
... |
def function(n):
e= 0
o= 0
number = 0
while number < n+1:
if(number % 2 == 0):
e = e + number
number=number+1
else:
o = o + number
number=number+1
print("Even total is", e , "and Odd total is", o)
|
from .struct_member import StructMember
import _dynStruct
import pyprind
import copy
# list of classical function which we ignore the access
# because there access are non relative to the struct
ignore_func = ["memset", "memcpy", "memcmp", "mempcpy"]
# list of classical-# use to detecte string
str_func = ["strlen", "... |
#!/usr/bin/env python
from SCons.Script import *
from SCons.Script.SConscript import SConsEnvironment
import SCons.Script.SConscript
def addRagelBuilder(env):
RagelAction = SCons.Action.Action("$RAGELCOM", "$RAGELCOMSTR")
env["RAGEL"] = env.Detect("ragel")
env["RAGELCOM"] = "$RAGEL $RAGELFLAGS -o $TARGET $SOURCE"
... |
from falcon.request import Request
from falcon.response import Response
from core.Controller import Controller, json
from core.Utils import Utils
from models.File import File
import configparser
from PIL import Image
import io
import sys
import base64
from falcon.media.multipart import BodyPart
import magic
from abc im... |
import numpy as np
import zengl
from objloader import Obj
from PIL import Image
from window import Window
window = Window(1280, 720)
ctx = zengl.context()
image = ctx.image(window.size, 'rgba8unorm', samples=4)
depth = ctx.image(window.size, 'depth24plus', samples=4)
image.clear_value = (1.0, 1.0, 1.0, 1.0)
model =... |
#!/usr/bin/python
import os
import subprocess
import sys
import getopt
from distutils.spawn import find_executable
class QtCreatorManager():
def __init__(self):
self.current_dir = "."
self.home_dir = ".."
self.ignore_folders = ['.git', 'build', 'tools', 'docs', 'site_s... |
# coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 7
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class ClusterEmailSettings(objec... |
# adapted from https://github.com/ftramer/Handcrafted-DP/blob/main/models.py
# MIT License
# Copyright (c) 2020 ftramer
# 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, ... |
# -*- encoding: utf-8 -*-
# pylint: disable=E0203,E1101,C0111
"""
@file
@brief Runtime operator.
"""
import numpy
from ._op import OpRunBinaryNum
class Min(OpRunBinaryNum):
def __init__(self, onnx_node, desc=None, **options):
OpRunBinaryNum.__init__(self, onnx_node, desc=desc, **options)
def _run(se... |
class cd:
def __init__(self):
pass
def getName(self):
return "CD"
def getDescription(self):
return "The new album of the Red Hot Chili Peppers"
|
# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from robotnik_msgs/SafetyModuleStatus.msg. Do not edit."""
import codecs
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
import robotnik_msgs.msg
class SafetyModuleStatus(genpy.Message):
_m... |
#!/usr/bin/env python
__author__ = 'etseng@pacb.com'
"""
Demultiplex IsoSeq (SMRT Link 8.0) job output (without genome mapping)
"""
import os, re, sys
from csv import DictReader, DictWriter
from collections import defaultdict, Counter
from Bio import SeqIO
#hq1_id_rex = re.compile('(i\d+_HQ_\S+\|\S+)\/f\d+p\d+\/\d+'... |
# Created by Elshad Karimov
# Copyright © AppMillers. All rights reserved.
# Validate BST
# write an algorithm to find the in-order successor of a given node in a BST
class Node:
def __init__(self, key):
self.data = key
self.left = None
self.right = None
def insert(node, data):
if node is None:
... |
# -*- coding: utf-8 -*-
############################################################################
#
# Copyright © 2015 OnlineGroups.net and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this dis... |
"""{{cookiecutter.widget_name}} controller."""
import dash
# import dash_html_components as html
# import dash_core_components as dcc
# import dash_bootstrap_components as dbc
from dash.dependencies import Output, Input, State
from dash.exceptions import PreventUpdate
from {{cookiecutter.widget_name}}.app import ap... |
"""
Created: 3 September 2016
Last Updated: 9 March 2018
Dan Marley
daniel.edison.marley@cernSPAMNOT.ch
Texas A&M University
-----
Steering script for making simple efficiency plots from TEfficiency objects.
This can be modified or extended by whomever.
To run:
python python/runEfficiency.py --files ... |
"""
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... |
#
# Copyright (c) 2021 Project CHIP 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 applica... |
# 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 ... |
import logging
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import MinMaxScaler
logger = logging.getLogger(__name__)
def get_train(*args):
"""Get training dataset for KDD 10 percent"""
return _get_adapted_dataset("train")
def get_test... |
import itertools
import json
import re
from collections import defaultdict, Counter
from pathlib import Path
import networkx
from parse import parse
parsed = parse()
def group_by_key_func(iterable, key_func):
"""
Create a dictionary from an iterable such that the keys are the result of evaluating a key fun... |
# Generated by Django 2.2.9 on 2020-04-27 09:22
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('posts', '0009_auto_20200419_1606'),
]
operations = [
migrations.AlterField(... |
#!/usr/bin/env python
def test_ssh_connect(net_connect, commands, expected_responses):
"""
Verify the connection was established successfully
"""
show_version = net_connect.send_command(commands["version"])
assert expected_responses["version_banner"] in show_version
def test_enable_mode(net_conn... |
# -*- coding: utf-8 -*-
from hearthstone.entities import Entity
from entity.spell_entity import SpellEntity
class LETL_256(SpellEntity):
"""
闪电军团5
<b>攻击</b>一个敌人。如果你控制着另一个恶魔,则随机对一个敌人造成$7点伤害。
"""
def __init__(self, entity: Entity):
super().__init__(entity)
self.damage = 0
... |
# Copyright 2020 Peter Bencze
#
# 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 app import db
class Releases(db.Model):
"""The basic data for release items"""
__tablename__ = "Releases"
ReleaseID = db.Column(db.Integer, primary_key=True)
ReleaseCode = db.Column(db.String(10), nullable=False)
Title = db.Column(db.String(200), nullable=False)
Date = db.Column(db.DateTi... |
import argparse
import os
import base64
import yaml
from management_api import ManagementAPIClient
from utils import read_yaml, should_use_external_idp
def read_and_endcode_template(path):
content = open(path, 'r', encoding='UTF-8').read()
return base64.b64encode(content.encode()).decode()
if __name__ == "_... |
import datetime
from enum import Enum
from typing import List
import dateutil.parser
import requests
from .entity import (
Aggsv2, Aggsv2Set, Trade, TradesV2, Quote, QuotesV2,
Exchange, SymbolTypeMap, ConditionMap, Company, Dividends, Splits,
Earnings, Financials, NewsList, Ticker, DailyOpenClose, Symbol
)
... |
#!/usr/bin/env python
'''
Currently support:
DT13 from PDB, circ
NHT19 from PDB
To do:
NHT19 + circ
CHT18(DNA)
'''
import sys
import math
import argparse
from cafysis.file_io.pdb import PdbFile
from cafysis.file_io.ninfo import NinfoFile
from cafysis.para.rnaAform import ARNA
from cafysis.para.rnaDT... |
from flask import (render_template, request, redirect,
url_for, abort)
from . import main
from .forms import PostForm, CommentForm, UpdateProfile
from ..models import User, Comment, Post
from flask_login import login_required, current_user
from .. import db, photos
@main.route("/", methods = ["GET"... |
# ***************************************************************
# Copyright (c) 2022 Jittor. All Rights Reserved.
# Maintainers: Dun Liang <randonlang@gmail.com>.
# This file is subject to the terms and conditions defined in
# file 'LICENSE.txt', which is part of this source code package.
# ************************... |
"""``generic`` module of ``dataql.parsers``.
It provides the ``DataQLParser`` that is the most generic parser (actually the only one)
provided by the ``dataql`` library.
"""
from dataql.parsers.base import BaseParser, rule
from dataql.parsers.exceptions import ParserError
from dataql.parsers.mixins import FiltersWit... |
from hazelcast.serialization.bits import *
from hazelcast.protocol.client_message import ClientMessage
from hazelcast.protocol.custom_codec import *
from hazelcast.util import ImmutableLazyDataList
from hazelcast.protocol.codec.map_message_type import *
REQUEST_TYPE = MAP_REPLACEIFSAME
RESPONSE_TYPE = 101
RETRYABLE = ... |
import pytest
import numpy as np
from datetime import timedelta
import pandas as pd
import pandas.util.testing as tm
from pandas import (timedelta_range, date_range, Series, Timedelta,
DatetimeIndex, TimedeltaIndex, Index, DataFrame,
Int64Index, _np_version_under1p8)
from panda... |
from .classic_actor_critic import *
from .deep_actor_critic import *
|
# -*- coding: utf-8 -*-
"""Factory boy factories for the IQB-RIMS addon."""
import factory
from django.utils import timezone
from dateutil.relativedelta import relativedelta
from factory.django import DjangoModelFactory
from osf_tests.factories import UserFactory, ProjectFactory, ExternalAccountFactory
from addons.i... |
# strings are immutable sequence of characters
# Declaration using single quote
message = 'Hello, Python World!'
print(message)
# Declaration using double quote
message = "Hello, Python World!"
print(message)
# Declaration and concatenation
message = 'python ' + 'language 1'
print(message)
# Declarati... |
from .get_covmat import CovmatGen, get_covmat
|
import tkinter as tk
from tkinter import *
import threading
import keyboard
from tkinter.ttk import *
from tkinter.messagebox import showinfo
def main():
window = tk.Tk()
window.overrideredirect(True)
window.attributes("-topmost",True)
window.resizable(width=False, height=False)
label = tk.Label(
... |
# 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.conf.urls import url
from vehicles import views
from django.urls import path
app_name = 'vehicles'
urlpatterns = [
url(r'^$', views.VehicleListView.as_view(),name='list'),
path('<int:pk>',views.VehicleDetailView.as_view()),
url(r'^vehicle/$',views.form_vehicle_view,name='form_vehicle'),
ur... |
import os
import argparse
import subprocess
from deepclean_prod import io
# Parse command line argument
def parse_cmd():
parser = argparse.ArgumentParser(
prog=os.path.basename(__file__), usage='%(prog)s [options]')
parser.add_argument('config', help='Path to config file', type=str)
params = par... |
from fdrtd.plugins.simon.caches.cache import Cache
from fdrtd.plugins.simon.microprotocols.microprotocol import Microprotocol
from fdrtd.plugins.simon.accumulators.accumulator_statistics_bivariate import AccumulatorStatisticsBivariate
class MicroprotocolStatisticsBivariate(Microprotocol):
def __init__(self, micr... |
import pickle
import numpy as np
with open("classified_results.pkl", "r") as f:
result = pickle.load(f)
f.close()
count = 0
confusion_matrix = np.zeros((10, 10), dtype=np.int)
for labels in result:
if labels[0] == labels[1]:
count += 1
confusion_matrix[labels[0]][labels[1]] += 1
... |
import pandas as pd
from simple_salesforce import Salesforce, format_soql
import os
from dotenv import load_dotenv
from ct_snippets.load_sf_class import SF_SOQL, SF_Report
from ct_snippets.sf_bulk import sf_bulk, sf_bulk_handler, generate_data_dict
from reportforce import Reportforce
import numpy as np
import soql_quer... |
# model settings
model = dict(
type='FasterRCNN',
pretrained='open-mmlab://msra/hrnetv2_w40',
backbone=dict(
type='HRNet',
extra=dict(
stage1=dict(
num_modules=1,
num_branches=1,
block='BOTTLENECK',
num_blocks=(4, ),... |
import fnmatch
import os
from typing import Any, List, Union
from libddog.command_line.console import ConsoleWriter
from libddog.crud.dashboards import DashboardManager
from libddog.crud.errors import AbstractCrudError
from libddog.dashboards.components import Request
from libddog.dashboards.dashboards import Dashboar... |
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <markdowncell>
# # CBIBS
# ## Plot the results of the CBIBC QARTOD QC Tests
#
# ### Procedure
# * Connect to CBIBS database
# * Get raw wave height data from a station
# * Plot raw data and QC'ed data for a series of QC tests
#
# ### Primary flags for QARTOD
#
#... |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="fluxamasynth",
version="1.0",
author="Modern Device",
author_email="shawn@as220.org",
description="A library for the Modern Device Fluxamasynth board.",
long_description=long_descripti... |
#!/usr/bin/python
import os
import string
os.system("make")
os.system("R CMD SHLIB detcovid.o ignbin.o toms343.o utils.o")
os.system("R CMD SHLIB stochcovid.o ignbin.o toms343.o utils.o")
os.system("R CMD SHLIB mcmc.o detcovid.o ignbin.o toms343.o utils.o")
os.system("R CMD SHLIB tanhrt.o")
os.system("/bin/rm -rf *.o")... |
"""HTTP Client for asyncio."""
import asyncio
import base64
import hashlib
import json
import os
import sys
import traceback
import warnings
from types import SimpleNamespace, TracebackType
from typing import ( # noqa
Any,
Awaitable,
Callable,
Coroutine,
FrozenSet,
Generator,
Generic,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.