code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from collections.abc import MutableMapping as DictMixin
import types
import threading
import base64
import pickle
import hmac
import hashlib
import email.utils
import time
from . import errors
def parse_date(ims):
""" Parse rfc1123, rfc850 and asctime timestamps and return UTC epoch. """
try:
ts = ema... | [
"time.mktime",
"threading.local",
"base64.b64decode",
"pickle.dumps"
] | [((1041, 1063), 'pickle.dumps', 'pickle.dumps', (['data', '(-1)'], {}), '(data, -1)\n', (1053, 1063), False, 'import pickle\n'), ((7948, 7965), 'threading.local', 'threading.local', ([], {}), '()\n', (7963, 7965), False, 'import threading\n'), ((362, 388), 'time.mktime', 'time.mktime', (['(ts[:8] + (0,))'], {}), '(ts[:... |
#!/usr/bin/env python
# coding: utf-8
# Copyright 2021 MICAS, KU LEUVEN
#
# 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 ... | [
"config.populate_tmp_dir",
"config.cleanup"
] | [((1819, 1849), 'config.populate_tmp_dir', 'CFG.populate_tmp_dir', (['CLK_LIST'], {}), '(CLK_LIST)\n', (1839, 1849), True, 'import config as CFG\n'), ((2638, 2662), 'config.cleanup', 'CFG.cleanup', (['CFG.TMP_DIR'], {}), '(CFG.TMP_DIR)\n', (2649, 2662), True, 'import config as CFG\n'), ((3289, 3313), 'config.cleanup', ... |
#!/usr/bin/env python
#https://docs.opencv.org/3.3.1/d7/d8b/tutorial_py_lucas_kanade.html
import numpy as np
import cv2
import sys
feature_params = dict( maxCorners = 100, #100, # params for ShiTomasi corner detection
qualityLevel = 0.2, #0.3,,#0.2,
minDistance = 7, #12, ... | [
"numpy.zeros_like",
"cv2.cvtColor",
"cv2.destroyAllWindows",
"cv2.waitKey",
"cv2.VideoCapture",
"numpy.random.randint",
"cv2.goodFeaturesToTrack",
"numpy.bitwise_and",
"sys.stdout.flush",
"cv2.calcOpticalFlowPyrLK",
"cv2.imshow",
"numpy.ndarray"
] | [((611, 646), 'numpy.random.randint', 'np.random.randint', (['(0)', '(255)', '(100, 3)'], {}), '(0, 255, (100, 3))\n', (628, 646), True, 'import numpy as np\n'), ((822, 836), 'numpy.ndarray', 'np.ndarray', (['[]'], {}), '([])\n', (832, 836), True, 'import numpy as np\n'), ((1490, 1519), 'cv2.VideoCapture', 'cv2.VideoCa... |
#!/usr/bin/python
# This script predicts body part in test dataset
import os
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
import numpy as np
import tensorflow
from tensorflow import keras
from keras import optimizers
from keras.models import load_model
from keras.preprocessi... | [
"keras.models.load_model",
"csv.writer",
"numpy.expand_dims",
"keras.preprocessing.image.img_to_array",
"keras.preprocessing.image.load_img",
"keras.optimizers.RMSprop",
"re.sub",
"os.listdir",
"numpy.vstack"
] | [((420, 439), 'csv.writer', 'csv.writer', (['csvFile'], {}), '(csvFile)\n', (430, 439), False, 'import csv\n'), ((480, 528), 'keras.models.load_model', 'load_model', (['"""inception_v3_0.9635416865348816.h5"""'], {}), "('inception_v3_0.9635416865348816.h5')\n", (490, 528), False, 'from keras.models import load_model\n'... |
import pandas as pd
data = pd.read_csv("anonymized_crushes.csv")
# indegree
kerb_in = {}
# outdegree
kerb_out = {}
for row in range(0, data.shape[0]):
# filter out all the NaNs
person_info = list(filter(lambda x: not (pd.isna(x)), data.iloc[row]))
kerb = person_info[0]
crushes = list(person_info[1:])... | [
"pandas.read_csv",
"pandas.isna",
"pandas.DataFrame"
] | [((28, 65), 'pandas.read_csv', 'pd.read_csv', (['"""anonymized_crushes.csv"""'], {}), "('anonymized_crushes.csv')\n", (39, 65), True, 'import pandas as pd\n'), ((1001, 1064), 'pandas.DataFrame', 'pd.DataFrame', (['output'], {'columns': "['kerb', 'indegree', 'outdegree']"}), "(output, columns=['kerb', 'indegree', 'outde... |
# import the necessary packages
from src.KeyClipWriter import KeyClipWriter
from imutils.video import VideoStream
import argparse
import datetime
import imutils
import time
import cv2
import os
class VideoFeedClipper(object):
"""docstring for VideoFeedClipper"""
def __init__(self, buffer=100, timeout=1.0, usePiCame... | [
"imutils.video.VideoStream",
"os.path.join",
"cv2.VideoWriter_fourcc",
"cv2.waitKey",
"cv2.imshow",
"src.KeyClipWriter.KeyClipWriter",
"time.sleep",
"imutils.resize",
"cv2.destroyAllWindows",
"datetime.datetime.now"
] | [((1050, 1065), 'time.sleep', 'time.sleep', (['(2.0)'], {}), '(2.0)\n', (1060, 1065), False, 'import time\n'), ((1110, 1145), 'src.KeyClipWriter.KeyClipWriter', 'KeyClipWriter', ([], {'bufSize': 'self.bufSize'}), '(bufSize=self.bufSize)\n', (1123, 1145), False, 'from src.KeyClipWriter import KeyClipWriter\n'), ((1406, ... |
import torch
import torchvision.models as models
import torch.autograd.profiler as profiler
model = models.resnet18()
inputs = torch.randn(5, 3, 224, 224)
with profiler.profile(record_shapes=True) as prof:
with profiler.record_function("model_inference"):
model(inputs)
print(prof.key_averages(... | [
"torchvision.models.resnet18",
"torch.autograd.profiler.record_function",
"torch.randn",
"torch.autograd.profiler.profile"
] | [((105, 122), 'torchvision.models.resnet18', 'models.resnet18', ([], {}), '()\n', (120, 122), True, 'import torchvision.models as models\n'), ((133, 160), 'torch.randn', 'torch.randn', (['(5)', '(3)', '(224)', '(224)'], {}), '(5, 3, 224, 224)\n', (144, 160), False, 'import torch\n'), ((169, 205), 'torch.autograd.profil... |
import random
from rule_constants import trial_info
OP_TEXTS = {"AT": "Attacke", "PA": "Parade", "FK": "Schuss", "AW": "Ausweichen"}
def W6():
return random.randint(1, 6)
def W20():
return random.randint(1, 20)
class TP:
def __init__(self, weapon, effects):
self.dice_rolls = []
self.dice... | [
"rule_constants.trial_info",
"random.randint"
] | [((156, 176), 'random.randint', 'random.randint', (['(1)', '(6)'], {}), '(1, 6)\n', (170, 176), False, 'import random\n'), ((200, 221), 'random.randint', 'random.randint', (['(1)', '(20)'], {}), '(1, 20)\n', (214, 221), False, 'import random\n'), ((1470, 1487), 'rule_constants.trial_info', 'trial_info', (['trial'], {})... |
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.contrib import admin
from django.contrib.auth.models import Group
from django.contrib.admin.models import LogEntry
from django.contrib.admin.sites import AdminSite
from django.views.decorators.cache import never_cache
from django.t... | [
"django.urls.re_path",
"django.urls.reverse",
"django.http.HttpResponseRedirect",
"configparser.ConfigParser",
"re.search"
] | [((1533, 1547), 'configparser.ConfigParser', 'ConfigParser', ([], {}), '()\n', (1545, 1547), False, 'from configparser import ConfigParser\n'), ((2367, 2439), 'django.urls.re_path', 're_path', (["('^poem/public_(?P<model>%s)/$' % self._regex)", 'self.public_views'], {}), "('^poem/public_(?P<model>%s)/$' % self._regex, ... |
import sys
import os
import json
from flask import Flask
from flask_mail import Mail
from flask_bcrypt import Bcrypt
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_debugtoolbar import DebugToolbarExtension
from app.config import TestingConfig, DevelopmentConfig, ProductionConfig... | [
"flask.Flask",
"flask_mail.Mail",
"flask_sqlalchemy.SQLAlchemy",
"flask_bcrypt.Bcrypt",
"flask_login.LoginManager",
"flask_debugtoolbar.DebugToolbarExtension"
] | [((328, 343), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (333, 343), False, 'from flask import Flask\n'), ((392, 404), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', ([], {}), '()\n', (402, 404), False, 'from flask_sqlalchemy import SQLAlchemy\n'), ((415, 423), 'flask_bcrypt.Bcrypt', 'Bcrypt', ([], {}), ... |
# Generated by Django 3.2.12 on 2022-04-06 16:49
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Ingredients',
fields=[
... | [
"django.db.models.URLField",
"django.db.models.TextField",
"django.db.models.BigAutoField",
"django.db.models.CharField",
"django.db.models.PositiveSmallIntegerField",
"django.db.models.DecimalField",
"django.db.models.IntegerField",
"django.db.models.DateTimeField"
] | [((337, 433), 'django.db.models.BigAutoField', 'models.BigAutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (356, 433), False, 'from django.db import migrations, m... |
#! /usr/bin/env python
# setup.py
"""Setup and installer for PySci.
"""
from distutils.core import setup
setup(name='PySci',
version='0.1',
description='Pythonic interface to the QsciScintilla editor widget',
author='<NAME>',
author_email='<EMAIL>',
url='http://github.com/wapcaplet/pysc... | [
"distutils.core.setup"
] | [((108, 356), 'distutils.core.setup', 'setup', ([], {'name': '"""PySci"""', 'version': '"""0.1"""', 'description': '"""Pythonic interface to the QsciScintilla editor widget"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'url': '"""http://github.com/wapcaplet/pysci"""', 'license': '"""MIT License"""', '... |
from event_manager.event import Attribute, Event
class ActionExecutedEvent(Event):
attributes = (
Attribute('automatic'),
Attribute('user.id', is_required=False),
)
| [
"event_manager.event.Attribute"
] | [((112, 134), 'event_manager.event.Attribute', 'Attribute', (['"""automatic"""'], {}), "('automatic')\n", (121, 134), False, 'from event_manager.event import Attribute, Event\n'), ((144, 183), 'event_manager.event.Attribute', 'Attribute', (['"""user.id"""'], {'is_required': '(False)'}), "('user.id', is_required=False)\... |
import typing
import random
from pathlib import Path
import logging
from time import strftime, gmtime
from datetime import datetime
import os
import argparse
import contextlib
from collections import defaultdict
import numpy as np
import torch
from torch.utils.data import Dataset
import torch.distributed as dist
logg... | [
"os.remove",
"numpy.random.seed",
"collections.defaultdict",
"os.path.isfile",
"os.close",
"torch.distributed.get_world_size",
"argparse.ArgumentTypeError",
"random.seed",
"lmdb.open",
"pickle.dumps",
"torch.manual_seed",
"datetime.datetime",
"zipfile.ZipFile",
"tempfile.mkstemp",
"os.pa... | [((325, 352), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (342, 352), False, 'import logging\n'), ((2349, 2366), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (2360, 2366), False, 'import random\n'), ((2371, 2391), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(se... |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import bottle
import common.auth as _auth
from models.badge import BadgeModel
from models.user import UserModel
@bottle.get("/badges/getasync... | [
"models.user.UserModel",
"bottle.get",
"models.badge.BadgeModel"
] | [((292, 322), 'bottle.get', 'bottle.get', (['"""/badges/getasync"""'], {}), "('/badges/getasync')\n", (302, 322), False, 'import bottle\n'), ((388, 399), 'models.user.UserModel', 'UserModel', ([], {}), '()\n', (397, 399), False, 'from models.user import UserModel\n'), ((446, 458), 'models.badge.BadgeModel', 'BadgeModel... |
import sys
sys.path.append("./")
import matplotlib.pyplot as plt
import pandas as pd
from loguru import logger
from pathlib import Path
from tpd import recorder
from myterial import salmon, teal, indigo
import draw
from data.dbase.db_tables import Tracking, ValidatedSession
from fcutils.progress import track
fold... | [
"sys.path.append",
"draw.Tracking.scatter",
"fcutils.progress.track",
"matplotlib.pyplot.close",
"tpd.recorder.start",
"matplotlib.pyplot.subplots",
"draw.Tracking",
"tpd.recorder.add_figure",
"draw.Hairpin",
"pathlib.Path",
"loguru.logger.info",
"data.dbase.db_tables.ValidatedSession",
"dat... | [((12, 33), 'sys.path.append', 'sys.path.append', (['"""./"""'], {}), "('./')\n", (27, 33), False, 'import sys\n'), ((325, 386), 'pathlib.Path', 'Path', (['"""D:\\\\Dropbox (UCL)\\\\Rotation_vte\\\\Locomotion\\\\analysis"""'], {}), "('D:\\\\Dropbox (UCL)\\\\Rotation_vte\\\\Locomotion\\\\analysis')\n", (329, 386), False... |
import docutils.nodes
import re
import nbformat.v4
import os.path
import datetime
from .utils import LanguageTranslator, JupyterOutputCellGenerators, get_source_file_name
class JupyterCodeTranslator(docutils.nodes.GenericNodeVisitor):
URI_SPACE_REPLACE_FROM = re.compile(r"\s")
URI_SPACE_REPLACE_TO = "-"
... | [
"datetime.datetime.now",
"re.compile"
] | [((266, 283), 're.compile', 're.compile', (['"""\\\\s"""'], {}), "('\\\\s')\n", (276, 283), False, 'import re\n'), ((3431, 3454), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (3452, 3454), False, 'import datetime\n')] |
import pandas as pd
import numpy as np
#####if 20-day volume avg >10000,can be traded in the next period
future_price=pd.read_csv("../data_extraction/future_price.csv")
future_info=pd.read_csv("../data_extraction/future_info.csv")
combined=future_price.set_index(['order_book_id'])[['date','volume']].join(future_info.... | [
"pandas.read_csv"
] | [((120, 170), 'pandas.read_csv', 'pd.read_csv', (['"""../data_extraction/future_price.csv"""'], {}), "('../data_extraction/future_price.csv')\n", (131, 170), True, 'import pandas as pd\n'), ((183, 232), 'pandas.read_csv', 'pd.read_csv', (['"""../data_extraction/future_info.csv"""'], {}), "('../data_extraction/future_in... |
from smooth.components.external_component_h2_dispenser import H2Dispenser
from os import path
def test_init():
# basic creation
test_path = path.join(path.dirname(__file__), 'test_timeseries')
h2 = H2Dispenser({"csv_filename": "test_csv.csv", "path": test_path, })
assert h2 is not None
assert h2.... | [
"os.path.dirname",
"smooth.components.external_component_h2_dispenser.H2Dispenser"
] | [((213, 277), 'smooth.components.external_component_h2_dispenser.H2Dispenser', 'H2Dispenser', (["{'csv_filename': 'test_csv.csv', 'path': test_path}"], {}), "({'csv_filename': 'test_csv.csv', 'path': test_path})\n", (224, 277), False, 'from smooth.components.external_component_h2_dispenser import H2Dispenser\n'), ((161... |
print ('[0/3] Importing libraries')
import struct
import wave
frame_rate = 44100
channels = 1
sample_width = 2
f = open('file.txt', 'r')
vals = []
print ('[1/3] Append values from file')
for line in f:
vals.append(int(line))
f.close()
print ('[2/3] Declare parameters of the wave')
wav = wave.open('waves/export.wa... | [
"wave.open",
"struct.pack"
] | [((294, 329), 'wave.open', 'wave.open', (['"""waves/export.wav"""', '"""wb"""'], {}), "('waves/export.wav', 'wb')\n", (303, 329), False, 'import wave\n'), ((553, 572), 'struct.pack', 'struct.pack', (['"""h"""', 'v'], {}), "('h', v)\n", (564, 572), False, 'import struct\n')] |
'''
provide a simple python3 interface to the gsl_fft_real_transform function
'''
import sys
import itertools
from gsl_setup import *
def grouper(n, iterable, fillvalue=None):
# http://docs.python.org/dev/3.0/library/itertools.html#module-itertools
"grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx"
args = [... | [
"itertools.zip_longest"
] | [((351, 400), 'itertools.zip_longest', 'itertools.zip_longest', (['*args'], {'fillvalue': 'fillvalue'}), '(*args, fillvalue=fillvalue)\n', (372, 400), False, 'import itertools\n')] |
# -*- coding: utf-8 -*-
""" Tablib - TSV (Tab Separated Values) Support.
"""
from tablib.compat import unicode
from tablib.formats._csv import (
export_set as export_set_wrapper,
import_set as import_set_wrapper,
detect as detect_wrapper,
)
title = 'tsv'
extensions = ('tsv',)
DELIMITER = unicode('\t')
... | [
"tablib.formats._csv.import_set",
"tablib.compat.unicode",
"tablib.formats._csv.detect",
"tablib.formats._csv.export_set"
] | [((305, 318), 'tablib.compat.unicode', 'unicode', (['"""\t"""'], {}), "('\\t')\n", (312, 318), False, 'from tablib.compat import unicode\n'), ((405, 453), 'tablib.formats._csv.export_set', 'export_set_wrapper', (['dataset'], {'delimiter': 'DELIMITER'}), '(dataset, delimiter=DELIMITER)\n', (423, 453), True, 'from tablib... |
import wx
import HeeksCNC
from PopupMenu import PopupMenu
class CAMWindow(wx.ScrolledWindow):
def __init__(self, parent):
wx.ScrolledWindow.__init__(self, parent, name = 'CAM')
self.image_list = wx.ImageList(16, 16)
self.image_map = {}
self.object_map = {}
self.tree = wx.Tre... | [
"wx.BoxSizer",
"wx.ImageList",
"PopupMenu.PopupMenu",
"wx.ScrolledWindow.__init__",
"wx.TreeCtrl",
"wx.Size"
] | [((135, 187), 'wx.ScrolledWindow.__init__', 'wx.ScrolledWindow.__init__', (['self', 'parent'], {'name': '"""CAM"""'}), "(self, parent, name='CAM')\n", (161, 187), False, 'import wx\n'), ((216, 236), 'wx.ImageList', 'wx.ImageList', (['(16)', '(16)'], {}), '(16, 16)\n', (228, 236), False, 'import wx\n'), ((314, 401), 'wx... |
import os
import json
import shutil
import random
from termcolor import cprint
import colorama
from pyvoc.check_config import config_dir_path
from pyvoc import pyvoc
import textwrap
colorama.init()
terminal_width = shutil.get_terminal_size().columns
def revise_vocab(group_number):
print("")
group_path ... | [
"colorama.init",
"json.load",
"random.shuffle",
"textwrap.wrap",
"shutil.get_terminal_size",
"os.path.isfile",
"pyvoc.check_config.config_dir_path",
"os.path.join",
"termcolor.cprint",
"pyvoc.pyvoc.stop_loading_animation"
] | [((188, 203), 'colorama.init', 'colorama.init', ([], {}), '()\n', (201, 203), False, 'import colorama\n'), ((222, 248), 'shutil.get_terminal_size', 'shutil.get_terminal_size', ([], {}), '()\n', (246, 248), False, 'import shutil\n'), ((749, 770), 'random.shuffle', 'random.shuffle', (['words'], {}), '(words)\n', (763, 77... |
from WebScrapy import HomedySpider
from scrapy.crawler import CrawlerProcess
from scrapy.utils.project import get_project_settings
import logging
from selenium.webdriver.remote.remote_connection import LOGGER
from urllib3.connectionpool import log
log.setLevel(logging.WARNING)
LOGGER.setLevel(logging.WARNING)
if _... | [
"selenium.webdriver.remote.remote_connection.LOGGER.setLevel",
"urllib3.connectionpool.log.setLevel",
"scrapy.utils.project.get_project_settings"
] | [((251, 280), 'urllib3.connectionpool.log.setLevel', 'log.setLevel', (['logging.WARNING'], {}), '(logging.WARNING)\n', (263, 280), False, 'from urllib3.connectionpool import log\n'), ((281, 313), 'selenium.webdriver.remote.remote_connection.LOGGER.setLevel', 'LOGGER.setLevel', (['logging.WARNING'], {}), '(logging.WARNI... |
import shelve
import os
database_filename = 'database'
dataKey = 'webpages_database'
def save(name, content):
# if os.path.isfile(database_filename):
# old_list = shelve.open(database_filename)[dataKey]
# else:
# old_list = []
# print("now start saving data")
# old_list.extend(content_... | [
"os.path.isdir",
"os.mkdir",
"shelve.open"
] | [((651, 689), 'shelve.open', 'shelve.open', (['(dir_name + name)'], {'flag': '"""c"""'}), "(dir_name + name, flag='c')\n", (662, 689), False, 'import shelve\n'), ((515, 538), 'os.path.isdir', 'os.path.isdir', (['dir_name'], {}), '(dir_name)\n', (528, 538), False, 'import os\n'), ((548, 566), 'os.mkdir', 'os.mkdir', (['... |
# -*- coding: utf-8 -*-
# Copyright (C) 2011-2014 Mag. <NAME> All rights reserved
# Glasauergasse 32, A--1130 Wien, Austria. <EMAIL>
# #*** <License> ************************************************************#
# This modify is part of the package GTW.OMP.SRM.
#
# This modify is licensed under the terms of the BSD 3-... | [
"_TFL.Regexp.Re_Replacer",
"_GTW.GTW.OMP.SRM._Export"
] | [((2287, 2311), '_GTW.GTW.OMP.SRM._Export', 'GTW.OMP.SRM._Export', (['"""*"""'], {}), "('*')\n", (2306, 2311), False, 'from _GTW import GTW\n'), ((1611, 1646), '_TFL.Regexp.Re_Replacer', 'Re_Replacer', (['"""\\\\W+"""', '""""""', 're.UNICODE'], {}), "('\\\\W+', '', re.UNICODE)\n", (1622, 1646), False, 'from _TFL.Regexp... |
#!/usr/bin/env python2
# Copyright (C) 2017 MongoDB Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License, version 3,
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,... | [
"unittest.main",
"os.path.abspath",
"os.path.exists",
"context.idl.compiler.CompilerArgs",
"unittest.skip",
"context.idl.compiler.compile_idl",
"os.path.join"
] | [((2400, 2415), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2413, 2415), False, 'import unittest\n'), ((1614, 1643), 'os.path.join', 'os.path.join', (['base_dir', '"""src"""'], {}), "(base_dir, 'src')\n", (1626, 1643), False, 'import os\n'), ((1689, 1726), 'os.path.join', 'os.path.join', (['src_dir', '"""mongo... |
from bs4 import BeautifulSoup
import json
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
from tech2grams import tech_2grams
from punctuation import remove_punctuation
with open("spacex-job-listing.html", "r") as file:
content = file.read()
bs = BeautifulSoup(content, "lxml")
script_tag ... | [
"nltk.probability.FreqDist",
"matplotlib.pyplot.show",
"json.loads",
"matplotlib.pyplot.imshow",
"wordcloud.WordCloud",
"punctuation.remove_punctuation",
"matplotlib.pyplot.axis",
"tech2grams.tech_2grams",
"nltk.corpus.stopwords.words",
"bs4.BeautifulSoup",
"nltk.tokenize.word_tokenize"
] | [((278, 308), 'bs4.BeautifulSoup', 'BeautifulSoup', (['content', '"""lxml"""'], {}), "(content, 'lxml')\n", (291, 308), False, 'from bs4 import BeautifulSoup\n'), ((398, 432), 'json.loads', 'json.loads', (['script_tag.contents[0]'], {}), '(script_tag.contents[0])\n', (408, 432), False, 'import json\n'), ((472, 530), 'b... |
import uuid
from django.db import models
from django.contrib.auth.models import AbstractUser
from django.conf import settings
class User(AbstractUser):
"""
A class representing a User instance
Attributes
----------
username : CharField
A field which stores the username of the user instan... | [
"django.db.models.CharField",
"django.db.models.TextField",
"django.db.models.UUIDField"
] | [((742, 828), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(63)', 'blank': '(True)', 'null': '(True)', 'default': 'None', 'unique': '(True)'}), '(max_length=63, blank=True, null=True, default=None, unique\n =True)\n', (758, 828), False, 'from django.db import models\n'), ((887, 944), 'djang... |
from office365.runtime.queries.service_operation_query import ServiceOperationQuery
from office365.runtime.resource_path import ResourcePath
from office365.runtime.resource_path_service_operation import ResourcePathServiceOperation
from office365.sharepoint.base_entity_collection import BaseEntityCollection
from office... | [
"office365.runtime.resource_path.ResourcePath",
"office365.runtime.queries.service_operation_query.ServiceOperationQuery",
"office365.runtime.resource_path_service_operation.ResourcePathServiceOperation"
] | [((2224, 2299), 'office365.runtime.queries.service_operation_query.ServiceOperationQuery', 'ServiceOperationQuery', (['self', '"""AddRoleAssignment"""', 'payload', 'None', 'None', 'None'], {}), "(self, 'AddRoleAssignment', payload, None, None, None)\n", (2245, 2299), False, 'from office365.runtime.queries.service_opera... |
# -*- coding: utf-8 -*-
#
# <NAME>. aïvázis
# orthologue
# (c) 1998-2019 all rights reserved
#
# access the framework
import pyre
# my protocol
from .Functor import Functor
class Gaussian(pyre.component, family="gauss.functors.gaussian", implements=Functor):
r"""
Component that implements the normal distrib... | [
"pyre.properties.float",
"pyre.properties.array",
"math.exp",
"math.sqrt"
] | [((622, 656), 'pyre.properties.array', 'pyre.properties.array', ([], {'default': '[0]'}), '(default=[0])\n', (643, 656), False, 'import pyre\n'), ((752, 784), 'pyre.properties.float', 'pyre.properties.float', ([], {'default': '(1)'}), '(default=1)\n', (773, 784), False, 'import pyre\n'), ((1229, 1240), 'math.sqrt', 'sq... |
#!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name='ExasolDatabaseConnector',
version="0.1.7",
license="MIT",
maintainer="<NAME>",
maintainer_email="<EMAIL>",
description="Exasol database connector class written in py... | [
"distutils.core.setup"
] | [((118, 712), 'distutils.core.setup', 'setup', ([], {'name': '"""ExasolDatabaseConnector"""', 'version': '"""0.1.7"""', 'license': '"""MIT"""', 'maintainer': '"""<NAME>"""', 'maintainer_email': '"""<EMAIL>"""', 'description': '"""Exasol database connector class written in python"""', 'long_description': '"""Exasol data... |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
"tensorflow.test.main",
"tensorflow_addons.utils.test_utils.layer_test",
"numpy.random.seed",
"numpy.random.random_sample",
"numpy.expand_dims",
"numpy.apply_along_axis",
"numpy.where",
"numpy.linalg.norm"
] | [((2992, 3006), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (3004, 3006), True, 'import tensorflow as tf\n'), ((1425, 1466), 'numpy.where', 'np.where', (['(norm > 1.0 - epsilon)', 'norm_x', 'x'], {}), '(norm > 1.0 - epsilon, norm_x, x)\n', (1433, 1466), True, 'import numpy as np\n'), ((1584, 1601), 'numpy... |
from .transform import RandomErasing
from .collate_batch import train_collate_fn
from .collate_batch import val_collate_fn
from .triplet_sampler import RandomIdentitySampler
from .data import ImageDataset, init_dataset
import torchvision.transforms as T
from torch.utils.data.dataloader import DataLoader
def ... | [
"torchvision.transforms.RandomHorizontalFlip",
"torchvision.transforms.ToTensor",
"torchvision.transforms.Pad",
"torch.utils.data.dataloader.DataLoader",
"torchvision.transforms.Normalize",
"torchvision.transforms.RandomCrop",
"torchvision.transforms.Resize"
] | [((376, 439), 'torchvision.transforms.Normalize', 'T.Normalize', ([], {'mean': 'cfg.INPUT.PIXEL_MEAN', 'std': 'cfg.INPUT.PIXEL_STD'}), '(mean=cfg.INPUT.PIXEL_MEAN, std=cfg.INPUT.PIXEL_STD)\n', (387, 439), True, 'import torchvision.transforms as T\n'), ((2216, 2353), 'torch.utils.data.dataloader.DataLoader', 'DataLoader... |
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import torch
import torchvision
import torch_mlir
resnet18 = t... | [
"torchvision.models.resnet18",
"torch.ones"
] | [((319, 363), 'torchvision.models.resnet18', 'torchvision.models.resnet18', ([], {'pretrained': '(True)'}), '(pretrained=True)\n', (346, 363), False, 'import torchvision\n'), ((419, 445), 'torch.ones', 'torch.ones', (['(1)', '(3)', '(224)', '(224)'], {}), '(1, 3, 224, 224)\n', (429, 445), False, 'import torch\n'), ((60... |
# Copyright 2019 NREL
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy of the
# License at http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software distribu... | [
"floris.tools.visualization.visualize_cut_plane",
"matplotlib.pyplot.show",
"numpy.linspace",
"floris.tools.floris_utilities.FlorisInterface",
"matplotlib.pyplot.subplots"
] | [((910, 969), 'floris.tools.floris_utilities.FlorisInterface', 'wfct.floris_utilities.FlorisInterface', (['"""example_input.json"""'], {}), "('example_input.json')\n", (947, 969), True, 'import floris.tools as wfct\n'), ((1658, 1672), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (1670, 1672), True, '... |
import glob
from os import truncate
import cv2 as cv
import re
import random
import argparse
from pandas.core import frame
parser = argparse.ArgumentParser()
parser.add_argument('--dir' , help='root directroy path')
parser.add_argument('--type', help='data type (train < 450) , (test >= 450)')
parser.add_argument('-... | [
"cv2.putText",
"argparse.ArgumentParser",
"random.randint",
"cv2.waitKey",
"cv2.rectangle",
"cv2.imread",
"glob.glob",
"cv2.imshow",
"re.search",
"cv2.namedWindow",
"re.compile"
] | [((136, 161), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (159, 161), False, 'import argparse\n'), ((474, 523), 'glob.glob', 'glob.glob', (["(seq_path + '/**/*.txt')"], {'recursive': '(True)'}), "(seq_path + '/**/*.txt', recursive=True)\n", (483, 523), False, 'import glob\n'), ((536, 585), '... |
import collections
from dataclasses import dataclass
from typing import List
def longest_substring_using_nested_for_loop(s: str) -> int:
"""
Given a string s, find the length of the longest substring without repeating characters.
https://leetcode.com/problems/longest-substring-without-repeating-character... | [
"collections.deque",
"doctest.testmod"
] | [((2328, 2347), 'collections.deque', 'collections.deque', ([], {}), '()\n', (2345, 2347), False, 'import collections\n'), ((2763, 2780), 'doctest.testmod', 'doctest.testmod', ([], {}), '()\n', (2778, 2780), False, 'import doctest\n')] |
# -*- coding: utf-8 -*-
import os
from parallel_ape.submit import submit_scripts
from parallel_ape.PBS import submit_job
class ParallelJob(object):
def __init__(self, job_path, input_file, ncpus, protocol, imaginary_bonds=''):
self.job_path = job_path
self.input_file = input_file
self.ncpus... | [
"os.path.isdir",
"parallel_ape.PBS.submit_job",
"os.path.join",
"os.makedirs"
] | [((1114, 1168), 'parallel_ape.PBS.submit_job', 'submit_job', (['submit_filename'], {'remote_path': 'self.job_path'}), '(submit_filename, remote_path=self.job_path)\n', (1124, 1168), False, 'from parallel_ape.PBS import submit_job\n'), ((868, 896), 'os.path.isdir', 'os.path.isdir', (['self.job_path'], {}), '(self.job_pa... |
import unittest
from project.rooms.room import Room
class TestRoom(unittest.TestCase):
def setUp(self) -> None:
self.room = Room('name', 100, 1)
def test_init(self):
self.assertEqual('name', self.room.family_name)
self.assertEqual(100, self.room.budget)
self.assertEqual(1, se... | [
"project.rooms.room.Room"
] | [((139, 159), 'project.rooms.room.Room', 'Room', (['"""name"""', '(100)', '(1)'], {}), "('name', 100, 1)\n", (143, 159), False, 'from project.rooms.room import Room\n')] |
# Copyright L.P.Klyne 2013
# Licenced under 3 clause BSD licence
# $Id: TestAll.py 2612 2008-08-11 20:08:49Z graham.klyne $
#
# Unit testing for WebBrick library functions (Functions.py)
# See http://pyunit.sourceforge.net/pyunit.html
#
import unittest, logging, sys
sys.path.append("../..")
from MiscLib import Te... | [
"sys.path.append",
"MiscLib.TestUtils.runTests",
"TestWbConfigEdit.getTestSuite",
"unittest.TestSuite",
"TestTaskRunner.getTestSuite",
"TestParameterSet.getTestSuite",
"TestAllWebBrick.getTestSuite"
] | [((272, 296), 'sys.path.append', 'sys.path.append', (['"""../.."""'], {}), "('../..')\n", (287, 296), False, 'import unittest, logging, sys\n'), ((523, 543), 'unittest.TestSuite', 'unittest.TestSuite', ([], {}), '()\n', (541, 543), False, 'import unittest, logging, sys\n'), ((890, 947), 'MiscLib.TestUtils.runTests', 'T... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Mossum is a tool for summarizing results from Stanford's Moss. The tool
generates a graph for (multiple) results from Moss, which can help in
identifying groups of students that have shared solutions.
The tool can also generate a report, which shows which solutions ar... | [
"os.remove",
"csv.reader",
"argparse.ArgumentParser",
"faker.Faker",
"datetime.datetime.today",
"sys.stdin.read",
"os.path.exists",
"re.match",
"pydot.Dot",
"collections.defaultdict",
"pydot.Edge",
"requests.get",
"collections.Counter",
"re.search"
] | [((746, 790), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__'}), '(description=__doc__)\n', (769, 790), False, 'import argparse\n'), ((5686, 5718), 're.match', 're.match', (['args.transformer', 'name'], {}), '(args.transformer, name)\n', (5694, 5718), False, 'import re\n'), ((5946, ... |
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
chrome_driver_path = 'C:/Development/chromedriver.exe'
driver = webdriver.Chrome(chrome_driver_path)
driver.set_window_size(1440, 720)
driver.get('http://secure-retreat-92358.herokuapp.com/')
# stats = driver.find_element_by_css_selecto... | [
"selenium.webdriver.Chrome"
] | [((146, 182), 'selenium.webdriver.Chrome', 'webdriver.Chrome', (['chrome_driver_path'], {}), '(chrome_driver_path)\n', (162, 182), False, 'from selenium import webdriver\n')] |
#!/usr/bin/env python3.3
import os
from qdunittest.program import TestProgram
if __name__ == "__main__":
os.chdir(os.path.dirname(__file__))
TestProgram(module=None)
| [
"os.path.dirname",
"qdunittest.program.TestProgram"
] | [((150, 174), 'qdunittest.program.TestProgram', 'TestProgram', ([], {'module': 'None'}), '(module=None)\n', (161, 174), False, 'from qdunittest.program import TestProgram\n'), ((119, 144), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (134, 144), False, 'import os\n')] |
#!/usr/bin/env python
# encoding: utf-8
# <NAME>, 2013
"""
Writes the c and cpp compile commands into build/compile_commands.json
see http://clang.llvm.org/docs/JSONCompilationDatabase.html
Usage:
def configure(conf):
conf.load('compiler_cxx')
...
conf.load('clang_compilation_database')
"... | [
"waflib.TaskGen.feature",
"waflib.TaskGen.after_method",
"json.load",
"json.dumps",
"waflib.Task.classes.get"
] | [((517, 544), 'waflib.TaskGen.feature', 'TaskGen.feature', (['"""c"""', '"""cxx"""'], {}), "('c', 'cxx')\n", (532, 544), False, 'from waflib import Logs, TaskGen, Task\n'), ((546, 581), 'waflib.TaskGen.after_method', 'TaskGen.after_method', (['"""process_use"""'], {}), "('process_use')\n", (566, 581), False, 'from wafl... |
import os
import numpy as np
import matplotlib.pyplot as plt
import yaml
from multiview_manipulation import plotting as plot_utils, utils as bc_viewag_plot_utils
# CONFIG
#-------------------------------------------------------------------------------
# plot options
wide_full_comp = True # wide is 2 rows by 5 cols, ... | [
"numpy.load",
"os.makedirs",
"matplotlib.pyplot.get_cmap",
"multiview_manipulation.utils.get_means_lowers_uppers",
"multiview_manipulation.plotting.setup_pretty_plotting",
"multiview_manipulation.utils.plot_four_conds",
"numpy.arange",
"matplotlib.pyplot.tick_params",
"matplotlib.pyplot.ylabel",
"... | [((1169, 1203), 'multiview_manipulation.plotting.setup_pretty_plotting', 'plot_utils.setup_pretty_plotting', ([], {}), '()\n', (1201, 1203), True, 'from multiview_manipulation import plotting as plot_utils, utils as bc_viewag_plot_utils\n'), ((4194, 4282), 'matplotlib.pyplot.tick_params', 'plt.tick_params', ([], {'labe... |
from typer.testing import CliRunner
from ward import fixture
from cs_tools.thoughtspot import ThoughtSpot
from cs_tools.settings import TSConfig
from cs_tools.cli import _gather_tools, app as app_, tools_app, cfg_app, log_app
@fixture(scope='global')
def thoughtspot():
# cfg = TSConfig.from_toml('tests/_test_con... | [
"ward.fixture",
"cs_tools.cli.app.add_typer",
"cs_tools.settings.TSConfig.from_toml",
"cs_tools.cli._gather_tools",
"cs_tools.thoughtspot.ThoughtSpot",
"typer.testing.CliRunner"
] | [((230, 253), 'ward.fixture', 'fixture', ([], {'scope': '"""global"""'}), "(scope='global')\n", (237, 253), False, 'from ward import fixture\n'), ((460, 483), 'ward.fixture', 'fixture', ([], {'scope': '"""global"""'}), "(scope='global')\n", (467, 483), False, 'from ward import fixture\n'), ((528, 551), 'ward.fixture', ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################################
## Write a file, typical use
##############################################################################
import unittest
import os
import tempfile
import copy
from savReaderWriter import *
... | [
"unittest.main",
"copy.deepcopy",
"os.remove",
"tempfile.gettempdir"
] | [((1214, 1229), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1227, 1229), False, 'import unittest\n'), ((1154, 1181), 'os.remove', 'os.remove', (['self.savFileName'], {}), '(self.savFileName)\n', (1163, 1181), False, 'import os\n'), ((474, 495), 'tempfile.gettempdir', 'tempfile.gettempdir', ([], {}), '()\n', (4... |
import time
import service
from model.discord.message import Message
def main():
print("# Beginning show fetch and push")
shows = service.anime_list_fetch_service.fetch_latest_aired_shows()
non_reported_shows = service.anime_list_filter_service.get_non_reported_shows(shows)
if len(non_reported_shows)... | [
"service.anime_list_filter_service.get_non_reported_shows",
"model.discord.message.Message",
"time.sleep",
"service.anime_list_fetch_service.fetch_latest_aired_shows",
"service.anime_list_embed_service.get_embed",
"service.anime_list_service.set_reported_show"
] | [((141, 200), 'service.anime_list_fetch_service.fetch_latest_aired_shows', 'service.anime_list_fetch_service.fetch_latest_aired_shows', ([], {}), '()\n', (198, 200), False, 'import service\n'), ((226, 289), 'service.anime_list_filter_service.get_non_reported_shows', 'service.anime_list_filter_service.get_non_reported_s... |
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import re
_MYPY = False
if _MYPY:
import typing # noqa: F401 # pylint: disable=import-error,unused-import,useless-suppression
# Hack to get around some of Python 2's standard library modules that
# accept ascii-encodabl... | [
"stone.backends.tsd_helpers.fmt_func",
"stone.backends.tsd_helpers.fmt_tag",
"stone.backends.tsd_helpers.fmt_error_type",
"stone.backends.tsd_helpers.fmt_type",
"os.path.isfile",
"re.search",
"stone.backends.tsd_helpers.check_route_name_conflict",
"os.path.join"
] | [((2254, 2311), 'os.path.join', 'os.path.join', (['self.target_folder_path', 'self.args.template'], {}), '(self.target_folder_path, self.args.template)\n', (2266, 2311), False, 'import os\n'), ((3942, 4000), 'stone.backends.tsd_helpers.fmt_func', 'fmt_func', (["(namespace.name + '_' + route.name)", 'route.version'], {}... |
"""
Clenshaw-Curtis quadrature method is a good all-around quadrature method
comparable to Gaussian quadrature, but typically limited to finite intervals
without a specific weight function. In addition to be quite accurate, the
weights and abscissas can be calculated quite fast.
Another thing to note is that Clenshaw-... | [
"numpy.sum",
"numpy.asarray",
"numpy.ones",
"numpy.where",
"numpy.array",
"numpy.arange",
"numpy.cos"
] | [((3598, 3617), 'numpy.array', 'numpy.array', (['domain'], {}), '(domain)\n', (3609, 3617), False, 'import numpy\n'), ((3471, 3489), 'numpy.sum', 'numpy.sum', (['weights'], {}), '(weights)\n', (3480, 3489), False, 'import numpy\n'), ((3768, 3794), 'numpy.ones', 'numpy.ones', (['dim'], {'dtype': 'int'}), '(dim, dtype=in... |
#data preparation utils
import numpy as np
import tensorflow as tf
def partitionByClass(X,y_true):
maxc = np.max(y_true+1)
ids = [[] for i in range(maxc)]
for i in range(np.shape(y_true)[0]):
ids[y_true[i]].append(i)
return ids
def prepareBatch(X,y_true,ids_by_class_train,N_classes = 10, N_su... | [
"tensorflow.reshape",
"tensorflow.Session",
"numpy.shape",
"numpy.max",
"numpy.mean",
"numpy.rot90",
"numpy.reshape",
"numpy.array",
"numpy.random.choice",
"numpy.random.permutation",
"numpy.concatenate",
"numpy.ndarray.flatten"
] | [((112, 130), 'numpy.max', 'np.max', (['(y_true + 1)'], {}), '(y_true + 1)\n', (118, 130), True, 'import numpy as np\n'), ((373, 387), 'numpy.max', 'np.max', (['y_true'], {}), '(y_true)\n', (379, 387), True, 'import numpy as np\n'), ((701, 745), 'numpy.ndarray.flatten', 'np.ndarray.flatten', (['ids_batch[:, :N_support]... |
import sys
from time import time
import click
import pyhecdss
from vtools.functions import filter
import pandas as pd
import numpy as np
from pydsm.ptm_animator import ptm_animate
from pydsm.hydro_slicer import slice_hydro
from pydsm.postpro import load_location_file, load_location_table
from pydsm.function... | [
"sys.stdout.write",
"pyhecdss.set_message_level",
"pydsm.functions.tsmath.rmse",
"pydsm.functions.tsmath.percent_bias",
"pydsm.functions.tsmath.mse",
"click.option",
"pydsm.functions.tsmath.mean_error",
"click.command",
"vtools.functions.filter.godin_filter",
"click.Choice",
"sys.stdout.flush",
... | [((342, 355), 'click.group', 'click.group', ([], {}), '()\n', (353, 355), False, 'import click\n'), ((2882, 2897), 'click.command', 'click.command', ([], {}), '()\n', (2895, 2897), False, 'import click\n'), ((2900, 3061), 'click.option', 'click.option', (['"""-o"""', '"""--outfile"""'], {'default': '"""out.gz"""', 'hel... |
#!/usr/bin/env python
# coding: utf-8
# # 02__trans_motifs
#
# in this notebook, i find motifs that are associated w/ trans effects using linear models and our RNA-seq data
# In[1]:
import warnings
warnings.filterwarnings('ignore')
import itertools
import pandas as pd
import numpy as np
import matplotlib as mpl
i... | [
"numpy.random.seed",
"numpy.abs",
"sklearn.preprocessing.StandardScaler",
"matplotlib.pyplot.subplot2grid",
"numpy.isnan",
"matplotlib.pyplot.figure",
"statsmodels.api.qqplot",
"pandas.read_table",
"sys.path.append",
"pandas.DataFrame",
"matplotlib.pyplot.close",
"numpy.max",
"statsmodels.fo... | [((203, 236), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (226, 236), False, 'import warnings\n'), ((779, 812), 'sys.path.append', 'sys.path.append', (['"""../../../utils"""'], {}), "('../../../utils')\n", (794, 812), False, 'import sys\n'), ((1029, 1052), 'seaborn.set'... |
import argparse
import os
from argparse import RawTextHelpFormatter
import hypercane.actions.identify
import hypercane.errors
from hypercane.args import universal_by_cid_gui_required_args, universal_gui_optional_args
from hypercane.actions import get_logger, calculate_loglevel
from hypercane.utils import get_hc_cach... | [
"os.getcwd",
"hypercane.utils.get_hc_cache_storage",
"argparse.ArgumentParser",
"hypercane.actions.calculate_loglevel"
] | [((385, 628), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Submit a public web archive collection\'s ID and Hypercane will generate a file listing all archived page URLs (i.e., mementos, captures, snapshots, URI-Ms)."""', 'formatter_class': 'RawTextHelpFormatter'}), '(description=\n ... |
import unittest
import numpy as np
import multipy
################################################################################
################################################################################
####
#### Class: Transform
####
########################################################################... | [
"numpy.random.rand",
"multipy.Transform",
"numpy.shape"
] | [((546, 568), 'numpy.random.rand', 'np.random.rand', (['(5)', '(100)'], {}), '(5, 100)\n', (560, 568), True, 'import numpy as np\n'), ((580, 602), 'numpy.random.rand', 'np.random.rand', (['(5)', '(100)'], {}), '(5, 100)\n', (594, 602), True, 'import numpy as np\n'), ((1015, 1037), 'numpy.random.rand', 'np.random.rand',... |
# Generated by Django 2.0.7 on 2018-09-28 13:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('interest', '0001_initial'),
('users', '0003_auto_20180916_1903'),
]
operations = [
migrations.AddField(
model_name='prof... | [
"django.db.models.IntegerField",
"django.db.models.ManyToManyField"
] | [((373, 415), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'blank': '(True)', 'default': '(0)'}), '(blank=True, default=0)\n', (392, 415), False, 'from django.db import migrations, models\n'), ((539, 585), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([], {'to': '"""interest.Interest""... |
# SPDX-FileCopyrightText: 2022 UChicago Argonne, LLC
# SPDX-License-Identifier: MIT
from datetime import datetime
from pathlib import Path
import shutil
from typing import List, Optional
import numpy as np
import pandas as pd
from .fileutils import PathLike, run as run_proc
from .parameters import Parameters
from .p... | [
"pandas.read_csv",
"pathlib.Path",
"numpy.array",
"shutil.which"
] | [((3600, 3617), 'pathlib.Path', 'Path', (['"""moose-opt"""'], {}), "('moose-opt')\n", (3604, 3617), False, 'from pathlib import Path\n'), ((4083, 4092), 'pathlib.Path', 'Path', (['exe'], {}), '(exe)\n', (4087, 4092), False, 'from pathlib import Path\n'), ((1644, 1665), 'pandas.read_csv', 'pd.read_csv', (['csv_file'], {... |
# -*- coding: utf-8 -*-
"""
© <NAME>, <NAME>, 2017
Script for resuming from saved checkpoint
"""
# ----------------------------------------------------------------------------------------------------------------------
# Imports
# ----------------------------------------------------------------------------------------... | [
"argparse.ArgumentParser",
"TeLL.utility.misc.extract_to_tmp",
"os.path.isfile",
"TeLL.config.Config.from_file",
"os.path.join",
"os.chdir",
"os.waitpid",
"shlex.split",
"os.path.exists",
"subprocess.Popen",
"TeLL.utility.misc.extract_named_args",
"signal.signal",
"TeLL.config.Config",
"sy... | [((1289, 1311), 'os.path.isfile', 'os.path.isfile', (['config'], {}), '(config)\n', (1303, 1311), False, 'import os\n'), ((1594, 1619), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1617, 1619), False, 'import argparse\n'), ((2034, 2054), 'shlex.split', 'shlex.split', (['command'], {}), '(com... |
import urllib3
import csv
import os
import json
import arin
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
# TODO: Add in reverse lookup
csvfile = open('countries_by_rir.csv', 'r')
readcsv = csv.reader(csvfile, delimiter=',')
rir = {'AFRINIC': [],
'APNIC': [],
'ARIN': [],
... | [
"urllib3.PoolManager",
"csv.reader",
"urllib3.disable_warnings",
"json.loads"
] | [((60, 127), 'urllib3.disable_warnings', 'urllib3.disable_warnings', (['urllib3.exceptions.InsecureRequestWarning'], {}), '(urllib3.exceptions.InsecureRequestWarning)\n', (84, 127), False, 'import urllib3\n'), ((214, 248), 'csv.reader', 'csv.reader', (['csvfile'], {'delimiter': '""","""'}), "(csvfile, delimiter=',')\n"... |
"""
:author: <NAME>
:id: 30632749
:assignment: FIT1045 Assignment 1, Task 1 (Semester 1 2019)
:purpose: Performs and compares algorithms that approximate pi.
:created: 2019-11-13 (remade within two hours)
:updated: 2019-11-17 (documentation)
This assignment task has since been replaced as of 2019-... | [
"math.sqrt"
] | [((1505, 1520), 'math.sqrt', 'sqrt', (['(6 * sub_x)'], {}), '(6 * sub_x)\n', (1509, 1520), False, 'from math import pi, sqrt\n')] |
# Copyright (c) 2020, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
import logging
import numpy as np
import copy
import coremltools
from coremltools import converters ... | [
"numpy.sum",
"numpy.abs",
"numpy.isclose",
"numpy.round",
"numpy.prod",
"logging.error",
"numpy.testing.assert_equal",
"coremltools.converters.mil.mil.Program",
"copy.deepcopy",
"coremltools.models.neural_network.printer.print_network_spec",
"numpy.issubdtype",
"numpy.all",
"coremltools.conv... | [((1597, 1665), 'coremltools.converters.mil.converter._convert', '_converter._convert', (['program'], {'convert_from': '"""mil"""', 'convert_to': 'backend'}), "(program, convert_from='mil', convert_to=backend)\n", (1616, 1665), True, 'from coremltools.converters.mil import converter as _converter\n'), ((1827, 1860), 'c... |
import logging
import json
from src.bot import bot
from src.constants import Client
log = logging.getLogger('discord')
log.setLevel(logging.DEBUG)
handler = logging.FileHandler(filename='devil.log', encoding='utf-8', mode='w')
handler.setFormatter(logging.Formatter('%(asctime)s | %(name)s | %(level... | [
"json.load",
"logging.FileHandler",
"src.bot.bot.load_extensions",
"logging.Formatter",
"src.bot.bot.run",
"logging.getLogger"
] | [((111, 139), 'logging.getLogger', 'logging.getLogger', (['"""discord"""'], {}), "('discord')\n", (128, 139), False, 'import logging\n'), ((178, 247), 'logging.FileHandler', 'logging.FileHandler', ([], {'filename': '"""devil.log"""', 'encoding': '"""utf-8"""', 'mode': '"""w"""'}), "(filename='devil.log', encoding='utf-... |
import os
import flopy
import pandas as pd
import numpy as np
def hdobj2data(hdsobj):
# convert usg hdsobj to array of shape (nper, nnodes)
hds = []
kstpkpers = hdsobj.get_kstpkper()
for kstpkper in kstpkpers:
data = hdsobj.get_data(kstpkper=kstpkper)
fdata = []
for lay in rang... | [
"pandas.DataFrame",
"numpy.array",
"os.path.join"
] | [((412, 425), 'numpy.array', 'np.array', (['hds'], {}), '(hds)\n', (420, 425), True, 'import numpy as np\n'), ((951, 1009), 'pandas.DataFrame', 'pd.DataFrame', (['data'], {'columns': "['head', 'name', 'node', 'sp']"}), "(data, columns=['head', 'name', 'node', 'sp'])\n", (963, 1009), True, 'import pandas as pd\n'), ((48... |
import io
import logging
import os
import re
import sys
import traceback
from logging.handlers import RotatingFileHandler
from jgutils.config import AZURE_WEB
try:
import colored_traceback
import colorlog
import pygments.lexers
from colored_traceback import Colorizer
# color tracebacks in termina... | [
"os.getenv",
"logging.Formatter.format",
"io.StringIO",
"traceback.format_exception",
"logging.StreamHandler",
"logging.Formatter",
"colored_traceback.Colorizer",
"traceback.format_stack",
"colored_traceback.add_hook",
"logging.handlers.RotatingFileHandler",
"logging.getLogger"
] | [((3171, 3211), 'logging.StreamHandler', 'logging.StreamHandler', ([], {'stream': 'sys.stdout'}), '(stream=sys.stdout)\n', (3192, 3211), False, 'import logging\n'), ((3302, 3334), 'os.getenv', 'os.getenv', (['"""file_log_path"""', 'None'], {}), "('file_log_path', None)\n", (3311, 3334), False, 'import os\n'), ((377, 43... |
from flask import Flask, request #import main Flask class and request object
from eth_keys import keys
from web3 import Web3
import dataset
import sys
app = Flask(__name__) #create the Flask app
@app.route('/transaction', methods = ['POST'])
def transaction():
db = dataset.connect('sqlite:///database/users.db')
... | [
"dataset.connect",
"flask.Flask",
"flask.request.get_json",
"flask.request.args.get"
] | [((158, 173), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (163, 173), False, 'from flask import Flask, request\n'), ((272, 318), 'dataset.connect', 'dataset.connect', (['"""sqlite:///database/users.db"""'], {}), "('sqlite:///database/users.db')\n", (287, 318), False, 'import dataset\n'), ((357, 375), 'f... |
# -*- coding: utf-8 -*-
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""Tests that HTML generation is awesome."""
import datetime
import glob
import json
import os
import os.path
import re
import sys
import ... | [
"os.remove",
"coverage.files.flat_rootname",
"tests.goldtest.contains_any",
"glob.glob",
"os.path.join",
"tests.goldtest.compare",
"re.escape",
"tests.goldtest.gold_path",
"re.search",
"re.sub",
"json.dump",
"tests.goldtest.doesnt_contain",
"os.path.basename",
"os.path.realpath",
"os.ren... | [((22170, 22185), 're.escape', 're.escape', (['path'], {}), '(path)\n', (22179, 22185), False, 'import re\n'), ((23654, 23717), 'tests.goldtest.compare', 'compare', (['expected', 'actual'], {'file_pattern': '"""*.html"""', 'scrubs': 'scrubs'}), "(expected, actual, file_pattern='*.html', scrubs=scrubs)\n", (23661, 23717... |
"""Functions to get OSC types from datagrams and vice versa"""
import struct
from spiegelib.network.osc import ntp
from datetime import datetime, timedelta, date
from typing import Union, Tuple
class ParseError(Exception):
"""Base exception for when a datagram parsing error occurs."""
class BuildError(Except... | [
"struct.unpack",
"struct.pack",
"spiegelib.network.osc.ntp.ntp_time_to_system_epoch",
"datetime.timedelta",
"datetime.datetime.min.time",
"spiegelib.network.osc.ntp.parse_timestamp",
"spiegelib.network.osc.ntp.system_time_to_ntp"
] | [((3199, 3221), 'struct.pack', 'struct.pack', (['""">i"""', 'val'], {}), "('>i', val)\n", (3210, 3221), False, 'import struct\n'), ((5589, 5617), 'spiegelib.network.osc.ntp.parse_timestamp', 'ntp.parse_timestamp', (['timetag'], {}), '(timetag)\n', (5608, 5617), False, 'from spiegelib.network.osc import ntp\n'), ((6250,... |
import grpc
import service_pb2
import service_pb2_grpc
_HOST = "127.0.0.1"
_PORT = "41005"
def main():
with grpc.insecure_channel("{0}:{1}".format(_HOST, _PORT)) as channel:
client = service_pb2_grpc.SayHelloServiceStub(channel=channel)
response = client.SayHello(service_pb2.SayHelloRequest(name="... | [
"service_pb2.SayHelloRequest",
"service_pb2_grpc.SayHelloServiceStub"
] | [((197, 250), 'service_pb2_grpc.SayHelloServiceStub', 'service_pb2_grpc.SayHelloServiceStub', ([], {'channel': 'channel'}), '(channel=channel)\n', (233, 250), False, 'import service_pb2_grpc\n'), ((286, 328), 'service_pb2.SayHelloRequest', 'service_pb2.SayHelloRequest', ([], {'name': '"""<NAME>"""'}), "(name='<NAME>')\... |
# coding=utf-8
from django.shortcuts import render_to_response, render
from django.views import generic
from course.models import App, AppCategory
class IndexView(generic.ListView):
template_name = 'index.html'
def get_queryset(self):
"""Return the last five published questions."""
return Ap... | [
"django.shortcuts.render_to_response",
"course.models.App.objects.all",
"course.models.AppCategory.objects.all",
"course.models.App.objects.order_by",
"course.models.App.objects.filter",
"django.shortcuts.render",
"course.models.App.objects.get"
] | [((982, 1004), 'course.models.App.objects.get', 'App.objects.get', ([], {'id': 'pk'}), '(id=pk)\n', (997, 1004), False, 'from course.models import App, AppCategory\n'), ((1059, 1104), 'django.shortcuts.render', 'render', (['request', '"""course-intro.html"""', 'context'], {}), "(request, 'course-intro.html', context)\n... |
import argparse
import network_utils
import helper_utils
import torch
import json
import numpy as np
def get_args():
parser = argparse.ArgumentParser(description="Predict flower classification with DNN")
parser.add_argument('input', default='./flowers/test/17/image_03911.jpg', type=str, help="input flower ima... | [
"helper_utils.str_to_bool",
"argparse.ArgumentParser",
"numpy.argmax",
"torch.exp",
"network_utils.loading_model",
"helper_utils.load_cat_to_name",
"torch.cuda.is_available",
"helper_utils.display_result",
"torch.unsqueeze",
"torch.no_grad",
"helper_utils.process_image",
"torch.from_numpy"
] | [((132, 209), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Predict flower classification with DNN"""'}), "(description='Predict flower classification with DNN')\n", (155, 209), False, 'import argparse\n'), ((1382, 1411), 'torch.unsqueeze', 'torch.unsqueeze', (['image'], {'dim': '(0)'})... |
from PIL import Image
from torchvision import transforms
def image_transforms(load_size):
return transforms.Compose([
# transforms.CenterCrop(size=(178, 178)), # for CelebA
transforms.RandomCrop(size=load_size),
transforms.ToTensor(),
transforms.Normalize((0.5, 0.5, 0.5), (0.... | [
"torchvision.transforms.Normalize",
"torchvision.transforms.Resize",
"torchvision.transforms.RandomCrop",
"torchvision.transforms.ToTensor"
] | [((198, 235), 'torchvision.transforms.RandomCrop', 'transforms.RandomCrop', ([], {'size': 'load_size'}), '(size=load_size)\n', (219, 235), False, 'from torchvision import transforms\n'), ((248, 269), 'torchvision.transforms.ToTensor', 'transforms.ToTensor', ([], {}), '()\n', (267, 269), False, 'from torchvision import ... |
# Copyright (c) 2017 Sony Corporation. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | [
"nnabla.ext_utils.get_extension_context",
"nnabla.parametric_functions.binary_weight_affine",
"nnabla.get_parameters",
"nnabla.parametric_functions.batch_normalization",
"_checkpoint_nnp_util.load_checkpoint",
"os.path.join",
"nnabla.parametric_functions.binary_connect_affine",
"nnabla.parametric_func... | [((3426, 3455), 'nnabla.functions.average_pooling', 'F.average_pooling', (['c6', '(4, 4)'], {}), '(c6, (4, 4))\n', (3443, 3455), True, 'import nnabla.functions as F\n'), ((5874, 5903), 'nnabla.functions.average_pooling', 'F.average_pooling', (['c6', '(4, 4)'], {}), '(c6, (4, 4))\n', (5891, 5903), True, 'import nnabla.f... |
import numpy as np
import pandas as pd
from glob import glob
import matplotlib.pyplot as plt
'''
turbine-08_helihoist-1_tom_acc-vel-pos_hammerhead_2019-10-14-07-55-52_2019-10-15-06-10-33
turbine-08_helihoist-1_tom_geometry_hammerhead_2019-10-14-07-55-52_2019-10-15-06-10-33
turbine-08_sbitroot_tom_acc-vel-pos_hammerhea... | [
"pandas.read_csv",
"pandas.Timestamp.fromtimestamp",
"pandas.concat",
"glob.glob"
] | [((1910, 1951), 'pandas.read_csv', 'pd.read_csv', (['hammerhead[0]'], {'delimiter': '""","""'}), "(hammerhead[0], delimiter=',')\n", (1921, 1951), True, 'import pandas as pd\n'), ((1981, 2022), 'pandas.read_csv', 'pd.read_csv', (['hammerhead[1]'], {'delimiter': '""","""'}), "(hammerhead[1], delimiter=',')\n", (1992, 20... |
import numpy as np
from eb_gridmaker import dtb, config
from eb_gridmaker.utils import aux, multiproc
from elisa import SingleSystem, BinarySystem, Observer, settings
from elisa.base.error import LimbDarkeningError, AtmosphereError, MorphologyError
def spotty_single_system_random_sampling(db_name=None, number_of_sam... | [
"eb_gridmaker.dtb.insert_observation",
"eb_gridmaker.dtb.search_for_breakpoint",
"numpy.random.seed",
"eb_gridmaker.utils.aux.draw_single_star_params",
"eb_gridmaker.utils.aux.assign_eccentric_system_params",
"eb_gridmaker.utils.aux.draw_inclination",
"elisa.SingleSystem.from_json",
"eb_gridmaker.util... | [((604, 660), 'numpy.linspace', 'np.linspace', (['(0)', '(1.0)'], {'num': 'config.N_POINTS', 'endpoint': '(False)'}), '(0, 1.0, num=config.N_POINTS, endpoint=False)\n', (615, 660), True, 'import numpy as np\n'), ((722, 767), 'numpy.arange', 'np.arange', (['(0)', 'number_of_samples'], {'dtype': 'np.int'}), '(0, number_o... |
from urllib.parse import urlparse
from django.http import Http404
from django.urls import resolve
class Referer:
"""
Wrapper for http referer information
"""
def __init__(self, current_path, referer_path):
self.current_path = current_path
self.referer_path = referer_path
self... | [
"urllib.parse.urlparse"
] | [((595, 609), 'urllib.parse.urlparse', 'urlparse', (['path'], {}), '(path)\n', (603, 609), False, 'from urllib.parse import urlparse\n')] |
import pygame
from src.weapons.data.weapon import WeaponData
from src.terrain import Terrain
from typing import Tuple
class Weapon(pygame.sprite.Sprite):
def __init__(
self, weapon_type: WeaponData,
pos: Tuple[int, int],
bounds: pygame.Rect, terrain: Terrain
):
"""Initia... | [
"pygame.transform.flip",
"pygame.Rect",
"pygame.transform.scale",
"pygame.sprite.Sprite.__init__",
"pygame.mixer.Sound"
] | [((486, 521), 'pygame.sprite.Sprite.__init__', 'pygame.sprite.Sprite.__init__', (['self'], {}), '(self)\n', (515, 521), False, 'import pygame\n'), ((623, 665), 'pygame.Rect', 'pygame.Rect', (['(0, 0)', 'self.weapon_type.size'], {}), '((0, 0), self.weapon_type.size)\n', (634, 665), False, 'import pygame\n'), ((902, 951)... |
""" CNN cell for architecture search """
import torch
import torch.nn as nn
from models import ops
class SearchCell(nn.Module):
"""
Cell for search
Each edge is mixed and continuous relaxed.
The cell is also simplified.
"""
def __init__(self, n_nodes, C_p, C, bn_momentum):
"""
... | [
"models.ops.StdConv",
"models.ops.MixedOp",
"torch.cat",
"torch.nn.ModuleList"
] | [((534, 601), 'models.ops.StdConv', 'ops.StdConv', (['C_p', 'C', '(1)', '(1)', '(0)'], {'affine': '(False)', 'bn_momentum': 'bn_momentum'}), '(C_p, C, 1, 1, 0, affine=False, bn_momentum=bn_momentum)\n', (545, 601), False, 'from models import ops\n'), ((645, 660), 'torch.nn.ModuleList', 'nn.ModuleList', ([], {}), '()\n'... |
from typing import TypeVar, Generic, Optional
from typing import Union
import numpy as np
import torch
from PIL.Image import Image as Img
T = TypeVar('T')
class Closure(Generic[T]):
def __init__(self):
self.value: Optional[T] = None
def shape(tensor: Union[Img, torch.Tensor, np.ndarray]) -> str:
i... | [
"typing.TypeVar"
] | [((144, 156), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (151, 156), False, 'from typing import TypeVar, Generic, Optional\n')] |
import xml.etree.ElementTree as etree
import ast
class Record(object):
pass
class Settings(object):
def __init__(self, filename):
self.filename = filename
try:
self._xml = etree.parse(self.filename)
self._root = self._xml.getroot()
self._parseContent(self... | [
"ast.literal_eval",
"xml.etree.ElementTree.parse"
] | [((213, 239), 'xml.etree.ElementTree.parse', 'etree.parse', (['self.filename'], {}), '(self.filename)\n', (224, 239), True, 'import xml.etree.ElementTree as etree\n'), ((1912, 1935), 'ast.literal_eval', 'ast.literal_eval', (['value'], {}), '(value)\n', (1928, 1935), False, 'import ast\n')] |
from django.db import migrations, models
def raise_error(apps, schema_editor):
# Test operation in non-atomic migration is not wrapped in transaction
Publisher = apps.get_model('migrations', 'Publisher')
Publisher.objects.create(name='Test Publisher')
raise RuntimeError('Abort migration')
... | [
"django.db.migrations.RunPython",
"django.db.models.CharField",
"django.db.models.ForeignKey"
] | [((591, 624), 'django.db.migrations.RunPython', 'migrations.RunPython', (['raise_error'], {}), '(raise_error)\n', (611, 624), False, 'from django.db import migrations, models\n'), ((501, 551), 'django.db.models.CharField', 'models.CharField', ([], {'primary_key': '(True)', 'max_length': '(255)'}), '(primary_key=True, m... |
# -*- coding: utf-8 -*-
"""Management command to create DKIM keys."""
from __future__ import print_function, unicode_literals
import os
from django.core.management.base import BaseCommand
from django.utils.encoding import smart_text
from modoboa.lib import sysutils
from modoboa.parameters import tools as param_too... | [
"django.utils.encoding.smart_text",
"modoboa.parameters.tools.get_global_parameter"
] | [((538, 595), 'modoboa.parameters.tools.get_global_parameter', 'param_tools.get_global_parameter', (['"""dkim_keys_storage_dir"""'], {}), "('dkim_keys_storage_dir')\n", (570, 595), True, 'from modoboa.parameters import tools as param_tools\n'), ((1787, 1846), 'modoboa.parameters.tools.get_global_parameter', 'param_tool... |
#!/usr/bin/env python3
"""
This module should introduce you to basic plotting routines
using matplotlib.
We will be plotting quadratic equations since we already
have a module to calculate them.
"""
# Matplotlib is a module with routines to
# plot data and display them on the screen or save them to files.
# The prima... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.axvline",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.legend",
"numpy.arange",
"quad_class.quadratic_Equation",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((1449, 1482), 'numpy.arange', 'np.arange', (['xlim[0]', 'xlim[1]', '(0.01)'], {}), '(xlim[0], xlim[1], 0.01)\n', (1458, 1482), True, 'import numpy as np\n'), ((1785, 1809), 'matplotlib.pyplot.plot', 'plt.plot', (['x_vals', 'y_vals'], {}), '(x_vals, y_vals)\n', (1793, 1809), True, 'import matplotlib.pyplot as plt\n'),... |
from selenium import webdriver
from selenium.webdriver.common.by import By
from configparser import ConfigParser
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriv... | [
"selenium.webdriver.support.expected_conditions.element_to_be_clickable",
"selenium.webdriver.Firefox",
"selenium.webdriver.common.action_chains.ActionChains",
"selenium.webdriver.support.expected_conditions.visibility_of_element_located",
"time.sleep",
"configparser.ConfigParser",
"selenium.webdriver.s... | [((440, 459), 'selenium.webdriver.Firefox', 'webdriver.Firefox', ([], {}), '()\n', (457, 459), False, 'from selenium import webdriver\n'), ((734, 763), 'selenium.webdriver.support.ui.WebDriverWait', 'WebDriverWait', (['self.driver', '(6)'], {}), '(self.driver, 6)\n', (747, 763), False, 'from selenium.webdriver.support.... |
import json
import logging
from thrift.Thrift import TException, TApplicationException
from EOSS.vassar.api import VASSARClient
from EOSS.data import problem_specific
from daphne_context.models import UserInformation
logger = logging.getLogger('EOSS.engineer')
def get_architecture_scores(design_id, designs, contex... | [
"EOSS.vassar.api.VASSARClient",
"EOSS.data.problem_specific.get_capabilities_sheet",
"EOSS.data.problem_specific.get_requirements_sheet",
"EOSS.data.problem_specific.get_instrument_sheet",
"logging.getLogger"
] | [((229, 263), 'logging.getLogger', 'logging.getLogger', (['"""EOSS.engineer"""'], {}), "('EOSS.engineer')\n", (246, 263), False, 'import logging\n'), ((381, 399), 'EOSS.vassar.api.VASSARClient', 'VASSARClient', (['port'], {}), '(port)\n', (393, 399), False, 'from EOSS.vassar.api import VASSARClient\n'), ((1057, 1075), ... |
'''
Joins multiple tsv files and clades into single dataframe.
Inputs are:
--clades (json)
--data (list of tsv files
--source, source tsv is from
--metadata
--output
'''
import argparse
import json
import pandas as pd
def make_df(data, source):
'''
Combines multiple data tsv files into one dat... | [
"pandas.DataFrame",
"json.load",
"pandas.read_csv",
"argparse.ArgumentParser"
] | [((346, 360), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (358, 360), True, 'import pandas as pd\n'), ((983, 1014), 'pandas.read_csv', 'pd.read_csv', (['metadata'], {'sep': '"""\t"""'}), "(metadata, sep='\\t')\n", (994, 1014), True, 'import pandas as pd\n'), ((1241, 1368), 'argparse.ArgumentParser', 'argparse... |
# Generated by Django 2.2.7 on 2020-02-12 12:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('songs', '0003_auto_20200107_0103'),
]
operations = [
migrations.AlterField(
model_name='song',
name='artist',
... | [
"django.db.models.CharField",
"django.db.models.IntegerField"
] | [((332, 387), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'max_length': '(255)', 'null': '(True)'}), '(blank=True, max_length=255, null=True)\n', (348, 387), False, 'from django.db import migrations, models\n'), ((505, 560), 'django.db.models.CharField', 'models.CharField', ([], {'blank':... |
import os
import dataclasses
import docutils.parsers.rst
import docutils.statemachine
import docutils.nodes
import sphinx.addnodes
import sphinx.util.docutils
import sphinx.util.nodes
from sphinx_a4doc.settings import GrammarType, OrderSettings, GroupingSettings, EndClass
from sphinx_a4doc.settings import global_names... | [
"sphinx_a4doc.model.reachable_finder.find_reachable_rules",
"sphinx_a4doc.model.model.ModelCache.instance",
"sphinx_a4doc.settings.autogrammar_namespace.for_directive",
"os.path.join",
"sphinx_a4doc.settings.autorule_namespace.for_directive",
"sphinx_a4doc.model.model_renderer.cc_to_dash",
"sphinx_a4doc... | [((4078, 4115), 'sphinx_a4doc.settings.autogrammar_namespace.for_directive', 'autogrammar_namespace.for_directive', ([], {}), '()\n', (4113, 4115), False, 'from sphinx_a4doc.settings import global_namespace, autogrammar_namespace, autorule_namespace\n'), ((14609, 14643), 'sphinx_a4doc.settings.autorule_namespace.for_di... |
import json
import os
import platform
import textwrap
import pytest
from conan.tools.cmake.presets import load_cmake_presets
from conan.tools.microsoft.visual import vcvars_command
from conans.client.tools import replace_in_file
from conans.model.ref import ConanFileReference
from conans.test.assets.cmake import gen_... | [
"textwrap.dedent",
"conans.test.assets.genconanfile.GenConanfile",
"conans.util.files.load",
"conans.model.ref.ConanFileReference.loads",
"conans.test.utils.tools.TurboTestClient",
"os.path.exists",
"conan.tools.microsoft.visual.vcvars_command",
"conans.util.files.rmdir",
"conans.test.assets.cmake.g... | [((582, 751), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""compiler, version, update, runtime"""', "[('msvc', '192', None, 'dynamic'), ('msvc', '192', '6', 'static'), ('msvc',\n '192', '8', 'static')]"], {}), "('compiler, version, update, runtime', [('msvc',\n '192', None, 'dynamic'), ('msvc', '192... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
########################################################################
#
# Copyright (c) 2016 Baidu.com, Inc. All Rights Reserved
#
########################################################################
"""
File: broadcast_manager.py
Author: haifeng(<EMAIL>)
Date: 2016... | [
"sys.path.append",
"threading.Thread",
"rospy.core.signal_shutdown",
"os.getpid",
"rospy.impl.registration.get_topic_manager",
"json.loads",
"json.dumps",
"time.sleep",
"os.environ.get",
"time.time",
"rospy.impl.participant.Participant",
"traceback.format_exc",
"rospy.impl.registration.get_n... | [((839, 872), 'os.environ.get', 'os.environ.get', (['"""LD_LIBRARY_PATH"""'], {}), "('LD_LIBRARY_PATH')\n", (853, 872), False, 'import os\n'), ((909, 934), 'sys.path.append', 'sys.path.append', (['sub_path'], {}), '(sub_path)\n', (924, 934), False, 'import sys\n'), ((2359, 2386), 'logging.getLogger', 'logging.getLogger... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
gnpy.core.request
=================
This module contains path request functionality.
This functionality allows the user to provide a JSON request
file in accordance with a Yang model for requesting path
computations and returns path results in terms of path
and feas... | [
"csv.writer",
"gnpy.core.info.create_input_spectral_information",
"networkx.dijkstra_path",
"numpy.mean",
"collections.namedtuple",
"gnpy.core.utils.lin2db",
"logging.getLogger"
] | [((959, 978), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (968, 978), False, 'from logging import getLogger, basicConfig, CRITICAL, DEBUG, INFO\n'), ((997, 1186), 'collections.namedtuple', 'namedtuple', (['"""RequestParams"""', "('request_id source destination trx_type' +\n ' trx_mode nodes... |
import pytest
from mock import Mock, MagicMock, patch
from dateutil.rrule import rrule, DAILY
import datetime
import trellostats
from trellostats import TrelloStats
from trellostats.settings import TOKEN_URL, LIST_URL, BOARD_URL
from trellostats.trellostats import TrelloStatsException
from requests.exceptions import ... | [
"trellostats.TrelloStats",
"mock.patch",
"trellostats.settings.LIST_URL.format",
"pytest.raises",
"trellostats.settings.TOKEN_URL.format",
"trellostats.settings.BOARD_URL.format",
"mock.Mock",
"mock.MagicMock"
] | [((482, 524), 'mock.patch', 'patch', (['"""trellostats.TrelloStats.get_lists"""'], {}), "('trellostats.TrelloStats.get_lists')\n", (487, 524), False, 'from mock import Mock, MagicMock, patch\n'), ((747, 789), 'mock.patch', 'patch', (['"""trellostats.TrelloStats.get_lists"""'], {}), "('trellostats.TrelloStats.get_lists'... |
"""
----------------------------------------------------------------------
--- jumeg.jumeg_noise_reducer --------------------------------
----------------------------------------------------------------------
author : <NAME>
email : <EMAIL>
last update: 02.05.2019
version : 1.14
-----------------------... | [
"numpy.abs",
"numpy.polyfit",
"mne.pick_types",
"mne.io.Raw",
"numpy.allclose",
"mne.epochs._is_good",
"mne.find_events",
"matplotlib.pyplot.figure",
"numpy.linalg.svd",
"numpy.mean",
"numpy.arange",
"sys.stdout.flush",
"numpy.diag",
"builtins.range",
"mne.utils.logger.info",
"numpy.co... | [((4687, 4717), 'jumeg.jumeg_utils.get_files_from_list', 'get_files_from_list', (['fname_raw'], {}), '(fname_raw)\n', (4706, 4717), False, 'from jumeg.jumeg_utils import get_files_from_list\n'), ((5704, 5755), 'matplotlib.pyplot.figure', 'plt.figure', (['"""denoising"""'], {'figsize': '(16, 6 * n_xplots)'}), "('denoisi... |
import argparse
import os
import logging
import string
import sys
import json
import numpy as np
import pandas as pd
import tensorflow as tf
from sqlalchemy import create_engine
from .alphabet import ALPHABET_DNA
from .model import (
conv1d_densenet_regression_model,
compile_regression_model,
Denormalized... | [
"json.load",
"argparse.ArgumentParser",
"logging.basicConfig",
"os.makedirs",
"os.getcwd",
"numpy.random.randint",
"sqlalchemy.create_engine",
"sys.exit",
"tensorflow.keras.callbacks.TensorBoard",
"os.path.join",
"logging.getLogger"
] | [((677, 704), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (694, 704), False, 'import logging\n'), ((723, 817), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': '"""%(asctime)s (%(levelname)s) %(message)s"""'}), "(level=logging.INFO, format=\n '%... |
import numpy
import xraylib
def transfocator_guess_configuration(focal_f_target, deltas=[0.999998], radii=[500e-4],
initial_focal_distance=None, verbose=0):
nn = len(radii)
ncombinations = 2**nn
Farray = numpy.zeros(ncombinations)
# Rarray = numpy.zeros(ncombina... | [
"numpy.binary_repr",
"numpy.zeros_like",
"numpy.abs",
"numpy.zeros",
"numpy.max",
"numpy.array",
"numpy.linspace",
"srxraylib.plot.gol.set_qt",
"srxraylib.plot.gol.plot",
"xraylib.Refractive_Index_Re"
] | [((258, 284), 'numpy.zeros', 'numpy.zeros', (['ncombinations'], {}), '(ncombinations)\n', (269, 284), False, 'import numpy\n'), ((2747, 2772), 'numpy.linspace', 'numpy.linspace', (['(2)', '(85)', '(50)'], {}), '(2, 85, 50)\n', (2761, 2772), False, 'import numpy\n'), ((3063, 3082), 'numpy.array', 'numpy.array', (['[42.2... |
#!usr/bin/env python
# -*- coding: utf-8 -*-
import os, argparse
from simple_file_user.File import File
from importlib import import_module, invalidate_caches
from . import testRunner
class Lens:
def __init__(self, testNames: list, functionsNames: list, resultsAndIterations: list) -> None:
self.testLen = m... | [
"os.path.abspath",
"importlib.invalidate_caches",
"argparse.ArgumentParser",
"importlib.import_module",
"os.path.dirname",
"simple_file_user.File.File",
"os.path.splitext",
"os.path.split",
"os.path.join",
"os.listdir"
] | [((4681, 4774), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Program for testing python modules."""', 'prog': '"""tester"""'}), "(description='Program for testing python modules.',\n prog='tester')\n", (4704, 4774), False, 'import os, argparse\n'), ((1245, 1274), 'os.path.abspath', ... |
from pathlib import Path
import os
from PIL import Image, ImageDraw
import nml
SPRITE_SIZE = (20, 45)
NUMBERS_SHEET = Image.open('numbers.png')
NUMBERS = [NUMBERS_SHEET.crop((i * 11, 0, i * 11 + 11, 11)) for i in range(20)]
NUMBERS_MASK = [Image.eval(img, (lambda a: 255 if a == 1 else 1)).convert('1') for img in NUMB... | [
"nml.SpriteSheet",
"PIL.Image.open",
"pathlib.Path",
"PIL.ImageDraw.Draw",
"os.chdir",
"PIL.Image.eval"
] | [((120, 145), 'PIL.Image.open', 'Image.open', (['"""numbers.png"""'], {}), "('numbers.png')\n", (130, 145), False, 'from PIL import Image, ImageDraw\n'), ((2237, 2250), 'pathlib.Path', 'Path', (['"""build"""'], {}), "('build')\n", (2241, 2250), False, 'from pathlib import Path\n'), ((2296, 2315), 'os.chdir', 'os.chdir'... |
"""1-100随机数字,猜数字游戏
程序产生 1 个,1 到 100 之间的随机数。
让玩家重复猜测,直到猜对为止。
每次提示:大了、小了、恭喜猜对了,总共猜了多少次。
效果:
请输入要猜的数字:50
大了
请输入要猜的数字:25
小了
请输入要猜的数字:35
大了
请输入要猜的数字:30
小了
请输入要猜的数字:32
恭喜猜对啦,总共猜了 5 次"""
sum=0
import random
number= random.randint (1,100)
while sum<8:
n1=int(input("请输入数字:"))
sum += 1
if number<n1:
print("大了... | [
"random.randint"
] | [((208, 230), 'random.randint', 'random.randint', (['(1)', '(100)'], {}), '(1, 100)\n', (222, 230), False, 'import random\n')] |
import RPi.GPIO as GPIO
from time import sleep
#GPIO.setmode(GPIO.BOARD)
class GpioMotor():
def __init__(self, in1,in2,en,freq=50,duty=100):
self.in1=in1
self.in2=in2
self.en=en
self.freq = freq
self.duty = duty
GPIO.setup(self.in1, GPIO.OUT)
GPIO.setup(self.in2, GPIO.OUT)
GPIO... | [
"RPi.GPIO.setup",
"RPi.GPIO.output",
"RPi.GPIO.PWM"
] | [((246, 276), 'RPi.GPIO.setup', 'GPIO.setup', (['self.in1', 'GPIO.OUT'], {}), '(self.in1, GPIO.OUT)\n', (256, 276), True, 'import RPi.GPIO as GPIO\n'), ((281, 311), 'RPi.GPIO.setup', 'GPIO.setup', (['self.in2', 'GPIO.OUT'], {}), '(self.in2, GPIO.OUT)\n', (291, 311), True, 'import RPi.GPIO as GPIO\n'), ((316, 345), 'RPi... |