text stringlengths 1 927k |
|---|
# Copyright 2018 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 (c) 2020, nana and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class Author(Document):
pass
@frappe.whitelist()
def test_function(doc_name):
author = frapp... |
from indy_node.persistence.attribute_store import AttributeStore
from indy_node.persistence.idr_cache import IdrCache
from indy_node.server.pool_config import PoolConfig
from indy_node.server.request_handlers.action_req_handlers.pool_restart_handler import PoolRestartHandler
from indy_node.server.request_handlers.actio... |
from chef.api import ChefAPI
from chef.base import ChefObject
class Client(ChefObject):
"""A Chef client object."""
url = '/clients'
def _populate(self, data):
self.platform = self.api and self.api.platform
self.private_key = None
if self.platform:
self.orgname = data.... |
'''
Copyright (c) 2011-2014, Agora Games, LLC All rights reserved.
https://github.com/agoragames/haigha/blob/master/LICENSE.txt
'''
from chai import Chai
from haigha.frames import heartbeat_frame
from haigha.frames.heartbeat_frame import HeartbeatFrame
from haigha.frames.frame import Frame
class HeartbeatFrameTest... |
"""
SoftLayer.tests.CLI.modules.report_tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:license: MIT, see LICENSE for more details.
"""
from SoftLayer import testing
import json
from pprint import pprint as pp
class ReportTests(testing.TestCase):
def test_bandwidth_invalid_date(self):
resul... |
#! /usr/bin/env python
from setuptools import setup
setup(
name='umpy',
packages=['umpy',],
version='0.9.9',
url='https://www.github.com/perdixsw/umpy',
download_url='https://www.github.com/perdixsw/umpy/tarball/master',
author='Perdix Software',
author_email='ssmith@perdixsw.com',
description=('Simple unit of... |
"""
PairList manager class
"""
import logging
from copy import deepcopy
from typing import Dict, List
from cachetools import TTLCache, cached
from finrl.constants import ListPairsWithTimeframes
from finrl.exceptions import OperationalException
from finrl.pairlist.IPairList import IPairList
from finrl.resolvers import... |
#!/usr/bin/env python3
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "eparhia.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are... |
'''
Created on 2016年8月4日
@author: Administrator
'''
from io import BytesIO
# write to BytesIO:
f = BytesIO()
f.write(b'hello')
f.write(b' ')
f.write(b'world!')
print(f.getvalue())
# read from BytesIO:
data = '人闲桂花落,夜静春山空。月出惊山鸟,时鸣春涧中。'.encode('utf-8')
f = BytesIO(data)
print(f.read()) |
import numpy as np
class lines:
maxNum = 50
threshold = 1
insist = True
def __init__(self):
# was the line detected in the last iteration?
self.detected = False
# x values of the last n fits of the line
self.recent_xfitted = []
#average x values of the fitted l... |
#!/usr/bin/env 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
# "... |
"""reindex_outcomes
Revision ID: 61a1763b9c8d
Revises: 340d5cc7e806
Create Date: 2019-08-09 12:47:22.165013
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "61a1763b9c8d"
down_revision = "340d5cc7e806"
branch_labels = ()
depends_on = None
def upgrade():
#... |
from typing import List, Dict, Callable, Union
from gbvision.constants.types import Frame, Shape
from gbvision.utils.continuity import ContinuesCircle
from gbvision.utils.continuity.continues_rect import ContinuesRect
from gbvision.utils.continuity import ContinuesRotatedRect
from gbvision.utils.continuity import Cont... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2022 all rights reserved
#
"""
Tests for all the exceptions raised by this package
"""
def test():
from pyre.parsing.exceptions import (
ParsingError, TokenizationError
)
try:
raise Parsi... |
#This file is part of ElectricEye.
#SPDX-License-Identifier: Apache-2.0
#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 un... |
#!/usr/bin/env python
# Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
'''
Usage: callstats.py [-h] <command> ...
Optional arguments:
-h, --help show this help message and exit
Commands:
run ... |
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
import json
import logging
from typing import List
from elasticsearch.exceptions import NotFoundError
from pyhocon import ConfigTree
from databuilder.publisher.base_publisher import Publisher
from databuilder.publisher.elasticsea... |
#!/usr/bin/env python
from setuptools import setup, find_packages
import rpcudp
setup(
name="rpcudp",
version=rpcudp.__version__,
description="Asynchronous RPC via UDP",
long_description=open("README.md", encoding='utf-8').read(),
long_description_content_type='text/markdown',
author="Brian Mul... |
from django.apps import AppConfig
class FlaggedConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'backend.apps.flagged' |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2019-2020 VMware, Inc. All Rights Reserved.
# SPDX-License-Identifier: BSD-2-Clause
"""
Execute scancode
https://github.com/nexB/scancode-toolkit
This plugin does not support installation of scancode
The expected environment is as follows:
1. Create a python3 virtual envir... |
from n_utils.account_utils import find_role_arn
def test_find_role_arn(mocker):
cloudformation = mocker.patch('n_utils.account_utils.cloudformation')
find_role_arn('foo')
cloudformation.assert_called_with() |
# coding=utf-8
# Copyright 2018 The DisentanglementLib 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
#
# Un... |
from __future__ import print_function
import time
import argparse
import numpy as np
import tqdm
import MNN
import yaml
from calibration_dataset import calibration_dataset
nn = MNN.nn
F = MNN.expr
def get_mnn_format(format_str):
fmt = str.lower(format_str)
if fmt == 'nchw':
return F.NCHW
elif fmt... |
# -*- coding: utf-8 -*-
"""Greedy coloring test suite.
"""
__author__ = "\n".join(["Christian Olsson <chro@itu.dk>",
"Jan Aagaard Meier <jmei@itu.dk>",
"Henrik Haugbølle <hhau@itu.dk>",
"Jake VanderPlas <jakevdp@uw.edu>"])
import networkx as nx
... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-19 20:32
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.CreateModel(
... |
class Escritor:
def __init__(self, nome):
self.__nome = nome
self.__ferramenta = None
@property
def nome(self):
return self.__nome
@property
def ferramenta(self):
return self.__ferramenta
@ferramenta.setter
def ferramenta(self, ferramenta):
self.__f... |
from direct.distributed import DistributedObjectAI
from direct.directnotify import DirectNotifyGlobal
from toontown.toonbase import ToontownGlobals
from otp.otpbase.PythonUtil import nonRepeatingRandomList
import DistributedGagAI, DistributedProjectileAI
from direct.task import Task
import random, time, Racer, RaceGlob... |
# Copyright 2020 The TensorFlow Probability Authors. All Rights Reserved.
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
# THIS FILE IS AUTO-GENERATED BY `gen_linear_operators.py`.
# DO NOT MODIFY DIRECTLY.
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@... |
from django.views import View
from django.shortcuts import render
import logging
from apps.goosepond.utils.namegoosifier import goosify
log = logging.getLogger('goosepond')
class NameComponent(View):
def post(self, request):
"""Render the goosename component."""
gooseinput = request.POST.get("goos... |
# -*- coding: utf-8 -*-
"""
Edmonds-Karp algorithm for maximum flow problems.
"""
__author__ = """ysitu <ysitu@users.noreply.github.com>"""
# Copyright (C) 2014 ysitu <ysitu@users.noreply.github.com>
# All rights reserved.
# BSD license.
import networkx_mod as nx
from networkx_mod.algorithms.flow.utils import *
__al... |
import boto3
from datetime import datetime, timedelta
from os import environ
from src.functions.csv_dump import send_sql
rds_client = boto3.client("rds-data")
ddb_resource = boto3.resource("dynamodb")
shub_table = ddb_resource.Table(environ.get("TABLE_SHUB"))
shub_index = environ.get("SHUB_INDEX")
db_name = environ.ge... |
from simulator import Simulator, Map, Agent
from devices import Device
import numpy as np
import simulator_config
env = Simulator(simulator_config)
map = Map()
map.get_map_from_geom2d(env, kp=np.array([[-100, 100], [-100, -100], [100, -100], [100, 100]]))
robot = Agent(env, kp=np.array([[-2, 0], [2, 0]]), color=(1, 0... |
import tfchain.polyfill.encoding.json as jsjson
import tfchain.polyfill.encoding.hex as jshex
from tfchain.polyfill.jsmods.sjcl import api as sjcl
from tfchain.polyfill.jsmods.blakejs import api as b2b
from tfchain.polyfill.jsmods.tweetnacljs import api as nacl
def random(n):
digest = ''
__pragma__("js", "{}", ""... |
#!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings.dev')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you ... |
"""
This file offers the methods to automatically retrieve the graph Candidatus Accumulibacter sp. SK-02.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: pro... |
from __future__ import absolute_import, unicode_literals
from collections import defaultdict
from django.contrib.auth import get_user_model
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
from django.forms import FileField
from django.http import JsonResponse
fro... |
from __future__ import absolute_import, division, print_function
import io
import locale
import os
from os.path import join, isdir, isfile, abspath, basename, exists, normpath, expanduser
import re
import shutil
from subprocess import CalledProcessError
import sys
import time
from .conda_interface import download, Te... |
from flask import Flask
app = Flask(__name__)
@app.route("/")
def index():
return "Hello, world!" |
#! /usr/bin/env python3
# coding=utf-8
"""
Write a Python program that prints a table of n, n^2, and n^3 in right-aligned
columns for 1 >= n <= 10.</p>
"""
def main():
for n in range(1, 11):
print(f"{n:2} {n**2:3} {n**3:4}")
if __name__ == "__main__":
main() |
# Copyright 2018 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 or agreed to in writing, ... |
# File automatically generated by mapry. DO NOT EDIT OR APPEND!
"""provides general structures and functions for parsing."""
import typing
import some.graph
class Error:
"""represents an error occurred while parsing."""
def __init__(self, ref: str, message: str) -> None:
"""
initializes ... |
"""
WSGI config for neurotech project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SET... |
import matplotlib.pyplot as plt
from numpy import array, ones, zeros, cov
plt.style.use('seaborn')
from fglasso import glasso
def GraphicalLasso(pop, lam, initStruct=None, approximate=0, warmInit=0, verbose=0, penalDiag=1, tolThreshold=1e-4, maxIter=1e4, w=None, theta=None):
# [w, theta, iter, avgTol, hasError] ... |
"""
Action
======
An action is an event that gets triggered on a device. For example, a camera can have an action ``acquire`` or
``read``. They should normally be associated with the pressing of a button. Action is a handy decorator to register
methods on a model and have quick access to them when ... |
import telegram
def send(buffer, sid, token):
"""
:param buffer:
:return:
"""
bot = telegram.Bot(token=token)
bot.send_message(chat_id=str(sid), text=buffer) |
"""
Exam 1, problem 2.
Authors: David Mutchler, Vibha Alangar, Matt Boutell, Dave Fisher,
Mark Hays, Amanda Stouder, Aaron Wilkin, their colleagues,
and Audrey Walters.
""" # DONE: 1. PUT YOUR NAME IN THE ABOVE LINE.
def main():
""" Calls the TEST functions in this module. """
test_fac... |
import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="comppyss",
version="0.0.2",
author="Andrew Sung",
author_email="aysung300@gmail.com",
description="Python implementation of the CompPASS algorithm for scoring AE-MS exper... |
# -*- coding: utf-8 -*-
# cf.http://d.hatena.ne.jp/white_wheels/20100327/p3
import numpy as np
import matplotlib.pylab as plt
from mpl_toolkits.mplot3d import Axes3D
def _numerical_gradient_no_batch(f, x):
h = 1e-4 #0.0001
grad = np.zeros_like(x) #xと同じ形状の配列を作成
for idx in range(x.size):
tmp_val... |
"""SMTP email backend class."""
import smtplib
import ssl
import threading
from flask_mailman.backends.base import BaseEmailBackend
from flask_mailman.message import sanitize_address
from flask_mailman.utils import DNS_NAME
class EmailBackend(BaseEmailBackend):
"""
A wrapper that manages the SMTP network con... |
# Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed
# under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licens... |
from __future__ import absolute_import
import re
from collections import namedtuple
from ..exceptions import LocationParseError
from ..packages import six
url_attrs = ["scheme", "auth", "host", "port", "path", "query", "fragment"]
# We only want to normalize urls with an HTTP(S) scheme.
# urllib3 infers URLs withou... |
from sklearn.preprocessing import MultiLabelBinarizer
from sklearn.metrics import hamming_loss
from sklearn.metrics import accuracy_score
from sklearn.metrics import multilabel_confusion_matrix
from sklearn.metrics import roc_auc_score
import numpy as np
import copy
def combinations(nums):
ans = [[]]
for row i... |
# Merge two sorted linked lists and return it as a new sorted list.
# The new list should be made by splicing together the nodes of the first two lists.
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# filename: __rpc.py
# Tencent is pleased to support the open source community by making Tars available.
#
# Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file ex... |
import cv2
import shutil
import tkinter as tk
from PIL import Image, ImageTk
from tkinter.filedialog import askdirectory
import re
import os
import json
from collections import OrderedDict
from tkinter.messagebox import *
class Tk_window():
def __init__(self):
self.window = tk.Tk()
# 第2步,给窗口的可视化... |
import pandas as pd
import numpy as np
import random
import string
import sys
from nltk.corpus import stopwords
from nltk.stem.wordnet import WordNetLemmatizer
from sklearn.model_selection import train_test_split, cross_val_predict
from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer, TfidfTrans... |
import webbrowser
from .App import App
def mirror(input, model, visualisations=[], port=5000, debug=False):
app = App(input, model, visualisations)
if not debug: webbrowser.open_new(f'http://localhost:{port}') # opens in default browser
app.run(host="0.0.0.0", port=port, use_reloader=debug) |
"""
Demonstrates adding a custom context menu to a GraphicsItem
and extending the context menu of a ViewBox.
PyQtGraph implements a system that allows each item in a scene to implement its
own context menu, and for the menus of its parent items to be automatically
displayed as well.
"""
import pyqtgraph as pg
fr... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-01-15 07:08
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('connection', '0002_auto_20180113_1458'),
]
operati... |
import app as server
server.startserver('nabla') |
# Generated by Django 2.2.27 on 2022-02-08 05:20
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0002_tag'),
]
operations = [
migrations.CreateModel(
... |
# -*- coding: utf-8 -*-
'''
Routines to set up a minion
'''
# Import python libs
from __future__ import absolute_import, print_function, with_statement
import os
import re
import sys
import copy
import time
import types
import signal
import fnmatch
import logging
import threading
import traceback
import contextlib
impo... |
import itertools
import json
import logging
import shlex
from json.decoder import JSONDecodeError
from typing import List, Optional, Union
import requests
from requests.exceptions import HTTPError, RequestException
from datahub import __package_name__
from datahub.configuration.common import OperationalError
from dat... |
import os
from insights import package_info
class InsightsConstants(object):
app_name = 'insights-client'
auth_method = 'BASIC'
package_path = os.path.dirname(
os.path.dirname(os.path.abspath(__file__)))
sleep_time = 300
default_conf_dir = '/etc/insights-client'
default_conf_file = '/... |
import pymysql
import datetime
from flask import Flask, render_template, request
from cal import calday
def datepick(db_password, zone, infra, id):
conn = pymysql.connect(
host='127.0.0.1',
port=3306,
user='root',
password=db_password,
db=zone)
curs = conn.cursor()
m_... |
# Copyright (c) 2016 Red Hat, 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 a... |
#!/usr/bin/env python
# isort:skip_file
import os
os.environ["OMP_NUM_THREADS"] = "1"
os.environ["MKL_NUM_THREADS"] = "1"
import argparse # noqa E402
import atexit # noqa E402
import copy # noqa E402
import multiprocessing as mp # noqa E402
import time # noqa E402
import torch # noqa E402
torch.set_num_threads... |
'''
# Unique paths in a grid
A small example of using dynamic programming techniques for finding out the total number of unique paths between two points in a 2D grid.
Author:
Goran Trlin
Find more tutorials and code samples on:
https://playandlearntocode.com
'''
class Solution:
# camelCase is used at the LeetC... |
import os, sys;
sModulePath = os.path.dirname(__file__);
sys.path = [sModulePath] + [sPath for sPath in sys.path if sPath.lower() != sModulePath.lower()];
from fTestDependencies import fTestDependencies;
fTestDependencies();
# I should add some tests here.
pass; |
import argparse
import glob
import re
import yaml
parser = argparse.ArgumentParser()
parser.add_argument("--prefix", default="xx", help="find files matching prefix")
parser.add_argument("--folder", required=True, help="Output folder")
args, _ = parser.parse_known_args()
HELM_SPARTAKUS_IF_START = "{{- if .Values.usag... |
# -*- coding: utf-8 -*-
# (C) Copyright 2020, 2021 IBM. All Rights Reserved.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modificatio... |
# A module to make your error messages less scary
import sys
from characters import AsciiCharacter
def output_ascii(err_message="You certainly messed something up."):
one_line = False
err_line_1 = err_message.split('--')[0]
try:
err_line_2 = err_message.split('--')[1]
except:
on... |
#!/usr/bin/env python3
# Copyright (c) 2018 The NavCoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import ElectrumTestFramework
from test_framework.cfund_util import *
impor... |
from __future__ import absolute_import
import copy
import datetime
import functools
import logging
import random
import tempfile
from collections import namedtuple
from typing import (Any, Callable, Dict, Generator, Iterable, List,
Mapping, MutableMapping, MutableSequence,
Optio... |
# coding: utf-8
"""
OpenAPI Extension x-auth-id-alias
This specification shows how to use x-auth-id-alias extension for API keys. # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import io
import json
import logging
import re
import ssl
from ... |
class Employees(object):
_employees = {}
_headcount = 0
def add_employee(self, employee):
self._headcount += 1
self._employees[self._headcount] = employee
def get_employee(self, i):
return self._employees[i]
@property
def headcount(self):
return self._headcount |
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from anchore_engine.services.policy_engine.api.models.base_model_ import Model
from anchore_engine.services.policy_engine.api.models.legacy_vulnerability_report import ... |
from domain.ErrorTypes import ErrorTypes
from validity import IncomingEdgeValidityChecker
from utils import CodeGenerationUtils
import os
def generate_code(args):
node = args["node"]
requireds_info = args["requireds_info"]
edges = args["edges"]
checklist={"df_count": {1}, "model_count": {0}}
erro... |
"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2013-2016 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... |
# -*- coding: utf-8 -*-
import numpy as np
def get_point_index(point,simplices):
for i in range(len(simplices)):
if simplices[i][2]==0:
if simplices[i][3]==point:
return i
def get_edge_index(edge,simplices):
for i in range(len(simplices)):
if simplices[i][2]==1:
... |
from httprunner.built_in import setup_hook_prepare_kwargs
from httprunner.client import HttpSession
from httprunner.compat import bytes
from tests.base import ApiServerUnittest
class TestHttpClient(ApiServerUnittest):
def setUp(self):
super(TestHttpClient, self).setUp()
self.api_client = HttpSessi... |
import nanome
from nanome.util import Logs
from nanome._internal._structure._residue import _Residue
from . import Base
class Residue(_Residue, Base):
RibbonMode = nanome.util.enums.RibbonMode
SecondaryStructure = nanome.util.enums.SecondaryStructure
def __init__(self):
super(Residue, self).__ini... |
"""
Implementation of taxi service that operates with following logic:
1. Service find a list of candidate taxies for one booking
2. It sends requests to all candidate taxies
3. The first taxi driver that accepts the request takes the job
"""
from typing import List, Tuple
import random
from collections import defau... |
from moodle import MoodleWarning
from typing import List
from moodle.attr import dataclass, field
@dataclass
class CalendarExportToken:
"""Auth token for exporting a calendar.
token (str): The calendar permanent access token for calendar export.
warnings (List[MoodleWarning]): list of MoodleWarning
""... |
def sum_num(x,y):
sum = x+y
return sum
def div_num(x,y):
div = x/y
return div |
#!/usr/bin/env python
# Copyright (c) 2013-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from __future__ import division,print_function,unicode_literals
import biplist
from ds_store import DSStore... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import datetime
from django.contrib import messages
from django.db.models import Q
from django.http import HttpResponse
from django.shortcuts import get_object_or_404
from django.urls import reverse_lazy
from django.utils.translation import... |
from pkg_resources import resource_filename
from compliance_checker.suite import CheckSuite
from compliance_checker.base import Result, BaseCheck
import numpy as np
import unittest
import os
static_files = {
'2dim' : resource_filename('compliance_checker', 'tests/data/2dim-grid.nc'),
'bad... |
from .base import * # noqa
from .base import env
# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#debug
DEBUG = True
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
SECRET_KEY = env(
"DJANGO_SECRET_KEY... |
# In[]
import cv2
import numpy as np
import os
from operator import eq
import random
import matplotlib.pyplot as plt
from skimage import io
import shutil
os.environ["CUDA_VISIBLE_DEVICES"]="0"
imgBase = "D:/[Data]/[Cardiomegaly]/1_ChestPA_Labeled_Baeksongyi/[PNG]_2_Generated_Data(2k)/Generated_Data_20180327_151... |
import sqlite3
import json
from tqdm import tqdm
from text_analysis import senti_score,sentiment_analyzer
data=[]
with open('tweets.txt','r') as f:
raw_data=f.readlines()
for i in raw_data:
if len(i)>1:
data.append(i)
##################################################################################... |
from .DBWorker import DatabaseWorker
from .models import Base
Base.metadata.create_all(DatabaseWorker.engine) |
# Generated by Django 3.0.6 on 2020-05-22 10:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("order", "0083_merge_20200421_0529"),
]
operations = [
migrations.AlterField(
model_name="orderevent",
name="type",
... |
from starlette.testclient import TestClient
from pet_store.entrypoints.api import app
from tests.e2e.utils.e2e_test_case import E2ETestCase
class PetTestCase(E2ETestCase):
def test_add_pet(self):
client = TestClient(app)
body = {
'age': 12,
'name': 'Milú'
}
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('tutor', '0011_auto_20150331_2034'),
]
operations = [
migrations.CreateModel(
name='Female2',
fields=... |
# Pong is a two-dimensional sports game that simulates table tennis.
# The player controls an in-game paddle by moving it vertically across
# the left side of the screen, and can compete against either a
# computer-controlled opponent or another player controlling a second
# paddle on the opposing side. Players use the... |
from gunicorn.config import Config
cfg = Config()
cfg.set("proxy_protocol", True)
req1 = {
"method": "GET",
"uri": uri("/stuff/here?foo=bar"),
"version": (1, 1),
"headers": [
("SERVER", "http://127.0.0.1:5984"),
("CONTENT-TYPE", "application/json"),
("CONTENT-LENGTH", "14"),
... |
from mako.template import Template
import os
from importlib import import_module
import pathlib
import zipfile
# TODO: Replace with Python 3.9's importlib.resources.files() when it becomes min version
def files(package):
spec = import_module(package).__spec__
if spec.submodule_search_locations is None:
... |
import os
import yaml
import time
import requests
import json
import datetime
from urllib.parse import urlparse, parse_qs
from dateutil.parser import parse
from requests.auth import HTTPBasicAuth
from pycti import OpenCTIConnectorHelper, get_config_variable
searchable_types = [
"threat-actor",
"malware",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.