code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from pathlib import Path
from src.modules.nj_tree import NjStep
from src.utils import get_data_path
from test.testing_utils import get_out_test_path
def test_nj_tree():
png_path = Path(get_out_test_path() / "dm_tree.png")
njs = NjStep(input_dm_csv=get_data_path() / "test/dm_expected.csv",
ou... | [
"src.utils.get_data_path",
"test.testing_utils.get_out_test_path"
] | [((192, 211), 'test.testing_utils.get_out_test_path', 'get_out_test_path', ([], {}), '()\n', (209, 211), False, 'from test.testing_utils import get_out_test_path\n'), ((259, 274), 'src.utils.get_data_path', 'get_data_path', ([], {}), '()\n', (272, 274), False, 'from src.utils import get_data_path\n'), ((334, 353), 'tes... |
from selenium import webdriver
import pyautogui
import time
from selenium.webdriver.common.action_chains import ActionChains
from twilio.rest import Client
from playsound import playsound
from screen_recorder_sdk import screen_recorder
# USING THHIS YOU CAN RECORD SCREEN AND SAVE IT LOCALLY
def msg():
... | [
"selenium.webdriver.ChromeOptions",
"pyautogui.write",
"pyautogui.press",
"selenium.webdriver.Chrome",
"playsound.playsound",
"time.sleep",
"pyautogui.click",
"twilio.rest.Client"
] | [((1647, 1672), 'selenium.webdriver.ChromeOptions', 'webdriver.ChromeOptions', ([], {}), '()\n', (1670, 1672), False, 'from selenium import webdriver\n'), ((1757, 1800), 'selenium.webdriver.Chrome', 'webdriver.Chrome', ([], {'desired_capabilities': 'caps'}), '(desired_capabilities=caps)\n', (1773, 1800), False, 'from s... |
from django.db import models
from django.contrib.auth import models as auth_models
from django.utils.timezone import now
class SuggestionManager(models.Manager):
def get_query_set(self):
return super(SuggestionManager, self).get_query_set().filter(in_reply_to=None)
class Comment(models.Model):
author ... | [
"django.db.models.Manager",
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.utils.timezone.now",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((322, 380), 'django.db.models.ForeignKey', 'models.ForeignKey', (['auth_models.User'], {'blank': '(True)', 'null': '(True)'}), '(auth_models.User, blank=True, null=True)\n', (339, 380), False, 'from django.db import models\n'), ((393, 427), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '"""200... |
import configparser
import platform
from zipfile import ZipFile
from configparser import ConfigParser
import shutil
import os
import time
import sys
import tempfile
import remonstrate_utils
import subprocess
from pathlib import Path
# This is not part of the stdlib
try:
import requests
except ImportError:
sys.... | [
"configparser.ConfigParser",
"zipfile.ZipFile",
"remonstrate_utils.generate_tag_file",
"time.sleep",
"sys.exit",
"remonstrate_utils.construct_tag_file_from_dirs",
"os.path.exists",
"subprocess.Popen",
"platform.system",
"shutil.copyfileobj",
"os.rename",
"requests.get",
"os.path.isfile",
"... | [((488, 514), 'configparser.ConfigParser', 'ConfigParser', ([], {'strict': '(False)'}), '(strict=False)\n', (500, 514), False, 'from configparser import ConfigParser\n'), ((2644, 2679), 'requests.get', 'requests.get', (["_ASSETS[asset]['URL']"], {}), "(_ASSETS[asset]['URL'])\n", (2656, 2679), False, 'import requests\n'... |
import gc
import numpy as np
import pandas as pd
def drop_duplicates_pharma(df):
"""
df: long-format dataframe of a patient
varref: variable reference table that contain the mean and standard deviation of values for a subset of variables
"""
df_dup = df[df.duplicated(["givenat", "pharmaid", "infu... | [
"numpy.timedelta64",
"pandas.concat",
"gc.collect",
"ipdb.set_trace"
] | [((7930, 7942), 'gc.collect', 'gc.collect', ([], {}), '()\n', (7940, 7942), False, 'import gc\n'), ((1965, 1999), 'numpy.timedelta64', 'np.timedelta64', (['acting_period', '"""m"""'], {}), "(acting_period, 'm')\n", (1979, 1999), True, 'import numpy as np\n'), ((2401, 2418), 'pandas.concat', 'pd.concat', (['df_new'], {}... |
"""
This file contains the objects for taking in pytmc-parsed TMC files and
generating Python-level configuration information.
"""
import copy
import itertools
import logging
import math
import re
from typing import Generator, Type, Union
from . import parser
from .record import RecordPackage
logger = logging.getLogg... | [
"logging.getLogger",
"re.compile",
"itertools.product",
"copy.copy",
"math.log10"
] | [((305, 332), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (322, 332), False, 'import logging\n'), ((422, 476), 're.compile', 're.compile', (['"""(?P<line>.+?)(?P<delim>(?:[;\\\\n\\\\r]+|$))"""'], {}), "('(?P<line>.+?)(?P<delim>(?:[;\\\\n\\\\r]+|$))')\n", (432, 476), False, 'import re\n... |
import io
import os
import logging
import tkinter as tk
import tkinter.ttk as ttk
import tkinter.filedialog as filedialog
import tkinter.messagebox as tkmessagebox
import libs.CFCrypto as CFCrypto
import libs.CFCryptoX as CFCryptoX
from libs.CFCanvas import CFCanvas
from libs.Util import set_combobox_item
from libs.Uti... | [
"tkinter.ttk.Button",
"tkinter.Label",
"logging.error",
"os.path.exists",
"os.listdir",
"tkinter.Entry",
"tkinter.StringVar",
"tkinter.ttk.Combobox",
"tkinter.filedialog.askopenfilename",
"tkinter.messagebox.showerror",
"libs.CFCanvas.CFCanvas",
"os.path.splitext",
"os.path.isfile",
"loggi... | [((343, 382), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (362, 382), False, 'import logging\n'), ((567, 581), 'tkinter.StringVar', 'tk.StringVar', ([], {}), '()\n', (579, 581), True, 'import tkinter as tk\n'), ((615, 678), 'tkinter.ttk.Combobox', 'ttk.Combob... |
# Copyright the Karmabot authors and contributors.
# All rights reserved. See AUTHORS.
#
# This file is part of 'karmabot' and is distributed under the BSD license.
# See LICENSE for more details.
# dedicated to LC
from json import JSONDecoder
from urllib import urlencode
from urllib2 import urlopen
from karmabot.co... | [
"re.sub",
"json.JSONDecoder",
"karmabot.core.commands.sets.CommandSet"
] | [((1436, 1467), 're.sub', 're.sub', (['"""&#?\\\\w+;"""', 'fixup', 'text'], {}), "('&#?\\\\w+;', fixup, text)\n", (1442, 1467), False, 'import re\n'), ((1571, 1587), 'karmabot.core.commands.sets.CommandSet', 'CommandSet', (['name'], {}), '(name)\n', (1581, 1587), False, 'from karmabot.core.commands.sets import CommandS... |
import requests, os, time, logging
from twilio.rest import Client
from dotenv import load_dotenv
load_dotenv()
TWILIO_ACCOUNT_SID = os.getenv('TWILIO_ACCOUNT_SID')
TWILIO_AUTH_TOKEN = os.getenv('TWILIO_AUTH_TOKEN')
client = Client(TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN)
r = requests.get(input('Введите полный адрес инте... | [
"twilio.rest.Client",
"time.sleep",
"os.getenv",
"dotenv.load_dotenv"
] | [((97, 110), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (108, 110), False, 'from dotenv import load_dotenv\n'), ((132, 163), 'os.getenv', 'os.getenv', (['"""TWILIO_ACCOUNT_SID"""'], {}), "('TWILIO_ACCOUNT_SID')\n", (141, 163), False, 'import requests, os, time, logging\n'), ((184, 214), 'os.getenv', 'os.get... |
# -*- coding: utf-8 -*-
# find Polish orphans - pages that are not linked by other pages from
# the main namespace
from pywikibot import Category
import pywikibot
from pywikibot import pagegenerators
import datetime
import config
from shutil import move
def main():
site = pywikibot.Site()
# fetch Polis... | [
"pywikibot.Site",
"pywikibot.Category",
"datetime.timedelta",
"pywikibot.pagegenerators.CategorizedPageGenerator",
"datetime.datetime.now",
"pywikibot.stopme"
] | [((281, 297), 'pywikibot.Site', 'pywikibot.Site', ([], {}), '()\n', (295, 297), False, 'import pywikibot\n'), ((352, 395), 'pywikibot.Category', 'Category', (['site', '"""Kategoria:polski (indeks)"""'], {}), "(site, 'Kategoria:polski (indeks)')\n", (360, 395), False, 'from pywikibot import Category\n'), ((489, 542), 'p... |
from __future__ import division
import numpy as np
import covariance as cov
from gp import GaussianProcess
#import com.ntraft.covariance as cov
#from com.ntraft.gp import GaussianProcess
import matplotlib
# The 'MacOSX' backend appears to have some issues on Mavericks.
import sys
if sys.platform.startswith('darwin'):
... | [
"matplotlib.use",
"matplotlib.pyplot.plot",
"sys.platform.startswith",
"gp.GaussianProcess",
"numpy.exp",
"numpy.linspace",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.title",
"numpy.random.randn",
"matplotlib.pyplot.show"
] | [((284, 317), 'sys.platform.startswith', 'sys.platform.startswith', (['"""darwin"""'], {}), "('darwin')\n", (307, 317), False, 'import sys\n'), ((836, 859), 'numpy.linspace', 'np.linspace', (['(-10)', '(-5)', 'N'], {}), '(-10, -5, N)\n', (847, 859), True, 'import numpy as np\n'), ((1077, 1099), 'numpy.linspace', 'np.li... |
import git
import subprocess
import datetime
import sys
import random
PREFIX = "ExpReplay"
# Prepare to escape in amend_command
COMMIT_LINE = 'ExpReplay: {id} \\"{command}\\" {date}'
def setup():
repo = git.Repo(search_parent_directories=True)
if repo.is_dirty():
raise Exception("Repo is dirty")
... | [
"datetime.datetime.now",
"random.getrandbits",
"subprocess.call",
"git.Repo"
] | [((211, 251), 'git.Repo', 'git.Repo', ([], {'search_parent_directories': '(True)'}), '(search_parent_directories=True)\n', (219, 251), False, 'import git\n'), ((731, 773), 'subprocess.call', 'subprocess.call', (['amend_command'], {'shell': '(True)'}), '(amend_command, shell=True)\n', (746, 773), False, 'import subproce... |
from pyppl import Box
from bioprocs.utils.tsvio import tsvops, TsvRecord
infile = {{i.infile | quote}}
outfile = {{o.outfile | quote}}
inopts = {{args.inopts}}
outopts = {{args.outopts}}
opshelper = {{args.opshelper | repr}}
if not isinstance(opshelper, list):
opshelper = [opshelper]
opshelper = [line for ... | [
"bioprocs.utils.tsvio.tsvops"
] | [((406, 451), 'bioprocs.utils.tsvio.tsvops', 'tsvops', (['infile', 'outfile', 'inopts', 'outopts', 'ops'], {}), '(infile, outfile, inopts, outopts, ops)\n', (412, 451), False, 'from bioprocs.utils.tsvio import tsvops, TsvRecord\n')] |
import unittest
from stactools.sentinel2.safe_manifest import SafeManifest
from stactools.sentinel2.product_metadata import ProductMetadata
from stactools.sentinel2.granule_metadata import GranuleMetadata
from tests.utils import TestData
class Sentinel2MetadataTest(unittest.TestCase):
def test_parses_product_me... | [
"tests.utils.TestData.get_path",
"stactools.sentinel2.product_metadata.ProductMetadata",
"stactools.sentinel2.granule_metadata.GranuleMetadata",
"stactools.sentinel2.safe_manifest.SafeManifest"
] | [((369, 486), 'tests.utils.TestData.get_path', 'TestData.get_path', (['"""data-files/sentinel2/S2A_MSIL2A_20190212T192651_N0212_R013_T07HFE_20201007T160857.SAFE"""'], {}), "(\n 'data-files/sentinel2/S2A_MSIL2A_20190212T192651_N0212_R013_T07HFE_20201007T160857.SAFE'\n )\n", (386, 486), False, 'from tests.utils imp... |
import numpy as np, cv2, os, copy, math, ctypes
Latency, Pressed, SCALE = 300, None, 10.0
user32 = ctypes.windll.user32; user32.SetProcessDPIAware()
Width, Height = user32.GetSystemMetrics(0), user32.GetSystemMetrics(1); print(type(Width), Width, type(Height), Height)
def address_fix(address):
if address... | [
"cv2.setMouseCallback",
"os.listdir",
"cv2.transpose",
"cv2.flip",
"math.sqrt",
"copy.copy",
"cv2.imshow",
"cv2.waitKey",
"cv2.destroyAllWindows",
"cv2.resize",
"cv2.imread",
"cv2.namedWindow"
] | [((5114, 5138), 'cv2.imread', 'cv2.imread', (['photo_dir', '(1)'], {}), '(photo_dir, 1)\n', (5124, 5138), False, 'import numpy as np, cv2, os, copy, math, ctypes\n'), ((5173, 5207), 'cv2.namedWindow', 'cv2.namedWindow', (['photos[Photo_num]'], {}), '(photos[Photo_num])\n', (5188, 5207), False, 'import numpy as np, cv2,... |
# coding=utf-8
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ... | [
"msrest.Serializer",
"azure.core.pipeline.policies.ProxyPolicy",
"msrest.Deserializer",
"azure.core.AsyncPipelineClient",
"azure.core.pipeline.policies.AsyncRetryPolicy",
"azure.core.pipeline.policies.AsyncBearerTokenCredentialPolicy",
"azure.core.pipeline.policies.UserAgentPolicy",
"azure.core.pipeli... | [((1953, 2006), 'typing.TypeVar', 'TypeVar', (['"""ClientType"""'], {'bound': '"""WebPubSubServiceClient"""'}), "('ClientType', bound='WebPubSubServiceClient')\n", (1960, 2006), False, 'from typing import Dict, TypeVar, Type\n'), ((5391, 5461), 'azure.core.AsyncPipelineClient', 'AsyncPipelineClient', ([], {'base_url': ... |
import csv
from pathlib import Path
def get_student_dict() -> list:
pom = []
with open(f"{Path(__file__).parent.absolute()}/../assets/students.csv", mode="rt+") as f:
reader = csv.reader(f)
header = reader.__iter__().__next__()
for line in reader:
pom.append(l... | [
"csv.reader",
"pathlib.Path"
] | [((203, 216), 'csv.reader', 'csv.reader', (['f'], {}), '(f)\n', (213, 216), False, 'import csv\n'), ((642, 655), 'csv.reader', 'csv.reader', (['f'], {}), '(f)\n', (652, 655), False, 'import csv\n'), ((108, 122), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (112, 122), False, 'from pathlib import Path\n')... |
# -*- coding: utf-8 -*-
# Author: XuMing <<EMAIL>>
# Brief:
import time
from multiprocessing import Pool
def function(index):
print('Start process: ', index)
time.sleep(3)
print('End process', index)
if __name__ == '__main__':
pool = Pool(processes=3)
for i in range(14):
pool.apply_asyn... | [
"multiprocessing.Pool",
"time.sleep"
] | [((169, 182), 'time.sleep', 'time.sleep', (['(3)'], {}), '(3)\n', (179, 182), False, 'import time\n'), ((255, 272), 'multiprocessing.Pool', 'Pool', ([], {'processes': '(3)'}), '(processes=3)\n', (259, 272), False, 'from multiprocessing import Pool\n')] |
#!/usr/bin/python
import rospy
import numpy as np
from operator import itemgetter
from sensor_msgs.msg import LaserScan
from geometry_msgs.msg import PointStamped
from geometry_msgs.msg import Point
from std_msgs.msg import Float32
from std_msgs.msg import Float64
import tf
class ConeDetector:
def __init__(self... | [
"numpy.mean",
"sensor_msgs.msg.LaserScan",
"rospy.Subscriber",
"rospy.init_node",
"numpy.sin",
"geometry_msgs.msg.PointStamped",
"rospy.Time.now",
"geometry_msgs.msg.Point",
"rospy.spin",
"numpy.cos",
"rospy.Duration",
"rospy.Publisher"
] | [((4300, 4331), 'rospy.init_node', 'rospy.init_node', (['"""ConeDetector"""'], {}), "('ConeDetector')\n", (4315, 4331), False, 'import rospy\n'), ((4360, 4372), 'rospy.spin', 'rospy.spin', ([], {}), '()\n', (4370, 4372), False, 'import rospy\n'), ((435, 491), 'rospy.Publisher', 'rospy.Publisher', (['"""laser_window"""'... |
import threading
import numpy as np
from plico.utils.logger import Logger
from plico.utils.decorator import override, synchronized
from plico.utils.timekeeper import TimeKeeper
from plico.utils.stepable import Stepable
from plico.utils.snapshotable import Snapshotable
from plico.utils.hackerable import Hackerable
from ... | [
"plico.utils.logger.Logger.of",
"plico.utils.timekeeper.TimeKeeper",
"plico.utils.snapshotable.Snapshotable.prepend",
"threading.RLock",
"plico.utils.serverinfoable.ServerInfoable.__init__",
"plico.utils.hackerable.Hackerable.__init__",
"plico.utils.decorator.synchronized"
] | [((4261, 4289), 'plico.utils.decorator.synchronized', 'synchronized', (['"""_mutexStatus"""'], {}), "('_mutexStatus')\n", (4273, 4289), False, 'from plico.utils.decorator import override, synchronized\n'), ((1144, 1183), 'plico.utils.logger.Logger.of', 'Logger.of', (['"""DeformableMirrorController"""'], {}), "('Deforma... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import ... | [
"pulumi.getter",
"pulumi.set",
"pulumi.get"
] | [((1749, 1781), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""deviceName"""'}), "(name='deviceName')\n", (1762, 1781), False, 'import pulumi\n'), ((2347, 2377), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""noDevice"""'}), "(name='noDevice')\n", (2360, 2377), False, 'import pulumi\n'), ((2588, 2621), 'pulum... |
import requests, sys
from PIL import Image
import time
def calc_perc(u):
tbpc = 0
img = Image.open(u)
pic = img.load()
total = img.height * img.width
for h in range(img.height):
for w in range(img.width):
if isinstance(pic[w,h], int):
if pic[w,h] == 0:
tbpc += 1
else:
try:
if isinstanc... | [
"PIL.Image.open"
] | [((92, 105), 'PIL.Image.open', 'Image.open', (['u'], {}), '(u)\n', (102, 105), False, 'from PIL import Image\n')] |
"""
Elasticsearch Checks
~~~~~~~~~~~~~~~~~~~~
"""
from pyapp.checks.registry import register
from ._factory import factory
register(factory)
| [
"pyapp.checks.registry.register"
] | [((125, 142), 'pyapp.checks.registry.register', 'register', (['factory'], {}), '(factory)\n', (133, 142), False, 'from pyapp.checks.registry import register\n')] |
import torch
from torch.utils.data import Dataset
import glob
import tifffile as T
from libtiff import TIFF
import numpy as np
def range_normalize(v):
v = (v - v.mean(axis=(1, 2), keepdims=True)) / (v.std(axis=(1, 2), keepdims=True) + 1e-12)
v_min, v_max = v.min(axis=(1, 2), keepdims=True), v.max(axis=(1, 2),... | [
"tifffile.imread",
"numpy.floor",
"torch.Tensor",
"numpy.stack",
"numpy.random.randint",
"numpy.unravel_index",
"libtiff.TIFF.open",
"numpy.pad",
"glob.glob"
] | [((506, 591), 'numpy.pad', 'np.pad', (['img', '((0, data_shape[0] - img.shape[0]), (0, 0), (0, 0))'], {'mode': '"""reflect"""'}), "(img, ((0, data_shape[0] - img.shape[0]), (0, 0), (0, 0)), mode='reflect'\n )\n", (512, 591), True, 'import numpy as np\n'), ((638, 723), 'numpy.pad', 'np.pad', (['img', '((0, 0), (0, da... |
"""
模块是一个包含所有你定义的函数和变量的文件,其后缀名是.py
模块可以被别的程序引入,以使用该模块中的函数等功能
OS:Operation System 操作系统
"""
import os
print('-------------------------------')
print(os.getcwd()) # 获取当前的目录位置
print('-------------------------------')
os.chdir('E:\\') # 改变当前目录位置
print(os.getcwd())
print('-------------------------------')
print(os.l... | [
"os.listdir",
"os.path.join",
"os.path.splitext",
"os.path.getatime",
"os.getcwd",
"os.chdir",
"os.path.dirname",
"os.path.split",
"os.path.basename",
"os.path.getmtime"
] | [((220, 236), 'os.chdir', 'os.chdir', (['"""E:\\\\"""'], {}), "('E:\\\\')\n", (228, 236), False, 'import os\n'), ((152, 163), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (161, 163), False, 'import os\n'), ((255, 266), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (264, 266), False, 'import os\n'), ((316, 334), 'os.listdi... |
import logging
import os
from azure.core.exceptions import ResourceNotFoundError
import azure.functions as func
from azure.identity import DefaultAzureCredential
from azure.storage.blob import BlobClient, ContainerClient
# Set up logger
LOG_LEVEL = os.getenv("LOGLEVEL", "INFO")
LOG_LEVEL = LOG_LEVEL.uppe... | [
"logging.getLogger",
"azure.identity.DefaultAzureCredential",
"os.getenv",
"os.environ.get",
"os.path.dirname",
"azure.storage.blob.ContainerClient.from_container_url",
"logging.getLevelName",
"azure.storage.blob.BlobClient.from_blob_url"
] | [((263, 292), 'os.getenv', 'os.getenv', (['"""LOGLEVEL"""', '"""INFO"""'], {}), "('LOGLEVEL', 'INFO')\n", (272, 292), False, 'import os\n'), ((334, 353), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (351, 353), False, 'import logging\n'), ((425, 462), 'os.environ.get', 'os.environ.get', (['"""CONTAINER_L... |
import os
import click
import boto3
import json
from airmail.cli import pass_context
from airmail.services.ecs_service import ECSService
@click.group(short_help='Create/modify ECS services')
@pass_context
def cli(ctx):
if ctx.dry_run:
ctx.warn_log("Running in dry run mode! Commands will not execute against... | [
"click.group",
"airmail.services.ecs_service.ECSService",
"json.dumps",
"click.prompt"
] | [((139, 191), 'click.group', 'click.group', ([], {'short_help': '"""Create/modify ECS services"""'}), "(short_help='Create/modify ECS services')\n", (150, 191), False, 'import click\n'), ((461, 529), 'airmail.services.ecs_service.ECSService', 'ECSService', ([], {'env': 'ctx.env', 'profile': 'ctx.profile', 'config': 'ct... |
from sklearn.datasets import fetch_20newsgroups
from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer
from sklearn.metrics import f1_score
import scattertext as st
newsgroups_train = fetch_20newsgroups(subset='train', remove=('headers', 'footers', 'quotes'))
vectorizer = TfidfVectorizer()
tfidf... | [
"sklearn.feature_extraction.text.CountVectorizer",
"sklearn.feature_extraction.text.TfidfVectorizer",
"sklearn.datasets.fetch_20newsgroups",
"scattertext.produce_pairplot"
] | [((207, 282), 'sklearn.datasets.fetch_20newsgroups', 'fetch_20newsgroups', ([], {'subset': '"""train"""', 'remove': "('headers', 'footers', 'quotes')"}), "(subset='train', remove=('headers', 'footers', 'quotes'))\n", (225, 282), False, 'from sklearn.datasets import fetch_20newsgroups\n'), ((297, 314), 'sklearn.feature_... |
import glob
from os.path import join, split
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration, get_mathlibs
config = Configuration('random',parent_package,top_path)
source_files = [join('mtrand', i) for i in ['mtrand.c',
... | [
"numpy.distutils.core.setup",
"os.path.join",
"numpy.distutils.misc_util.Configuration"
] | [((180, 229), 'numpy.distutils.misc_util.Configuration', 'Configuration', (['"""random"""', 'parent_package', 'top_path'], {}), "('random', parent_package, top_path)\n", (193, 229), False, 'from numpy.distutils.misc_util import Configuration, get_mathlibs\n'), ((1349, 1383), 'numpy.distutils.core.setup', 'setup', ([], ... |
from rest_framework.generics import ListCreateAPIView, RetrieveUpdateDestroyAPIView
from rest_framework import permissions
from .permissions import IsOwnerOrReadOnly
from .serializers import PostSerializer
from main_page.models import Post
class PostListView(ListCreateAPIView):
queryset = Post.objects.all().s... | [
"main_page.models.Post.objects.all"
] | [((300, 318), 'main_page.models.Post.objects.all', 'Post.objects.all', ([], {}), '()\n', (316, 318), False, 'from main_page.models import Post\n'), ((682, 700), 'main_page.models.Post.objects.all', 'Post.objects.all', ([], {}), '()\n', (698, 700), False, 'from main_page.models import Post\n')] |
# -*- coding: utf-8 -*-
"""
This module contains the classes for testing the model module of mpcpy.
"""
import unittest
from mpcpy import models
from mpcpy import exodata
from mpcpy import utility
from mpcpy import systems
from mpcpy import units
from mpcpy import variables
from testing import TestCaseMPCPy
import pan... | [
"mpcpy.exodata.ControlFromCSV",
"pickle.dump",
"pandas.DataFrame",
"pandas.read_csv",
"mpcpy.models.Occupancy",
"mpcpy.systems.EmulationFromFMU",
"mpcpy.exodata.ParameterFromCSV",
"os.environ.get",
"pickle.load",
"mpcpy.models.Modelica",
"mpcpy.exodata.WeatherFromEPW",
"mpcpy.exodata.InternalF... | [((46885, 46900), 'unittest.main', 'unittest.main', ([], {}), '()\n', (46898, 46900), False, 'import unittest\n'), ((1334, 1392), 'mpcpy.exodata.ControlFromCSV', 'exodata.ControlFromCSV', (['control_csv_filepath', 'variable_map'], {}), '(control_csv_filepath, variable_map)\n', (1356, 1392), False, 'from mpcpy import ex... |
#!/usr/bin/env python
# coding=utf-8
#
#
# Copyright 2021 <NAME>
#
#
import random
import os
# import sys
from optparse import OptionParser
from PIL import Image
""" if "darwin" in sys.platform:
os.system("clear")
elif "win" in sys.platform:
os.system("cls")
elif "linux" in sys.platform:
os.system("clear"... | [
"os.path.abspath",
"PIL.Image.open",
"optparse.OptionParser",
"random.randrange"
] | [((517, 531), 'optparse.OptionParser', 'OptionParser', ([], {}), '()\n', (529, 531), False, 'from optparse import OptionParser\n'), ((2245, 2266), 'random.randrange', 'random.randrange', (['(100)'], {}), '(100)\n', (2261, 2266), False, 'import random\n'), ((2022, 2044), 'PIL.Image.open', 'Image.open', (['opts.image'], ... |
import logging
from flask import Flask
from flask import request
from gevent.pywsgi import WSGIServer
def create_app():
app = Flask(__name__)
@app.route('/', methods=['POST'])
def upload():
logging.error('coming')
chunk_size = 1024 * 4
stream = request.stream # typ... | [
"werkzeug.contrib.profiler.ProfilerMiddleware",
"logging.error",
"gevent.pywsgi.WSGIServer",
"flask.Flask"
] | [((141, 156), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (146, 156), False, 'from flask import Flask\n'), ((802, 833), 'werkzeug.contrib.profiler.ProfilerMiddleware', 'ProfilerMiddleware', (['application'], {}), '(application)\n', (820, 833), False, 'from werkzeug.contrib.profiler import ProfilerMiddle... |
from cincanregistry import VersionInfo, VersionType
from cincanregistry.checkers import UpstreamChecker
from datetime import datetime
from unittest import mock
import pytest
import json
from cincanregistry.utils import format_time
from .fake_instances import (
FAKE_VERSION_INFO_NO_CHECKER,
FAKE_VERSION_INFO_WIT... | [
"datetime.datetime",
"json.dumps",
"cincanregistry.VersionInfo",
"datetime.datetime.now",
"pytest.raises",
"unittest.mock.patch.object",
"cincanregistry.VersionInfo.from_dict",
"cincanregistry.utils.format_time"
] | [((336, 431), 'unittest.mock.patch.object', 'mock.patch.object', (['VersionInfo.__init__', '"""__defaults__"""', 'VersionInfo.__init__.__defaults__'], {}), "(VersionInfo.__init__, '__defaults__', VersionInfo.\n __init__.__defaults__)\n", (353, 431), False, 'from unittest import mock\n'), ((3233, 3328), 'unittest.moc... |
import pytest
from asgiref.testing import ApplicationCommunicator as HttpCommunicator
from asgi_cors_middleware import CorsASGIApp
from .asgi_app import app
@pytest.mark.asyncio
async def test_init_app():
communicator = HttpCommunicator(
scope={"type": "http", "http_version": "1.0", "method": "GET", "path... | [
"asgiref.testing.ApplicationCommunicator",
"asgi_cors_middleware.CorsASGIApp"
] | [((226, 340), 'asgiref.testing.ApplicationCommunicator', 'HttpCommunicator', ([], {'scope': "{'type': 'http', 'http_version': '1.0', 'method': 'GET', 'path': '/'}", 'application': 'app'}), "(scope={'type': 'http', 'http_version': '1.0', 'method':\n 'GET', 'path': '/'}, application=app)\n", (242, 340), True, 'from as... |
from layer import Layer
import numpy as np
class FCLayer(Layer):
def __init__(self,input_size,output_size):
self.weights = np.random.rand(input_size,output_size)-0.5
self.bias = np.random.rand(1,output_size)-0.5
def forward_propagation(self,input_data):
self.input = input_data
... | [
"numpy.dot",
"numpy.random.rand"
] | [((490, 526), 'numpy.dot', 'np.dot', (['output_error', 'self.weights.T'], {}), '(output_error, self.weights.T)\n', (496, 526), True, 'import numpy as np\n'), ((550, 584), 'numpy.dot', 'np.dot', (['self.input.T', 'output_error'], {}), '(self.input.T, output_error)\n', (556, 584), True, 'import numpy as np\n'), ((136, 17... |
from math import factorial
from math import cos
from math import radians
from math import sin
from math import sqrt
from math import atan2
from math import degrees
from math import gcd
import statistics
def typeint(value):
try:
int(value)
return True
except ValueError:
return False
de... | [
"statistics.stdev",
"math.factorial",
"math.gcd",
"math.sqrt",
"math.degrees",
"math.radians",
"math.atan2"
] | [((925, 968), 'math.sqrt', 'sqrt', (['(vadd[0] * vadd[0] + vadd[1] * vadd[1])'], {}), '(vadd[0] * vadd[0] + vadd[1] * vadd[1])\n', (929, 968), False, 'from math import sqrt\n'), ((974, 997), 'math.atan2', 'atan2', (['vadd[1]', 'vadd[0]'], {}), '(vadd[1], vadd[0])\n', (979, 997), False, 'from math import atan2\n'), ((10... |
import xml.etree.ElementTree as ET
from zadmin.soap.server import ServerRequest
from zadmin.request import Request
from zadmin.auth import Auth
class Server():
"""
A class used to mostly usefull admin commands for Zimbra
"""
def __init__(self, auth=''):
self.auth = auth
def count_account... | [
"xml.etree.ElementTree.fromstring"
] | [((696, 720), 'xml.etree.ElementTree.fromstring', 'ET.fromstring', (['r.content'], {}), '(r.content)\n', (709, 720), True, 'import xml.etree.ElementTree as ET\n'), ((982, 1006), 'xml.etree.ElementTree.fromstring', 'ET.fromstring', (['r.content'], {}), '(r.content)\n', (995, 1006), True, 'import xml.etree.ElementTree as... |
from ahh import vis
x = [1, 2, 3, 4]
y = [5, 6, 7, 8]
vis.plot_line(x, y)
| [
"ahh.vis.plot_line"
] | [((59, 78), 'ahh.vis.plot_line', 'vis.plot_line', (['x', 'y'], {}), '(x, y)\n', (72, 78), False, 'from ahh import vis\n')] |
import cv2
import numpy as np
from .image_processor import ImageProcessor
from .thermal_image import ThermalImage
from .util import save_image, VideoCreator
class OpenCvImageProcessor(ImageProcessor):
def __init__(self):
self.video_creator = VideoCreator()
self.recording = False
def on_imag... | [
"cv2.drawContours",
"cv2.inpaint",
"numpy.where",
"cv2.imshow",
"numpy.array",
"cv2.findContours",
"cv2.Canny",
"cv2.waitKey"
] | [((508, 530), 'numpy.where', 'np.where', (['mask', '(255)', '(0)'], {}), '(mask, 255, 0)\n', (516, 530), True, 'import numpy as np\n'), ((639, 663), 'cv2.Canny', 'cv2.Canny', (['mask', '(30)', '(200)'], {}), '(mask, 30, 200)\n', (648, 663), False, 'import cv2\n'), ((694, 759), 'cv2.findContours', 'cv2.findContours', ([... |
"""
Fetch data from hepdata (yaml format) and write output files in jetscape-stat format documented
[location of format specification file goes here]
"""
from urllib.request import urlopen
import re
import sys
import ssl
import yaml
import os
#------------------------------------------------------------------------... | [
"os.path.exists",
"os.makedirs",
"ssl._create_unverified_context",
"yaml.load",
"sys.exit",
"urllib.request.urlopen"
] | [((1299, 1331), 'ssl._create_unverified_context', 'ssl._create_unverified_context', ([], {}), '()\n', (1329, 1331), False, 'import ssl\n'), ((1120, 1144), 'os.path.exists', 'os.path.exists', (['filepath'], {}), '(filepath)\n', (1134, 1144), False, 'import os\n'), ((1150, 1171), 'os.makedirs', 'os.makedirs', (['filepath... |
#from PythonMagick import Image
from pynput.keyboard import Key
import win32clipboard
import pyperclip
import sys
import ctypes
class py_copy_paste:
def __init__(self, keyboard):
self.keyboard_obj = keyboard
self.buffer = ['', '', '', '', '', '', '', '', '', '']
self.object_type_buffer = ... | [
"win32clipboard.OpenClipboard",
"win32clipboard.SetClipboardData",
"win32clipboard.CloseClipboard",
"sys.getsizeof",
"win32clipboard.GetClipboardData",
"ctypes.windll.kernel32.GlobalLock",
"ctypes.windll.kernel32.GlobalUnlock",
"pyperclip.copy",
"pyperclip.paste"
] | [((2045, 2075), 'win32clipboard.OpenClipboard', 'win32clipboard.OpenClipboard', ([], {}), '()\n', (2073, 2075), False, 'import win32clipboard\n'), ((2102, 2158), 'win32clipboard.GetClipboardData', 'win32clipboard.GetClipboardData', (['win32clipboard.CF_HDROP'], {}), '(win32clipboard.CF_HDROP)\n', (2133, 2158), False, '... |
import argparse
import numpy as np
import torch
import os, sys
import math
from subspace_inference import models, losses, posteriors, utils
# from swag.posteriors import SWAG, EllipticalSliceSampling, BenchmarkPyro, BenchmarkVIModel
from regression import run
from bayesian_benchmarks.data import get_regression_data
fr... | [
"torch.manual_seed",
"bayesian_benchmarks.data.get_regression_data",
"numpy.ceil",
"os.makedirs",
"argparse.ArgumentParser",
"os.path.join",
"regression.run",
"torch.cuda.is_available",
"argparse.Namespace",
"torch.cuda.manual_seed",
"torch.device"
] | [((405, 430), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (428, 430), False, 'import argparse\n'), ((2033, 2061), 'torch.manual_seed', 'torch.manual_seed', (['args.seed'], {}), '(args.seed)\n', (2050, 2061), False, 'import torch\n'), ((2062, 2095), 'torch.cuda.manual_seed', 'torch.cuda.manua... |
"""
Functions for querying opensearch versions and getting download URLs. This script is also runnable to generate
the latest install_versions from the github repository tags. Run::
python -m localstack.services.opensearch.versions
"""
from typing import Dict
import semver
from localstack.aws.api.opensearch imp... | [
"localstack.aws.api.opensearch.CompatibleVersionsMap",
"requests.get",
"semver.VersionInfo.parse",
"collections.defaultdict",
"localstack.utils.common.get_arch"
] | [((805, 898), 'localstack.aws.api.opensearch.CompatibleVersionsMap', 'CompatibleVersionsMap', ([], {'SourceVersion': '"""OpenSearch_1.0"""', 'TargetVersions': "['OpenSearch_1.1']"}), "(SourceVersion='OpenSearch_1.0', TargetVersions=[\n 'OpenSearch_1.1'])\n", (826, 898), False, 'from localstack.aws.api.opensearch imp... |
#!/usr/bin/python
from valarie.dao.document import Collection
def create_text_file(parent_objuuid, name = "New Text File", objuuid = None):
collection = Collection("inventory")
text_file = collection.get_object(objuuid)
text_file.object = {
"type" : "text file",
"parent" : parent... | [
"valarie.dao.document.Collection"
] | [((159, 182), 'valarie.dao.document.Collection', 'Collection', (['"""inventory"""'], {}), "('inventory')\n", (169, 182), False, 'from valarie.dao.document import Collection\n')] |
import collections
from controllers import relevanceutils
MIN_RETURN_VALUE = 100
def sort_age(artists):
artists = sorted(artists,
key = lambda x: x['age_distance'])
return artists
def sort_location(artists):
artists = sorted(artists,
key = lambda x: x['location_... | [
"controllers.relevanceutils.decorate_artist",
"controllers.relevanceutils.SorterList",
"controllers.relevanceutils.is_exact_match"
] | [((1158, 1265), 'controllers.relevanceutils.decorate_artist', 'relevanceutils.decorate_artist', (['artist', 'age_criteria', 'location_criteria', 'rate_criteria', 'gender_criteria'], {}), '(artist, age_criteria, location_criteria,\n rate_criteria, gender_criteria)\n', (1188, 1265), False, 'from controllers import rel... |
from concurrent import futures
import time
import grpc
import hello_pb2
import hello_pb2_grpc
_ONE_DAY_IN_SECONDS = 60 * 60 * 24
class Greeter(hello_pb2_grpc.HelloServicer):
def GetInfo(self, request, context):
return hello_pb2.InfoReply(message="Hello from python")
def serve():
server = grpc.serv... | [
"concurrent.futures.ThreadPoolExecutor",
"time.sleep",
"hello_pb2.InfoReply"
] | [((234, 282), 'hello_pb2.InfoReply', 'hello_pb2.InfoReply', ([], {'message': '"""Hello from python"""'}), "(message='Hello from python')\n", (253, 282), False, 'import hello_pb2\n'), ((323, 365), 'concurrent.futures.ThreadPoolExecutor', 'futures.ThreadPoolExecutor', ([], {'max_workers': '(10)'}), '(max_workers=10)\n', ... |
import pyautogui
print("EN: Monitor's X size | PT-BR: Tamanho X do monitor: {}\nEN: Monitor's Y size | PT-BR: Tamanho Y do monitor: {}\n".format(pyautogui.size()[0], pyautogui.size()[1]))
input("EN: Press enter to exit | PT-BR: Aperte enter para sair ") | [
"pyautogui.size"
] | [((146, 162), 'pyautogui.size', 'pyautogui.size', ([], {}), '()\n', (160, 162), False, 'import pyautogui\n'), ((167, 183), 'pyautogui.size', 'pyautogui.size', ([], {}), '()\n', (181, 183), False, 'import pyautogui\n')] |
# Hall of fame display
# (C) KA 2020
import config as CONFIG
import display
import pygame
import log4p
import time
import datetime
import math
import sqlite3 as sl
class HallOfFameDisplay(display.Display):
titleFont = None
rowFont = None
doDraw = True
# Always drawing full screen
fullRect = None
#
# Cons... | [
"sqlite3.connect",
"pygame.display.flip",
"pygame.image.load",
"pygame.font.Font",
"pygame.display.update",
"pygame.Rect"
] | [((476, 574), 'pygame.font.Font', 'pygame.font.Font', (['(CONFIG.FONT_FOLDER + CONFIG.HOF_TITLE_FONT_TYPE)', 'CONFIG.HOF_TITLE_FONT_SIZE'], {}), '(CONFIG.FONT_FOLDER + CONFIG.HOF_TITLE_FONT_TYPE, CONFIG.\n HOF_TITLE_FONT_SIZE)\n', (492, 574), False, 'import pygame\n'), ((587, 681), 'pygame.font.Font', 'pygame.font.F... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# DATE: 2022/1/19
# Author: <EMAIL>
import os
import sqlite3.dbapi2 as sqlite3
import threading
import time
from typing import NoReturn
import pytest
from cache3 import SimpleDiskCache
from cache3.disk import SessionDescriptor
# api >>> SessionDescriptor.__set__
def test__... | [
"time.sleep",
"pytest.main",
"cache3.SimpleDiskCache",
"pytest.raises",
"threading.Thread",
"sqlite3.dbapi2.connect",
"os.remove"
] | [((354, 371), 'cache3.SimpleDiskCache', 'SimpleDiskCache', ([], {}), '()\n', (369, 371), False, 'from cache3 import SimpleDiskCache\n'), ((562, 592), 'sqlite3.dbapi2.connect', 'sqlite3.connect', (['"""test.sqlite"""'], {}), "('test.sqlite')\n", (577, 592), True, 'import sqlite3.dbapi2 as sqlite3\n'), ((597, 621), 'os.r... |
import copy
import logging
import numpy
import theano
from theano import tensor
from theano.gradient import disconnected_grad
from blocks.bricks import (
Bias, Identity, Initializable, MLP, Tanh, Softmax, Random)
from blocks.bricks.attention import SequenceContentAttention
from blocks.bricks.base import applicati... | [
"logging.getLogger",
"theano.tensor.exp",
"lvsr.bricks.attention.SequenceContentAndConvAttention",
"theano.tensor.lscalar",
"theano.tensor.roll",
"blocks.bricks.attention.SequenceContentAttention",
"lvsr.beam_search.BeamSearch",
"theano.tensor.zeros_like",
"numpy.array",
"lvsr.utils.global_push_in... | [((1233, 1260), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1250, 1260), False, 'import logging\n'), ((2675, 2726), 'blocks.bricks.base.application', 'application', ([], {'inputs': "['inputs']", 'outputs': "['outputs']"}), "(inputs=['inputs'], outputs=['outputs'])\n", (2686, 2726), Fa... |
from django.contrib.auth import get_user_model
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase
REGISTER_USER = reverse('rest_register')
PROFILES = reverse('profile-list')
FRIENDS = reverse('profile-my-friends')
def detail_url(profile_id):
"""Return pr... | [
"django.contrib.auth.get_user_model",
"django.urls.reverse"
] | [((174, 198), 'django.urls.reverse', 'reverse', (['"""rest_register"""'], {}), "('rest_register')\n", (181, 198), False, 'from django.urls import reverse\n'), ((210, 233), 'django.urls.reverse', 'reverse', (['"""profile-list"""'], {}), "('profile-list')\n", (217, 233), False, 'from django.urls import reverse\n'), ((244... |
# -*- coding: utf-8 -*-
from model.contact import Contact
def test_add_contact(app):
app.contact.create(Contact(firstname="<NAME>", middlename="<NAME>", lastname="<NAME>",
nickname="nickname", path_to_photo="C:\\Users\\Asus\\Desktop\\test_image.jfif",
... | [
"model.contact.Contact"
] | [((110, 699), 'model.contact.Contact', 'Contact', ([], {'firstname': '"""<NAME>"""', 'middlename': '"""<NAME>"""', 'lastname': '"""<NAME>"""', 'nickname': '"""nickname"""', 'path_to_photo': '"""C:\\\\Users\\\\Asus\\\\Desktop\\\\test_image.jfif"""', 'title': '"""title"""', 'company': '"""company"""', 'address': '"""addr... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2016-11-22 12:30
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Crea... | [
"django.db.models.IntegerField",
"django.db.models.ForeignKey",
"django.db.models.BooleanField",
"django.db.models.SlugField",
"django.db.models.AutoField",
"django.db.models.PositiveIntegerField",
"django.db.models.ImageField",
"django.db.models.CharField"
] | [((397, 490), '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", (413, 490), False, 'from django.db import migrations, models\... |
import click
import pyregion
import logging
from regions import read_ds9
from pathlib import Path
from astropy import log
log.setLevel('DEBUG')
TEST_FILE_DIR = Path('../regions/io/ds9/tests/data')
@click.group()
def cli():
"""astropy.regions parser debugging tool."""
pass
@cli.command('list-files')
def list... | [
"click.argument",
"astropy.log.setLevel",
"pathlib.Path",
"click.group",
"click.option",
"IPython.embed"
] | [((123, 144), 'astropy.log.setLevel', 'log.setLevel', (['"""DEBUG"""'], {}), "('DEBUG')\n", (135, 144), False, 'from astropy import log\n'), ((162, 198), 'pathlib.Path', 'Path', (['"""../regions/io/ds9/tests/data"""'], {}), "('../regions/io/ds9/tests/data')\n", (166, 198), False, 'from pathlib import Path\n'), ((201, 2... |
#**********************************************************************
# Copyright 2020 Advanced Micro Devices, 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.o... | [
"bgl.Buffer",
"bgl.glBindTexture",
"bgl.glGenTextures",
"ctypes.cdll.LoadLibrary",
"bgl.glDeleteTextures",
"bgl.glTexParameteri",
"platform.system",
"ctypes.c_void_p"
] | [((868, 896), 'ctypes.cdll.LoadLibrary', 'cdll.LoadLibrary', (['"""libGL.so"""'], {}), "('libGL.so')\n", (884, 896), False, 'from ctypes import cdll\n'), ((968, 1074), 'ctypes.cdll.LoadLibrary', 'cdll.LoadLibrary', (['"""/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib"""'], {}), "(\n '/S... |
import glob
import os
from parse_coredump_hex import parse_core
from parse_ramdump import parse_ram
list_of_files = glob.glob('../*.log') # * means all if need specific format then *.csv
print(list_of_files)
if list_of_files:
latest_file = max(list_of_files, key=os.path.getmtime)
# parse_ram(latest_file, l... | [
"parse_coredump_hex.parse_core",
"glob.glob"
] | [((118, 139), 'glob.glob', 'glob.glob', (['"""../*.log"""'], {}), "('../*.log')\n", (127, 139), False, 'import glob\n'), ((359, 382), 'parse_coredump_hex.parse_core', 'parse_core', (['latest_file'], {}), '(latest_file)\n', (369, 382), False, 'from parse_coredump_hex import parse_core\n')] |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function, division
from io import open
import unicodedata
import string
import re
import random
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch import optim
import torch.nn.functional as F
use_cuda = torch.cuda.i... | [
"random.choice",
"torch.nn.Dropout",
"math.floor",
"torch.LongTensor",
"io.open",
"torch.cat",
"unicodedata.category",
"torch.cuda.is_available",
"torch.nn.NLLLoss",
"torch.nn.Linear",
"torch.nn.functional.relu",
"unicodedata.normalize",
"re.sub",
"random.random",
"time.time",
"torch.z... | [((308, 333), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (331, 333), False, 'import torch\n'), ((1498, 1526), 're.sub', 're.sub', (['"""([.!?])"""', '""" \\\\1"""', 's'], {}), "('([.!?])', ' \\\\1', s)\n", (1504, 1526), False, 'import re\n'), ((1536, 1567), 're.sub', 're.sub', (['"""[^a-zA-... |
import math
import pandas as pd
from rdkit import Chem
from rdkit.Chem import AllChem, Draw
from tools import helpers as h
def main():
COLUMN_NAMES = ['iupac', 'log_solubility', 'log_solubility_pred', 'SMILES']
MOLS_PER_PAGE = 50
data = pd.read_csv('data/delaney.csv', names=COLUMN_NAMES, header=0)
... | [
"rdkit.Chem.AllChem.Compute2DCoords",
"rdkit.Chem.MolFromSmiles",
"pandas.read_csv"
] | [((254, 315), 'pandas.read_csv', 'pd.read_csv', (['"""data/delaney.csv"""'], {'names': 'COLUMN_NAMES', 'header': '(0)'}), "('data/delaney.csv', names=COLUMN_NAMES, header=0)\n", (265, 315), True, 'import pandas as pd\n'), ((333, 356), 'rdkit.Chem.MolFromSmiles', 'Chem.MolFromSmiles', (['smi'], {}), '(smi)\n', (351, 356... |
import io
from PIL import Image, ImageDraw, ImageFont
from fastapi.param_functions import File
from app.models.schemas.words import (
WordOutWithIdDate
)
from app.resources import strings
from typing import List
# import datetime as dt
from O365 import calendar
import textwrap
""" Return byte buffer if output=='_... | [
"PIL.Image.new",
"io.BytesIO",
"PIL.ImageFont.truetype",
"PIL.ImageDraw.Draw",
"textwrap.wrap"
] | [((445, 476), 'PIL.Image.new', 'Image.new', (['"""1"""', '(800, 480)', '(255)'], {}), "('1', (800, 480), 255)\n", (454, 476), False, 'from PIL import Image, ImageDraw, ImageFont\n'), ((490, 569), 'PIL.ImageFont.truetype', 'ImageFont.truetype', (["(strings.PATH_FONTS_FOLDER + 'freemono/FreeMonoBold.ttf')", '(60)'], {}),... |
#!/usr/bin/env python
# Copyright (c) 2018, <NAME>
#
# This program is free software; you can redistribute and/or modify
# it under the terms of the Apache License, Version 2.0. See the
# accompanying LICENSE file or read the terms at:
# http://www.apache.org/licenses/LICENSE-2.0
from __future__ import absolute_impo... | [
"logging.getLogger",
"os.path.exists",
"logging.StreamHandler",
"logging.Formatter",
"os.path.join",
"os.mkdir"
] | [((1186, 1211), 'logging.getLogger', 'logging.getLogger', (['"""main"""'], {}), "('main')\n", (1203, 1211), False, 'import logging\n'), ((1531, 1554), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (1552, 1554), False, 'import logging\n'), ((1619, 1693), 'logging.Formatter', 'logging.Formatter', ([... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import ... | [
"pulumi.get",
"pulumi.getter",
"pulumi.set",
"pulumi.InvokeOptions",
"pulumi.runtime.invoke"
] | [((4123, 4154), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""createdBy"""'}), "(name='createdBy')\n", (4136, 4154), False, 'import pulumi\n'), ((4317, 4350), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""downloadUri"""'}), "(name='downloadUri')\n", (4330, 4350), False, 'import pulumi\n'), ((4533, 4569), 'p... |
import numpy as np
import matplotlib.pyplot as plt
def plot_hist_sum(data, r_labels, ylabel, xlabel, title, x_tick_labels=None, adjacent_bars=True):
"""
plots Histogram of sum
plots multiple bars
"""
n_rows = len(r_labels)
total_bars_width = 0.8
bar_width = total_bars_width / n_rows
#... | [
"matplotlib.pyplot.subplots",
"numpy.arange"
] | [((425, 454), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': '(10, 6)'}), '(figsize=(10, 6))\n', (437, 454), True, 'import matplotlib.pyplot as plt\n'), ((1398, 1427), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': '(10, 6)'}), '(figsize=(10, 6))\n', (1410, 1427), True, 'import matplotli... |
import socket
import urllib
import urllib.error
import urllib.request
from . import log
def get_content_from_url(url):
"""The get_content_from_url function can be used to retrieve(get) the content from an provided URL.
This function takes one string containing the full url as its parameter.
"""
# Se... | [
"urllib.request.urlopen"
] | [((591, 630), 'urllib.request.urlopen', 'urllib.request.urlopen', (['url'], {'timeout': '(10)'}), '(url, timeout=10)\n', (613, 630), False, 'import urllib\n')] |
from uuid import uuid4
from botocore.exceptions import EndpointConnectionError
from boto3.dynamodb.conditions import Key, Attr
from chalice import NotFoundError
from chalicelib.validates import Validates
from chalicelib.exceptions import DatabaseConnectionError
DEFAULT_USERNAME = 'default'
def except_endpoint_con... | [
"chalicelib.validates.Validates.username",
"chalice.NotFoundError",
"chalicelib.validates.Validates.state",
"chalicelib.validates.Validates.description",
"chalicelib.validates.Validates.subject",
"uuid.uuid4",
"boto3.dynamodb.conditions.Key",
"boto3.dynamodb.conditions.Attr",
"chalicelib.exceptions.... | [((3715, 3749), 'chalicelib.validates.Validates.subject', 'Validates.subject', (["item['subject']"], {}), "(item['subject'])\n", (3732, 3749), False, 'from chalicelib.validates import Validates\n'), ((3758, 3800), 'chalicelib.validates.Validates.description', 'Validates.description', (["item['description']"], {}), "(it... |
# coding: utf-8
from datetime import datetime, timedelta
from sqlalchemy import Column, Integer, String, Sequence, Boolean, ForeignKey, DateTime, Text, Date
from sqlalchemy.dialects.postgresql import JSON
from sqlalchemy.orm import relationship, backref
from .organizers import organizer_event_table
from .volunteers i... | [
"sqlalchemy.orm.relationship",
"sqlalchemy.Text",
"sqlalchemy.Date",
"sqlalchemy.ForeignKey",
"sqlalchemy.Integer",
"sqlalchemy.String",
"datetime.datetime.today",
"datetime.timedelta",
"sqlalchemy.Sequence"
] | [((985, 1028), 'sqlalchemy.orm.relationship', 'relationship', (['"""EventSubject"""'], {'lazy': '"""joined"""'}), "('EventSubject', lazy='joined')\n", (997, 1028), False, 'from sqlalchemy.orm import relationship, backref\n'), ((1047, 1145), 'sqlalchemy.orm.relationship', 'relationship', (['"""Organizer"""'], {'secondar... |
# -*- coding: utf-8 -*-
from collections import defaultdict
__author__ = "mertsalik"
__copyright__ = "Copyright 2018"
__credits__ = ["mertsalik", ""]
__license__ = "Private"
__email__ = ""
class CellTypes(object):
pass
class Graph(object):
def __init__(self):
self.nodes = set()
self.edges =... | [
"collections.defaultdict"
] | [((321, 338), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (332, 338), False, 'from collections import defaultdict\n')] |
import csv
import pandas as pd
import matplotlib.pyplot as plt
import datetime
import time
import math
from matplotlib import rc
import numpy as np
import glob
def plotter_days(month_number, year_number):
try:
try:
list_cols = ['line', 'date', 'glucose', 'idk', 'type', 'source']
in... | [
"matplotlib.pyplot.grid",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.locator_params",
"matplotlib.rc",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"matplotlib.pyplot.ylim",
"glob.glob",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"matplotlib... | [((1047, 1071), 'matplotlib.rc', 'rc', (['"""text"""'], {'usetex': '(False)'}), "('text', usetex=False)\n", (1049, 1071), False, 'from matplotlib import rc\n'), ((1084, 1127), 'matplotlib.pyplot.rc', 'plt.rc', (['"""grid"""'], {'linestyle': '"""-"""', 'color': '"""grey"""'}), "('grid', linestyle='-', color='grey')\n", ... |
import sqlite3
import xml.etree.ElementTree as et
from pymzml import spec
from pymzml.run import Reader
def create_database_from_file(db_name, file_path):
conn = sqlite3.connect(db_name + ".db")
Run = Reader("./tests/data/example.mzML")
with conn:
cursor = conn.cursor()
cursor.execute("CRE... | [
"pymzml.run.Reader",
"sqlite3.connect",
"xml.etree.ElementTree.XML",
"pymzml.spec.Chromatogram",
"pymzml.spec.Spectrum"
] | [((168, 200), 'sqlite3.connect', 'sqlite3.connect', (["(db_name + '.db')"], {}), "(db_name + '.db')\n", (183, 200), False, 'import sqlite3\n'), ((211, 246), 'pymzml.run.Reader', 'Reader', (['"""./tests/data/example.mzML"""'], {}), "('./tests/data/example.mzML')\n", (217, 246), False, 'from pymzml.run import Reader\n'),... |
__all__ = ["DialogPreprocessor"]
import string
from dataclasses import dataclass
from typing import Optional, Mapping, ClassVar
import utils
from ..common import Turn
from ..common import Dialog
from ..common import DialogState
from ..common import ActSlotValue
from ..tokenizer import tokenize
@dataclass
class Dial... | [
"utils.private_field"
] | [((497, 537), 'utils.private_field', 'utils.private_field', ([], {'default_factory': 'set'}), '(default_factory=set)\n', (516, 537), False, 'import utils\n')] |
""" Tests for the midgard.math.planetary_motion module"""
# Third party imports
import numpy as np
# Midgard imports
from midgard.data import time
from midgard.math import planetary_motion
def t_jd_gps():
"""Time, format julian date, scale gps"""
return time.Time(2457448.5, scale="gps", fmt="jd")
def test... | [
"midgard.data.time.Time",
"numpy.array",
"numpy.testing.assert_allclose"
] | [((266, 309), 'midgard.data.time.Time', 'time.Time', (['(2457448.5)'], {'scale': '"""gps"""', 'fmt': '"""jd"""'}), "(2457448.5, scale='gps', fmt='jd')\n", (275, 309), False, 'from midgard.data import time\n'), ((406, 469), 'numpy.array', 'np.array', (['[-148102175.80162, -7980320.884334, -19534142.160482]'], {}), '([-1... |
from src.params.ParamsPING import *
from src.izhikevich_simulation.IzhikevichNetworkOutcome import *
from src.params.ParamsFrequencies import *
import numpy as np
from math import floor, pi
from scipy import fft
import matplotlib.pyplot as plt
from collections import Counter
from tqdm import tqdm
import warnings
cl... | [
"numpy.abs",
"scipy.fft.ifft",
"matplotlib.pyplot.hist",
"tqdm.tqdm",
"warnings.catch_warnings",
"numpy.count_nonzero",
"numpy.array",
"numpy.argwhere",
"warnings.simplefilter",
"scipy.fft.fft",
"matplotlib.pyplot.subplots"
] | [((1780, 1810), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': '(30, 30)'}), '(figsize=(30, 30))\n', (1792, 1810), True, 'import matplotlib.pyplot as plt\n'), ((1885, 1935), 'matplotlib.pyplot.hist', 'plt.hist', (['frequencies'], {'color': '"""#ACDDE7"""', 'rwidth': '(0.7)'}), "(frequencies, color='#ACD... |
"""Authorization code representation."""
from datetime import datetime, timedelta
from sqlalchemy import Boolean, Column, Integer, String
from ...base import Base
class AuthorizationCode(Base):
__tablename__ = "authorizationcodes"
id = Column(Integer, primary_key=True)
user_id = Column(Integer)
cli... | [
"datetime.timedelta",
"sqlalchemy.Column",
"datetime.datetime.utcnow"
] | [((249, 282), 'sqlalchemy.Column', 'Column', (['Integer'], {'primary_key': '(True)'}), '(Integer, primary_key=True)\n', (255, 282), False, 'from sqlalchemy import Boolean, Column, Integer, String\n'), ((297, 312), 'sqlalchemy.Column', 'Column', (['Integer'], {}), '(Integer)\n', (303, 312), False, 'from sqlalchemy impor... |
import matplotlib.pyplot as plt
import datetime
from scipy.stats import *
from dis_mdp.mdp import *
import time
t2n = lambda hh, mm: hh * 60 + mm
def assign_pdf_abs(states, sid, sid_out, tid, time_span_left, time_span_middle, time_span_right, pdf_scale):
outcome_list = list()
r = 1.0
for j in range(time_... | [
"time.time"
] | [((6442, 6453), 'time.time', 'time.time', ([], {}), '()\n', (6451, 6453), False, 'import time\n'), ((6941, 6952), 'time.time', 'time.time', ([], {}), '()\n', (6950, 6952), False, 'import time\n')] |
import os
import yaml
from telegram import InlineKeyboardButton, InlineKeyboardMarkup
from telegram.ext import ConversationHandler
from commons import authentication, checkAdmin, checkId
from config import config
from translations import i18n
config = config["transmission"]
TSL_LIMIT = 'limited'
TSL_NORMAL = 'norma... | [
"telegram.InlineKeyboardMarkup",
"commons.checkId",
"translations.i18n.t",
"commons.checkAdmin",
"commons.authentication",
"os.system"
] | [((1288, 1318), 'telegram.InlineKeyboardMarkup', 'InlineKeyboardMarkup', (['keyboard'], {}), '(keyboard)\n', (1308, 1318), False, 'from telegram import InlineKeyboardButton, InlineKeyboardMarkup\n'), ((2236, 2254), 'os.system', 'os.system', (['command'], {}), '(command)\n', (2245, 2254), False, 'import os\n'), ((596, 6... |
"""
Pytorch implementation of the Autoencoder
For denoising the images
"""
import sys
import torch
sys.path.append("../")
device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
import matplotlib.pyplot as plt
from torch import nn
from dataloader import load_mnist
from basic_autoencoder im... | [
"basic_autoencoder.save_checkpoint",
"matplotlib.pyplot.gray",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.show",
"torch.load",
"basic_autoencoder.Decoder",
"torch.clip",
"torch.nn.MSELoss",
"torch.randn_like",
"torch.cuda.is_available",
"basic_autoencoder.Encoder",
"dataloader.load_mnist"... | [((100, 122), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (115, 122), False, 'import sys\n'), ((156, 181), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (179, 181), False, 'import torch\n'), ((132, 152), 'torch.device', 'torch.device', (['"""cuda"""'], {}), "('cuda'... |
"""
Plug-in infrastructure. Not stable.
Also package containing **unstable** plugins shipped with reader.
Note that while the plugin entry points (import names) are relatively stable,
the contents of the actual plugins is not.
"""
import functools
from contextlib import contextmanager
from reader._vendor.pkgutil im... | [
"reader._vendor.pkgutil.resolve_name"
] | [((834, 852), 'reader._vendor.pkgutil.resolve_name', 'resolve_name', (['name'], {}), '(name)\n', (846, 852), False, 'from reader._vendor.pkgutil import resolve_name\n')] |
from copy import deepcopy
from django.urls import reverse
from os import path
from rest_framework import status
from rest_framework.test import APITestCase
import json
FIXTURES_DIR = path.join(
path.dirname(path.dirname(path.abspath(__file__))),
'fixtures'
)
RESPONSE_EMPTY_PAGE = {
'count': 0,
'n... | [
"django.urls.reverse",
"os.path.join",
"json.load",
"copy.deepcopy",
"os.path.abspath"
] | [((454, 477), 'django.urls.reverse', 'reverse', (['"""weather-list"""'], {}), "('weather-list')\n", (461, 477), False, 'from django.urls import reverse\n'), ((503, 532), 'copy.deepcopy', 'deepcopy', (['RESPONSE_EMPTY_PAGE'], {}), '(RESPONSE_EMPTY_PAGE)\n', (511, 532), False, 'from copy import deepcopy\n'), ((230, 252),... |
# Copyright 2014 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | [
"mock.patch.object",
"mock.call",
"fuel_agent.manager.Manager"
] | [((1318, 1361), 'mock.patch.object', 'mock.patch.object', (['hu', '"""list_block_devices"""'], {}), "(hu, 'list_block_devices')\n", (1335, 1361), False, 'import mock\n'), ((1810, 1842), 'mock.patch.object', 'mock.patch.object', (['fu', '"""make_fs"""'], {}), "(fu, 'make_fs')\n", (1827, 1842), False, 'import mock\n'), (... |
"""
The tool to check the availability or syntax of domains, IPv4, IPv6 or URL.
::
██████╗ ██╗ ██╗███████╗██╗ ██╗███╗ ██╗ ██████╗███████╗██████╗ ██╗ ███████╗
██╔══██╗╚██╗ ██╔╝██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝██╔══██╗██║ ██╔════╝
██████╔╝ ╚████╔╝ █████╗ ██║ ██║██╔██╗ ██║██║ ... | [
"PyFunceble.helpers.File",
"datetime.datetime.now",
"PyFunceble.helpers.Dict",
"PyFunceble.REQUESTS.post"
] | [((2888, 2917), 'PyFunceble.helpers.File', 'PyFunceble.helpers.File', (['file'], {}), '(file)\n', (2911, 2917), False, 'import PyFunceble\n'), ((5969, 6192), 'PyFunceble.REQUESTS.post', 'PyFunceble.REQUESTS.post', (['PyFunceble.LINKS.api_date_format'], {'data': 'to_write[self.current_time]', 'timeout': 'PyFunceble.CONF... |
import sys
from PyQt5 import QtWidgets
from LoginMainWindow import LoginMainWindow
if __name__ == '__main__':
app = QtWidgets.QApplication(sys.argv)
loginWindow = LoginMainWindow()
loginWindow.show()
sys.exit(app.exec_())
| [
"PyQt5.QtWidgets.QApplication",
"LoginMainWindow.LoginMainWindow"
] | [((130, 162), 'PyQt5.QtWidgets.QApplication', 'QtWidgets.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (152, 162), False, 'from PyQt5 import QtWidgets\n'), ((182, 199), 'LoginMainWindow.LoginMainWindow', 'LoginMainWindow', ([], {}), '()\n', (197, 199), False, 'from LoginMainWindow import LoginMainWindow\n')] |
import numpy as np
import pandas as pd
def rolling_window_sequences(X, window_size, target_size, value_column, time_column):
"""
Function that takes in a pandas.DataFrame and a window_size then creates
output arrays that correspond to a timeseries sequence with window_size overlap.
... | [
"pandas.DataFrame",
"numpy.asarray"
] | [((3295, 3361), 'pandas.DataFrame', 'pd.DataFrame', (['accepted_points'], {'columns': '[time_column, value_column]'}), '(accepted_points, columns=[time_column, value_column])\n', (3307, 3361), True, 'import pandas as pd\n'), ((1601, 1621), 'numpy.asarray', 'np.asarray', (['output_X'], {}), '(output_X)\n', (1611, 1621),... |
# @Date : 2019-10-22
# @Author : <NAME>
import os
import numpy as np
import math
import torch
import torch.nn as nn
from torchvision.utils import make_grid
from imageio import imsave
from tqdm import tqdm
from copy import deepcopy
import logging
from utils.inception_score import get_inception_score
from utils.fid... | [
"logging.getLogger",
"numpy.random.normal",
"torch.nn.ReLU",
"os.makedirs",
"math.floor",
"imageio.imsave",
"torch.mean",
"tqdm.tqdm",
"os.path.join",
"utils.inception_score.get_inception_score",
"torchvision.utils.make_grid",
"utils.fid_score.calculate_fid_given_paths"
] | [((455, 482), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (472, 482), False, 'import logging\n'), ((5942, 6006), 'torchvision.utils.make_grid', 'make_grid', (['sample_imgs'], {'nrow': '(10)', 'normalize': '(True)', 'scale_each': '(True)'}), '(sample_imgs, nrow=10, normalize=True, scale... |
import os
from copy import deepcopy
import numpy as np
import torch
import goalrepresent as gr
from goalrepresent.helper.randomhelper import set_seed
from goalrepresent.models import PCAModel
class BCSpectrumFourierModel():
@staticmethod
def default_config():
default_config = gr.Config()
de... | [
"numpy.ones",
"goalrepresent.helper.randomhelper.set_seed",
"goalrepresent.Config",
"torch.rfft",
"goalrepresent.models.PCAModel.load_model",
"torch.from_numpy",
"os.path.dirname",
"numpy.zeros",
"torch.cuda.is_available",
"torch.range",
"copy.deepcopy",
"torch.zeros",
"torch.atan",
"torch... | [((298, 309), 'goalrepresent.Config', 'gr.Config', ([], {}), '()\n', (307, 309), True, 'import goalrepresent as gr\n'), ((439, 450), 'goalrepresent.helper.randomhelper.set_seed', 'set_seed', (['(0)'], {}), '(0)\n', (447, 450), False, 'from goalrepresent.helper.randomhelper import set_seed\n'), ((915, 955), 'goalreprese... |
# Generated by Django 3.0.7 on 2021-05-21 15:29
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('backend', '0001_initial'),
]
operations = [
migrations.RemoveField(
... | [
"django.db.migrations.RemoveField",
"django.db.models.ForeignKey"
] | [((287, 350), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""machine"""', 'name': '"""identifier"""'}), "(model_name='machine', name='identifier')\n", (309, 350), False, 'from django.db import migrations, models\n'), ((495, 615), 'django.db.models.ForeignKey', 'models.ForeignKey',... |
import torch
import torch3d.datasets as datasets
ROOT_DIR = "data"
class TestModelnet40:
def test_download(self):
dataset = datasets.ModelNet40(ROOT_DIR, download=True)
assert dataset._check_integrity()
class TestS3DIS:
def test_download(self):
dataset = datasets.S3DIS(ROOT_DIR, tr... | [
"torch3d.datasets.ShapeNetPart",
"torch3d.datasets.ModelNet40",
"torch3d.datasets.S3DIS"
] | [((140, 184), 'torch3d.datasets.ModelNet40', 'datasets.ModelNet40', (['ROOT_DIR'], {'download': '(True)'}), '(ROOT_DIR, download=True)\n', (159, 184), True, 'import torch3d.datasets as datasets\n'), ((293, 345), 'torch3d.datasets.S3DIS', 'datasets.S3DIS', (['ROOT_DIR'], {'train': '(False)', 'download': '(True)'}), '(RO... |
import warnings
from numba.errors import NumbaDeprecationWarning, \
NumbaPendingDeprecationWarning, NumbaPerformanceWarning
warnings.simplefilter('ignore', category=NumbaDeprecationWarning)
warnings.simplefilter('ignore', category=NumbaPendingDeprecationWarning)
warnings.simplefilter('ignore', category=NumbaPerfo... | [
"warnings.simplefilter"
] | [((130, 195), 'warnings.simplefilter', 'warnings.simplefilter', (['"""ignore"""'], {'category': 'NumbaDeprecationWarning'}), "('ignore', category=NumbaDeprecationWarning)\n", (151, 195), False, 'import warnings\n'), ((196, 268), 'warnings.simplefilter', 'warnings.simplefilter', (['"""ignore"""'], {'category': 'NumbaPen... |
import logging
import os
import re
from threading import Thread, currentThread
import time
import traceback
import json
import sys
# logging util function
def log_uncaught_exception(e, logger=None, context=None):
if logger is None:
logger = logging.getLogger('default')
if context is None:
cont... | [
"logging.getLogger",
"threading.Thread.__init__",
"json.loads",
"threading.currentThread",
"traceback.format_tb",
"re.split",
"time.sleep",
"os.getpid",
"logging.LoggerAdapter",
"time.time"
] | [((255, 283), 'logging.getLogger', 'logging.getLogger', (['"""default"""'], {}), "('default')\n", (272, 283), False, 'import logging\n'), ((450, 486), 'traceback.format_tb', 'traceback.format_tb', (['e.__traceback__'], {}), '(e.__traceback__)\n', (469, 486), False, 'import traceback\n'), ((2125, 2212), 'logging.LoggerA... |
#!/usr/bin/env python
import numpy as np
import pytest
import raytracing as rt
def test_ray_penetrates_grid_1d_pos_x():
start = np.array([[-1.23]])
end = np.array([[6.78]])
shape = np.array([5])
size = np.array([0.45])
map_gt = rt.gridmap(shape, size)
map_gt.misses[:5] = 1
map = rt.... | [
"numpy.ones",
"pytest.main",
"numpy.array",
"raytracing.gridmap",
"raytracing.trace2d",
"raytracing.trace1d"
] | [((135, 154), 'numpy.array', 'np.array', (['[[-1.23]]'], {}), '([[-1.23]])\n', (143, 154), True, 'import numpy as np\n'), ((165, 183), 'numpy.array', 'np.array', (['[[6.78]]'], {}), '([[6.78]])\n', (173, 183), True, 'import numpy as np\n'), ((196, 209), 'numpy.array', 'np.array', (['[5]'], {}), '([5])\n', (204, 209), T... |
"""
此页面用于爬取雪球网单支股票数据
Created by CSDN梦栖,2020-05-22
"""
# 导库
import os
from bs4 import BeautifulSoup
import requests
import csv
message = '即将开始处理...'
# 获取源数据
def get_source_data(source_file_path):
stock_id_list = []
with open(source_file_path, 'r', encoding='utf-8') as fp:
reader =... | [
"csv.DictWriter",
"requests.get",
"bs4.BeautifulSoup",
"os.path.realpath",
"csv.reader"
] | [((1378, 1412), 'requests.get', 'requests.get', (['url'], {'headers': 'headers'}), '(url, headers=headers)\n', (1390, 1412), False, 'import requests\n'), ((1474, 1501), 'bs4.BeautifulSoup', 'BeautifulSoup', (['text', '"""lxml"""'], {}), "(text, 'lxml')\n", (1487, 1501), False, 'from bs4 import BeautifulSoup\n'), ((321,... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from tensorboardX import SummaryWriter
class Net1(nn.Module):
def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(1,10,kernel_size=5)
self.conv2 = nn.Conv2d(10,20,kernel_size=5)
self.conv... | [
"torch.nn.BatchNorm2d",
"tensorboardX.SummaryWriter",
"torch.nn.Dropout2d",
"torch.nn.functional.dropout",
"torch.nn.Conv2d",
"torch.nn.Linear",
"torch.nn.functional.relu",
"torch.nn.functional.softmax",
"torch.rand"
] | [((883, 908), 'torch.rand', 'torch.rand', (['(13)', '(1)', '(28)', '(28)'], {}), '(13, 1, 28, 28)\n', (893, 908), False, 'import torch\n'), ((928, 969), 'tensorboardX.SummaryWriter', 'SummaryWriter', ([], {'log_dir': '"""test_tensorboard"""'}), "(log_dir='test_tensorboard')\n", (941, 969), False, 'from tensorboardX imp... |
import numpy as np
x = np.array([75, 138, 679])
y = np.array([3.45, 2.7, 0.3])
a = np.polyfit(x, np.log(y),1)
demand_erraticity = 140
print(a)
print(round(np.exp(a[0] *demand_erraticity + a[1])))
print(isinstance(int(np.round(2.99)), int)) | [
"numpy.exp",
"numpy.array",
"numpy.log",
"numpy.round"
] | [((24, 48), 'numpy.array', 'np.array', (['[75, 138, 679]'], {}), '([75, 138, 679])\n', (32, 48), True, 'import numpy as np\n'), ((53, 79), 'numpy.array', 'np.array', (['[3.45, 2.7, 0.3]'], {}), '([3.45, 2.7, 0.3])\n', (61, 79), True, 'import numpy as np\n'), ((98, 107), 'numpy.log', 'np.log', (['y'], {}), '(y)\n', (104... |
from sklearn import linear_model
from sklearn.linear_model import Lasso
import seaborn as sns
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from yellowbrick.features import RadViz, ParallelCoordinates
from yellowbrick.regressor import Predict... | [
"sklearn.preprocessing.LabelEncoder",
"yellowbrick.features.RadViz",
"sklearn.linear_model.Lasso",
"pandas.DataFrame",
"yellowbrick.features.Rank2D",
"sklearn.model_selection.train_test_split",
"pandas.read_sql",
"yellowbrick.features.ParallelCoordinates",
"seaborn.jointplot",
"matplotlib.pyplot.s... | [((620, 684), 'pandas.read_sql', 'pd.read_sql', (['"""Select * FROM final_data_thayn;"""'], {'con': 'myConnection'}), "('Select * FROM final_data_thayn;', con=myConnection)\n", (631, 684), True, 'import pandas as pd\n'), ((1607, 1661), 'sklearn.model_selection.train_test_split', 'train_test_split', (['X', 'y'], {'test_... |
import gym
import itertools
import matplotlib
import numpy as np
import sys
import tensorflow as tf
import collections
from time import time
import os.path
from fourInARowWrapper import FourInARowWrapper
if "../" not in sys.path:
sys.path.append("../")
from lib import plotting
matplotlib.style.... | [
"tensorflow.contrib.framework.get_global_step",
"tensorflow.reduce_sum",
"numpy.log",
"tensorflow.get_default_session",
"tensorflow.multiply",
"numpy.array",
"matplotlib.style.use",
"sys.path.append",
"tensorflow.squared_difference",
"tensorflow.Session",
"tensorflow.placeholder",
"tensorflow.... | [((303, 333), 'matplotlib.style.use', 'matplotlib.style.use', (['"""ggplot"""'], {}), "('ggplot')\n", (323, 333), False, 'import matplotlib\n'), ((343, 363), 'fourInARowWrapper.FourInARowWrapper', 'FourInARowWrapper', (['(1)'], {}), '(1)\n', (360, 363), False, 'from fourInARowWrapper import FourInARowWrapper\n'), ((215... |
# This script prints all layer information and image sizes
import torch as T
import torchvision.models as models
import sys
sys.path.insert(0, './small_scripts/')
from small_scripts import imagenet_loader
alexnet = models.alexnet(pretrained=True)
alexnet.eval()
val_loader = imagenet_loader.get_val_loader(1)
# (imag... | [
"sys.path.insert",
"small_scripts.imagenet_loader.get_val_loader",
"torchvision.models.alexnet",
"torch.flatten"
] | [((126, 164), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""./small_scripts/"""'], {}), "(0, './small_scripts/')\n", (141, 164), False, 'import sys\n'), ((218, 249), 'torchvision.models.alexnet', 'models.alexnet', ([], {'pretrained': '(True)'}), '(pretrained=True)\n', (232, 249), True, 'import torchvision.models a... |
# Copyright (c) 2013, aaa and contributors
# For license information, please see license.txt
import frappe
fields = ['yearmonth', 'ward_dept', 'ward_code', 'sec_ward_code', 'ward_cat_code', 'sec_ward', 'ward', 'ward_chin_name',
'bed_qua', 'date', 'bed_people', 'total_hos_people', 'hos_people', 'other_ward_p... | [
"frappe.logger",
"frappe.db.get_list"
] | [((661, 711), 'frappe.db.get_list', 'frappe.db.get_list', (['"""Admission New"""'], {'fields': 'fields'}), "('Admission New', fields=fields)\n", (679, 711), False, 'import frappe\n'), ((2403, 2418), 'frappe.logger', 'frappe.logger', ([], {}), '()\n', (2416, 2418), False, 'import frappe\n')] |
import subutai
from time import sleep
from shutil import copyfile
import os
import stat
def subutaistart():
subutai.CheckDirectories()
tmpDir = subutai.GetTmpDir()
targetDir = subutai.GetInstallDir()
subutai.download("snappy.ova")
while subutai.isDownloadComplete() != 1:
sleep(0.05)
s... | [
"subutai.CheckDirectories",
"subutai.GetTmpDir",
"subutai.GetMasterVersion",
"subutai.download",
"subutai.GetInstallDir",
"time.sleep",
"subutai.Shutdown",
"subutai.VBox",
"subutai.isDownloadComplete"
] | [((113, 139), 'subutai.CheckDirectories', 'subutai.CheckDirectories', ([], {}), '()\n', (137, 139), False, 'import subutai\n'), ((153, 172), 'subutai.GetTmpDir', 'subutai.GetTmpDir', ([], {}), '()\n', (170, 172), False, 'import subutai\n'), ((189, 212), 'subutai.GetInstallDir', 'subutai.GetInstallDir', ([], {}), '()\n'... |
from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic.base import RedirectView
from django.contrib.auth import views as auth_views
urlpatterns = [
# Examples:
# url(r'^$', 'bhr_site.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'... | [
"django.conf.urls.url",
"django.conf.urls.include",
"django.contrib.auth.views.LoginView.as_view",
"django.contrib.auth.views.LogoutView.as_view",
"django.views.generic.base.RedirectView.as_view"
] | [((314, 345), 'django.conf.urls.url', 'url', (['"""^admin/"""', 'admin.site.urls'], {}), "('^admin/', admin.site.urls)\n", (317, 345), False, 'from django.conf.urls import include, url\n'), ((366, 385), 'django.conf.urls.include', 'include', (['"""bhr.urls"""'], {}), "('bhr.urls')\n", (373, 385), False, 'from django.co... |
import numpy
import csb.test as test
from csb.numeric import log
from csb.statistics.pdf.parameterized import ParameterizedDensity
from csb.statistics.pdf.parameterized import ParameterValueError, ParameterizationError
from csb.statistics.pdf.parameterized import AbstractParameter, Parameter, NonVirtualParameter
c... | [
"csb.statistics.pdf.parameterized.ParameterValueError",
"csb.statistics.pdf.parameterized.Parameter",
"numpy.sqrt",
"csb.test.Console"
] | [((10393, 10407), 'csb.test.Console', 'test.Console', ([], {}), '()\n', (10405, 10407), True, 'import csb.test as test\n'), ((8545, 8556), 'csb.statistics.pdf.parameterized.Parameter', 'Parameter', ([], {}), '()\n', (8554, 8556), False, 'from csb.statistics.pdf.parameterized import AbstractParameter, Parameter, NonVirt... |
import os
from click.testing import CliRunner
from twine.utils import TEST_REPOSITORY
from hatch.cli import hatch
from hatch.env import install_packages
from hatch.settings import SETTINGS_FILE, copy_default_settings, save_settings
from hatch.utils import env_vars, temp_chdir, temp_move_path
from hatch.venv import cr... | [
"hatch.settings.copy_default_settings",
"os.path.expanduser",
"hatch.utils.temp_chdir",
"hatch.env.install_packages",
"hatch.venv.create_venv",
"os.path.join",
"click.testing.CliRunner",
"os.chdir",
"hatch.settings.save_settings",
"hatch.utils.temp_move_path",
"hatch.venv.venv",
"hatch.utils.e... | [((561, 573), 'hatch.utils.temp_chdir', 'temp_chdir', ([], {}), '()\n', (571, 573), False, 'from hatch.utils import env_vars, temp_chdir, temp_move_path\n'), ((597, 608), 'click.testing.CliRunner', 'CliRunner', ([], {}), '()\n', (606, 608), False, 'from click.testing import CliRunner\n'), ((965, 977), 'hatch.utils.temp... |