code stringlengths 20 1.04M | apis list | extract_api stringlengths 75 9.94M |
|---|---|---|
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.0
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
raise Runtime... | [
"_Box2D.new_b2EdgeShape",
"_Box2D.new_b2DistanceInput",
"_Box2D.new_b2SolverData",
"_Box2D.b2ContactFeature_swigregister",
"_Box2D.new_b2ContactListener",
"_Box2D.b2Jacobian_swigregister",
"_Box2D.new_b2TrackedBlockAllocator",
"_Box2D.new_b2MouseJointDef",
"_Box2D.b2TrackedBlockAllocator_swigregiste... | [((20666, 20745), 'collections.namedtuple', 'collections.namedtuple', (['"""b2DistanceResult"""', '"""pointA pointB distance iterations"""'], {}), "('b2DistanceResult', 'pointA pointB distance iterations')\n", (20688, 20745), False, 'import collections\n'), ((23093, 23143), '_Box2D.b2ContactPoint_swigregister', '_Box2D... |
#-------------------------------------------------------------------------------
# Author: <NAME> <<EMAIL>>
# Date: 27.11.2017
#
# Licensed under the 3-Clause BSD License, see the LICENSE file for details.
#-------------------------------------------------------------------------------
import json
import uuid
from ... | [
"scrapy_do.webservice.PushProject",
"json.dumps",
"scrapy_do.webservice.ListJobs",
"scrapy_do.webservice.RemoveProject",
"scrapy_do.webservice.GetLog",
"scrapy_do.webservice.ScheduleJob",
"scrapy_do.webservice.Status",
"json.loads",
"unittest.mock.MagicMock",
"scrapy_do.webservice.ListSpiders",
... | [((1129, 1135), 'unittest.mock.Mock', 'Mock', ([], {}), '()\n', (1133, 1135), False, 'from unittest.mock import Mock, MagicMock, patch\n'), ((1950, 2068), 'scrapy_do.schedule.Job', 'Job', (['JobStatus.PENDING', 'Actor.SCHEDULER'], {'schedule': '"""every 5 minutes"""', 'project': '"""quotesbot"""', 'spider': '"""toscrap... |
import machine
if machine.reset_cause() == machine.DEEPSLEEP_RESET:
print('Woke from a deep sleep')
else:
print('Power on or hard reset')
def main() :
import os
files = os.listdir()
if 'ws.py' in files :
import ws
ws.station.run()
#import time
#time.sleep(10)
main()
| [
"machine.reset_cause",
"ws.station.run",
"os.listdir"
] | [((19, 40), 'machine.reset_cause', 'machine.reset_cause', ([], {}), '()\n', (38, 40), False, 'import machine\n'), ((187, 199), 'os.listdir', 'os.listdir', ([], {}), '()\n', (197, 199), False, 'import os\n'), ((252, 268), 'ws.station.run', 'ws.station.run', ([], {}), '()\n', (266, 268), False, 'import ws\n')] |
import os
import json
from definitions import Definitions
from generator.AnalyticsModel.analysis import get_search_to_clicks_mapping
from generator.AnalyticsModel.broken_links import remove_broken_links_documents_searches_mapping, \
remove_broken_links_documents_clicks
from generator.AnalyticsModel.clicks_counts ... | [
"generator.AnalyticsModel.broken_links.remove_broken_links_documents_clicks",
"json.dump",
"generator.AnalyticsModel.analysis.get_search_to_clicks_mapping",
"generator.AnalyticsModel.history.get_history",
"generator.AnalyticsModel.broken_links.remove_broken_links_documents_searches_mapping",
"os.path.dirn... | [((1598, 1645), 'generator.AnalyticsModel.clicks_counts.get_clicks_counts', 'get_clicks_counts', (['CLICKS_FILE_PATH', 'is_verbose'], {}), '(CLICKS_FILE_PATH, is_verbose)\n', (1615, 1645), False, 'from generator.AnalyticsModel.clicks_counts import get_clicks_counts\n'), ((1654, 1717), 'generator.AnalyticsModel.broken_l... |
# -*- coding: UTF-8 -*-
import markdown
from django.db import models
from django.utils.translation import ugettext_lazy as _
from model_utils.choices import Choices
from symcon import querysets
from symcon.common.util.markdown import MarkDownToHtml
class Repository(models.Model):
user = models.CharField(max_leng... | [
"symcon.common.util.markdown.MarkDownToHtml",
"symcon.querysets.LibraryQuerySet.as_manager",
"django.utils.translation.ugettext_lazy"
] | [((1592, 1630), 'symcon.querysets.LibraryQuerySet.as_manager', 'querysets.LibraryQuerySet.as_manager', ([], {}), '()\n', (1628, 1630), False, 'from symcon import querysets\n'), ((853, 868), 'django.utils.translation.ugettext_lazy', '_', (['"""Repository"""'], {}), "('Repository')\n", (854, 868), True, 'from django.util... |
#!/home/smartmet/anaconda3/envs/xr/bin/python
#/usr/bin/env python
import sys
import cdsapi
if ( len(sys.argv) > 2):
year= sys.argv[1]
month= sys.argv[2]
day= sys.argv[3]
c = cdsapi.Client(url="https://ads.atmosphere.copernicus.eu/api/v2" ,
key="<KEY>"
)
c.retrieve(
'cams-europe-air-quality-forecasts... | [
"cdsapi.Client"
] | [((188, 265), 'cdsapi.Client', 'cdsapi.Client', ([], {'url': '"""https://ads.atmosphere.copernicus.eu/api/v2"""', 'key': '"""<KEY>"""'}), "(url='https://ads.atmosphere.copernicus.eu/api/v2', key='<KEY>')\n", (201, 265), False, 'import cdsapi\n')] |
import re
import random
from datetime import datetime
from flask import request, abort, current_app, make_response, jsonify, session
from . import passport_blu
from info.utils.captcha.captcha import captcha
from ... import redis_store, constants, db
from ...libs.yuntongxun.sms import CCP
from ...models import User
fr... | [
"flask.session.pop",
"random.randint",
"flask.request.args.get",
"flask.abort",
"re.match",
"flask.current_app.logger.debug",
"flask.jsonify",
"info.utils.captcha.captcha.captcha.generate_captcha",
"flask.make_response",
"datetime.datetime.now",
"flask.current_app.logger.error"
] | [((505, 533), 'flask.session.pop', 'session.pop', (['"""user_id"""', 'None'], {}), "('user_id', None)\n", (516, 533), False, 'from flask import request, abort, current_app, make_response, jsonify, session\n'), ((538, 565), 'flask.session.pop', 'session.pop', (['"""mobile"""', 'None'], {}), "('mobile', None)\n", (549, 5... |
__all__ = [
"BaseConnector",
"BaseCommuter",
]
from contextlib import contextmanager
from typing import Any, Iterator, List, Mapping, Optional, Sequence, Tuple, Union
import abc
import numpy as np
import psycopg2
from psycopg2 import sql
from psycopg2.extensions import register_adapter, AsIs
from psycopg2.ex... | [
"psycopg2.extensions.register_adapter",
"psycopg2.extras.execute_batch"
] | [((420, 452), 'psycopg2.extensions.register_adapter', 'register_adapter', (['np.int64', 'AsIs'], {}), '(np.int64, AsIs)\n', (436, 452), False, 'from psycopg2.extensions import register_adapter, AsIs\n'), ((453, 487), 'psycopg2.extensions.register_adapter', 'register_adapter', (['np.float64', 'AsIs'], {}), '(np.float64,... |
from django.shortcuts import render
from django.http import HttpResponse,JsonResponse
def index_view(request):
return render(request,'website/index.html')
def about_view(request):
return render(request,'website/about.html')
def contact_view(request):
return render(request,'website/contact.html')
def t... | [
"django.shortcuts.render"
] | [((124, 161), 'django.shortcuts.render', 'render', (['request', '"""website/index.html"""'], {}), "(request, 'website/index.html')\n", (130, 161), False, 'from django.shortcuts import render\n'), ((199, 236), 'django.shortcuts.render', 'render', (['request', '"""website/about.html"""'], {}), "(request, 'website/about.h... |
import numpy as np
import random
import math
import matplotlib.pyplot as plt
m = 5
w = 10
worth = np.array([6, 3, 5, 4, 6])
weight = np.array([2, 2, 6, 4, 5])
# helper function, note that state is represent as a interger,
# we convert it to binary to indicate choice
def get_state(v):
f = np.binary_repr(v, width... | [
"matplotlib.pyplot.title",
"numpy.binary_repr",
"matplotlib.pyplot.savefig",
"math.exp",
"matplotlib.pyplot.show",
"numpy.sum",
"matplotlib.pyplot.plot",
"numpy.asarray",
"numpy.array",
"numpy.arange",
"numpy.random.choice",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"numpy.un... | [((100, 125), 'numpy.array', 'np.array', (['[6, 3, 5, 4, 6]'], {}), '([6, 3, 5, 4, 6])\n', (108, 125), True, 'import numpy as np\n'), ((135, 160), 'numpy.array', 'np.array', (['[2, 2, 6, 4, 5]'], {}), '([2, 2, 6, 4, 5])\n', (143, 160), True, 'import numpy as np\n'), ((1788, 1825), 'numpy.unique', 'np.unique', (['states... |
from flask import Flask
from api.rest import api_rest
app = Flask(
__name__,
template_folder="../site/templates",
static_folder="../site/static",
)
app.register_blueprint(api_rest)
def get_app():
return app
| [
"flask.Flask"
] | [((62, 151), 'flask.Flask', 'Flask', (['__name__'], {'template_folder': '"""../site/templates"""', 'static_folder': '"""../site/static"""'}), "(__name__, template_folder='../site/templates', static_folder=\n '../site/static')\n", (67, 151), False, 'from flask import Flask\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
japp.py
(C) 2020 by Semiring Inc., <NAME> <<EMAIL>>
The NLP-Lab Team 2019 (http://nlp-lab.org/) contributed to older code versions.
NLP pipeline server as a RESTful API engine using:
- spaCy
- benepar
- neurocoref
"""
from __future__ import unicode_literals, pri... | [
"collections.OrderedDict",
"datetime.datetime.now"
] | [((2664, 2677), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (2675, 2677), False, 'from collections import OrderedDict, defaultdict, Counter\n'), ((813, 836), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (834, 836), False, 'import datetime\n'), ((896, 919), 'datetime.datetime.now',... |
import angr
import claripy
from collections import namedtuple
import copy
from kalm import utils
from klint.externals.net import packet # ouch
from klint.externals.net import tx # ouch, bis
from klint.fullstack import spec_act
from klint.fullstack import spec_reg
from klint.fullstack import reg_util
# cou... | [
"klint.fullstack.reg_util.fetch_reg",
"kalm.utils.can_be_true",
"klint.fullstack.reg_util.update_reg",
"klint.fullstack.reg_util.find_fields_on_write",
"klint.fullstack.reg_util.check_access_write",
"claripy.BVS",
"klint.externals.net.tx.TransmissionMetadata",
"claripy.BVV",
"klint.externals.net.pac... | [((411, 595), 'collections.namedtuple', 'namedtuple', (['"""SpecDevice"""', "['index', 'phys_addr', 'virt_addr', 'bar_size', 'pci_regs', 'regs',\n 'counter', 'use_init', 'latest_action', 'actions', 'packet_length',\n 'packet_data']"], {}), "('SpecDevice', ['index', 'phys_addr', 'virt_addr', 'bar_size',\n 'pci_... |
import json
from bs4 import BeautifulSoup
import urllib.request as urllib2
from flask import request
from flask_restful import Resource
class Info_api(Resource):
def __init__(self, **kwargs):
print('init Info_api')
def options(self):
return ({
"allowed_methods": ['post'],
... | [
"bs4.BeautifulSoup",
"flask.request.get_json",
"urllib.request.urlopen",
"json.dumps"
] | [((2673, 2700), 'urllib.request.urlopen', 'urllib2.urlopen', (['quote_page'], {}), '(quote_page)\n', (2688, 2700), True, 'import urllib.request as urllib2\n'), ((2712, 2746), 'bs4.BeautifulSoup', 'BeautifulSoup', (['page', '"""html.parser"""'], {}), "(page, 'html.parser')\n", (2725, 2746), False, 'from bs4 import Beaut... |
import pytest
import math
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), "..", ".."))
from src.map.Road import Road
from src.map.Coordinates import Coordinates
from src.map.Intersection import Intersection
from src.map.Constants import LANE_WIDTH
def get_points(road):
"""
Retur... | [
"os.path.dirname",
"src.map.Coordinates.Coordinates",
"src.map.Road.Road",
"src.map.Intersection.Intersection"
] | [((3111, 3190), 'src.map.Road.Road', 'Road', (['start_coords', 'end_coords', 'length', 'out_ln', 'in_ln', 'angle', 'speed_limit', 'name'], {}), '(start_coords, end_coords, length, out_ln, in_ln, angle, speed_limit, name)\n', (3115, 3190), False, 'from src.map.Road import Road\n'), ((3987, 4066), 'src.map.Road.Road', 'R... |
import time
import queue
import random
import threading
class SleepyBarber:
def __init__(self, count_chairs=5):
self.count_chairs = count_chairs
self.clients = queue.Queue(self.count_chairs)
self.id = 0
self.block = threading.Semaphore(1)
self.start_threads()
def gene... | [
"threading.Thread",
"random.randint",
"time.sleep",
"threading.Semaphore",
"queue.Queue"
] | [((182, 212), 'queue.Queue', 'queue.Queue', (['self.count_chairs'], {}), '(self.count_chairs)\n', (193, 212), False, 'import queue\n'), ((254, 276), 'threading.Semaphore', 'threading.Semaphore', (['(1)'], {}), '(1)\n', (273, 276), False, 'import threading\n'), ((1754, 1800), 'threading.Thread', 'threading.Thread', ([],... |
from django.conf import settings
from django.conf.urls import include
from django.contrib import admin
from django.template.response import TemplateResponse
from django.urls import re_path, path
from django.views.generic import TemplateView, RedirectView
from grandchallenge.core.views import comicmain
from grandchalle... | [
"django.contrib.admin.autodiscover",
"django.conf.urls.include",
"django.urls.path",
"grandchallenge.pages.views.FaviconView.as_view",
"django.template.response.TemplateResponse",
"django.views.generic.TemplateView.as_view",
"django.views.generic.RedirectView.as_view"
] | [((356, 376), 'django.contrib.admin.autodiscover', 'admin.autodiscover', ([], {}), '()\n', (374, 376), False, 'from django.contrib import admin\n'), ((481, 542), 'django.template.response.TemplateResponse', 'TemplateResponse', (['request', 'template_name', 'context'], {'status': '(500)'}), '(request, template_name, con... |
# Copyright 2015, 2018 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | [
"nova.exception.NovaException",
"nova.virt.powervm.tasks.vm.Delete",
"taskflow.patterns.linear_flow.Flow",
"nova.virt.powervm.tasks.vm.PowerOn",
"nova.virt.powervm.tasks.vm.Get",
"mock.patch",
"taskflow.task.FunctorTask",
"nova.virt.powervm.tasks.vm.PowerOff",
"mock.Mock",
"nova.virt.powervm.tasks... | [((1019, 1089), 'mock.patch', 'mock.patch', (['"""nova.virt.powervm.vm.get_instance_wrapper"""'], {'autospec': '(True)'}), "('nova.virt.powervm.vm.get_instance_wrapper', autospec=True)\n", (1029, 1089), False, 'import mock\n'), ((1519, 1605), 'mock.patch', 'mock.patch', (['"""pypowervm.tasks.storage.add_lpar_storage_sc... |
import torch
class FCNet(torch.nn.Module):
""" Standard feed forward neural network with fully connected layers and ReLUs"""
def __init__(self, *layer_nodes):
self.dim_in = layer_nodes[0]
self.dim_out = layer_nodes[-1]
self.net = torch.nn.Sequential()
# Skip Layer -- just a l... | [
"torch.nn.Linear",
"torch.no_grad",
"torch.nn.ReLU",
"torch.nn.Sequential"
] | [((895, 910), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (908, 910), False, 'import torch\n'), ((265, 286), 'torch.nn.Sequential', 'torch.nn.Sequential', ([], {}), '()\n', (284, 286), False, 'import torch\n'), ((360, 408), 'torch.nn.Linear', 'torch.nn.Linear', (['layer_nodes[0]', 'layer_nodes[-1]'], {}), '(lay... |
# Copyright 2021 The FastEstimator 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 appl... | [
"fastestimator.op.numpyop.univariate.ColorJitter",
"torch.eye",
"torch.nn.AdaptiveMaxPool2d",
"torch.cat",
"fastestimator.dataset.data.cifair10.load_data",
"fastestimator.trace.io.ModelSaver",
"torch.nn.functional.leaky_relu",
"torch.nn.functional.normalize",
"torch.flatten",
"fastestimator.op.ten... | [((4554, 4584), 'torch.nn.functional.normalize', 'fn.normalize', (['A'], {'p': '(2.0)', 'dim': '(-1)'}), '(A, p=2.0, dim=-1)\n', (4566, 4584), True, 'import torch.nn.functional as fn\n'), ((4593, 4623), 'torch.nn.functional.normalize', 'fn.normalize', (['B'], {'p': '(2.0)', 'dim': '(-1)'}), '(B, p=2.0, dim=-1)\n', (460... |
import collections
import enum
import glob
import re
import sys
import mako.template
import mako.lookup
################################################################################
# File to Docstring Comments Parser
################################################################################
class FilePar... | [
"re.match",
"glob.iglob",
"re.sub",
"collections.namedtuple"
] | [((1381, 1441), 'collections.namedtuple', 'collections.namedtuple', (['"""Docstring"""', "['description', 'tags']"], {}), "('Docstring', ['description', 'tags'])\n", (1403, 1441), False, 'import collections\n'), ((4102, 4188), 'collections.namedtuple', 'collections.namedtuple', (['"""ParameterDoc"""', "['name', 'type',... |
# tribe.config
# Configuration for the Tribe project
#
# Author: <NAME> <<EMAIL>>
# Created: Wed Nov 12 20:50:40 2014 -0500
#
# Copyright (C) 2014 District Data Labs
# For license information, see LICENSE.txt
#
# ID: config.py [a537f84] <EMAIL> $
"""
Uses confire to get meaningful configurations from a yaml file
""... | [
"os.path.abspath",
"os.path.expanduser"
] | [((1015, 1050), 'os.path.expanduser', 'os.path.expanduser', (['"""~/.tribe.yaml"""'], {}), "('~/.tribe.yaml')\n", (1033, 1050), False, 'import os\n'), ((1086, 1120), 'os.path.abspath', 'os.path.abspath', (['"""conf/tribe.yaml"""'], {}), "('conf/tribe.yaml')\n", (1101, 1120), False, 'import os\n')] |
import os
from pycocotools.coco import COCO
# initialize COCO API for instance annotations
dataDir = 'C:/Users/User/Desktop/image_captioning-master/'
dataType = 'val2014'
#instances_annFile = os.path.join(dataDir, 'annotations/instances_{}.json'.format(dataType))
instances_annFile = os.path.join(dataDir, 'annotations/... | [
"matplotlib.pyplot.switch_backend",
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.axis",
"pycocotools.coco.COCO",
"matplotlib.pyplot.get_backend",
"numpy.random.choice",
"skimage.io.imread"
] | [((364, 387), 'pycocotools.coco.COCO', 'COCO', (['instances_annFile'], {}), '(instances_annFile)\n', (368, 387), False, 'from pycocotools.coco import COCO\n'), ((628, 650), 'pycocotools.coco.COCO', 'COCO', (['captions_annFile'], {}), '(captions_annFile)\n', (632, 650), False, 'from pycocotools.coco import COCO\n'), ((7... |
# Copyright 2018 The TensorFlow Probability 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... | [
"tensorflow.test.main",
"tensorflow.ones",
"numpy.ones_like",
"importlib.import_module",
"numpy.median",
"tensorflow.TensorShape",
"numpy.isfinite",
"numpy.random.RandomState",
"tensorflow.constant",
"tensorflow.executing_eagerly",
"tensorflow.compat.v1.placeholder_with_default",
"tensorflow.z... | [((15953, 15967), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (15965, 15967), True, 'import tensorflow as tf\n'), ((1202, 1231), 'importlib.import_module', 'importlib.import_module', (['name'], {}), '(name)\n', (1225, 1231), False, 'import importlib\n'), ((1533, 1559), 'numpy.random.RandomState', 'np.rand... |
"""
Factory function for tridiagonal solver objects
"""
from mapping.tridiag.householder.full import Householder
from mapping.tridiag.lanczos.full import Lanczos
from mapping.tridiag.scipy_hessenberg.full import ScipyHessenberg
from mapping.tridiag.lanczos.full_low_memory import LowMemLanczos
from mapping.tridiag.l... | [
"mapping.tridiag.lanczos.full.Lanczos",
"mapping.tridiag.lanczos.diag.LanczosDiag",
"mapping.tridiag.lanczos.full_low_memory.LowMemLanczos",
"mapping.tridiag.lanczos.special_sparse.LanczosSpecialSparse",
"mapping.tridiag.scipy_hessenberg.full.ScipyHessenberg",
"mapping.tridiag.householder.full.Householder... | [((1014, 1043), 'mapping.tridiag.scipy_hessenberg.full.ScipyHessenberg', 'ScipyHessenberg', (['A'], {'view': 'view'}), '(A, view=view)\n', (1029, 1043), False, 'from mapping.tridiag.scipy_hessenberg.full import ScipyHessenberg\n'), ((1827, 1906), 'mapping.tridiag.lanczos.diag_low_memory.LowMemLanczosDiag', 'LowMemLancz... |
# To use a consistent encoding
from codecs import open
from os import path
from setuptools import setup, find_packages
import sys
if sys.version_info[0] > 2:
sys.exit("Incompatible with Python 3. IronPython 2.7 from Rhino can only be "
"connected to a Python 2 instance.")
here = path.abspath(path.dir... | [
"os.path.dirname",
"os.path.join",
"setuptools.find_packages",
"sys.exit"
] | [((163, 284), 'sys.exit', 'sys.exit', (['"""Incompatible with Python 3. IronPython 2.7 from Rhino can only be connected to a Python 2 instance."""'], {}), "(\n 'Incompatible with Python 3. IronPython 2.7 from Rhino can only be connected to a Python 2 instance.'\n )\n", (171, 284), False, 'import sys\n'), ((312, 3... |
import os
LOG_TO_STDOUT = os.environ.get('LOG_TO_STDOUT') | [
"os.environ.get"
] | [((27, 58), 'os.environ.get', 'os.environ.get', (['"""LOG_TO_STDOUT"""'], {}), "('LOG_TO_STDOUT')\n", (41, 58), False, 'import os\n')] |
from dpsniper.attack.attack import Attack
from dpsniper.classifiers.stable_classifier import StableClassifier
import numpy as np
import os
class MlAttack(Attack):
"""
An attack based on membership inference.
"""
def __init__(self, classifier: StableClassifier, thresh: float, q: float):
"""
... | [
"numpy.atleast_2d",
"os.path.basename"
] | [((1496, 1545), 'os.path.basename', 'os.path.basename', (['self.classifier.state_dict_file'], {}), '(self.classifier.state_dict_file)\n', (1512, 1545), False, 'import os\n'), ((732, 748), 'numpy.atleast_2d', 'np.atleast_2d', (['b'], {}), '(b)\n', (745, 748), True, 'import numpy as np\n'), ((1707, 1756), 'os.path.basena... |
# -*- coding: utf-8 -*-
from django.urls import include
from django.urls import path
from django.urls import reverse_lazy
from django.views.generic import RedirectView
from django.views.generic import TemplateView
from django.contrib.auth.decorators import login_required
from djforms.spacegrant.conference import views... | [
"django.urls.reverse_lazy",
"django.views.generic.TemplateView.as_view",
"django.urls.path"
] | [((546, 634), 'django.urls.path', 'path', (['"""conference/registration/"""', 'registration.form'], {'name': '"""spacegrant_registration"""'}), "('conference/registration/', registration.form, name=\n 'spacegrant_registration')\n", (550, 634), False, 'from django.urls import path\n'), ((417, 486), 'django.views.gene... |
# GENERATED BY KOMAND SDK - DO NOT EDIT
import komand
import json
class Component:
DESCRIPTION = "Gets history about an incident"
class Input:
INCIDENT_ID = "incident_id"
ORGANIZATION_ID = "organization_id"
class Output:
INCIDENT_HISTORY = "incident_history"
class GetIncidentHistoryInput... | [
"json.loads"
] | [((349, 806), 'json.loads', 'json.loads', (['"""\n {\n "type": "object",\n "title": "Variables",\n "properties": {\n "incident_id": {\n "type": "number",\n "title": "Incident ID",\n "description": "The incident ID",\n "order": 2\n },\n "organization_id": {\n "type": "number",\n ... |
import socketio
import eventlet
from flask import Flask
from keras.models import load_model
import base64
import cv2
from io import BytesIO
from PIL import Image
import numpy as np
sio = socketio.Server()
app =Flask(__name__)
speed_limit = 10
def img_preprocess(img):
img = img[60:140,:,:]
img = cv2.cvtColor(img,c... | [
"keras.models.load_model",
"cv2.GaussianBlur",
"socketio.Middleware",
"eventlet.listen",
"cv2.cvtColor",
"socketio.Server",
"flask.Flask",
"numpy.asarray",
"base64.b64decode",
"numpy.array",
"cv2.resize"
] | [((188, 205), 'socketio.Server', 'socketio.Server', ([], {}), '()\n', (203, 205), False, 'import socketio\n'), ((212, 227), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (217, 227), False, 'from flask import Flask\n'), ((302, 338), 'cv2.cvtColor', 'cv2.cvtColor', (['img', 'cv2.COLOR_RGB2YUV'], {}), '(img,... |
from flask import g, session
from . import db, socketio, celery
from .models import User, Message
from .auth import verify_token
def push_model(model):
"""Push the model to all connected Socket.IO clients."""
socketio.emit('updated_model', {'class': model.__class__.__name__,
... | [
"flask.g.current_user.ping",
"flask.session.get"
] | [((1769, 1792), 'flask.session.get', 'session.get', (['"""nickname"""'], {}), "('nickname')\n", (1780, 1792), False, 'from flask import g, session\n'), ((596, 617), 'flask.g.current_user.ping', 'g.current_user.ping', ([], {}), '()\n', (615, 617), False, 'from flask import g, session\n')] |
import torch
import functools
from scipy import stats
from torch.autograd import Variable
from torch.distributions import Dirichlet
from problog.engine import DefaultEngine
from problog.program import PrologString
from problog.logic import Term, Clause, Not, And
from problog import get_evaluatable
from ExampleModule ... | [
"problog.program.PrologString",
"torch.sqrt",
"problog.program.PrologFile",
"torch.device",
"torch.std_mean",
"torch.no_grad",
"problog.logic.Not",
"ExampleModule.ExampleModule",
"problog.logic.Term",
"scipy.stats.beta.ppf",
"matplotlib.pyplot.subplots",
"scipy.stats.beta.pdf",
"problog.logi... | [((13005, 13020), 'problog.engine.DefaultEngine', 'DefaultEngine', ([], {}), '()\n', (13018, 13020), False, 'from problog.engine import DefaultEngine\n'), ((15093, 15126), 'problog.program.PrologFile', 'PrologFile', (['"""./networks/_prob.pl"""'], {}), "('./networks/_prob.pl')\n", (15103, 15126), False, 'from problog.p... |
#!/usr/bin/env python3
# MIT License
#
# Copyright (C) 2019-2020, Entynetproject. All Rights Reserved.
#
# 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 withou... | [
"lib.googlesearch.search",
"lib.request.send"
] | [((6360, 6380), 'lib.googlesearch.search', 'search', (['req'], {'stop': '(10)'}), '(req, stop=10)\n', (6366, 6380), False, 'from lib.googlesearch import search\n'), ((6973, 6993), 'lib.googlesearch.search', 'search', (['req'], {'stop': '(10)'}), '(req, stop=10)\n', (6979, 6993), False, 'from lib.googlesearch import sea... |
from tensorflow.keras.models import model_from_json
import efficientnet.tfkeras
from tensorflow.keras.models import load_model
from utils import custom_save_model
from configs import argHandler # Import the default arguments
import os
import argparse
FLAGS = argHandler()
FLAGS.setDefaults()
parser = argparse.Argume... | [
"configs.argHandler",
"tensorflow.keras.models.load_model",
"argparse.ArgumentParser",
"utils.custom_save_model",
"os.path.basename",
"os.path.exists",
"os.path.splitext"
] | [((262, 274), 'configs.argHandler', 'argHandler', ([], {}), '()\n', (272, 274), False, 'from configs import argHandler\n'), ((305, 330), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (328, 330), False, 'import argparse\n'), ((551, 584), 'os.path.basename', 'os.path.basename', (['LOAD_MODEL_PAT... |
import asyncio
import io
from contextlib import AsyncExitStack
import pytest
from google.protobuf.message import EncodeError
from multiaddr import Multiaddr, protocols
from hivemind.p2p.p2p_daemon_bindings.control import ControlClient, DaemonConnector, parse_conn_protocol
from hivemind.p2p.p2p_daemon_bindings.datastr... | [
"hivemind.p2p.p2p_daemon_bindings.utils.read_unsigned_varint",
"hivemind.proto.p2pd_pb2.DHTResponse",
"test_utils.p2p_daemon.connect_safe",
"pytest.mark.parametrize",
"hivemind.p2p.p2p_daemon_bindings.control.parse_conn_protocol",
"hivemind.p2p.p2p_daemon_bindings.utils.write_unsigned_varint",
"hivemind... | [((1635, 1656), 'hivemind.p2p.p2p_daemon_bindings.datastructures.PeerID', 'PeerID', (['PEER_ID_BYTES'], {}), '(PEER_ID_BYTES)\n', (1641, 1656), False, 'from hivemind.p2p.p2p_daemon_bindings.datastructures import PeerID, PeerInfo, StreamInfo\n'), ((1665, 1687), 'multiaddr.Multiaddr', 'Multiaddr', (['"""/unix/123"""'], {... |
# pylint: disable=redefined-outer-name
# pylint: disable=unused-argument
# pylint: disable=unused-variable
# pylint: disable=no-member
import asyncio
import concurrent.futures
import time
from typing import Any, Dict
import distributed
import pytest
from dask_task_models_library.container_tasks.events import (
T... | [
"tenacity.retry.retry_if_exception_type",
"distributed.Pub",
"asyncio.sleep",
"simcore_service_dask_sidecar.dask_utils.is_current_task_aborted",
"tenacity.wait.wait_fixed",
"dask_task_models_library.container_tasks.events.TaskCancelEvent",
"time.sleep",
"asyncio.current_task",
"simcore_service_dask_... | [((3821, 3971), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""resources, expected_boot_mode"""', "[({'CPU': 2}, BootMode.CPU), ({'MPI': 1.0}, BootMode.MPI), ({'GPU': 5.0},\n BootMode.GPU)]"], {}), "('resources, expected_boot_mode', [({'CPU': 2},\n BootMode.CPU), ({'MPI': 1.0}, BootMode.MPI), ({'GPU'... |
import math
import argparse
import os
import itertools
import logging
import numpy as np
import tensorflow as tf
import ase
import msgnet
import runner
def get_arguments():
parser = argparse.ArgumentParser(description="Evaluate graph convolution network")
parser.add_argument("--modelpath", type=str, default... | [
"numpy.abs",
"argparse.ArgumentParser",
"msgnet.datahandler.EdgeSelectDataHandler",
"numpy.copy",
"itertools.permutations",
"os.path.dirname",
"runner.get_dataloader_class",
"runner.get_model",
"numpy.repeat",
"numpy.stack",
"logging.StreamHandler",
"tensorflow.Session",
"numpy.square",
"n... | [((190, 263), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Evaluate graph convolution network"""'}), "(description='Evaluate graph convolution network')\n", (213, 263), False, 'import argparse\n'), ((5778, 5808), 'numpy.count_nonzero', 'np.count_nonzero', (['(a == atm_arr)'], {}), '(a ... |
from typing import Dict
import tempfile
import pytest
import sys
import os
import yaml
import requests
import numpy as np
import ray
from ray import serve
from ray.serve.application import Application
from ray.serve.api import build as build_app
from ray._private.test_utils import wait_for_condition
class TestApplic... | [
"ray.serve.get_deployment",
"ray.serve.application.Application.from_yaml",
"ray.serve.deployment",
"ray.serve.run",
"os.path.dirname",
"numpy.zeros",
"pytest.main",
"tempfile.TemporaryFile",
"ray.serve.application.Application.from_dict",
"pytest.mark.skipif",
"pytest.raises",
"yaml.safe_load",... | [((8735, 8778), 'ray.serve.deployment', 'serve.deployment', ([], {'max_concurrent_queries': '(17)'}), '(max_concurrent_queries=17)\n', (8751, 8778), False, 'from ray import serve\n'), ((8902, 8945), 'ray.serve.deployment', 'serve.deployment', ([], {'max_concurrent_queries': '(17)'}), '(max_concurrent_queries=17)\n', (8... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-17 09:59
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('calculator', '0016_auto_20171016_1518'),
]
operations = [
migrations.AddFie... | [
"django.db.models.SmallIntegerField",
"django.db.models.DecimalField"
] | [((411, 478), 'django.db.models.DecimalField', 'models.DecimalField', ([], {'decimal_places': '(2)', 'default': '"""0.00"""', 'max_digits': '(6)'}), "(decimal_places=2, default='0.00', max_digits=6)\n", (430, 478), False, 'from django.db import migrations, models\n'), ((638, 673), 'django.db.models.SmallIntegerField', ... |
import time
import pytest
@pytest.mark.slow_test
def test_minion_hangs_on_master_failure_50814(
event_listener,
salt_mm_master_1,
salt_mm_master_2,
salt_mm_minion_1,
mm_master_2_salt_cli,
):
"""
Check minion handling events for the alive master when another master is dead.
The case be... | [
"time.sleep",
"time.time"
] | [((519, 530), 'time.time', 'time.time', ([], {}), '()\n', (528, 530), False, 'import time\n'), ((1367, 1382), 'time.sleep', 'time.sleep', (['(0.5)'], {}), '(0.5)\n', (1377, 1382), False, 'import time\n'), ((1452, 1463), 'time.time', 'time.time', ([], {}), '()\n', (1461, 1463), False, 'import time\n'), ((2302, 2313), 't... |
# Code is from Osvaldo Martin et al,
# "Bayesian Modeling and Comptuation In Python"
# https://github.com/aloctavodia/BMCP/blob/master/Code/chp_3_5/splines.py
import superimport
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
from patsy import bs, dmatrix
import pyprobml_utils as pml
x ... | [
"numpy.zeros_like",
"numpy.random.seed",
"matplotlib.pyplot.show",
"patsy.dmatrix",
"numpy.linspace",
"numpy.random.normal",
"numpy.dot",
"pyprobml_utils.savefig",
"matplotlib.pyplot.subplots"
] | [((322, 348), 'numpy.linspace', 'np.linspace', (['(0.0)', '(1.0)', '(500)'], {}), '(0.0, 1.0, 500)\n', (333, 348), True, 'import numpy as np\n'), ((379, 476), 'patsy.dmatrix', 'dmatrix', (['"""bs(x, knots=knots, degree=0, include_intercept=True) - 1"""', "{'x': x, 'knots': knots}"], {}), "('bs(x, knots=knots, degree=0,... |
import strategyease_sdk
# 注意:需将回测调成分钟级别
# 注意:用于回测没有意义,需挂到“我的交易”
def initialize(context):
# 每天的收盘前5分钟进行逆回购,参数设置见:https://www.joinquant.com/api#定时运行
run_daily(repo, '14:55')
def process_initialize(context):
# 创建 StrategyManager 对象
# 参数为配置文件中的 manager id
g.__manager = strategyease_sdk.JoinQuantStr... | [
"strategyease_sdk.JoinQuantStrategyManagerFactory"
] | [((291, 348), 'strategyease_sdk.JoinQuantStrategyManagerFactory', 'strategyease_sdk.JoinQuantStrategyManagerFactory', (['context'], {}), '(context)\n', (339, 348), False, 'import strategyease_sdk\n')] |
"""
Timezone stuff.
"""
import datetime
import pytz
TIMEZONE = None
"""
Timezone used for resolving what "today" means. Defaults to local tz.
"""
def get_timezone():
return TIMEZONE
def set_timezone(tz):
"""
Set a timezone to use for resolving what "today" means.
Set to None to reset to default.... | [
"pytz.timezone"
] | [((425, 442), 'pytz.timezone', 'pytz.timezone', (['tz'], {}), '(tz)\n', (438, 442), False, 'import pytz\n')] |
__author__ = 'amw'
from quicktest.Reporting import plot3d, plot2d, create_dataset, create_plot_matrix
# Initialise database config
db_config = {"hostname": "localhost", "port": "27017", "db_name": "simulations", "collection_name": "02-09-13"}
# Create plot
tag = "direct_null_1m_020913"
x_param = "parameters.numSubs... | [
"quicktest.Reporting.plot3d",
"quicktest.Reporting.plot2d"
] | [((684, 801), 'quicktest.Reporting.plot3d', 'plot3d', (['db_config', 'tag', 'x_param', 'y_param', 'z_param', 'filter_list', '(2)', '(3)', '"""Direct Null: Average Latency to all nodes"""'], {}), "(db_config, tag, x_param, y_param, z_param, filter_list, 2, 3,\n 'Direct Null: Average Latency to all nodes')\n", (690, 8... |
# -*- coding: utf-8 -*-
from time import time
from argparse import ArgumentParser
import numpy as np
def integral(a,b):
"""Function to evaulate the integral. """
if (abs(a + 1.) > 1e-10):
intg_val = (1. / (a + 1.) * pow(b, a + 1.))
else:
intg_val= (np.log(b))
return intg_val
def ave... | [
"numpy.log",
"argparse.ArgumentParser",
"time.time"
] | [((1851, 1857), 'time.time', 'time', ([], {}), '()\n', (1855, 1857), False, 'from time import time\n'), ((1871, 1933), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': '"""Lancichinetti–Fortunato–Radicchi"""'}), "(description='Lancichinetti–Fortunato–Radicchi')\n", (1885, 1933), False, 'from argparse i... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: ethermint/evm/v1/genesis.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
fr... | [
"google.protobuf.symbol_database.Default",
"google.protobuf.descriptor.FieldDescriptor",
"google.protobuf.reflection.GeneratedProtocolMessageType",
"google.protobuf.descriptor.FileDescriptor"
] | [((429, 455), 'google.protobuf.symbol_database.Default', '_symbol_database.Default', ([], {}), '()\n', (453, 455), True, 'from google.protobuf import symbol_database as _symbol_database\n'), ((631, 1707), 'google.protobuf.descriptor.FileDescriptor', '_descriptor.FileDescriptor', ([], {'name': '"""ethermint/evm/v1/genes... |
import math
from datetime import timedelta
import matplotlib.axes
import pandas as pd
# Graphing Settings
import talib
from matplotlib import pyplot as plt
from matplotlib.collections import PatchCollection
from matplotlib.patches import Rectangle, Patch
from pandas import to_datetime
import matplotlib as mpl
from s... | [
"talib.MACD",
"math.isnan",
"util.langUtil.strtodatetime",
"matplotlib.pyplot.style.use",
"matplotlib.use",
"util.langUtil.is_datetime",
"util.langUtil.timedeltatoyahootimestr",
"matplotlib.pyplot.subplots"
] | [((1271, 1290), 'matplotlib.use', 'mpl.use', (['PLOTENGINE'], {}), '(PLOTENGINE)\n', (1278, 1290), True, 'import matplotlib as mpl\n'), ((1342, 1366), 'matplotlib.pyplot.style.use', 'plt.style.use', (['PLOTSTYLE'], {}), '(PLOTSTYLE)\n', (1355, 1366), True, 'from matplotlib import pyplot as plt\n'), ((1378, 1426), 'matp... |
import torch
from torch import nn
class MyMultilayerRNN(nn.Module):
def __init__(self, needs_cell, constr, input_size, hidden_size, num_layers, dropout, bidirectional):
super().__init__()
assert not bidirectional
self.num_layers = num_layers
self.needs_cell = needs_cell
sel... | [
"torch.nn.Dropout",
"torch.nn.ModuleList",
"torch.nn.utils.rnn.pad_packed_sequence",
"torch.nn.utils.rnn.pack_padded_sequence",
"torch.zeros"
] | [((376, 391), 'torch.nn.ModuleList', 'nn.ModuleList', ([], {}), '()\n', (389, 391), False, 'from torch import nn\n'), ((920, 966), 'torch.nn.utils.rnn.pad_packed_sequence', 'torch.nn.utils.rnn.pad_packed_sequence', (['packed'], {}), '(packed)\n', (958, 966), False, 'import torch\n'), ((1845, 1903), 'torch.zeros', 'torc... |
import json
import argparse
from pathlib import Path
import yaml
class ConfigBuilder:
def __init__(self, config, options):
self.config = config
self.options = options
def set_option(self, option_name, category=None, alt_config_name=None):
# some options are optional, skip them if it's... | [
"json.load",
"argparse.ArgumentParser",
"yaml.safe_dump",
"pathlib.Path",
"yaml.safe_load"
] | [((3534, 3627), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Construct an appropriate yaml configuration file."""'}), "(description=\n 'Construct an appropriate yaml configuration file.')\n", (3557, 3627), False, 'import argparse\n'), ((2439, 2451), 'json.load', 'json.load', (['f'],... |
#!/usr/bin/env python2
# coding: utf-8
import sys
class Solution(object):
def leastBricks(self, wall):
"""
:type wall: List[List[int]]
:rtype: int
"""
if len(wall) < 1: return 0
from collections import defaultdict
marks = defaultdict(int)
for row i... | [
"collections.defaultdict"
] | [((286, 302), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (297, 302), False, 'from collections import defaultdict\n')] |
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import NoSuchElementException
import time
import os
import schedule
from colorama import Fore as textColor, Style
from userInfo import New_Download_Directory, Default_Download_Directory
#Function to check whe... | [
"schedule.run_pending",
"os.remove",
"zipfile.ZipFile",
"pandas.read_csv",
"os.path.exists",
"time.sleep",
"time.time",
"selenium.webdriver.ChromeOptions",
"selenium.webdriver.Chrome",
"os.replace",
"schedule.every",
"os.listdir"
] | [((3256, 3292), 'pandas.read_csv', 'pandas.read_csv', (['myCSVFile'], {'header': '(0)'}), '(myCSVFile, header=0)\n', (3271, 3292), False, 'import pandas\n'), ((7504, 7529), 'selenium.webdriver.ChromeOptions', 'webdriver.ChromeOptions', ([], {}), '()\n', (7527, 7529), False, 'from selenium import webdriver\n'), ((8208, ... |
from bashbot import bot
from bashbot.commands import Command
from bashbot.commands.syntax import SyntaxBuilder
class HelpCommand(Command):
def __init__(self):
super().__init__()
self.name = "Help command"
self.aliases = [".help"]
self.description = "Shows help"
self.usage ... | [
"bashbot.commands.syntax.SyntaxBuilder",
"bashbot.bot.settings.get",
"bashbot.bot.commands_manager.get"
] | [((1533, 1585), 'bashbot.bot.commands_manager.get', 'bot.commands_manager.get', (["parameters['command_name']"], {}), "(parameters['command_name'])\n", (1557, 1585), False, 'from bashbot import bot\n'), ((1357, 1386), 'bashbot.bot.settings.get', 'bot.settings.get', (['"""_username"""'], {}), "('_username')\n", (1373, 1... |
from django.shortcuts import render
from .models import Category, Group, Website
def build_category(category):
groups = Group.objects.filter(category=category, number__isnull=False)
websites = Website.objects.filter(category=category)
categories = Category.objects.filter(parent=category)
return {
... | [
"django.shortcuts.render"
] | [((731, 781), 'django.shortcuts.render', 'render', (['request', '"""groups/group.j2"""', "{'root': root}"], {}), "(request, 'groups/group.j2', {'root': root})\n", (737, 781), False, 'from django.shortcuts import render\n'), ((899, 951), 'django.shortcuts.render', 'render', (['request', '"""groups/website.j2"""', "{'roo... |
#!/usr/bin/env python
# -*- mode: Python -*-
""":"
# Bash code to check which python version to use
if [ "$ROS_DISTRO" == melodic ] ; then
PYTHON_VERSION_TO_USE=python2
else
PYTHON_VERSION_TO_USE=python3
fi
echo "$PYTHON_VERSION_TO_USE"
exec /usr/bin/$PYTHON_VERSION_TO_USE $0
":"""
# Basic ROS imports
impor... | [
"PyKDL.Vector",
"rospy.Subscriber",
"nav_msgs.msg.Odometry",
"rospy.Time.now",
"tf.TransformBroadcaster",
"rospy.Publisher",
"rospy.Rate",
"rospy.get_param",
"rospy.is_shutdown",
"rospy.init_node",
"tf.transformations.quaternion_from_euler",
"PyKDL.Frame",
"rospy.Service",
"roslib.load_man... | [((330, 366), 'roslib.load_manifest', 'roslib.load_manifest', (['"""dynamics_sim"""'], {}), "('dynamics_sim')\n", (350, 366), False, 'import roslib\n'), ((860, 907), 'rospy.init_node', 'rospy.init_node', (['"""dynamics_sim"""'], {'anonymous': '(True)'}), "('dynamics_sim', anonymous=True)\n", (875, 907), False, 'import ... |
#
# Tests for the Parameter class
#
import unittest
import sympy
import pybamm
class TestIndependentVariable(unittest.TestCase):
def test_variable_init(self):
a = pybamm.IndependentVariable("a")
self.assertEqual(a.name, "a")
self.assertEqual(a.domain, [])
a = pybamm.IndependentVa... | [
"unittest.main",
"sympy.Symbol",
"pybamm.t.to_equation",
"pybamm.IndependentVariable",
"pybamm.SpatialVariable",
"pybamm.SpatialVariableEdge",
"pybamm.Time"
] | [((2851, 2866), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2864, 2866), False, 'import unittest\n'), ((179, 210), 'pybamm.IndependentVariable', 'pybamm.IndependentVariable', (['"""a"""'], {}), "('a')\n", (205, 210), False, 'import pybamm\n'), ((300, 348), 'pybamm.IndependentVariable', 'pybamm.IndependentVaria... |
#!/usr/bin/env python3
try:
from scripts.responseaction import ResponseAction
from scripts.responseplaybook import ResponsePlaybook
from scripts.responsestage import ResponseStage
from scripts.reactutils import REACTutils
except:
from response.atc_react.scripts.responseaction import ResponseAction
... | [
"response.atc_react.scripts.reactutils.REACTutils.load_yamls_with_paths",
"jinja2.FileSystemLoader",
"response.atc_react.scripts.reactutils.REACTutils.write_file",
"response.atc_react.scripts.reactutils.REACTutils.load_config"
] | [((648, 684), 'response.atc_react.scripts.reactutils.REACTutils.load_config', 'REACTutils.load_config', (['"""config.yml"""'], {}), "('config.yml')\n", (670, 684), False, 'from response.atc_react.scripts.reactutils import REACTutils\n'), ((1537, 1578), 'response.atc_react.scripts.reactutils.REACTutils.load_yamls_with_p... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pipes
import shutil
import bisect
import sys
import click
# Modified from pairtools_restrict, fixed the issue with first fragment of each chromosome
# and this implementation is two times faster
@click.command()
@click.argument(
'pairs_path',
type=str,
... | [
"click.argument",
"click.option",
"shutil.which",
"click.command",
"pipes.Template",
"bisect.insort"
] | [((252, 267), 'click.command', 'click.command', ([], {}), '()\n', (265, 267), False, 'import click\n'), ((269, 323), 'click.argument', 'click.argument', (['"""pairs_path"""'], {'type': 'str', 'required': '(False)'}), "('pairs_path', type=str, required=False)\n", (283, 323), False, 'import click\n'), ((338, 599), 'click... |
import displaz
from numpy.random import randn, rand
N = 100000
displaz.plot(40*randn(N, 3), color=rand(N,3)*[1,0.2,0.8])
| [
"numpy.random.rand",
"numpy.random.randn"
] | [((80, 91), 'numpy.random.randn', 'randn', (['N', '(3)'], {}), '(N, 3)\n', (85, 91), False, 'from numpy.random import randn, rand\n'), ((99, 109), 'numpy.random.rand', 'rand', (['N', '(3)'], {}), '(N, 3)\n', (103, 109), False, 'from numpy.random import randn, rand\n')] |
import sys
import os
sys.path.append(os.getcwd())
from ProjectAnalysis.renderer import run
run(False)
| [
"os.getcwd",
"ProjectAnalysis.renderer.run"
] | [((95, 105), 'ProjectAnalysis.renderer.run', 'run', (['(False)'], {}), '(False)\n', (98, 105), False, 'from ProjectAnalysis.renderer import run\n'), ((38, 49), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (47, 49), False, 'import os\n')] |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import os
from maya import cmds
from maya import mel
def onMayaDroppedPythonFile(*args, **kwargs):
"""for Maya2017.3+"""
_register_hotkey()
def onMayaDroppedMelFile():
"for old Maya"
_register_hotkey()
def _... | [
"maya.cmds.about",
"maya.cmds.nameCommand",
"os.path.dirname",
"maya.cmds.hotkey",
"maya.cmds.runTimeCommand"
] | [((1019, 1061), 'maya.cmds.runTimeCommand', 'cmds.runTimeCommand', (['command_name'], {'ex': '(True)'}), '(command_name, ex=True)\n', (1038, 1061), False, 'from maya import cmds\n'), ((1130, 1255), 'maya.cmds.runTimeCommand', 'cmds.runTimeCommand', (['command_name'], {'ann': '"""Open WindowSwitcher"""', 'category': '""... |
from random import randrange
from model.contact import Contact
import re
def test_all_information_fields_on_home_page(app):
if app.contact.count() == 0:
app.contact.create_new_contact(Contact(firstname="Ivan", middlename="Ivanovich", lastname="Ivanov",
nickna... | [
"re.sub",
"model.contact.Contact"
] | [((1827, 1850), 're.sub', 're.sub', (['"""[() -]"""', '""""""', 's'], {}), "('[() -]', '', s)\n", (1833, 1850), False, 'import re\n'), ((198, 614), 'model.contact.Contact', 'Contact', ([], {'firstname': '"""Ivan"""', 'middlename': '"""Ivanovich"""', 'lastname': '"""Ivanov"""', 'nickname': '"""Vano"""', 'company': '"""C... |
import json, os, datetime, re, requests, requests_cache, logging
from urllib.request import urlretrieve
from urllib.parse import quote_plus, unquote_plus
from comics.models import Arc, Character, Creator, Team, Publisher, Series, Issue, Roles, Settings
from .comicfilehandler import ComicFileHandler
from . import fnamep... | [
"comics.models.Publisher.objects.create",
"comics.models.Character.objects.get",
"requests_cache.install_cache",
"comics.models.Issue.objects.get",
"comics.models.Series.objects.get",
"comics.models.Series.objects.create",
"comics.models.Arc.objects.filter",
"requests_cache.core.remove_expired_respons... | [((543, 569), 'logging.getLogger', 'logging.getLogger', (['"""tenma"""'], {}), "('tenma')\n", (560, 569), False, 'import json, os, datetime, re, requests, requests_cache, logging\n'), ((600, 685), 'requests_cache.install_cache', 'requests_cache.install_cache', (['"""./media/CACHE/comicvine-cache"""'], {'expire_after': ... |
from jinja2 import Environment, PackageLoader
from .train import Meta, ERROR, WARNING, NOTICE, TOOLTIPS
# This is all just for testing, will be removed.
# Real html formatting is done in the THH.
template_env = Environment(
loader=PackageLoader('hh_page_clf', 'templates'),
extensions=['jinja2.ext.with_'])
... | [
"jinja2.PackageLoader"
] | [((240, 281), 'jinja2.PackageLoader', 'PackageLoader', (['"""hh_page_clf"""', '"""templates"""'], {}), "('hh_page_clf', 'templates')\n", (253, 281), False, 'from jinja2 import Environment, PackageLoader\n')] |
import os
import pandas as pd
def get_all_product_id_files():
for source in os.listdir('data/product_info'):
if source[0].isupper():
s_file = f'data/product_info/{source}'
yield s_file
def main():
dfs = []
for source in get_all_product_id_files():
df = pd.read_csv... | [
"pandas.read_csv",
"pandas.concat",
"os.listdir"
] | [((82, 113), 'os.listdir', 'os.listdir', (['"""data/product_info"""'], {}), "('data/product_info')\n", (92, 113), False, 'import os\n'), ((365, 379), 'pandas.concat', 'pd.concat', (['dfs'], {}), '(dfs)\n', (374, 379), True, 'import pandas as pd\n'), ((309, 328), 'pandas.read_csv', 'pd.read_csv', (['source'], {}), '(sou... |
#!/usr/bin/env python3
import sys
from gomireader import GomiReader, PatternValuePair
def main(argv):
# メモ:
# 市のホームページでは「ビールびん」の分類が「空きびん」と誤記されているので
# 空きびん・生きびんについては分類ではなく備考により分別するようにした。
reader = GomiReader()
reader.municipality_id = "232025"
reader.municipality_name = "愛知県岡崎市"
reader.datas... | [
"gomireader.GomiReader",
"gomireader.PatternValuePair"
] | [((213, 225), 'gomireader.GomiReader', 'GomiReader', ([], {}), '()\n', (223, 225), False, 'from gomireader import GomiReader, PatternValuePair\n'), ((886, 928), 'gomireader.PatternValuePair', 'PatternValuePair', (['"""/(?可燃ごみ)?/"""', '"""burnable"""'], {}), "('/(?可燃ごみ)?/', 'burnable')\n", (902, 928), False, 'from gomir... |
from onegov.winterthur import _
# translations provided by onegov.org, overriden by Winterthur
_("Hide from the public")
_(
"This site is hidden from the general public. "
"To show it to everyone, edit this page and disable \"Hide from public\"."
)
| [
"onegov.winterthur._"
] | [((96, 121), 'onegov.winterthur._', '_', (['"""Hide from the public"""'], {}), "('Hide from the public')\n", (97, 121), False, 'from onegov.winterthur import _\n'), ((122, 247), 'onegov.winterthur._', '_', (['"""This site is hidden from the general public. To show it to everyone, edit this page and disable "Hide from p... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: privacy.proto
import os
import sys
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflect... | [
"google.protobuf.descriptor.FieldDescriptor",
"google.protobuf.descriptor_pb2.MessageOptions.RegisterExtension",
"google.protobuf.descriptor.EnumValueDescriptor",
"google.protobuf.descriptor_pb2.FieldOptions.RegisterExtension",
"google.protobuf.symbol_database.Default",
"google.protobuf.reflection.Generat... | [((450, 476), 'google.protobuf.symbol_database.Default', '_symbol_database.Default', ([], {}), '()\n', (474, 476), True, 'from google.protobuf import symbol_database as _symbol_database\n'), ((646, 1456), 'google.protobuf.descriptor.FileDescriptor', '_descriptor.FileDescriptor', ([], {'name': '"""privacy.proto"""', 'pa... |
from __future__ import unicode_literals
import six
from httoop import Date
from httoop.messages import Message
from httoop.meta import HTTPSemantic
def test_repr(request_, response):
to_test = (
request_, request_.body, request_.method,
request_.protocol, response, Message(),
response.status, response.header... | [
"httoop.Date",
"httoop.messages.Message",
"six.with_metaclass"
] | [((558, 598), 'six.with_metaclass', 'six.with_metaclass', (['HTTPSemantic', 'object'], {}), '(HTTPSemantic, object)\n', (576, 598), False, 'import six\n'), ((275, 284), 'httoop.messages.Message', 'Message', ([], {}), '()\n', (282, 284), False, 'from httoop.messages import Message\n'), ((323, 329), 'httoop.Date', 'Date'... |
from rdflib.term import URIRef
from rdflib.namespace import DefinedNamespace, Namespace
class SSN(DefinedNamespace):
"""
Semantic Sensor Network Ontology
This ontology describes sensors, actuators and observations, and related concepts. It does not describe domain
concepts, time, locations, etc. ... | [
"rdflib.namespace.Namespace"
] | [((4841, 4879), 'rdflib.namespace.Namespace', 'Namespace', (['"""http://www.w3.org/ns/ssn/"""'], {}), "('http://www.w3.org/ns/ssn/')\n", (4850, 4879), False, 'from rdflib.namespace import DefinedNamespace, Namespace\n')] |
#!/usr/bin/python
#Importing the required libraries
import os, random, argparse
from PIL import Image
import imghdr
import numpy as np
## This tests to make sure the dimensions of all the photos are the same
for filename in os.listdir("images/"):
print(filename)
path = "test/"+filename
x = Image.open(path)
im ... | [
"numpy.array",
"os.listdir",
"PIL.Image.open"
] | [((225, 246), 'os.listdir', 'os.listdir', (['"""images/"""'], {}), "('images/')\n", (235, 246), False, 'import os, random, argparse\n'), ((298, 314), 'PIL.Image.open', 'Image.open', (['path'], {}), '(path)\n', (308, 314), False, 'from PIL import Image\n'), ((322, 333), 'numpy.array', 'np.array', (['x'], {}), '(x)\n', (... |
# PsychroLib (version 2.2.0) (https://github.com/psychrometrics/psychrolib)
# Copyright (c) 2018 <NAME> and <NAME> for the current library implementation
# Copyright (c) 2017 ASHRAE Handbook — Fundamentals for ASHRAE equations and coefficients
# Licensed under the MIT License.
""" psychrolib.py
Contains functions for... | [
"math.exp",
"math.pow",
"math.fabs",
"enum.auto",
"math.log"
] | [((3500, 3506), 'enum.auto', 'auto', ([], {}), '()\n', (3504, 3506), False, 'from enum import Enum, auto\n'), ((3516, 3522), 'enum.auto', 'auto', ([], {}), '()\n', (3520, 3522), False, 'from enum import Enum, auto\n'), ((15395, 15412), 'math.log', 'math.log', (['VapPres'], {}), '(VapPres)\n', (15403, 15412), False, 'im... |
#!/usr/bin/python3
import argparse
from time import sleep
from pycomfoconnect import *
parser = argparse.ArgumentParser()
parser.add_argument('--ip', help='ip address of the bridge')
args = parser.parse_args()
## Configuration ##########################################################################################... | [
"argparse.ArgumentParser",
"time.sleep"
] | [((98, 123), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (121, 123), False, 'import argparse\n'), ((8014, 8022), 'time.sleep', 'sleep', (['(1)'], {}), '(1)\n', (8019, 8022), False, 'from time import sleep\n')] |
from typing import List, Text
import pytest
from rasa.core.policies.policy import PolicyPrediction
from rasa.core.processor import MessageProcessor
from rasa.shared.constants import DEFAULT_NLU_FALLBACK_INTENT_NAME
from rasa.core.actions.two_stage_fallback import TwoStageFallbackAction
from rasa.core.channels import ... | [
"rasa.shared.core.events.UserUtteranceReverted",
"rasa.core.nlg.TemplatedNaturalLanguageGenerator",
"rasa.shared.core.events.ActiveLoop",
"rasa.shared.core.events.UserUttered",
"rasa.shared.core.domain.Domain.empty",
"rasa.core.actions.two_stage_fallback.TwoStageFallbackAction",
"rasa.shared.core.events... | [((10157, 10283), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""intent_which_lets_action_give_up"""', '[USER_INTENT_OUT_OF_SCOPE, DEFAULT_NLU_FALLBACK_INTENT_NAME]'], {}), "('intent_which_lets_action_give_up', [\n USER_INTENT_OUT_OF_SCOPE, DEFAULT_NLU_FALLBACK_INTENT_NAME])\n", (10180, 10283), False, '... |
import json
import requests
from websocket import WebSocketApp
from nameko.rpc import rpc
from nameko.events import EventDispatcher
class ListenerService:
name = 'listener'
dispatch = EventDispatcher()
ORDER_BOOK_ENDPOINT = 'https://api.binance.com/api/v3/depth'
STREAM_SOCKET = 'wss://stream.binanc... | [
"websocket.WebSocketApp",
"json.loads",
"nameko.events.EventDispatcher"
] | [((196, 213), 'nameko.events.EventDispatcher', 'EventDispatcher', ([], {}), '()\n', (211, 213), False, 'from nameko.events import EventDispatcher\n'), ((400, 419), 'json.loads', 'json.loads', (['message'], {}), '(message)\n', (410, 419), False, 'import json\n'), ((1249, 1321), 'websocket.WebSocketApp', 'WebSocketApp', ... |
# Copyright (c) 2019-2020, NVIDIA CORPORATION.
# 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... | [
"cupy.empty_like",
"cupy.dtype"
] | [((2225, 2275), 'cupy.empty_like', 'cp.empty_like', (['binary'], {'dtype': 'dtype', 'shape': 'out_size'}), '(binary, dtype=dtype, shape=out_size)\n', (2238, 2275), True, 'import cupy as cp\n'), ((2119, 2134), 'cupy.dtype', 'cp.dtype', (['dtype'], {}), '(dtype)\n', (2127, 2134), True, 'import cupy as cp\n')] |
"""
:codeauthor: <NAME> <<EMAIL>>
"""
import pytest
import salt.modules.random_org as random_org
from salt.ext.tornado.httpclient import HTTPClient
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import TestCase, skipIf
def check_status():
"""
Check the status of random.org... | [
"salt.modules.random_org.generateIntegers",
"salt.modules.random_org.generateDecimalFractions",
"tests.support.unit.skipIf",
"salt.modules.random_org.getUsage",
"salt.ext.tornado.httpclient.HTTPClient",
"pytest.mark.flaky",
"salt.modules.random_org.generateGaussians",
"salt.modules.random_org.generate... | [((489, 577), 'tests.support.unit.skipIf', 'skipIf', (['(True)', '"""WAR ROOM 7/31/2019, test needs to allow for quotas of random website"""'], {}), "(True,\n 'WAR ROOM 7/31/2019, test needs to allow for quotas of random website')\n", (495, 577), False, 'from tests.support.unit import TestCase, skipIf\n'), ((6339, 6... |
"""Data structures responsible for storing a collection of :class:`Value` s"""
from traychain.util import to_json
class Column(object):
"""A column in the schema of a :class:`BTree` or :class:`Table`."""
def __init__(self, name, dtype, max_size=None):
self.name = name
self.dtype = dtype
... | [
"traychain.util.to_json"
] | [((562, 594), 'traychain.util.to_json', 'to_json', (['(self.name, self.dtype)'], {}), '((self.name, self.dtype))\n', (569, 594), False, 'from traychain.util import to_json\n'), ((628, 675), 'traychain.util.to_json', 'to_json', (['(self.name, self.dtype, self.max_size)'], {}), '((self.name, self.dtype, self.max_size))\n... |
import os, sys, getopt
import math
import random
import bisect
import utilities
from classes.window import Window
from calculateTravel import calculateTravel
"""Get a random exit position on circle edge"""
def randomExit(origin, radius):
angle = random.random() * math.pi * 2;
x = math.cos(angle) * radius + or... | [
"random.randint",
"getopt.getopt",
"math.sin",
"bisect.insort_left",
"random.random",
"calculateTravel.calculateTravel",
"math.cos",
"classes.window.Window",
"utilities.suppress_stdout",
"sys.exit"
] | [((533, 548), 'random.random', 'random.random', ([], {}), '()\n', (546, 548), False, 'import random\n'), ((966, 986), 'random.randint', 'random.randint', (['(0)', '(1)'], {}), '(0, 1)\n', (980, 986), False, 'import random\n'), ((1385, 1446), 'calculateTravel.calculateTravel', 'calculateTravel', (['diskPos', 'radius', '... |
"""Constants"""
from string import Template
from collections import OrderedDict
import arrow
# iCalendar
FIRST_DAY = arrow.get(2021, 3, 15)
LAST_DAY = arrow.get(2021, 7, 9).shift(days=1)
MODULE_LENGTH = {"hours": 1, "minutes": 20}
MODULE_START_TIME = {
1: {"hour": 8, "minute": 30},
2: {"hour": 10, "minu... | [
"collections.OrderedDict",
"arrow.get",
"string.Template"
] | [((122, 144), 'arrow.get', 'arrow.get', (['(2021)', '(3)', '(15)'], {}), '(2021, 3, 15)\n', (131, 144), False, 'import arrow\n'), ((1959, 2026), 'collections.OrderedDict', 'OrderedDict', ([], {'L': '"""MO"""', 'M': '"""TU"""', 'W': '"""WE"""', 'J': '"""TH"""', 'V': '"""FR"""', 'S': '"""SA"""', 'D': '"""SU"""'}), "(L='M... |
import csv
from Model import Model
import tensorflow as tf
class ClassifyDigits():
def parseTrainingData(self, csvFile, imageSize):
data = []
labels = []
reader = csv.reader(csvFile)
for row in reader:
if(len(data) <= 1000):
floatRow = []
labels.append(int(row[0]))
for... | [
"tensorflow.image.resize_images",
"csv.reader",
"Model.Model",
"tensorflow.global_variables_initializer",
"tensorflow.Session",
"tensorflow.image.decode_png",
"tensorflow.cast",
"tensorflow.read_file"
] | [((179, 198), 'csv.reader', 'csv.reader', (['csvFile'], {}), '(csvFile)\n', (189, 198), False, 'import csv\n'), ((744, 774), 'tensorflow.read_file', 'tf.read_file', (['(im_dir + im_name)'], {}), '(im_dir + im_name)\n', (756, 774), True, 'import tensorflow as tf\n'), ((785, 828), 'tensorflow.image.decode_png', 'tf.image... |
from asynctest import mock as async_mock, TestCase as AsyncTestCase
from aiohttp.web import HTTPForbidden
from ...admin.request_context import AdminRequestContext
from ...ledger.base import BaseLedger
from ...multitenant.manager import MultitenantManager
from ...wallet.key_type import KeyType
from ...wallet.did_method... | [
"asynctest.mock.create_autospec",
"asynctest.mock.MagicMock",
"asynctest.mock.CoroutineMock",
"asynctest.mock.Mock"
] | [((557, 595), 'asynctest.mock.create_autospec', 'async_mock.create_autospec', (['BaseWallet'], {}), '(BaseWallet)\n', (583, 595), True, 'from asynctest import mock as async_mock, TestCase as AsyncTestCase\n'), ((896, 1000), 'asynctest.mock.MagicMock', 'async_mock.MagicMock', ([], {'app': '{}', 'match_info': '{}', 'quer... |
from sys import setrecursionlimit
import threading
setrecursionlimit(10 ** 9)
threading.stack_size(67108864)
def main():
file_input = open('map.in', 'r')
file_output = open('map.out', 'w')
def get_hash(key):
prime = 239
hash = 0
power = 1
for i in range(len(key)):
... | [
"threading.Thread",
"sys.setrecursionlimit",
"threading.stack_size"
] | [((51, 77), 'sys.setrecursionlimit', 'setrecursionlimit', (['(10 ** 9)'], {}), '(10 ** 9)\n', (68, 77), False, 'from sys import setrecursionlimit\n'), ((78, 108), 'threading.stack_size', 'threading.stack_size', (['(67108864)'], {}), '(67108864)\n', (98, 108), False, 'import threading\n'), ((2644, 2673), 'threading.Thre... |
#!/usr/bin/env python
"""
# *****************************************************************
# (C) Copyright IBM Corp. 2020, 2021. 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 L... | [
"os.path.abspath",
"os.path.isabs",
"os.remove",
"os.path.basename",
"os.path.dirname",
"os.path.exists",
"os.system",
"open_ce.inputs.parse_arg_list",
"open_ce.errors.OpenCEError",
"os.path.relpath",
"os.path.splitext",
"os.path.join",
"shutil.copy"
] | [((1343, 1399), 'os.path.join', 'os.path.join', (['OPEN_CE_PATH', '"""images"""', 'RUNTIME_IMAGE_NAME'], {}), "(OPEN_CE_PATH, 'images', RUNTIME_IMAGE_NAME)\n", (1355, 1399), False, 'import os\n'), ((2659, 2679), 'os.system', 'os.system', (['build_cmd'], {}), '(build_cmd)\n', (2668, 2679), False, 'import os\n'), ((3527,... |
import pandas as pd
import numpy as np
@pd.api.extensions.register_series_accessor("srri")
class SRRI:
"""
Synthetic Risk and Reward Indicator (Standard Deviation over 5 Years)
https://www.esma.europa.eu/sites/default/files/library/2015/11/10_673.pdf
The volatility of the fund shall be computed,
... | [
"pandas.api.extensions.register_series_accessor",
"numpy.sum",
"numpy.sqrt"
] | [((42, 92), 'pandas.api.extensions.register_series_accessor', 'pd.api.extensions.register_series_accessor', (['"""srri"""'], {}), "('srri')\n", (84, 92), True, 'import pandas as pd\n'), ((1305, 1328), 'numpy.sum', 'np.sum', (['(deviations ** 2)'], {}), '(deviations ** 2)\n', (1311, 1328), True, 'import numpy as np\n'),... |
# Copyright 2021 The TF-Coder 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 in... | [
"tf_coder.value_search.value.ConstantValue",
"sys.stdout.flush",
"absl.logging.set_verbosity",
"tf_coder.value_search.operation_statistics.OperationStatistics",
"tf_coder.value_search.value_search_settings.default_settings",
"typing.NamedTuple",
"tf_coder.value_search.filtered_values_cache.FilteredValue... | [((1732, 1847), 'typing.NamedTuple', 'NamedTuple', (['"""Solution"""', "[('value', value_module.Value), ('expression', Text), ('weight', int), (\n 'time', float)]"], {}), "('Solution', [('value', value_module.Value), ('expression', Text),\n ('weight', int), ('time', float)])\n", (1742, 1847), False, 'from typing ... |
import time
"""
硬件调度中心
"""
class Drive:
def __init__(self, nnmi, receiveMsg, led, pi):
super(Drive, self).__init__()
self.nnmi = nnmi # 接收数据模块
self.receiveMsg = receiveMsg # 串口数据接收模块
self.led = led # 灯
self.pi = pi # 树莓派
# 循环处查询列表内任务线程方法
def order_monitor(self... | [
"time.sleep"
] | [((380, 393), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (390, 393), False, 'import time\n')] |
import random
from collections import Counter
from typing import Dict, Optional
import numpy as np
import torch
import torch.nn.functional as F
from .backbone import BertRelationClassifier, BertTextClassifier
from .dataset import BERTTorchTextClassDataset, BERTTorchRelationClassDataset, BaseDataset, TextData... | [
"numpy.random.seed",
"numpy.sum",
"numpy.logical_and",
"numpy.log",
"torch.manual_seed",
"torch.utils.data._utils.collate.default_collate",
"torch.nn.functional.binary_cross_entropy_with_logits",
"numpy.ones",
"torch.nn.functional.cross_entropy",
"random.seed",
"collections.Counter",
"numpy.va... | [((418, 435), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (429, 435), False, 'import random\n'), ((441, 461), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (455, 461), True, 'import numpy as np\n'), ((467, 490), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (48... |
from build.management.commands.base_build import Command as BaseBuild
from build.management.commands.build_homology_models_zip import Command as UploadModel
from build_gpcr.management.commands.build_homology_models import CallHomologyModeling
from django.db.models import Q
from django.conf import settings
from protein... | [
"os.mkdir",
"structure.homology_modeling_functions.ImportHomologyModel",
"logging.FileHandler",
"build_gpcr.management.commands.build_homology_models.CallHomologyModeling",
"warnings.filterwarnings",
"structure.homology_modeling_functions.SignprotFunctions",
"signprot.models.SignprotComplex.objects.filt... | [((1514, 1528), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (1526, 1528), False, 'from datetime import datetime, date\n'), ((1538, 1576), 'logging.getLogger', 'logging.getLogger', (['"""homology_modeling"""'], {}), "('homology_modeling')\n", (1555, 1576), False, 'import logging\n'), ((1584, 1635), 'loggi... |
import json
import sys
from os.path import join
def create_plot_labels(sample,strain,out):
"""Creating labels and storing as json for
https://github.com/nahanoo/gc_bias/tree/main/gc_bias
"""
labels = dict()
density_plot = dict()
density_plot['title'] = strain+' in '+sample
density_plot['xla... | [
"os.path.join",
"json.dumps"
] | [((703, 731), 'json.dumps', 'json.dumps', (['labels'], {'indent': '(4)'}), '(labels, indent=4)\n', (713, 731), False, 'import json\n'), ((746, 770), 'os.path.join', 'join', (['out', '"""labels.json"""'], {}), "(out, 'labels.json')\n", (750, 770), False, 'from os.path import join\n')] |
import click
import pysam
@click.command()
@click.option('--bf', help='path for bamfile')
@click.option('--rf', help='path for readfile')
def subsample(bf, rf):
readList = set([])
bam = pysam.AlignmentFile(bf, 'rb')
for line in bam:
readList.add(line.qname.strip().split('_')[0])
with open(rf)... | [
"pysam.AlignmentFile",
"click.option",
"click.command"
] | [((28, 43), 'click.command', 'click.command', ([], {}), '()\n', (41, 43), False, 'import click\n'), ((45, 90), 'click.option', 'click.option', (['"""--bf"""'], {'help': '"""path for bamfile"""'}), "('--bf', help='path for bamfile')\n", (57, 90), False, 'import click\n'), ((93, 139), 'click.option', 'click.option', (['"... |
"""
This module contains the QtInteractor and BackgroundPlotter.
Diagram
^^^^^^^
.. code-block:: none
BackgroundPlotter
+-- QtInteractor
|-- QVTKRenderWindowInteractor
| +-- QWidget
+-- BasePlotter
MainWindow
+-- QMainWindow
Implementation
^^^^^^^^^^^^^^
.. code-block:: n... | [
"qtpy.QtGui.QIcon",
"qtpy.QtWidgets.QFrame",
"pyvista.plotting.plotting.BasePlotter.render",
"os.path.isfile",
"pyvista.plotting.plotting.BasePlotter.disable",
"scooby.in_ipython",
"qtpy.QtWidgets.QAction",
"os.path.dirname",
"qtpy.QtCore.QTimer",
"vtk.qt.QVTKRenderWindowInteractor.QVTKRenderWindo... | [((3120, 3139), 'scooby.in_ipython', 'scooby.in_ipython', ([], {}), '()\n', (3137, 3139), False, 'import scooby\n'), ((3327, 3357), 'logging.getLogger', 'logging.getLogger', (['"""pyvistaqt"""'], {}), "('pyvistaqt')\n", (3344, 3357), False, 'import logging\n'), ((3404, 3427), 'logging.StreamHandler', 'logging.StreamHan... |
# -*- coding: utf-8 -*-
#
# Copyright 2018-2020- Swiss Data Science Center (SDSC)
# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
# Eidgenössische Technische Hochschule Zürich (ETHZ).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in co... | [
"pkg_resources.resource_string",
"pyshacl.validate"
] | [((1226, 1388), 'pyshacl.validate', 'validate', (['graph'], {'shacl_graph': 'shacl', 'inference': '"""rdfs"""', 'meta_shacl': '(True)', 'debug': '(False)', 'data_graph_format': 'format', 'shacl_graph_format': '"""json-ld"""', 'advanced': '(True)'}), "(graph, shacl_graph=shacl, inference='rdfs', meta_shacl=True, debug\n... |
#!/usr/bin/env python
import copy
import json
import requests
import requests_cache
from collections import OrderedDict
from jsonschema import validate
import nf_core.workflow.validation as vld
NFCORE_PARAMS_SCHEMA_URI = "https://nf-co.re/parameters.schema.json"
class Parameters:
"""Contains a static factory m... | [
"jsonschema.validate",
"copy.deepcopy",
"json.loads",
"requests_cache.disabled",
"nf_core.workflow.validation.Validators.get_validator_for_param",
"json.dumps",
"requests.get"
] | [((1085, 1139), 'json.loads', 'json.loads', (['schema_json'], {'object_pairs_hook': 'OrderedDict'}), '(schema_json, object_pairs_hook=OrderedDict)\n', (1095, 1139), False, 'import json\n'), ((1161, 1219), 'json.loads', 'json.loads', (['parameters_json'], {'object_pairs_hook': 'OrderedDict'}), '(parameters_json, object_... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('structure', '0038_add_project_and_customer_permissions'),
('users', '0004_migrate_to_new_permissions... | [
"django.db.migrations.RemoveField",
"django.db.migrations.swappable_dependency",
"django.db.migrations.DeleteModel"
] | [((338, 395), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (369, 395), False, 'from django.db import migrations, models\n'), ((552, 618), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name... |
from sklearn.base import BaseEstimator, TransformerMixin
class TextProcessor(BaseEstimator, TransformerMixin):
"""
Custom sklearn transformer to preprocess data.
Data fit to should be raw document (not split by tokens).
"""
def __init__(self, remove_stopwords=True, do_lemmatize=False, do_stem=Fa... | [
"nltk.corpus.stopwords.words",
"nltk.stem.PorterStemmer",
"nltk.stem.WordNetLemmatizer"
] | [((1318, 1337), 'nltk.stem.WordNetLemmatizer', 'WordNetLemmatizer', ([], {}), '()\n', (1335, 1337), False, 'from nltk.stem import PorterStemmer, WordNetLemmatizer\n'), ((1361, 1376), 'nltk.stem.PorterStemmer', 'PorterStemmer', ([], {}), '()\n', (1374, 1376), False, 'from nltk.stem import PorterStemmer, WordNetLemmatize... |
from NodeState import NodeState
import logging
logging.basicConfig(format='%(asctime)s - %(levelname)s: %(message)s', datefmt='%H:%M:%S', level=logging.INFO)
class Follower(NodeState):
def __init__(self, node):
super(Follower, self).__init__(node)
self.leader = None
self.commit_index = 0
... | [
"logging.basicConfig"
] | [((48, 162), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s - %(levelname)s: %(message)s"""', 'datefmt': '"""%H:%M:%S"""', 'level': 'logging.INFO'}), "(format='%(asctime)s - %(levelname)s: %(message)s',\n datefmt='%H:%M:%S', level=logging.INFO)\n", (67, 162), False, 'import logging\n')... |
# Generated by Django 2.2.18 on 2021-03-08 13:55
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import olympia.amo.models
class Migration(migrations.Migration):
dependencies = [
('activity', '0007_auto_20210114_1347'),
]
operations = [
... | [
"django.db.models.CharField",
"django.db.models.DateTimeField",
"django.db.models.ForeignKey",
"django.db.models.AutoField"
] | [((419, 512), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (435, 512), False, 'from django.db import migrations, models\... |
import tensorflow as tf
from networks.network import Network
from fcn.config import cfg
class vgg16_flow(Network):
def __init__(self, input_format, num_classes, num_units, scales, vertex_reg=False, trainable=True):
self.inputs = []
self.input_format = input_format
self.num_output_dimensions... | [
"tensorflow.FIFOQueue",
"tensorflow.placeholder",
"tensorflow.constant"
] | [((482, 537), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'shape': '[None, None, None, 3]'}), '(tf.float32, shape=[None, None, None, 3])\n', (496, 537), True, 'import tensorflow as tf\n'), ((564, 619), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'shape': '[None, None, None, 3]'}), '(... |
# 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, software
# d... | [
"oslo_log.log.getLogger",
"placement.exception.ResourceClassExists",
"placement.exception.ResourceClassCannotUpdateStandard",
"placement.db.graph_db.pythonize",
"placement.exception.ResourceClassCannotDeleteStandard",
"placement.exception.MaxDBRetriesExceeded",
"placement.exception.ObjectActionError",
... | [((1053, 1080), 'oslo_log.log.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1070, 1080), True, 'from oslo_log import log as logging\n'), ((2627, 2650), 'placement.db.graph_db.pythonize', 'db.pythonize', (['result[0]'], {}), '(result[0])\n', (2639, 2650), True, 'from placement.db import graph_db ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.