code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
#!/usr/bin/env python3
import multiprocessing as mp
import os
import timeit
import pandas as pd
import _init_path
from spacenet7_model.configs import load_config
from spacenet7_model.utils import (convert_geojsons_to_csv, ensemble_subdir,
get_subdirs, interpolate_polys, map_wrapper... | [
"spacenet7_model.utils.ensemble_subdir",
"os.makedirs",
"timeit.default_timer",
"spacenet7_model.configs.load_config",
"os.path.join",
"multiprocessing.cpu_count",
"spacenet7_model.utils.remove_polygon_empty_row_if_polygon_exists",
"spacenet7_model.utils.get_subdirs",
"multiprocessing.Pool",
"pand... | [((578, 600), 'timeit.default_timer', 'timeit.default_timer', ([], {}), '()\n', (598, 600), False, 'import timeit\n'), ((615, 628), 'spacenet7_model.configs.load_config', 'load_config', ([], {}), '()\n', (626, 628), False, 'from spacenet7_model.configs import load_config\n'), ((689, 729), 'spacenet7_model.utils.ensembl... |
from resources import resource_log_group as re_log_group
from resources import resource_log_stream as re_log_stream
from resources import resource_log_event as re_log_event
from resources import resource_names as re_names
from contents import contents_json as ct
from s3 import s3_class as s3
import boto3... | [
"contents.contents_json.ContentJson",
"load_balancer_cloud_watch_logs.LoadBalancerCloudWatchLogs",
"boto3.client"
] | [((1351, 1424), 'load_balancer_cloud_watch_logs.LoadBalancerCloudWatchLogs', 'lb_cw_logs.LoadBalancerCloudWatchLogs', (['[log_group, log_stream, log_event]'], {}), '([log_group, log_stream, log_event])\n', (1388, 1424), True, 'import load_balancer_cloud_watch_logs as lb_cw_logs\n'), ((481, 499), 'boto3.client', 'boto3.... |
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------
import os
i... | [
"pytest.fixture",
"pytest.skip"
] | [((477, 493), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (491, 493), False, 'import pytest\n'), ((1096, 1112), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (1110, 1112), False, 'import pytest\n'), ((1814, 1830), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (1828, 1830), False, 'import pytes... |
"""
This is awesome. And needs more documentation.
To bring some light in the big number of classes in this file:
First there are:
* ``SuperForm``
* ``SuperModelForm``
They are the forms that you probably want to use in your own code. They are
direct base classes of ``django.forms.Form`` and ``django.forms.ModelFor... | [
"django.forms.forms.ErrorList",
"django.utils.datastructures.SortedDict",
"django.forms.forms.ErrorDict",
"django.forms.Media"
] | [((5167, 5180), 'django.utils.datastructures.SortedDict', 'OrderedDict', ([], {}), '()\n', (5178, 5180), True, 'from django.utils.datastructures import SortedDict as OrderedDict\n'), ((5205, 5218), 'django.utils.datastructures.SortedDict', 'OrderedDict', ([], {}), '()\n', (5216, 5218), True, 'from django.utils.datastru... |
import os
import shutil
import subprocess
import time
from bw_plex import LOG
TYPES = {'cut': 0,
'mute': 1,
'scene marker': 2,
'commercial break': 3}
TYPES.update(dict((v, k) for (k, v) in TYPES.items()))
def db_to_edl(item, type=3):
elds = {}
if (item.correct_theme_start and
... | [
"bw_plex.LOG.debug",
"shutil.move",
"subprocess.Popen",
"os.path.splitext",
"time.sleep",
"os.path.basename",
"os.remove"
] | [((2137, 2186), 'bw_plex.LOG.debug', 'LOG.debug', (['"""Created a metadatafile %s"""', 'meta_name'], {}), "('Created a metadatafile %s', meta_name)\n", (2146, 2186), False, 'from bw_plex import LOG\n'), ((2932, 2954), 'os.path.splitext', 'os.path.splitext', (['path'], {}), '(path)\n', (2948, 2954), False, 'import os\n'... |
#coding=utf-8
from __future__ import with_statement
from itertools import chain
from select import select
import os
import socket
import sys
import threading
from ssdb._compat import (b, xrange, imap, byte_to_chr, unicode, bytes, long,
BytesIO, nativestr, basestring,
... | [
"itertools.chain",
"ssdb.exceptions.TimeoutError",
"select.select",
"ssdb._compat.BytesIO",
"socket.socket",
"ssdb.exceptions.ResponseError",
"threading.Lock",
"ssdb._compat.imap",
"sys.exc_info",
"socket.getaddrinfo",
"os.getpid",
"ssdb.exceptions.ConnectionError",
"ssdb._compat.b",
"sock... | [((655, 662), 'ssdb._compat.b', 'b', (['"""\n"""'], {}), "('\\n')\n", (656, 662), False, 'from ssdb._compat import b, xrange, imap, byte_to_chr, unicode, bytes, long, BytesIO, nativestr, basestring, LifoQueue, Empty, Full\n'), ((675, 680), 'ssdb._compat.b', 'b', (['""""""'], {}), "('')\n", (676, 680), False, 'from ssdb... |
from csc.nl.euro import LemmatizedEuroNL
def NL():
exceptions = {
u'people': (u'person', u's'),
u'ground': (u'ground', u''),
}
return LemmatizedEuroNL('en', exceptions=exceptions)
| [
"csc.nl.euro.LemmatizedEuroNL"
] | [((163, 208), 'csc.nl.euro.LemmatizedEuroNL', 'LemmatizedEuroNL', (['"""en"""'], {'exceptions': 'exceptions'}), "('en', exceptions=exceptions)\n", (179, 208), False, 'from csc.nl.euro import LemmatizedEuroNL\n')] |
import inspect
from datetime import date
from textwrap import dedent
from unittest import TestCase
import regret
from regret import Deprecator
from regret.emitted import Callable, Deprecation, Inheritance
from regret.testing import Recorder
class Adder(object):
"""
Add things.
"""
def __init__(self,... | [
"textwrap.dedent",
"inspect.getmembers",
"regret.testing.Recorder",
"regret.Deprecator",
"regret.emitted.Callable",
"datetime.date",
"regret.emitted.Inheritance",
"regret.callable"
] | [((740, 792), 'regret.callable', 'regret.callable', ([], {'version': '"""4.5.6"""', 'replacement': 'better'}), "(version='4.5.6', replacement=better)\n", (755, 792), False, 'import regret\n'), ((980, 990), 'regret.testing.Recorder', 'Recorder', ([], {}), '()\n', (988, 990), False, 'from regret.testing import Recorder\n... |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [
"mindspore.ops.functional.assign",
"mindspore.ops.composite.HyperMap",
"mindspore.ops.operations.Cast",
"mindspore.ops.functional.tuple_to_array",
"mindspore.ops.composite.MultitypeFuncGraph",
"mindspore.ops.functional.depend",
"mindspore.ops.operations.Shape",
"mindspore.parallel._utils._get_gradient... | [((3986, 4022), 'mindspore.ops.composite.MultitypeFuncGraph', 'C.MultitypeFuncGraph', (['"""_my_adam_opt"""'], {}), "('_my_adam_opt')\n", (4006, 4022), True, 'import mindspore.ops.composite as C\n'), ((2037, 2045), 'mindspore.ops.operations.Cast', 'P.Cast', ([], {}), '()\n', (2043, 2045), True, 'import mindspore.ops.op... |
'''
Created on 1/12/2014
@author: victor
'''
import math
def sq_distance(a,b):
return (a[0]-b[0])**2 + (a[1]-b[1])**2 + (a[2]-b[2])**2
def angular_rmsd(a,b):
return math.sqrt((angular_increment(a-b)**2).sum()/len(a))
def to_0_2PI_range(angle):
"""
Converts an angle from the [-pi, pi] range to the [... | [
"math.sqrt",
"math.atan2"
] | [((1507, 1776), 'math.atan2', 'math.atan2', (['((v13 * v14 * v11 * v10 - v8 * v2 * v13 * v14) * v18 * v17 + (v3 * v8 * v13 *\n v14 - v13 * v14 * v12 * v10) * v18 * v16 + v5 * (v2 * v13 * v14 * v12 -\n v3 * v13 * v14 * v11) * v18)', '(v13 * v12 * v18 * v17 + v13 * v11 * v18 * v16 + v8 * v5 * v13 * v18)'], {}), '((... |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
from telemetry.core import util
from telemetry.core.platform import platform_backend
class DesktopPlatformBackend(platform_bac... | [
"subprocess.Popen",
"os.listdir",
"os.path.join",
"os.path.exists"
] | [((907, 928), 'os.listdir', 'os.listdir', (['directory'], {}), '(directory)\n', (917, 928), False, 'import os\n'), ((1108, 1130), 'subprocess.Popen', 'subprocess.Popen', (['args'], {}), '(args)\n', (1124, 1130), False, 'import subprocess\n'), ((597, 622), 'os.path.exists', 'os.path.exists', (['directory'], {}), '(direc... |
from keras.models import load_model
import cv2
import numpy as np
model = load_model('models\model_final_bin.h5')
model.compile(loss='binary_crossentropy',
optimizer='rmsprop',
metrics=['accuracy'])
img = cv2.imread('2.jpg')
img = cv2.resize(img,(256,256))
img = np.reshape(img... | [
"cv2.resize",
"keras.models.load_model",
"numpy.reshape",
"cv2.imread"
] | [((79, 119), 'keras.models.load_model', 'load_model', (['"""models\\\\model_final_bin.h5"""'], {}), "('models\\\\model_final_bin.h5')\n", (89, 119), False, 'from keras.models import load_model\n'), ((246, 265), 'cv2.imread', 'cv2.imread', (['"""2.jpg"""'], {}), "('2.jpg')\n", (256, 265), False, 'import cv2\n'), ((273, ... |
import imp
import sys
def new_module(name):
"""
Do all of the gruntwork associated with creating a new module.
"""
parent = None
if '.' in name:
parent_name = name.rsplit('.', 1)[0]
parent = __import__(parent_name, fromlist=[''])
module = imp.new_module(name)
sys.modules[... | [
"imp.new_module"
] | [((283, 303), 'imp.new_module', 'imp.new_module', (['name'], {}), '(name)\n', (297, 303), False, 'import imp\n')] |
import tensorflow as tf
"""tf.accumulate_n(inputs, shape=None, tensor_dtype=None, name=None)
功能:对应位置元素相加。如果输入是训练变量,不要使用,应使用tf.add_n。
输入:shape,tensor_dtype:类型检查"""
a = tf.constant([[1, 2], [3, 4]])
b = tf.constant([[5, 6], [7, 8]])
z = tf.accumulate_n([a, b])
sess = tf.Session()
print(sess.run(z))
sess.close()
# z==>... | [
"tensorflow.Session",
"tensorflow.constant",
"tensorflow.accumulate_n"
] | [((168, 197), 'tensorflow.constant', 'tf.constant', (['[[1, 2], [3, 4]]'], {}), '([[1, 2], [3, 4]])\n', (179, 197), True, 'import tensorflow as tf\n'), ((202, 231), 'tensorflow.constant', 'tf.constant', (['[[5, 6], [7, 8]]'], {}), '([[5, 6], [7, 8]])\n', (213, 231), True, 'import tensorflow as tf\n'), ((236, 259), 'ten... |
# -*- coding: utf-8 -*-
"""
Implementation of scarper against Finn.no housing ad search
"""
__author__ = '<NAME>'
__email__ = '<EMAIL>'
# import json
from time import time
import re
from http.client import responses
import requests
from requests.exceptions import ConnectTimeout, ConnectionError as ConnectError
from... | [
"source.util.Assertor.assert_data_types",
"source.util.LOGGER.success",
"bs4.BeautifulSoup",
"time.time"
] | [((879, 925), 'source.util.Assertor.assert_data_types', 'Assertor.assert_data_types', (['[finn_code]', '[str]'], {}), '([finn_code], [str])\n', (905, 925), False, 'from source.util import LOGGER, TimeOutError, NoConnectionError, NotFoundError, Assertor, Tracking\n'), ((4956, 5001), 'source.util.Assertor.assert_data_typ... |
import numpy as np
import random
def heightmap_1D(iter, smoothing, seed, init):
"""Create 2^iter + 1 linear heightmap via midpoint displacement.
"""
if init == None:
random.seed(seed + "init")
heightmap = np.array([random.random(), random.random()])
else:
heightmap = init
r... | [
"random.uniform",
"random.choice",
"numpy.delete",
"numpy.floor",
"numpy.ndenumerate",
"random.seed",
"numpy.array",
"numpy.zeros",
"numpy.cos",
"numpy.sin",
"numpy.meshgrid",
"random.random",
"random.randint"
] | [((319, 348), 'random.seed', 'random.seed', (["(seed + 'iterate')"], {}), "(seed + 'iterate')\n", (330, 348), False, 'import random\n'), ((1161, 1190), 'random.seed', 'random.seed', (["(seed + 'iterate')"], {}), "(seed + 'iterate')\n", (1172, 1190), False, 'import random\n'), ((3847, 3877), 'numpy.zeros', 'np.zeros', (... |
import FWCore.ParameterSet.Config as cms
# This cfi contains everything needed to use the VolumeBased magnetic
# field engine version 071212
magfield = cms.ESSource("XMLIdealGeometryESSource",
geomXMLFiles = cms.vstring('Geometry/CMSCommonData/data/normal/cmsextent.xml',
'Geometry/CMSCommonData/data/cms.... | [
"FWCore.ParameterSet.Config.string",
"FWCore.ParameterSet.Config.untracked.string",
"FWCore.ParameterSet.Config.ESPrefer",
"FWCore.ParameterSet.Config.vstring",
"FWCore.ParameterSet.Config.vint32",
"FWCore.ParameterSet.Config.vdouble",
"FWCore.ParameterSet.Config.int32",
"FWCore.ParameterSet.Config.un... | [((609, 661), 'FWCore.ParameterSet.Config.ESPrefer', 'cms.ESPrefer', (['"""XMLIdealGeometryESSource"""', '"""magfield"""'], {}), "('XMLIdealGeometryESSource', 'magfield')\n", (621, 661), True, 'import FWCore.ParameterSet.Config as cms\n'), ((214, 445), 'FWCore.ParameterSet.Config.vstring', 'cms.vstring', (['"""Geometry... |
# -*- coding: utf-8 -*-
import pytest
import os
from apolloarchive.cli import cli_sync
@pytest.fixture
def folder():
return 'Announcements'
@pytest.fixture
def pictures(folder):
return [
'Also-follow-project-apollo-archive-on-facebook',
'About-the-project-apollo-archive-flickr-gallery',
... | [
"os.path.exists",
"os.path.join",
"os.removedirs",
"apolloarchive.cli.cli_sync",
"os.remove"
] | [((714, 728), 'apolloarchive.cli.cli_sync', 'cli_sync', (['argv'], {}), '(argv)\n', (722, 728), False, 'from apolloarchive.cli import cli_sync\n'), ((1023, 1037), 'apolloarchive.cli.cli_sync', 'cli_sync', (['argv'], {}), '(argv)\n', (1031, 1037), False, 'from apolloarchive.cli import cli_sync\n'), ((1218, 1240), 'os.pa... |
import asyncio
from .exceptions import LoopNotRunning
def _check_event_loop():
if not asyncio.get_event_loop().is_running():
raise LoopNotRunning
def _get_or_create_cache():
loop = asyncio.get_event_loop()
try:
return asyncio.Task.current_task(loop=loop)._sanicjwt
except AttributeE... | [
"asyncio.get_event_loop",
"asyncio.Task.current_task"
] | [((202, 226), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (224, 226), False, 'import asyncio\n'), ((795, 819), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (817, 819), False, 'import asyncio\n'), ((251, 287), 'asyncio.Task.current_task', 'asyncio.Task.current_task', ([... |
#!/usr/bin/env python3
#-*- coding: UTF-8 -*-
import sys
import os.path
import re
import shutil
import uuid
app = os.path.basename(__file__)
localeDir = '.'
notepad2_src = '../src/Notepad2.rc'
metapath_src = '../metapath/src/metapath.rc'
def get_available_locales():
result = []
with os.scandir(localeDir) as it:
f... | [
"re.sub",
"shutil.copy",
"uuid.uuid4"
] | [((768, 840), 're.sub', 're.sub', (['"""(<ProjectGuid>)(.+)(</ProjectGuid>)"""', "('\\\\1' + guid + '\\\\3')", 'doc'], {}), "('(<ProjectGuid>)(.+)(</ProjectGuid>)', '\\\\1' + guid + '\\\\3', doc)\n", (774, 840), False, 'import re\n'), ((2013, 2053), 'shutil.copy', 'shutil.copy', (['metapath_src', 'metapath_dest'], {}),... |
"""mycal URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based v... | [
"django.urls.path"
] | [((799, 830), 'django.urls.path', 'path', (['"""admin/"""', 'admin.site.urls'], {}), "('admin/', admin.site.urls)\n", (803, 830), False, 'from django.urls import include, path\n'), ((836, 897), 'django.urls.path', 'path', (['"""register/"""', 'attend_views.registerPage'], {'name': '"""register"""'}), "('register/', att... |
# https://www.hackerrank.com/challenges/standardize-mobile-number-using-decorators/problem
import re
""" Solution """
def wrapper(f):
def formattor(l):
f(["+91 " + phone[-10:-5] + " " + phone[-5:] for phone in l])
return formattor
""" My Solution Using RegEx """
def wrapper2(f):
def forma... | [
"re.sub"
] | [((824, 883), 're.sub', 're.sub', (['"""(\\\\+\\\\d{2})(\\\\d{5})(\\\\d{5})"""', '"""\\\\1 \\\\2 \\\\3"""', 'phone'], {}), "('(\\\\+\\\\d{2})(\\\\d{5})(\\\\d{5})', '\\\\1 \\\\2 \\\\3', phone)\n", (830, 883), False, 'import re\n'), ((677, 709), 're.sub', 're.sub', (['"""(?<=^)91"""', '"""+91"""', 'phone'], {}), "('(?<=^... |
# -*- coding: utf-8 -*-
from .models import Counter
from django.contrib import admin
class CounterAdmin(admin.ModelAdmin):
list_display = [ 'create_datetime', 'date_key', 'hay_accessions', 'hay_refiles', 'non_hay_accessions', 'non_hay_refiles', 'notes' ]
list_filter = [
'create_datetime',
'd... | [
"django.contrib.admin.site.register"
] | [((497, 539), 'django.contrib.admin.site.register', 'admin.site.register', (['Counter', 'CounterAdmin'], {}), '(Counter, CounterAdmin)\n', (516, 539), False, 'from django.contrib import admin\n')] |
import sys
import time
from concurrent.futures import ThreadPoolExecutor
from os import mkdir, path
from os.path import isdir
from urllib.parse import urlparse
import requests
from bs4 import BeautifulSoup
from PyQt5 import uic
from PyQt5.QtCore import QObject, QRect, Qt, QThread, pyqtSignal, pyqtSlot
from PyQt5.QtGui... | [
"time.sleep",
"PyQt5.QtWidgets.QApplication",
"os.path.isdir",
"PyQt5.QtWidgets.QLabel",
"os.mkdir",
"PyQt5.QtWidgets.QPushButton",
"PyQt5.QtCore.pyqtSignal",
"PyQt5.QtGui.QFont",
"requests.get",
"time.time",
"PyQt5.QtWidgets.QFileDialog.getExistingDirectory",
"urllib.parse.urlparse",
"concu... | [((1760, 1772), 'PyQt5.QtCore.pyqtSignal', 'pyqtSignal', ([], {}), '()\n', (1770, 1772), False, 'from PyQt5.QtCore import QObject, QRect, Qt, QThread, pyqtSignal, pyqtSlot\n'), ((3416, 3429), 'PyQt5.QtCore.pyqtSlot', 'pyqtSlot', (['int'], {}), '(int)\n', (3424, 3429), False, 'from PyQt5.QtCore import QObject, QRect, Qt... |
import random
from collections import deque
from typing import Any
from srl.base.rl.base import RLRemoteMemory
class ExperienceReplayBuffer(RLRemoteMemory):
def __init__(self, *args):
super().__init__(*args)
def init(self, capacity: int):
self.memory = deque(maxlen=capacity)
def length(... | [
"random.sample",
"collections.deque"
] | [((281, 303), 'collections.deque', 'deque', ([], {'maxlen': 'capacity'}), '(maxlen=capacity)\n', (286, 303), False, 'from collections import deque\n'), ((641, 679), 'random.sample', 'random.sample', (['self.memory', 'batch_size'], {}), '(self.memory, batch_size)\n', (654, 679), False, 'import random\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
sys.path.append("../")
import argparse
import tensorflow as tf
import random
from models.data_generator import tf_data_generator
from models.gan import Discriminator, Generator, sample_noise
from deeploglizer.common.preprocess import FeatureExtractor
from deep... | [
"models.gan.Generator",
"models.gan.Discriminator",
"argparse.ArgumentParser",
"deeploglizer.common.utils.seed_everything",
"models.data_generator.tf_data_generator",
"deeploglizer.common.preprocess.FeatureExtractor",
"tensorflow.keras.optimizers.Adam",
"tensorflow.GradientTape",
"deeploglizer.commo... | [((58, 80), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (73, 80), False, 'import sys\n'), ((479, 504), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (502, 504), False, 'import argparse\n'), ((2207, 2226), 'deeploglizer.common.utils.dump_params', 'dump_params', (['pa... |
import RPi.GPIO as GPIO
import sys
import db
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
green = 12
GPIO.setup(green, GPIO.OUT)
if sys.argv[1] == "HIGH":
# change db value to 1 if on
# but don't actually turn on the light - let the cron on uptime.py do that after the next check
# status = GPIO.HIGH
... | [
"db.overrideLedActive",
"RPi.GPIO.setup",
"RPi.GPIO.output",
"RPi.GPIO.setwarnings",
"RPi.GPIO.setmode"
] | [((46, 68), 'RPi.GPIO.setmode', 'GPIO.setmode', (['GPIO.BCM'], {}), '(GPIO.BCM)\n', (58, 68), True, 'import RPi.GPIO as GPIO\n'), ((69, 92), 'RPi.GPIO.setwarnings', 'GPIO.setwarnings', (['(False)'], {}), '(False)\n', (85, 92), True, 'import RPi.GPIO as GPIO\n'), ((105, 132), 'RPi.GPIO.setup', 'GPIO.setup', (['green', '... |
import asyncio
import logging
from collections import deque
from contextlib import asynccontextmanager
from functools import wraps
logger = logging.getLogger(__name__)
class AcurlSessionWrapper:
def __init__(self, session):
self.__session = session
self.__callback = None
self.additional_m... | [
"logging.getLogger",
"collections.deque",
"functools.wraps",
"acurl.EventLoop",
"asyncio.get_event_loop"
] | [((141, 168), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (158, 168), False, 'import logging\n'), ((1251, 1258), 'collections.deque', 'deque', ([], {}), '()\n', (1256, 1258), False, 'from collections import deque\n'), ((1522, 1533), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n... |
from __future__ import print_function
import math
import re
import sys
from libs.nnet3.xconfig.basic_layers import XconfigLayerBase
class XconfigDimRangeComponentInit(XconfigLayerBase):
"""This class is for parsing lines like
'dim-range-component name=feature1 input=Append(-3,0,3) dim=40 dim-offset=0'
w... | [
"libs.nnet3.xconfig.basic_layers.XconfigLayerBase.__init__"
] | [((715, 785), 'libs.nnet3.xconfig.basic_layers.XconfigLayerBase.__init__', 'XconfigLayerBase.__init__', (['self', 'first_token', 'key_to_value', 'prev_names'], {}), '(self, first_token, key_to_value, prev_names)\n', (740, 785), False, 'from libs.nnet3.xconfig.basic_layers import XconfigLayerBase\n'), ((3311, 3381), 'li... |
"""
The goal of this challenge is to create a function that will take a list of
names and a bin size and then shuffle those names and return them in a
list of lists where the length of the inner lists matches the bin size.
For example calling the function with a list of names and the size of 2 should return
a lis... | [
"random.shuffle"
] | [((1523, 1538), 'random.shuffle', 'shuffle', (['a_list'], {}), '(a_list)\n', (1530, 1538), False, 'from random import shuffle\n')] |
# SPDX-FileCopyrightText: 2021 <NAME> for Adafruit Industries
#
# SPDX-License-Identifier: MIT
import random
from adafruit_clue import clue
import displayio
from adafruit_display_text import label, wrap_text_to_pixels
from adafruit_bitmap_font import bitmap_font
import board
column_1 = [
"Champ, ",
"Fact: ",
... | [
"adafruit_bitmap_font.bitmap_font.load_font",
"random.choice",
"displayio.Group",
"displayio.ColorConverter",
"displayio.OnDiskBitmap",
"adafruit_display_text.label.Label"
] | [((2083, 2127), 'adafruit_bitmap_font.bitmap_font.load_font', 'bitmap_font.load_font', (['"""/fonts/Arial-18.bdf"""'], {}), "('/fonts/Arial-18.bdf')\n", (2104, 2127), False, 'from adafruit_bitmap_font import bitmap_font\n'), ((2138, 2182), 'adafruit_bitmap_font.bitmap_font.load_font', 'bitmap_font.load_font', (['"""/fo... |
import os
from collections import OrderedDict
import numpy as np
import tensorflow as tf
import torch
import torch.nn as nn
from baselines.common import tf_util as U
from baselines.ppo1 import mlp_policy
from codes.envs.utils import make_env
from codes.model.expert_policy.normal_mlp import NormalMLPPolicy
from codes.... | [
"numpy.prod",
"collections.OrderedDict",
"baselines.ppo1.mlp_policy.MlpPolicy",
"codes.envs.utils.make_env",
"baselines.common.tf_util.make_session",
"torch.load",
"tensorflow.get_default_session",
"numpy.asarray",
"torch.from_numpy",
"torch.save",
"tensorflow.get_default_graph",
"codes.model.... | [((672, 694), 'codes.envs.utils.make_env', 'make_env', (['env_id', 'seed'], {}), '(env_id, seed)\n', (680, 694), False, 'from codes.envs.utils import make_env\n'), ((3029, 3062), 'torch.save', 'torch.save', (['state_dict', 'file_name'], {}), '(state_dict, file_name)\n', (3039, 3062), False, 'import torch\n'), ((3442, 3... |
import dataset
if __name__ == "__main__":
todo_list_db = dataset.connect('sqlite:///todo_list.db')
todo_table = todo_list_db.get_table('todo')
todo_table.drop()
todo_table = todo_list_db.create_table('todo')
todo_table.insert_many([
{ 'course_number' : 'CS23001', 'course_name': 'Computer Sc... | [
"dataset.connect"
] | [((62, 103), 'dataset.connect', 'dataset.connect', (['"""sqlite:///todo_list.db"""'], {}), "('sqlite:///todo_list.db')\n", (77, 103), False, 'import dataset\n')] |
import scipy.misc
import random
import csv
DATA_DIR = '/vol/data/'
FILE_EXT = '.png'
class DataReader(object):
def __init__(self, data_dir=DATA_DIR, file_ext=FILE_EXT, sequential=False):
self.load()
def load(self):
xs = []
ys = []
self.train_batch_pointer = 0
self.va... | [
"random.random",
"csv.DictReader",
"random.shuffle"
] | [((2296, 2313), 'random.shuffle', 'random.shuffle', (['c'], {}), '(c)\n', (2310, 2313), False, 'import random\n'), ((483, 500), 'csv.DictReader', 'csv.DictReader', (['f'], {}), '(f)\n', (497, 500), False, 'import csv\n'), ((1708, 1725), 'csv.DictReader', 'csv.DictReader', (['f'], {}), '(f)\n', (1722, 1725), False, 'imp... |
# Generated by Django 3.1.5 on 2021-02-02 08:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('application_evaluator', '0005_criteriongroup_abbr'),
]
operations = [
migrations.AlterField(
model_name='score',
name... | [
"django.db.models.FloatField"
] | [((348, 376), 'django.db.models.FloatField', 'models.FloatField', ([], {'default': '(0)'}), '(default=0)\n', (365, 376), False, 'from django.db import migrations, models\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pyfiglet import Figlet
from random import randint
from clint.textui import colored
from pyfiglet import Figlet
from selenium import webdriver
from selenium.webdriver import Firefox
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.... | [
"clint.textui.colored.red",
"clint.textui.colored.yellow",
"selenium.webdriver.support.wait.WebDriverWait",
"selenium.webdriver.Firefox",
"time.sleep",
"clint.textui.colored.green",
"selenium.webdriver.firefox.options.Options",
"selenium.webdriver.support.expected_conditions.presence_of_element_locate... | [((861, 870), 'selenium.webdriver.firefox.options.Options', 'Options', ([], {}), '()\n', (868, 870), False, 'from selenium.webdriver.firefox.options import Options\n'), ((1083, 1109), 'selenium.webdriver.FirefoxProfile', 'webdriver.FirefoxProfile', ([], {}), '()\n', (1107, 1109), False, 'from selenium import webdriver\... |
from reference_sequence_fetcher.fetcher import Fetcher, handle_error
import pytest
import json
class MockResponse(object):
'''
Mock object to test handle_error function in test_handle_error_function.
It mocks the functionality of Response object from requests library
'''
def __init__(self, status_... | [
"reference_sequence_fetcher.fetcher.Fetcher.sequence",
"reference_sequence_fetcher.fetcher.Fetcher.metadata",
"reference_sequence_fetcher.fetcher.Fetcher.info",
"json.dumps",
"reference_sequence_fetcher.fetcher.Fetcher",
"pytest.mark.parametrize",
"pytest.raises",
"pytest.warns"
] | [((3262, 3591), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""_input, _output"""', "[(400, 'Check the parameters provided i.e start, end, fbs and lbs.'), (404,\n 'Checksum identifier provided can not be found.'), (415,\n 'Encoding is not supported by the server.'), (416,\n 'Range can not be satis... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack 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 requ... | [
"oslo.config.cfg.StrOpt",
"os.path.exists",
"keystone.common.logging.SysLogHandler",
"oslo.config.cfg.ListOpt",
"keystone.common.logging.config.fileConfig",
"oslo.config.cfg.BoolOpt",
"keystone.common.logging.WatchedFileHandler",
"os.path.join",
"oslo.config.cfg.IntOpt",
"keystone.common.logging.F... | [((905, 1055), 'oslo.config.cfg.BoolOpt', 'cfg.BoolOpt', (['"""debug"""'], {'short': '"""d"""', 'default': '(False)', 'help': '"""Print debugging output (set logging level to DEBUG instead of default WARNING level)."""'}), "('debug', short='d', default=False, help=\n 'Print debugging output (set logging level to DEB... |
"""Tests for the `client` module."""
import json
import os
import signal
import threading
import time
from base64 import b64encode
from copy import deepcopy
import pytest
import requests
from responses import mock as responses
from aria2p import Client, ClientException
from aria2p.client import JSONRPC_CODES, JSONRP... | [
"json.loads",
"aria2p.client.Notification.get_or_raise",
"responses.mock.add_callback",
"aria2p.Client",
"base64.b64encode",
"json.dumps",
"time.sleep",
"aria2p.client.Notification",
"pytest.raises",
"os.getpid",
"copy.deepcopy",
"threading.Thread",
"pytest.xfail",
"responses.mock.add"
] | [((657, 681), 'json.loads', 'json.loads', (['request.body'], {}), '(request.body)\n', (667, 681), False, 'import json\n'), ((920, 944), 'json.loads', 'json.loads', (['request.body'], {}), '(request.body)\n', (930, 944), False, 'import json\n'), ((1224, 1245), 'aria2p.Client', 'Client', ([], {'secret': 'secret'}), '(sec... |
import sys
import imp
try:
from importlib import find_loader
except ImportError:
find_loader = None
_import_hooks = {}
def register_import_hook(name, callable):
imp.acquire_lock()
try:
hooks = _import_hooks.get(name, None)
if not name in _import_hooks or hooks is None:
... | [
"imp.release_lock",
"imp.acquire_lock",
"sys.modules.get",
"importlib.find_loader"
] | [((176, 194), 'imp.acquire_lock', 'imp.acquire_lock', ([], {}), '()\n', (192, 194), False, 'import imp\n'), ((1157, 1175), 'imp.release_lock', 'imp.release_lock', ([], {}), '()\n', (1173, 1175), False, 'import imp\n'), ((565, 592), 'sys.modules.get', 'sys.modules.get', (['name', 'None'], {}), '(name, None)\n', (580, 59... |
# Copyright (C) 2011, 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011, 2012 <NAME> <yamahata at valinux co jp>
#
# 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
#
# htt... | [
"struct.calcsize",
"ryu.ofproto.oxm_fields.NiciraExtended1",
"ryu.ofproto.oxm_fields.NiciraExperimenter",
"ryu.ofproto.oxm_fields.NiciraExtended0"
] | [((1831, 1868), 'struct.calcsize', 'calcsize', (['NX_ACTION_RESUBMIT_PACK_STR'], {}), '(NX_ACTION_RESUBMIT_PACK_STR)\n', (1839, 1868), False, 'from struct import calcsize\n'), ((1978, 2017), 'struct.calcsize', 'calcsize', (['NX_ACTION_SET_TUNNEL_PACK_STR'], {}), '(NX_ACTION_SET_TUNNEL_PACK_STR)\n', (1986, 2017), False,... |
import datetime
import unittest
import random
from faker import Faker
from src.logica.destacados import Coleccion
from src.modelo.estudiante import Estudiante,Medio
from src.modelo.seccion import Seccion,EstudianteSeccion
from src.modelo.profesor import Interprete
from src.modelo.declarative_base import Session
from ... | [
"faker.Faker",
"src.logica.destacados.Coleccion",
"src.modelo.declarative_base.Session"
] | [((438, 449), 'src.logica.destacados.Coleccion', 'Coleccion', ([], {}), '()\n', (447, 449), False, 'from src.logica.destacados import Coleccion\n'), ((473, 482), 'src.modelo.declarative_base.Session', 'Session', ([], {}), '()\n', (480, 482), False, 'from src.modelo.declarative_base import Session\n'), ((513, 520), 'fak... |
import pandas as pd
import os
from metaphor.models import Dictionary
from metaphor.settings import BASE_DIR
file_path = os.path.join(BASE_DIR, 'static/dicts/bragitoff_dict.csv')
df = pd.read_csv(file_path, names=['word', 'type', 'definition'])
nouns = df[df.type == 'n.']['word'].tolist()
adjectives = df[df.type == 'a... | [
"metaphor.models.Dictionary",
"os.path.join",
"pandas.read_csv"
] | [((121, 178), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""static/dicts/bragitoff_dict.csv"""'], {}), "(BASE_DIR, 'static/dicts/bragitoff_dict.csv')\n", (133, 178), False, 'import os\n'), ((184, 244), 'pandas.read_csv', 'pd.read_csv', (['file_path'], {'names': "['word', 'type', 'definition']"}), "(file_path, names... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_south_central
------------
Tests for `south_central` migration module.
"""
import os
import unittest
from south_central import migration
class Test_Migrations(unittest.TestCase):
test_app_name = 'test_app'
@classmethod
def setUpClass(cls):
... | [
"os.path.exists",
"os.path.join",
"south_central.migration.Migrations"
] | [((340, 379), 'south_central.migration.Migrations', 'migration.Migrations', (['cls.test_app_name'], {}), '(cls.test_app_name)\n', (360, 379), False, 'from south_central import migration\n'), ((748, 796), 'os.path.join', 'os.path.join', (['self.migrations_dir', '"""__init__.py"""'], {}), "(self.migrations_dir, '__init__... |
# Copyright (C) 2020 TU Dresden
# Licensed under the ISC license (see LICENSE.txt)
#
# Authors: <NAME>
from mocasin.tetris.job_request import JobRequestInfo
from mocasin.maps.graph import MapsDataflowGraph
from mocasin.util.mapping_table import MappingTableReader
import csv
import logging
import math
import os
log ... | [
"logging.getLogger",
"mocasin.maps.graph.MapsDataflowGraph",
"os.listdir",
"csv.DictReader",
"mocasin.util.mapping_table.MappingTableReader",
"os.path.join",
"os.path.isdir"
] | [((322, 349), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (339, 349), False, 'import logging\n'), ((909, 932), 'os.path.isdir', 'os.path.isdir', (['base_dir'], {}), '(base_dir)\n', (922, 932), False, 'import os\n'), ((1066, 1086), 'os.listdir', 'os.listdir', (['base_dir'], {}), '(base_... |
import struct, zlib, _pickle as pickle, codecs, json
class GPEncode(json.JSONEncoder):
def default(self, o):
try:
for e in ['Cameras', 'DockCamera', 'damageDistribution']:
o.__dict__.pop(e, o.__dict__)
return o.__dict__
except:
return {}
f = open... | [
"codecs.open",
"json.dumps",
"_pickle.load"
] | [((1004, 1037), '_pickle.load', 'pickle.load', (['f'], {'encoding': '"""latin1"""'}), "(f, encoding='latin1')\n", (1015, 1037), True, 'import struct, zlib, _pickle as pickle, codecs, json\n'), ((1053, 1107), 'codecs.open', 'codecs.open', (['"""GameParams.json"""', '"""w"""'], {'encoding': '"""latin1"""'}), "('GameParam... |
import setuptools
with open('README.md', 'r') as fh:
long_description = fh.read()
setuptools.setup(
name='dictfilter',
use_scm_version={
'tag_regex': r'^(?P<prefix>v)?(?P<version>[^\+]+)$',
'write_to': 'dictfilter/version.py'
},
author='<NAME>',
author_email='<EMAIL>',
desc... | [
"setuptools.find_packages"
] | [((553, 579), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (577, 579), False, 'import setuptools\n')] |
"""
Module for entities implemented using the
sensor platform (https://www.home-assistant.io/integrations/sensor/).
"""
from __future__ import annotations
import logging
from typing import Any
from hahomematic.const import HmPlatform
import hahomematic.device as hm_device
from hahomematic.entity import GenericEntity
... | [
"logging.getLogger"
] | [((331, 358), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (348, 358), False, 'import logging\n')] |
from unittest import TestCase
from dexpy.simplex_centroid import build_simplex_centroid
from dexpy.eval import det_xtxi
from dexpy.model import make_quadratic_model
import numpy as np
import patsy
class TestSimplexCentroid(TestCase):
@classmethod
def test_d_optimality(cls):
answer_d = [ 2.513455e3, 2.... | [
"numpy.testing.assert_allclose",
"dexpy.simplex_centroid.build_simplex_centroid",
"patsy.dmatrix",
"dexpy.eval.det_xtxi",
"dexpy.model.make_quadratic_model"
] | [((865, 923), 'numpy.testing.assert_allclose', 'np.testing.assert_allclose', (['answer_d', 'actual_d'], {'rtol': '(1e-05)'}), '(answer_d, actual_d, rtol=1e-05)\n', (891, 923), True, 'import numpy as np\n'), ((475, 500), 'dexpy.simplex_centroid.build_simplex_centroid', 'build_simplex_centroid', (['i'], {}), '(i)\n', (49... |
from django.conf.urls import url
from core import views
urlpatterns = [
url(r'^$', views.index),
url(r'^generate_pdf/$', views.generate_pdf),
]
| [
"django.conf.urls.url"
] | [((77, 99), 'django.conf.urls.url', 'url', (['"""^$"""', 'views.index'], {}), "('^$', views.index)\n", (80, 99), False, 'from django.conf.urls import url\n'), ((106, 148), 'django.conf.urls.url', 'url', (['"""^generate_pdf/$"""', 'views.generate_pdf'], {}), "('^generate_pdf/$', views.generate_pdf)\n", (109, 148), False... |
from utils import create_input_files
if __name__ == '__main__':
# Create input files (along with word map)
create_input_files(dataset='aicc',
karpathy_json_path='/workspace/data/aicc_caption/dataset_aicc.json',
image_folder='/workspace/data/aicc_caption/images',
... | [
"utils.create_input_files"
] | [((116, 383), 'utils.create_input_files', 'create_input_files', ([], {'dataset': '"""aicc"""', 'karpathy_json_path': '"""/workspace/data/aicc_caption/dataset_aicc.json"""', 'image_folder': '"""/workspace/data/aicc_caption/images"""', 'captions_per_image': '(5)', 'min_word_freq': '(5)', 'output_folder': '"""/workspace/d... |
"""
This script define the helper function for the agent to use
"""
import numpy as np
from collections import deque
import torch.nn as nn
import cv2
from src.params import *
# from params import *
def init_weight(layers):
for layer in layers:
if type(layer) == nn.Conv2d or type(layer)==nn.Linear:
... | [
"torch.nn.init.constant_",
"torch.nn.init.xavier_uniform_",
"numpy.zeros",
"cv2.cvtColor",
"cv2.resize"
] | [((651, 690), 'cv2.cvtColor', 'cv2.cvtColor', (['frame', 'cv2.COLOR_RGB2GRAY'], {}), '(frame, cv2.COLOR_RGB2GRAY)\n', (663, 690), False, 'import cv2\n'), ((846, 867), 'numpy.zeros', 'np.zeros', (['(1, 84, 84)'], {}), '((1, 84, 84))\n', (854, 867), True, 'import numpy as np\n'), ((327, 364), 'torch.nn.init.xavier_unifor... |
"""
This simple example reads data for multiple tags from an TAGGED_INSTANCE curve
Have a look at the documentation for further information:
https://wattsight-wapi-python.readthedocs-hosted.com/en/latest/index.html
"""
import wapi
import pandas as pd
import matplotlib.pyplot as plt
###################################... | [
"pandas.Timestamp",
"wapi.Session",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show"
] | [((526, 566), 'wapi.Session', 'wapi.Session', ([], {'config_file': 'my_config_file'}), '(config_file=my_config_file)\n', (538, 566), False, 'import wapi\n'), ((1108, 1138), 'pandas.Timestamp', 'pd.Timestamp', (['"""2018-7-1 00:00"""'], {}), "('2018-7-1 00:00')\n", (1120, 1138), True, 'import pandas as pd\n'), ((1246, 1... |
from Jumpscale import j
from .SimulatorBase import SimulatorBase
import matplotlib.pyplot as plt
class NodesBatch(SimulatorBase):
"""
nodes are brought life per month in batches, its our way how to simulate the growth of the network
a notes batch is X nr of nodes in a group
the batch_nr is the month i... | [
"Jumpscale.j.data.worksheets.sheet_new",
"matplotlib.pyplot.savefig",
"Jumpscale.j.exceptions.Input",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"plotly.graph_objects.Scatter",
"plotly.graph_objects.FigureWidget",
"matplotlib.pyplot.style.context",
"Jumpscale.j.s... | [((2585, 2652), 'Jumpscale.j.data.worksheets.sheet_new', 'j.data.worksheets.sheet_new', (["('batch_%s' % self.batch_nr)"], {'nrcols': '(120)'}), "('batch_%s' % self.batch_nr, nrcols=120)\n", (2612, 2652), False, 'from Jumpscale import j\n'), ((19228, 19254), 'Jumpscale.j.core.tools.text_strip', 'j.core.tools.text_strip... |
from django.test import TestCase, override_settings
from hunts.models import Hunt
from puzzles.models import Puzzle
from .models import ChatRoom
from .service import ChatService
from .fake_service import FakeChatService
@override_settings(
CHAT_DEFAULT_SERVICE="DEFAULT",
CHAT_SERVICES={
"DEFAULT": Cha... | [
"django.test.override_settings",
"hunts.models.Hunt.objects.create",
"puzzles.models.Puzzle.objects.create"
] | [((223, 341), 'django.test.override_settings', 'override_settings', ([], {'CHAT_DEFAULT_SERVICE': '"""DEFAULT"""', 'CHAT_SERVICES': "{'DEFAULT': ChatService, 'FAKE': FakeChatService}"}), "(CHAT_DEFAULT_SERVICE='DEFAULT', CHAT_SERVICES={'DEFAULT':\n ChatService, 'FAKE': FakeChatService})\n", (240, 341), False, 'from ... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from keras_applications import densenet
from . import keras_modules_injection
@keras_modules_injection
def DenseNet121(*args, **kwargs):
return densenet.DenseNet121(*args, **kwargs)
@keras_... | [
"keras_applications.densenet.decode_predictions",
"keras_applications.densenet.DenseNet201",
"keras_applications.densenet.DenseNet169",
"keras_applications.densenet.DenseNet121",
"keras_applications.densenet.preprocess_input"
] | [((270, 307), 'keras_applications.densenet.DenseNet121', 'densenet.DenseNet121', (['*args'], {}), '(*args, **kwargs)\n', (290, 307), False, 'from keras_applications import densenet\n'), ((385, 422), 'keras_applications.densenet.DenseNet169', 'densenet.DenseNet169', (['*args'], {}), '(*args, **kwargs)\n', (405, 422), Fa... |
import math
from utils.points_utils import distance, distance_squared
#this code: import with_nolib.unsupervised.clustering.metrics as mu
def sum_of_squared(data, assignments, centroids):
return -99
def sum_of_squared_within(data, assignments, centroids): #SSW cohesion
ssw = 0.0
for idata in range(len(da... | [
"utils.points_utils.distance_squared",
"math.log",
"matplotlib.pyplot.bar",
"random.random",
"utils.points_utils.distance",
"matplotlib.pyplot.show"
] | [((4504, 4532), 'matplotlib.pyplot.bar', 'plt.bar', (['y_axis', 'silhouettes'], {}), '(y_axis, silhouettes)\n', (4511, 4532), True, 'import matplotlib.pyplot as plt\n'), ((5113, 5123), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (5121, 5123), True, 'import matplotlib.pyplot as plt\n'), ((1927, 1938), 'math.... |
import pickle
from django.utils import timezone
from api.helpers import classify_text
from helpers.common import classification_confidence
from classifier.models import ClassifiedDocument, ClassifiedExcerpt
# NOTE: this is for older classifier update, where user inputs recommended
# label for classification, But at ... | [
"classifier.models.Recommendation.objects.filter",
"helpers.common.classification_confidence",
"pickle.dumps",
"django.utils.timezone.now",
"classifier.models.ClassifiedDocument.objects.all",
"api.helpers.classify_text",
"classifier.models.ClassifiedExcerpt.objects.all",
"pickle.loads"
] | [((496, 540), 'classifier.models.Recommendation.objects.filter', 'Recommendation.objects.filter', ([], {'is_used': '(False)'}), '(is_used=False)\n', (525, 540), False, 'from classifier.models import Recommendation\n'), ((1581, 1616), 'pickle.loads', 'pickle.loads', (['classifier_model.data'], {}), '(classifier_model.da... |
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
def get_driver():
opt = webdriver.ChromeOptions()
opt.add_experimental_option("debuggerAddress", "localhost:8989")
driver = webdriver.Chrome(executable_path="E:\\chromedriver\\chromedriver.exe", chrome_option... | [
"selenium.webdriver.Chrome",
"selenium.webdriver.ChromeOptions"
] | [((120, 145), 'selenium.webdriver.ChromeOptions', 'webdriver.ChromeOptions', ([], {}), '()\n', (143, 145), False, 'from selenium import webdriver\n'), ((236, 330), 'selenium.webdriver.Chrome', 'webdriver.Chrome', ([], {'executable_path': '"""E:\\\\chromedriver\\\\chromedriver.exe"""', 'chrome_options': 'opt'}), "(execu... |
# -*- coding: utf-8 -*-
"""
:mod:`channel.worker` -- Multi-device sync API for a single computation device
==============================================================================
.. module:: worker
:platform: Unix
:synopsis: Provide methods for single device Theano code that enable
homogeneo... | [
"signal.signal",
"pygpu.collectives.GpuCommCliqueId",
"posix_ipc.unlink_shared_memory",
"argparse.ArgumentParser",
"six.add_metaclass",
"base64.b64encode",
"posix_ipc.SharedMemory",
"pygpu.collectives.GpuComm",
"theano.gpuarray.get_context",
"zmq.Poller",
"numpy.ndarray",
"os.getpid",
"sys.e... | [((1847, 1879), 'six.add_metaclass', 'six.add_metaclass', (['SingletonType'], {}), '(SingletonType)\n', (1864, 1879), False, 'import six\n'), ((3355, 3368), 'zmq.Context', 'zmq.Context', ([], {}), '()\n', (3366, 3368), False, 'import zmq\n'), ((3443, 3454), 'os.getpid', 'os.getpid', ([], {}), '()\n', (3452, 3454), Fals... |
from fastapi import APIRouter
from api.routes import trainer
from api.routes import common
from api.routes import predictor
router = APIRouter()
router.include_router(predictor.router, tags=["predictor"], prefix="/v1")
router.include_router(predictor.router, tags=["trainer"], prefix="/v1")
router.include_router(predi... | [
"fastapi.APIRouter"
] | [((135, 146), 'fastapi.APIRouter', 'APIRouter', ([], {}), '()\n', (144, 146), False, 'from fastapi import APIRouter\n')] |
import pytest
from simple_zpl2 import ZPLDocument
def test_comment():
zdoc = ZPLDocument()
zdoc.add_comment('Testing Comment')
assert zdoc.zpl_bytes == b'^XA\n^FXTesting Comment^FS\n^XZ'
| [
"simple_zpl2.ZPLDocument"
] | [((83, 96), 'simple_zpl2.ZPLDocument', 'ZPLDocument', ([], {}), '()\n', (94, 96), False, 'from simple_zpl2 import ZPLDocument\n')] |
#!/usr/bin/python -ci=__import__;o=i("os");s=i("sys");a=s.argv;p=o.path;y=p.join(p.dirname(a[1]),".python");o.execv(y,a)
from photons_app.executor import library_setup
from photons_control.script import Pipeline, Repeater
from photons_control.colour import ColourParser
from photons_messages import DeviceMessages
fro... | [
"logging.getLogger",
"photons_messages.DeviceMessages.SetPower",
"argparse.ArgumentParser",
"delfick_project.logging.setup_logging",
"photons_app.executor.library_setup",
"photons_control.script.Pipeline",
"photons_control.colour.ColourParser.msg"
] | [((406, 440), 'logging.getLogger', 'logging.getLogger', (['"""cycle_rainbow"""'], {}), "('cycle_rainbow')\n", (423, 440), False, 'import logging\n'), ((533, 558), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (556, 558), False, 'import argparse\n'), ((781, 817), 'photons_messages.DeviceMessage... |
from unittest import TestCase
from blog import Blog
class BlogTestClass(TestCase):
def test_create_blog(self):
title = "Blog random"
author = "<NAME>"
b = Blog(title=title, author=author)
self.assertEqual(title, b.title)
self.assertEqual(author, b.author)
self.asser... | [
"blog.Blog"
] | [((185, 217), 'blog.Blog', 'Blog', ([], {'title': 'title', 'author': 'author'}), '(title=title, author=author)\n', (189, 217), False, 'from blog import Blog\n'), ((513, 545), 'blog.Blog', 'Blog', ([], {'title': 'title', 'author': 'author'}), '(title=title, author=author)\n', (517, 545), False, 'from blog import Blog\n'... |
'''set_degrees_counted(degrees_counted)
Sets the "number of degrees counted" to the desired value.
Parameters
degrees_counted
The value to which the number of degrees counted should be set.
Type:integer (a positive or negative whole number, including 0)
Values:any number
Default:no default value
Errors
TypeError
degree... | [
"spike.Motor"
] | [((445, 455), 'spike.Motor', 'Motor', (['"""A"""'], {}), "('A')\n", (450, 455), False, 'from spike import Motor\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: locationsharinglib.py
#
# Copyright 2017 <NAME>
#
# 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... | [
"logging.getLogger",
"logging.NullHandler",
"json.loads",
"pickle.dump",
"requests.Session",
"pickle.load",
"bs4.BeautifulSoup",
"cachetools.TTLCache",
"cachetools.cached"
] | [((2447, 2481), 'logging.getLogger', 'logging.getLogger', (['LOGGER_BASENAME'], {}), '(LOGGER_BASENAME)\n', (2464, 2481), False, 'import logging\n'), ((2813, 2859), 'cachetools.TTLCache', 'TTLCache', ([], {'maxsize': '(1)', 'ttl': 'STATE_CACHING_SECONDS'}), '(maxsize=1, ttl=STATE_CACHING_SECONDS)\n', (2821, 2859), Fals... |
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 8 16:13:27 2018
@author: <NAME>
@e-mail: <EMAIL>
Program for converting .mzXML files into .csv files with the purpose to be able to generate fragementation diagramms.
"""
# Imports - these are bound to the emzed area
from pyopenms import *
import pandas as pd
datafr... | [
"pandas.DataFrame"
] | [((326, 340), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (338, 340), True, 'import pandas as pd\n'), ((1652, 1667), 'pandas.DataFrame', 'pd.DataFrame', (['d'], {}), '(d)\n', (1664, 1667), True, 'import pandas as pd\n'), ((1790, 1805), 'pandas.DataFrame', 'pd.DataFrame', (['d'], {}), '(d)\n', (1802, 1805), Tr... |
import matplotlib.pyplot as plt
import numpy as np
import statistics as st
from scipy import stats
data = [[73,65,70],[64,61,67],[72,63,66],[58,71,56],[54,70,61],[57,48,56]]
Averaget = []
for i in data:
Averaget.append(st.mean(i))
#define global vars
eoverD = 0.0063
vis = 0.001002 # Pa * s
D = float(0.012... | [
"statistics.mean",
"numpy.log10",
"matplotlib.pyplot.ylabel",
"numpy.arange",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.linspace",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show"
] | [((1372, 1402), 'numpy.linspace', 'np.linspace', (['minRe', 'maxRe', '(100)'], {}), '(minRe, maxRe, 100)\n', (1383, 1402), True, 'import numpy as np\n'), ((1462, 1490), 'numpy.linspace', 'np.linspace', (['minRe', 'maxRe', '(3)'], {}), '(minRe, maxRe, 3)\n', (1473, 1490), True, 'import numpy as np\n'), ((1491, 1510), 'm... |
#coding: utf8
import os
import sys
import time
import ctypes
import subprocess
import shutil
try:
import send2trash
except:
send2trash = None
from . import run_commands
from .path import same_slash as _
try:
import win32file, win32con
except:
win32file = None
win32con = None
is_win = sys.platform =... | [
"os.path.exists",
"ctypes.windll.kernel32.SetFileAttributesW",
"send2trash.send2trash",
"os.makedirs",
"subprocess.Popen",
"os.path.getctime",
"os.path.splitext",
"time.sleep",
"os.path.split",
"os.path.isfile",
"os.path.isdir",
"shutil.rmtree",
"os.stat",
"sys.platform.lower",
"os.remov... | [((386, 406), 'sys.platform.lower', 'sys.platform.lower', ([], {}), '()\n', (404, 406), False, 'import sys\n'), ((735, 758), 'os.path.isdir', 'os.path.isdir', (['filepath'], {}), '(filepath)\n', (748, 758), False, 'import os\n'), ((973, 997), 'os.path.isfile', 'os.path.isfile', (['filepath'], {}), '(filepath)\n', (987,... |
'''
Before running this program, please execute the following statements in PostgreSQL to create tables.
This program is to parse the entities of the Stack Overflow network.
--------------------------------------------------------------
create table question(
Qid int not null primary key,
Accepted_Aid int,
Owner_Id in... | [
"psycopg2.connect",
"time.time"
] | [((8744, 8799), 'psycopg2.connect', 'psycopg2.connect', ([], {'database': 'db', 'user': 'dbUser', 'port': 'dbPort'}), '(database=db, user=dbUser, port=dbPort)\n', (8760, 8799), False, 'import psycopg2\n'), ((8969, 8980), 'time.time', 'time.time', ([], {}), '()\n', (8978, 8980), False, 'import time\n'), ((9086, 9097), '... |
# coding: utf-8
"""
Selling Partner API for FBA Inventory
The Selling Partner API for FBA Inventory lets you programmatically retrieve information about inventory in Amazon's fulfillment network. # noqa: E501
OpenAPI spec version: v1
Generated by: https://github.com/swagger-api/swagger-codegen.... | [
"six.iteritems"
] | [((8233, 8266), 'six.iteritems', 'six.iteritems', (['self.swagger_types'], {}), '(self.swagger_types)\n', (8246, 8266), False, 'import six\n')] |
import dash_core_components as dcc
import dash_html_components as html
from dash_docs import styles
from dash_docs import reusable_components as rc
layout = html.Div(children=[
rc.Markdown('''
# Deploying Dash Apps
By default, Dash apps run on `localhost` - you can only access them on your
own machine... | [
"dash_docs.reusable_components.Markdown"
] | [((182, 3476), 'dash_docs.reusable_components.Markdown', 'rc.Markdown', (['"""\n # Deploying Dash Apps\n\n By default, Dash apps run on `localhost` - you can only access them on your\n own machine. To share a Dash app, you need to "deploy" it to a server.\n\n Our recommend method for securely deploying Dash... |
import os
from whitenoise import WhiteNoise
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project_backend.settings')
application = get_wsgi_application()
application = WhiteNoise(application, root='/frontend/build/static')
application.add_files('/static', prefix='m... | [
"os.environ.setdefault",
"whitenoise.WhiteNoise",
"django.core.wsgi.get_wsgi_application"
] | [((95, 170), 'os.environ.setdefault', 'os.environ.setdefault', (['"""DJANGO_SETTINGS_MODULE"""', '"""project_backend.settings"""'], {}), "('DJANGO_SETTINGS_MODULE', 'project_backend.settings')\n", (116, 170), False, 'import os\n'), ((186, 208), 'django.core.wsgi.get_wsgi_application', 'get_wsgi_application', ([], {}), ... |
from utils import read_data
import numpy as np
def test_mnist_images():
train_images = read_data.get_mnist_data(read_data.MNIST_TRAIN_IMAGES_URL)
assert train_images.shape == (60000, 28, 28)
test_images = read_data.get_mnist_data(read_data.MNIST_TEST_IMAGES_URL)
assert test_images.shape == (10000, 28, ... | [
"utils.read_data.get_mnist_data"
] | [((92, 150), 'utils.read_data.get_mnist_data', 'read_data.get_mnist_data', (['read_data.MNIST_TRAIN_IMAGES_URL'], {}), '(read_data.MNIST_TRAIN_IMAGES_URL)\n', (116, 150), False, 'from utils import read_data\n'), ((218, 275), 'utils.read_data.get_mnist_data', 'read_data.get_mnist_data', (['read_data.MNIST_TEST_IMAGES_UR... |
import os
from fnmatch import fnmatch
import pickle
# General Processing
import numpy as np
import pandas as pd
import collections
# DECOMPOSITION
from sklearn.decomposition import NMF
from scipy.linalg import svd
# NLU
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
from ibm_watson import NaturalLan... | [
"pandas.Series",
"sklearn.decomposition.NMF",
"os.path.exists",
"collections.namedtuple",
"numpy.sqrt",
"os.listdir",
"pickle.dump",
"pickle.dumps",
"seaborn.clustermap",
"cloud_object_store.CloudObjectStore",
"numpy.square",
"numpy.array",
"ibm_watson.NaturalLanguageUnderstandingV1",
"fnm... | [((605, 618), 'numpy.array', 'np.array', (['lst'], {}), '(lst)\n', (613, 618), True, 'import numpy as np\n'), ((623, 650), 'numpy.random.shuffle', 'np.random.shuffle', (['shuffled'], {}), '(shuffled)\n', (640, 650), True, 'import numpy as np\n'), ((1124, 1142), 'numpy.sqrt', 'np.sqrt', (['(vec @ vec)'], {}), '(vec @ ve... |
import torch
import torch.nn as nn
import torch.nn.functional as F
# from CAPS.effiUnet_v3 import EfficientUNet
from loguru import logger
# from CAPS.effiUnet_v3_1 import EfficientUNet
from CAPS.effiUnet_v4 import EfficientUNet
class CAPSNet(nn.Module):
def __init__(self, args, device):
super(CAPSNet, sel... | [
"torch.nn.functional.grid_sample",
"CAPS.effiUnet_v4.EfficientUNet",
"torch.load",
"torch.max",
"torch.Tensor",
"torch.stack",
"torch.clamp",
"torch.min",
"torch.nn.functional.normalize",
"torch.flip",
"torch.sum",
"torch.div",
"torch.linspace",
"torch.nn.functional.softmax",
"torch.cat"... | [((407, 422), 'CAPS.effiUnet_v4.EfficientUNet', 'EfficientUNet', ([], {}), '()\n', (420, 422), False, 'from CAPS.effiUnet_v4 import EfficientUNet\n'), ((1868, 1912), 'torch.div', 'torch.div', (['ind', 'width'], {'rounding_mode': '"""floor"""'}), "(ind, width, rounding_mode='floor')\n", (1877, 1912), False, 'import torc... |
import pandas as pd
import pickle
print('\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n')
print('Starting data labelling...')
with open('cache/data_labeler_vars.pickle', 'rb') as f:
lastIndex, datajobs = pickle.load(f)
print('Starting from index: ' + str(lastIndex))
for i in range(lastIndex, datajobs.shape[0]):
prin... | [
"pickle.dump",
"pickle.load"
] | [((201, 215), 'pickle.load', 'pickle.load', (['f'], {}), '(f)\n', (212, 215), False, 'import pickle\n'), ((1307, 1344), 'pickle.dump', 'pickle.dump', (['(lastIndex, datajobs)', 'f'], {}), '((lastIndex, datajobs), f)\n', (1318, 1344), False, 'import pickle\n')] |
# Import dependencies
from flask import Flask, render_template, redirect, url_for, request
from flask_login import LoginManager, login_required
import logging
import pxc_modules.plcnextAPI as API
import socket
import json
# Get the local IP address of the PLCnext
def get_ip():
s = socket.socket(socket.... | [
"flask.render_template",
"socket.socket",
"flask.Flask",
"flask.url_for",
"pxc_modules.plcnextAPI.getData"
] | [((609, 673), 'flask.Flask', 'Flask', (['__name__'], {'static_folder': '"""public"""', 'template_folder': '"""views"""'}), "(__name__, static_folder='public', template_folder='views')\n", (614, 673), False, 'from flask import Flask, render_template, redirect, url_for, request\n'), ((299, 347), 'socket.socket', 'socket.... |
from django.contrib import admin
from app.models import Kategori, Produk
# Register your models here.
class DaftarProduk(admin.ModelAdmin):
list_display = ['judul', 'harga', 'kategori_produk']
search_fields = ['judul', 'harga', 'kategori_produk']
list_filter = ['kategori_produk']
list_per_page = 5
a... | [
"django.contrib.admin.site.register"
] | [((319, 360), 'django.contrib.admin.site.register', 'admin.site.register', (['Produk', 'DaftarProduk'], {}), '(Produk, DaftarProduk)\n', (338, 360), False, 'from django.contrib import admin\n'), ((361, 390), 'django.contrib.admin.site.register', 'admin.site.register', (['Kategori'], {}), '(Kategori)\n', (380, 390), Fal... |
from warnings import warn
from django.conf import settings
from wagtail.utils.deprecation import RemovedInWagtail50Warning
def get_admin_base_url(context=None):
"""
Gets the base URL for the wagtail admin site. This is set in `settings.WAGTAILADMIN_BASE_URL`,
which was previously `settings.BASE_URL`.
... | [
"warnings.warn"
] | [((617, 733), 'warnings.warn', 'warn', (['"""settings.BASE_URL has been renamed to settings.WAGTAILADMIN_BASE_URL"""'], {'category': 'RemovedInWagtail50Warning'}), "('settings.BASE_URL has been renamed to settings.WAGTAILADMIN_BASE_URL',\n category=RemovedInWagtail50Warning)\n", (621, 733), False, 'from warnings imp... |
# -*- coding: utf-8 -*-
from django.conf import settings
from django.conf.urls.defaults import patterns, include, url
from django.core.urlresolvers import reverse
from django.test import TestCase, Client
from ....cart.app import cart_app
from ....cart.models import Cart, CART_SESSION_KEY
from ....delivery.tests import... | [
"django.conf.urls.defaults.url.decode",
"django.core.urlresolvers.reverse",
"django.conf.urls.defaults.include",
"django.test.Client"
] | [((685, 707), 'django.conf.urls.defaults.include', 'include', (['cart_app.urls'], {}), '(cart_app.urls)\n', (692, 707), False, 'from django.conf.urls.defaults import patterns, include, url\n'), ((733, 786), 'django.conf.urls.defaults.include', 'include', (['"""satchless.contrib.checkout.singlestep.urls"""'], {}), "('sa... |
from django.urls import path, include
from profiles_api_app import views
from rest_framework.routers import DefaultRouter
#definig a router
router = DefaultRouter()
router.register('HelloViewSet/', views.HelloViewSet, base_name='HelloViewSet')
router.register('profile/', views.UserProfileViewSet)
urlpatterns = [
... | [
"profiles_api_app.views.HelloApiView.as_view",
"rest_framework.routers.DefaultRouter",
"django.urls.include"
] | [((150, 165), 'rest_framework.routers.DefaultRouter', 'DefaultRouter', ([], {}), '()\n', (163, 165), False, 'from rest_framework.routers import DefaultRouter\n'), ((354, 382), 'profiles_api_app.views.HelloApiView.as_view', 'views.HelloApiView.as_view', ([], {}), '()\n', (380, 382), False, 'from profiles_api_app import ... |
from . import generators as gen
from datetime import date
import pytest
import settler as s
# -- example-based tests --
@pytest.mark.parametrize('trade_date,tenor,expected', [
(date(2021, 11, 1), 'TOM', date(2021, 11, 2))])
def test_tenors_before_spot(trade_date, tenor, expected):
vd = s.ValueDateCalculator()... | [
"settler.ValueDateCalculator",
"datetime.date"
] | [((297, 320), 'settler.ValueDateCalculator', 's.ValueDateCalculator', ([], {}), '()\n', (318, 320), True, 'import settler as s\n'), ((635, 658), 'settler.ValueDateCalculator', 's.ValueDateCalculator', ([], {}), '()\n', (656, 658), True, 'import settler as s\n'), ((183, 200), 'datetime.date', 'date', (['(2021)', '(11)',... |
"""
Скрипт, выводящий информацию о таблице экспорта PE-файла.
Для каждой экспортируемой функции выводит имя функции и ее RVA. Также выводит
общее количество экспортируемых функций.
Пример использования:
python get_export_info.py d:/file.exe
"""
import sys
import pefile
try:
file_path = sys.a... | [
"pefile.PE",
"sys.exit"
] | [((410, 430), 'pefile.PE', 'pefile.PE', (['file_path'], {}), '(file_path)\n', (419, 430), False, 'import pefile\n'), ((382, 393), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (390, 393), False, 'import sys\n'), ((523, 534), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (531, 534), False, 'import sys\n'), ((636, 64... |
# Generated by gen_timm_models.py
import torch
import timm.models.vision_transformer
import time
from ...util.model import BenchmarkModel
from torchbenchmark.tasks import COMPUTER_VISION
from .config import TimmConfig
import torch.cuda.nvtx as nvtx
class Model(BenchmarkModel):
task = COMPUTER_VISION.GENERAT... | [
"torch.jit.script",
"torch.autograd.profiler.emit_nvtx",
"torch.cuda.nvtx.range_push",
"torch.cuda.nvtx.range_pop",
"torch.cuda._Graph",
"torch.cuda.Stream",
"torch.cuda.synchronize",
"torch.cuda.stream",
"time.time",
"torch.no_grad",
"torch.empty",
"torch.cuda.empty_cache"
] | [((1270, 1311), 'torch.cuda.nvtx.range_push', 'nvtx.range_push', (['"""zeroing optimizer grad"""'], {}), "('zeroing optimizer grad')\n", (1285, 1311), True, 'import torch.cuda.nvtx as nvtx\n'), ((1349, 1365), 'torch.cuda.nvtx.range_pop', 'nvtx.range_pop', ([], {}), '()\n', (1363, 1365), True, 'import torch.cuda.nvtx as... |
# -*- coding: utf-8 -*-
import asyncio
import collections
import functools
import json
import time
from typing import List, Optional
from threading import Thread
from vk_api import VkApi
from vk_api.bot_longpoll import VkBotEventType, VkBotLongPoll
from vk_api.execute import VkFunction
from vk_api.upload import VkUplo... | [
"json.loads",
"collections.deque",
"vk_api.bot_longpoll.VkBotLongPoll",
"json.dumps",
"time.sleep",
"vk_api.VkApi",
"vk_api.execute.VkFunction",
"functools.partial",
"vk_api.utils.get_random_id",
"asyncio.sleep",
"vk_api.upload.VkUpload",
"threading.Thread"
] | [((400, 504), 'vk_api.execute.VkFunction', 'VkFunction', ([], {'args': "('methods',)", 'clean_args': "('methods',)", 'code': '"""\n %(methods)s;\n return 1;\n"""'}), '(args=(\'methods\',), clean_args=(\'methods\',), code=\n """\n %(methods)s;\n return 1;\n""")\n', (410, 504), False, 'from vk_api.execute ... |
import os
import json
from Bio.Seq import Seq
from django.test import TestCase
import edge.recombine
from edge.recombine import find_swap_region, recombine, remove_overhangs
from edge.blastdb import build_all_genome_dbs, fragment_fasta_fn
from edge.models import Genome, Fragment, Genome_Fragment, Operation
class Re... | [
"edge.models.Genome.objects.get",
"json.loads",
"edge.models.Genome_Fragment",
"edge.recombine.recombine",
"Bio.Seq.Seq",
"edge.models.Genome",
"edge.recombine.remove_overhangs",
"edge.blastdb.fragment_fasta_fn",
"edge.models.Fragment.create_with_sequence",
"edge.models.Operation.objects.count",
... | [((2338, 2356), 'edge.models.Genome', 'Genome', ([], {'name': '"""Foo"""'}), "(name='Foo')\n", (2344, 2356), False, 'from edge.models import Genome, Fragment, Genome_Fragment, Operation\n'), ((2669, 2703), 'edge.blastdb.build_all_genome_dbs', 'build_all_genome_dbs', ([], {'refresh': '(True)'}), '(refresh=True)\n', (268... |
# Generated file, please do not change!!!
import re
import typing
import marshmallow
import marshmallow_enum
from commercetools import helpers
from ... import models
from ..cart import (
CartOrigin,
CartState,
DiscountCodeState,
InventoryMode,
LineItemMode,
LineItemPriceMode,
RoundingMode... | [
"marshmallow_enum.EnumField",
"marshmallow.fields.Float",
"marshmallow.fields.Raw",
"marshmallow.fields.DateTime",
"marshmallow.fields.String",
"commercetools.helpers.absmod",
"marshmallow.fields.Integer",
"marshmallow.fields.Boolean"
] | [((668, 724), 'marshmallow.fields.String', 'marshmallow.fields.String', ([], {'allow_none': '(True)', 'missing': 'None'}), '(allow_none=True, missing=None)\n', (693, 724), False, 'import marshmallow\n'), ((1297, 1411), 'marshmallow.fields.String', 'marshmallow.fields.String', ([], {'allow_none': '(True)', 'metadata': "... |
# coding: utf-8
import sys
import re
from natsort import natsorted
INPUT = sys.argv[ 1 ]
# NOTE: This script for Kontakt6!
# KSP Reference Manual.txt created by Acrobat DC (Windows version & locale cp932) and re-save on vscode as utf-8 encoding.
# If created by different locale, change encoding name.
ENCODING = 'utf... | [
"re.sub",
"re.findall",
"natsort.natsorted"
] | [((1544, 1563), 'natsort.natsorted', 'natsorted', (['wordList'], {}), '(wordList)\n', (1553, 1563), False, 'from natsort import natsorted\n'), ((1173, 1196), 're.findall', 're.findall', (['REGEX', 'line'], {}), '(REGEX, line)\n', (1183, 1196), False, 'import re\n'), ((1295, 1324), 're.sub', 're.sub', (['""".*?\\\\s+.*"... |
import discord
import asyncio
import io
import aiohttp
import utils
from random_generators import RandomMessageGenerator
from base_client import BaseClient
class DiscordClient(discord.Client, BaseClient):
def __init__(self, discord_config, send_handler):
discord.Client.__init__(self)
self.channel... | [
"discord.Client.__init__",
"aiohttp.ClientSession",
"random_generators.RandomMessageGenerator.get_random_said",
"discord.File"
] | [((270, 299), 'discord.Client.__init__', 'discord.Client.__init__', (['self'], {}), '(self)\n', (293, 299), False, 'import discord\n'), ((1696, 1719), 'aiohttp.ClientSession', 'aiohttp.ClientSession', ([], {}), '()\n', (1717, 1719), False, 'import aiohttp\n'), ((803, 843), 'random_generators.RandomMessageGenerator.get_... |
import time
from cpo import *
def run_demo():
Sols = [
BadRWSolution,
ReadFavouredRWSolution,
WriteFavouredSolution,
BalancedRWSolution,
]
for Sol in Sols:
run_solution(Sol)
return Sols
def run_solution(Solution):
N_READERS = 20
N_WRITERS = 20
DATA... | [
"time.sleep"
] | [((461, 481), 'time.sleep', 'time.sleep', (['RUN_TIME'], {}), '(RUN_TIME)\n', (471, 481), False, 'import time\n')] |
import numpy as np
import pyCubbyFlow
from pytest import approx
from pytest_utils import *
cnt = 0
def test_grid2():
global cnt
a = pyCubbyFlow.VertexCenteredScalarGrid2(resolution=(3, 4),
gridSpacing=(1, 2),
gridOr... | [
"pyCubbyFlow.CellCenteredScalarGrid3",
"pyCubbyFlow.VertexCenteredScalarGrid2",
"pyCubbyFlow.BoundingBox2D",
"pyCubbyFlow.BoundingBox3D"
] | [((145, 244), 'pyCubbyFlow.VertexCenteredScalarGrid2', 'pyCubbyFlow.VertexCenteredScalarGrid2', ([], {'resolution': '(3, 4)', 'gridSpacing': '(1, 2)', 'gridOrigin': '(7, 5)'}), '(resolution=(3, 4), gridSpacing=(1, 2),\n gridOrigin=(7, 5))\n', (182, 244), False, 'import pyCubbyFlow\n'), ((649, 748), 'pyCubbyFlow.Vert... |
import yaml
import json
from os import listdir
from os.path import isfile, join
"""
{ name, kingdom, imageUrl}
"""
path = "./data/raw/image-url.yml"
stream = open(path, "r")
data = yaml.load_all(stream, yaml.Loader)
data_dicts = [
{
"name": datum["name"].lower(),
"kingdom": datum["kingdom"],
... | [
"json.dumps",
"yaml.load_all"
] | [((184, 218), 'yaml.load_all', 'yaml.load_all', (['stream', 'yaml.Loader'], {}), '(stream, yaml.Loader)\n', (197, 218), False, 'import yaml\n'), ((507, 538), 'json.dumps', 'json.dumps', (['json_data'], {'indent': '(4)'}), '(json_data, indent=4)\n', (517, 538), False, 'import json\n')] |
# Copyright 2021 AI Redefined Inc. <<EMAIL>>
#
# 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 ... | [
"cogment.session.RecvAction",
"collections.namedtuple",
"asyncio.Queue",
"cogment.session.RecvEvent",
"time.time"
] | [((740, 819), 'collections.namedtuple', 'namedtuple', (['"""SentReward"""', "['value', 'confidence', 'to', 'tick_id', 'user_data']"], {}), "('SentReward', ['value', 'confidence', 'to', 'tick_id', 'user_data'])\n", (750, 819), False, 'from collections import namedtuple\n'), ((832, 967), 'collections.namedtuple', 'namedt... |
import os
import sys
def make_new_path(directory):
import os
if not os.path.exists(directory):
os.makedirs(directory)
def merge_file(input1, input2, output_path):
with open(input1, 'r') as f1, open(input2, 'r') as f2:
input1_list = f1.readlines()
input2_list = f2.readlines()
... | [
"os.path.exists",
"os.path.join",
"os.makedirs",
"os.getcwd"
] | [((671, 682), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (680, 682), False, 'import os\n'), ((776, 818), 'os.path.join', 'os.path.join', (['PATH_DIR', 'output_dataset_dir'], {}), '(PATH_DIR, output_dataset_dir)\n', (788, 818), False, 'import os\n'), ((969, 1013), 'os.path.join', 'os.path.join', (['dataset_dir_path', '... |
#!/usr/bin/env python
# coding: utf-8
"""
This script assembles the training dataset
from the folder relative to different bags
"""
from __future__ import print_function, division
import os
import glob
import torch
import pandas as pd
import numpy as np
from torch.utils.data import Dataset, ConcatDataset
from torchvi... | [
"torch.utils.data.ConcatDataset",
"torchvision.transforms.RandomAffine",
"torchvision.transforms.ToPILImage",
"pandas.read_csv",
"os.path.join",
"opts.parser.parse_args",
"numpy.array",
"torch.tensor",
"numpy.sum",
"numpy.cumsum",
"img_utils.load_img",
"torchvision.transforms.ToTensor",
"war... | [((407, 426), 'opts.parser.parse_args', 'parser.parse_args', ([], {}), '()\n', (424, 426), False, 'from opts import parser\n'), ((462, 495), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (485, 495), False, 'import warnings\n'), ((2936, 2960), 'glob.glob', 'glob.glob', (["... |
"""
Copyright 2018 Novartis Institutes for BioMedical Research 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 agr... | [
"numpy.prod",
"numpy.log",
"numpy.argsort",
"numpy.array",
"numpy.arange",
"keras.models.Model.load",
"numpy.repeat",
"numpy.where",
"hnswlib.Index",
"numpy.asarray",
"numpy.max",
"keras.models.Model",
"numpy.min",
"warnings.simplefilter",
"numpy.frombuffer",
"sklearn.preprocessing.Min... | [((3118, 3149), 'numpy.round', 'np.round', (['x0'], {'decimals': 'decimals'}), '(x0, decimals=decimals)\n', (3126, 3149), True, 'import numpy as np\n'), ((3160, 3191), 'numpy.round', 'np.round', (['x1'], {'decimals': 'decimals'}), '(x1, decimals=decimals)\n', (3168, 3191), True, 'import numpy as np\n'), ((3202, 3233), ... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | [
"traceback.format_exc",
"fta.utils.logging.getLogger"
] | [((798, 828), 'fta.utils.logging.getLogger', 'logging.getLogger', (['"""webserver"""'], {}), "('webserver')\n", (815, 828), False, 'from fta.utils import logging\n'), ((3085, 3107), 'traceback.format_exc', 'traceback.format_exc', ([], {}), '()\n', (3105, 3107), False, 'import traceback\n')] |
import asyncio
import logging
from logging.config import fileConfig
from aiokafka import AIOKafkaProducer
from service.mongodb.db_layer import DBLayer
def __init_logger__():
fileConfig('logging.conf')
logger = logging.getLogger()
logger.info("Logger was initialized.")
def __init_io_loop__():
retur... | [
"logging.getLogger",
"service.mongodb.db_layer.DBLayer",
"asyncio.get_event_loop",
"logging.config.fileConfig"
] | [((182, 208), 'logging.config.fileConfig', 'fileConfig', (['"""logging.conf"""'], {}), "('logging.conf')\n", (192, 208), False, 'from logging.config import fileConfig\n'), ((222, 241), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (239, 241), False, 'import logging\n'), ((322, 346), 'asyncio.get_event_loo... |
import os
from PyQt5.QtWidgets import QFileDialog
from thoth.FileManager import FileManager
class Controller:
def __init__(self):
self._manager = FileManager()
def create(self, path: str, _type: str) -> bool:
# 文件已存在的情況
if os.path.exists(path):
return False
if _typ... | [
"PyQt5.QtWidgets.QFileDialog.getExistingDirectory",
"os.path.exists",
"thoth.FileManager.FileManager"
] | [((160, 173), 'thoth.FileManager.FileManager', 'FileManager', ([], {}), '()\n', (171, 173), False, 'from thoth.FileManager import FileManager\n'), ((258, 278), 'os.path.exists', 'os.path.exists', (['path'], {}), '(path)\n', (272, 278), False, 'import os\n'), ((835, 889), 'PyQt5.QtWidgets.QFileDialog.getExistingDirector... |