code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import typer
import deciphon_cli.data as data
__all__ = ["app"]
app = typer.Typer()
@app.command()
def default():
typer.echo(data.env_example_content(), nl=False)
| [
"deciphon_cli.data.env_example_content",
"typer.Typer"
] | [((73, 86), 'typer.Typer', 'typer.Typer', ([], {}), '()\n', (84, 86), False, 'import typer\n'), ((134, 160), 'deciphon_cli.data.env_example_content', 'data.env_example_content', ([], {}), '()\n', (158, 160), True, 'import deciphon_cli.data as data\n')] |
import olll
import numpy as np
test1 = [[1,0,0,1,1,0,1],[0,1,0,5,0,0,0],[0,0,1,0,5,0,5]]
test2 = [[1,0,0,2,-1,1],[0,1,0,3,-4,-2],[0,0,1,5,-10,-8]]
test3 = [[1,0,0,1,1,0,1], [0,1,0,4,-1,0,-1], [0,0,1,1,1,0,1]]
test4 = [[1,0,0,2,5,3],[0,1,0,1,1,1,],[0,0,1,4,-2,0]]
test5 = [[1,0,0,0,0,0,2,1,1,2],[0,1,0,0,0,0,1,1,-1,-1],[... | [
"numpy.identity",
"olll.reduction"
] | [((787, 801), 'numpy.identity', 'np.identity', (['k'], {}), '(k)\n', (798, 801), True, 'import numpy as np\n'), ((1169, 1196), 'olll.reduction', 'olll.reduction', (['test7', '(0.75)'], {}), '(test7, 0.75)\n', (1183, 1196), False, 'import olll\n')] |
from __future__ import annotations
import logging
from typing import Any
from homeassistant.components.integration.sensor import (
TRAPEZOIDAL_METHOD,
IntegrationSensor,
)
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
from homeassistant.const import CONF_NAME, TIME_HOURS
from homeassista... | [
"logging.getLogger",
"custom_components.powercalc.migrate.async_migrate_entity_id"
] | [((818, 845), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (835, 845), False, 'import logging\n'), ((1542, 1603), 'custom_components.powercalc.migrate.async_migrate_entity_id', 'async_migrate_entity_id', (['hass', '"""sensor"""', 'unique_id', 'entity_id'], {}), "(hass, 'sensor', unique_... |
import numpy as np
import matplotlib.pyplot as plt
import ipywidgets
from mesostat.utils.opencv_helper import cvWriter
from mesostat.utils.arrays import numpy_merge_dimensions
from sklearn.decomposition import PCA
def distance_matrix(data):
nDim, nTime = data.shape
dataExtr = np.repeat(data[..., None], nTime... | [
"numpy.repeat",
"sklearn.decomposition.PCA",
"numpy.linalg.norm",
"numpy.zeros",
"mesostat.utils.opencv_helper.cvWriter",
"ipywidgets.interact",
"numpy.std",
"numpy.percentile",
"mesostat.utils.arrays.numpy_merge_dimensions",
"matplotlib.pyplot.subplots"
] | [((288, 329), 'numpy.repeat', 'np.repeat', (['data[..., None]', 'nTime'], {'axis': '(2)'}), '(data[..., None], nTime, axis=2)\n', (297, 329), True, 'import numpy as np\n'), ((392, 421), 'numpy.linalg.norm', 'np.linalg.norm', (['delta'], {'axis': '(0)'}), '(delta, axis=0)\n', (406, 421), True, 'import numpy as np\n'), (... |
import sys
import os
import numpy as np
import scipy.io as sio
import random
from decimal import Decimal
import argparse
import csv
from keras.models import load_model
import f_model
from f_preprocess import fill_length
# Usage: python rematch_challenge.py test_file_path
def arg_parse():
"""
Parse arguements... | [
"f_preprocess.fill_length",
"os.listdir",
"argparse.ArgumentParser",
"csv.writer",
"numpy.asarray",
"scipy.io.loadmat",
"numpy.empty",
"f_model.build_model_01"
] | [((343, 409), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Rematch test of ECG Contest"""'}), "(description='Rematch test of ECG Contest')\n", (366, 409), False, 'import argparse\n'), ((1293, 1354), 'f_model.build_model_01', 'f_model.build_model_01', ([], {'num_classes': '(10)', 'len_t... |
#!/usr/bin/env python
# coding=utf-8
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
... | [
"datetime.datetime.strptime",
"datetime.date.today",
"argparse.ArgumentParser",
"datetime.timedelta"
] | [((1746, 1838), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Get Constraint Payment information for yesterday"""'}), "(description=\n 'Get Constraint Payment information for yesterday')\n", (1769, 1838), False, 'import argparse\n'), ((1673, 1711), 'datetime.datetime.strptime', 'date... |
"""Run a minimal bot."""
import nonebot
from nonebot.adapters.cqhttp import Bot
nonebot.init()
app = nonebot.get_asgi()
driver = nonebot.get_driver()
driver.register_adapter("cqhttp", Bot)
nonebot.load_builtin_plugins()
nonebot.load_plugins("nonebot_plugin_guess")
if __name__ == "__main__":
# nonebot.run()
... | [
"nonebot.run",
"nonebot.load_builtin_plugins",
"nonebot.get_driver",
"nonebot.load_plugins",
"nonebot.get_asgi",
"nonebot.init"
] | [((81, 95), 'nonebot.init', 'nonebot.init', ([], {}), '()\n', (93, 95), False, 'import nonebot\n'), ((102, 120), 'nonebot.get_asgi', 'nonebot.get_asgi', ([], {}), '()\n', (118, 120), False, 'import nonebot\n'), ((131, 151), 'nonebot.get_driver', 'nonebot.get_driver', ([], {}), '()\n', (149, 151), False, 'import nonebot... |
from lib.appController import driver_queue
from lib.pyapp import Pyapp
import threading
# driver 多线程运行是进行线程之间的数据隔离
local = threading.local()
# 配置在实例化时,去mq中获取创建好的driver,如果调试page则需要传递driver
class BasePage(object):
def __init__(self, driver=None):
if driver is None:
local.driver = driver_queue.g... | [
"threading.local",
"lib.pyapp.Pyapp",
"lib.appController.driver_queue.get"
] | [((124, 141), 'threading.local', 'threading.local', ([], {}), '()\n', (139, 141), False, 'import threading\n'), ((306, 324), 'lib.appController.driver_queue.get', 'driver_queue.get', ([], {}), '()\n', (322, 324), False, 'from lib.appController import driver_queue\n'), ((351, 370), 'lib.pyapp.Pyapp', 'Pyapp', (['local.d... |
from NoviCypher import FileCypher
from os import path
import sys
Version = '1.0.0b'
def encode(p, r, k, c):
print(f"encoding {p}\nrows={r}\nkey={k}\nchunk={c}")
FileCypher(p, rows=r, chunk=c, key=k)
input()
def decode(p, k):
print(f"Decoding {p}\nkey={k}")
if not FileCypher.decrypt_file(p, k):
input()
ar... | [
"os.path.exists",
"NoviCypher.FileCypher.decrypt_file",
"os.path.splitext",
"os.path.isfile",
"os.path.isdir",
"NoviCypher.FileCypher"
] | [((588, 602), 'os.path.isfile', 'path.isfile', (['a'], {}), '(a)\n', (599, 602), False, 'from os import path\n'), ((167, 204), 'NoviCypher.FileCypher', 'FileCypher', (['p'], {'rows': 'r', 'chunk': 'c', 'key': 'k'}), '(p, rows=r, chunk=c, key=k)\n', (177, 204), False, 'from NoviCypher import FileCypher\n'), ((505, 519),... |
from typing import List
import cv2
from fellbeast.bounding_box import BoundingBox
from fellbeast.configurations import CHECK_FOR_NEW_FACE_FREQUENCY
from fellbeast.utils import get_closest_coordinate
OPENCV_OBJECT_TRACKERS = {
"csrt": cv2.TrackerCSRT_create,
"kcf": cv2.TrackerKCF_create,
"boosting": cv2.T... | [
"fellbeast.utils.get_closest_coordinate",
"cv2.MultiTracker_create",
"cv2.TrackerCSRT_create"
] | [((786, 810), 'cv2.TrackerCSRT_create', 'cv2.TrackerCSRT_create', ([], {}), '()\n', (808, 810), False, 'import cv2\n'), ((1501, 1526), 'cv2.MultiTracker_create', 'cv2.MultiTracker_create', ([], {}), '()\n', (1524, 1526), False, 'import cv2\n'), ((3766, 3844), 'fellbeast.utils.get_closest_coordinate', 'get_closest_coord... |
"""Views for Zinnia channels"""
from django.views.generic.list import ListView
from zinnia.models.entry import Entry
from zinnia.settings import PAGINATION
class EntryChannel(ListView):
"""View for displaying a custom selection of entries
based on a search pattern, useful for SEO/SMO pages"""
query = ''
... | [
"zinnia.models.entry.Entry.published.search"
] | [((457, 491), 'zinnia.models.entry.Entry.published.search', 'Entry.published.search', (['self.query'], {}), '(self.query)\n', (479, 491), False, 'from zinnia.models.entry import Entry\n')] |
from bge import logic, events, render
from mathutils import Vector
class mouseScroll:
def __init__ (self, cont):
#get Dependencies
self.cont = cont
self.camera = cont.owner
self.mouse = logic.mouse
x = render.getWindowWidth()//2
y = render.get... | [
"bge.render.showMouse",
"bge.render.getWindowHeight",
"bge.render.setMousePosition",
"bge.render.getWindowWidth"
] | [((382, 419), 'bge.render.setMousePosition', 'render.setMousePosition', (['(x + 1)', '(y + 1)'], {}), '(x + 1, y + 1)\n', (405, 419), False, 'from bge import logic, events, render\n'), ((448, 467), 'bge.render.showMouse', 'render.showMouse', (['(1)'], {}), '(1)\n', (464, 467), False, 'from bge import logic, events, ren... |
# Copyright 2020 The Magenta Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | [
"tensorflow.compat.v1.one_hot",
"tensor2tensor.layers.common_layers.length_from_embedding",
"tensorflow.compat.v1.exp",
"tensor2tensor.layers.common_layers.shape_list",
"tensorflow.compat.v1.maximum",
"tensorflow.compat.v1.concat",
"tensorflow.compat.v1.zeros",
"tensorflow.compat.v1.nn.rnn_cell.MultiR... | [((27888, 27918), 'tensor2tensor.layers.common_hparams.basic_params1', 'common_hparams.basic_params1', ([], {}), '()\n', (27916, 27918), False, 'from tensor2tensor.layers import common_hparams\n'), ((1819, 1867), 'tensorflow.compat.v1.reshape', 'tf.reshape', (["features['targets']", '[-1, 64, 64, 1]'], {}), "(features[... |
import csv
import numpy as np
import time
from pathlib import Path
from Panalyzer.utils.wr_extractor import wr_extractor
from Panalyzer.TraceParser.logic_masking import *
def arm32buffered_csv2np(fcsv, buffersize, num_reg):
detailded_info = {'wr': None, 'regval': None, 'tick': None, 'masking': None, ... | [
"pathlib.Path",
"Panalyzer.utils.wr_extractor.wr_extractor",
"time.perf_counter",
"numpy.zeros",
"numpy.full",
"csv.reader"
] | [((402, 440), 'numpy.zeros', 'np.zeros', (['[buffersize]'], {'dtype': 'np.int64'}), '([buffersize], dtype=np.int64)\n', (410, 440), True, 'import numpy as np\n'), ((456, 508), 'numpy.full', 'np.full', (['[num_reg, 2, buffersize]', '(False)'], {'dtype': 'bool'}), '([num_reg, 2, buffersize], False, dtype=bool)\n', (463, ... |
"""
define model for gp
"""
# from threading import Thread
# from queue import Queue
from multiprocessing import Pool
from random import random, randint
from math import floor
import operator
from autoprover.gp.gene import Gene
from autoprover.gp.rule import GeneRule
from autoprover.gp.action import GeneAction
from aut... | [
"math.floor",
"autoprover.gp.gene.Gene",
"multiprocessing.Pool",
"autoprover.gp.rule.GeneRule",
"operator.itemgetter",
"random.random",
"random.randint"
] | [((8178, 8209), 'autoprover.gp.gene.Gene', 'Gene', ([], {'chromosome': 'new_chromosome'}), '(chromosome=new_chromosome)\n', (8182, 8209), False, 'from autoprover.gp.gene import Gene\n'), ((14306, 14325), 'random.randint', 'randint', (['begin', 'end'], {}), '(begin, end)\n', (14313, 14325), False, 'from random import ra... |
import sys
sys.exit(1)
| [
"sys.exit"
] | [((12, 23), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (20, 23), False, 'import sys\n')] |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-11-26 10:42
from __future__ import unicode_literals
from django.db import migrations, models
import jsonfield.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(... | [
"django.db.models.TextField",
"django.db.models.BooleanField",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((393, 486), '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", (409, 486), False, 'from django.db import migrations, models\... |
"""
Markdownreveal local module tests.
"""
import json
import time
from hashlib import sha1
from pathlib import Path
from shutil import rmtree
from tarfile import TarInfo
from tempfile import mkdtemp
import pytest
from markdownreveal.local import clean_tar_members
from markdownreveal.local import initialize_localdir
f... | [
"markdownreveal.local.clean_tar_members",
"markdownreveal.local.initialize_localdir",
"tempfile.mkdtemp",
"markdownreveal.local.latest_project_release",
"time.time",
"tarfile.TarInfo"
] | [((518, 568), 'markdownreveal.local.latest_project_release', 'latest_project_release', ([], {'github': '"""hakimel/reveal.js"""'}), "(github='hakimel/reveal.js')\n", (540, 568), False, 'from markdownreveal.local import latest_project_release\n'), ((717, 760), 'markdownreveal.local.latest_project_release', 'latest_proje... |
from models.MultiGMPmodel import MultiCopyGMPmodel
from models.MultiGGHPmodel import MultiCopyGGHPmodel
from util.calculatedCRBrateAndEstimationAccuracy import calculatedCRBrateAndEstimationAccuracy
from util.cutCircularChromosomes import cutCircularChromosomes
"""
Inferring ancestor species for Gramineae species.
An... | [
"util.calculatedCRBrateAndEstimationAccuracy.calculatedCRBrateAndEstimationAccuracy",
"models.MultiGMPmodel.MultiCopyGMPmodel",
"models.MultiGGHPmodel.MultiCopyGGHPmodel"
] | [((1094, 1246), 'models.MultiGGHPmodel.MultiCopyGGHPmodel', 'MultiCopyGGHPmodel', (['dup_child_file', 'outgroup_file', 'outAncestor4dir', 'ancestor_name', 'dup_copy_number', 'out_copy_number', 'ancestor_target_copy_number'], {}), '(dup_child_file, outgroup_file, outAncestor4dir,\n ancestor_name, dup_copy_number, out... |
from django.conf.urls import url
import views
urlpatterns = [
url(r'^user/', views.get_user, name='user'),
url(r'^all/', views.get_all, name='all'),
url(r'^fix/$', views.get_fix, name='fix'),
]
| [
"django.conf.urls.url"
] | [((67, 109), 'django.conf.urls.url', 'url', (['"""^user/"""', 'views.get_user'], {'name': '"""user"""'}), "('^user/', views.get_user, name='user')\n", (70, 109), False, 'from django.conf.urls import url\n'), ((116, 155), 'django.conf.urls.url', 'url', (['"""^all/"""', 'views.get_all'], {'name': '"""all"""'}), "('^all/'... |
import os
import argparse
import json
import tqdm
import numpy as np
from program_synthesis.datasets import dataset, executor
parser = argparse.ArgumentParser()
parser.add_argument("--data-pickle", default='data/karel/val.pkl')
parser.add_argument("--input-file", required=True, help="file containing list of beams,... | [
"os.path.exists",
"program_synthesis.datasets.executor.KarelExecutor",
"argparse.ArgumentParser",
"program_synthesis.datasets.dataset.KarelTorchDataset",
"tqdm.tqdm",
"program_synthesis.datasets.executor.evaluate_code",
"json.load",
"json.dump"
] | [((140, 165), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (163, 165), False, 'import argparse\n'), ((558, 614), 'program_synthesis.datasets.dataset.KarelTorchDataset', 'dataset.KarelTorchDataset', (['args.data_pickle', '(lambda x: x)'], {}), '(args.data_pickle, lambda x: x)\n', (583, 614), F... |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from contrib.cluster_telemetry import ct_benchmarks_util
from contrib.cluster_telemetry import page_set
from contrib.cluster_telemetry import repaint_helpers... | [
"contrib.cluster_telemetry.ct_benchmarks_util.ValidateCommandLineArgs",
"contrib.cluster_telemetry.page_set.CTPageSet",
"benchmarks.rasterize_and_record_micro._RasterizeAndRecordMicro.AddBenchmarkCommandLineArgs",
"contrib.cluster_telemetry.ct_benchmarks_util.AddBenchmarkCommandLineArgs"
] | [((718, 810), 'benchmarks.rasterize_and_record_micro._RasterizeAndRecordMicro.AddBenchmarkCommandLineArgs', 'rasterize_and_record_micro._RasterizeAndRecordMicro.AddBenchmarkCommandLineArgs', (['parser'], {}), '(\n parser)\n', (797, 810), False, 'from benchmarks import rasterize_and_record_micro\n'), ((820, 874), 'co... |
import queue
ROOM_ENTERED = 'roomEntered'
class Event:
def __init__(self, eventType='', userParam=dict()):
self.type = eventType
self.userParam = userParam
class EventSystem:
def __init__(self):
self._eventQueue = queue.Queue()
self._eventHandlers = dict()
def registerE... | [
"queue.Queue"
] | [((251, 264), 'queue.Queue', 'queue.Queue', ([], {}), '()\n', (262, 264), False, 'import queue\n')] |
import os
import FWCore.ParameterSet.Config as cms
process = cms.Process('TauDQMOffline')
process.load("FWCore.MessageLogger.MessageLogger_cfi")
process.MessageLogger.cerr.FwkReport.reportEvery = 1000
# import of standard configurations
from Configuration.StandardSequences.GeometryRecoDB_cff import *
process.load(... | [
"FWCore.ParameterSet.Config.untracked.string",
"FWCore.Modules.logErrorHarvester_cff.customiseLogErrorHarvesterUsingOutputCommands",
"FWCore.ParameterSet.Config.Source",
"FWCore.ParameterSet.Config.untracked.int32",
"FWCore.ParameterSet.Config.untracked.uint32",
"FWCore.ParameterSet.Config.Process",
"FW... | [((63, 91), 'FWCore.ParameterSet.Config.Process', 'cms.Process', (['"""TauDQMOffline"""'], {}), "('TauDQMOffline')\n", (74, 91), True, 'import FWCore.ParameterSet.Config as cms\n'), ((902, 925), 'FWCore.ParameterSet.Config.untracked.vstring', 'cms.untracked.vstring', ([], {}), '()\n', (923, 925), True, 'import FWCore.P... |
import os
import numpy as np
import tensorflow as tf
import tensorflow_addons as tfa
from loguru import logger
import config
from Train import train
from Model import EEGNet
class OptunaTrainer:
def __init__(self, checkpointPath, epochs, batchsize, logPath=None):
self.checkpointPath = checkpointPath
self.logpa... | [
"numpy.mean",
"numpy.median",
"loguru.logger.info",
"Train.train",
"os.path.dirname",
"numpy.array",
"Model.EEGNet"
] | [((1200, 1217), 'numpy.array', 'np.array', (['metrics'], {}), '(metrics)\n', (1208, 1217), True, 'import numpy as np\n'), ((1449, 1466), 'loguru.logger.info', 'logger.info', (['info'], {}), '(info)\n', (1460, 1466), False, 'from loguru import logger\n'), ((1469, 1494), 'loguru.logger.info', 'logger.info', (['trial.para... |
from PyQt5 import QtGui, QtWidgets, QtCore
class RoundPixmapStyle(QtWidgets.QProxyStyle):
def __init__(self, radius=10, *args, **kwargs):
super(RoundPixmapStyle, self).__init__(*args, **kwargs)
self._radius = radius
def drawItemPixmap(self, painter, rectangle, alignment, pixmap):
pain... | [
"PyQt5.QtGui.QBrush",
"PyQt5.QtGui.QPainter"
] | [((426, 445), 'PyQt5.QtGui.QPainter', 'QtGui.QPainter', (['pix'], {}), '(pix)\n', (440, 445), False, 'from PyQt5 import QtGui, QtWidgets, QtCore\n'), ((465, 485), 'PyQt5.QtGui.QBrush', 'QtGui.QBrush', (['pixmap'], {}), '(pixmap)\n', (477, 485), False, 'from PyQt5 import QtGui, QtWidgets, QtCore\n')] |
from qcodes import Instrument
try:
from spirack import D4_module
except ImportError:
raise ImportError(('The D4_module class could not be found. '
'Try installing it using pip install spirack'))
from functools import partial
class D4(Instrument):
"""
Qcodes driver for the D4 A... | [
"functools.partial",
"spirack.D4_module"
] | [((827, 854), 'spirack.D4_module', 'D4_module', (['spi_rack', 'module'], {}), '(spi_rack, module)\n', (836, 854), False, 'from spirack import D4_module\n'), ((1475, 1511), 'functools.partial', 'partial', (['self.d4.singleConversion', 'i'], {}), '(self.d4.singleConversion, i)\n', (1482, 1511), False, 'from functools imp... |
from typing import Optional
import yaml
from returns.result import Result, Success, Failure
from typistry.protos.invalid_object import InvalidObject, IgnorableObject
from typistry.protos.typed_dict import TypedDict
def safe_parse_yaml(file: str, include_file: bool = False, filter_type: Optional[str] = None) -> Resu... | [
"yaml.safe_load",
"typistry.protos.typed_dict.TypedDict",
"typistry.protos.invalid_object.IgnorableObject",
"typistry.protos.invalid_object.InvalidObject"
] | [((444, 466), 'yaml.safe_load', 'yaml.safe_load', (['stream'], {}), '(stream)\n', (458, 466), False, 'import yaml\n'), ((1603, 1661), 'typistry.protos.invalid_object.InvalidObject', 'InvalidObject', (['f"""Specified YAML does not exist: {e}"""', 'file'], {}), "(f'Specified YAML does not exist: {e}', file)\n", (1616, 16... |
from datetime import datetime
import logging
from bs4 import BeautifulSoup
from db.models import Victim
from net.proxy import Proxy
from .sitecrawler import SiteCrawler
import time
class Nefilim(SiteCrawler):
actor = "Nefilim"
def _handle_page(self, soup):
victim_list = soup.find_all("header", ... | [
"net.proxy.Proxy",
"time.sleep",
"datetime.datetime.utcnow"
] | [((1674, 1689), 'time.sleep', 'time.sleep', (['(1.0)'], {}), '(1.0)\n', (1684, 1689), False, 'import time\n'), ((1742, 1749), 'net.proxy.Proxy', 'Proxy', ([], {}), '()\n', (1747, 1749), False, 'from net.proxy import Proxy\n'), ((1511, 1528), 'datetime.datetime.utcnow', 'datetime.utcnow', ([], {}), '()\n', (1526, 1528),... |
import numpy
import sympy
from matplotlib import pyplot
from sympy.utilities.lambdify import lambdify
# Set the font family and size to use for Matplotlib figures.
pyplot.rcParams['font.family'] = 'serif'
pyplot.rcParams['font.size'] = 16
sympy.init_printing()
x, nu, t = sympy.symbols('x nu t')
phi = (sympy.exp(-(x ... | [
"sympy.utilities.lambdify.lambdify",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.clf",
"sympy.init_printing",
"sympy.symbols",
"numpy.linspace",
"matplotlib.pyplot.figure",
"sympy.exp",
"matplotlib.pyplot.ylim",... | [((241, 262), 'sympy.init_printing', 'sympy.init_printing', ([], {}), '()\n', (260, 262), False, 'import sympy\n'), ((275, 298), 'sympy.symbols', 'sympy.symbols', (['"""x nu t"""'], {}), "('x nu t')\n", (288, 298), False, 'import sympy\n'), ((496, 519), 'sympy.utilities.lambdify.lambdify', 'lambdify', (['(t, x, nu)', '... |
from django import forms
from django.forms import ModelForm
from .models import Category,Image, Location
class ImageForm(forms.ModelForm):
class Meta:
model = Image
fields = '__all__'
CATEGORIES =(
("1", "Cars"),
("2", "Food"),
("3", "Travel"),
("4", "Animals"),
("5", "N... | [
"django.forms.ImageField",
"django.forms.ChoiceField",
"django.forms.CharField"
] | [((398, 429), 'django.forms.ImageField', 'forms.ImageField', ([], {'required': '(True)'}), '(required=True)\n', (414, 429), False, 'from django import forms\n'), ((446, 476), 'django.forms.CharField', 'forms.CharField', ([], {'required': '(True)'}), '(required=True)\n', (461, 476), False, 'from django import forms\n'),... |
from .base import FunctionalTest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
class NewVisitorTest(FunctionalTest):
def test_can_start_a_list_and_retrieve_it_later(self):
self.browser.get(self.server_url)
self.assertIn("To-Do", self.browser.title)
header... | [
"selenium.webdriver.Firefox"
] | [((1226, 1245), 'selenium.webdriver.Firefox', 'webdriver.Firefox', ([], {}), '()\n', (1243, 1245), False, 'from selenium import webdriver\n')] |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"numpy.einsum",
"reservoir_nn.keras.rewiring.AdaptiveSparseReservoir",
"numpy.arange",
"numpy.random.RandomState",
"numpy.testing.assert_allclose",
"tensorflow.keras.optimizers.SGD",
"reservoir_nn.keras.rewiring.GlobalPolicy",
"reservoir_nn.keras.rewiring.MutationPolicy",
"numpy.testing.assert_array... | [((8276, 8291), 'absl.testing.absltest.main', 'absltest.main', ([], {}), '()\n', (8289, 8291), False, 'from absl.testing import absltest\n'), ((899, 917), 'tensorflow.constant', 'tf.constant', (['[1.0]'], {}), '([1.0])\n', (910, 917), True, 'import tensorflow as tf\n'), ((929, 997), 'reservoir_nn.keras.rewiring.Adaptiv... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import cv2
import numpy as np
from progress.bar import Bar
import torch
import math
import copy
from .base_debugger import BaseDebugger
from models.utils import _tranpose_and_gather_feat, _gather_feat
from mo... | [
"numpy.sqrt",
"models.decode._topk",
"models.utils._tranpose_and_gather_feat",
"numpy.ascontiguousarray",
"numpy.argsort",
"numpy.array",
"copy.copy",
"math.atan",
"numpy.partition",
"numpy.max",
"math.fabs",
"numpy.concatenate",
"numpy.arctan",
"torch.abs",
"torch.topk",
"numpy.argmax... | [((626, 641), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (639, 641), False, 'import torch\n'), ((5076, 5096), 'torch.device', 'torch.device', (['"""cuda"""'], {}), "('cuda')\n", (5088, 5096), False, 'import torch\n'), ((5178, 5198), 'torch.device', 'torch.device', (['"""cuda"""'], {}), "('cuda')\n", (5190, 519... |
import logbook
import pandas as pd
import zipline as zl
from datetime import datetime, timedelta
import pathlib
import azul
import numpy as np
from typing import List, Tuple
log = logbook.Logger('BasePriceManager')
class BasePriceManager(object):
def __init__(self, calendar_name='NYSE'):
self._calendar ... | [
"logbook.Logger",
"pandas.DataFrame",
"pathlib.Path",
"numpy.array",
"zipline.get_calendar",
"datetime.datetime.today",
"datetime.timedelta",
"pandas.concat"
] | [((181, 215), 'logbook.Logger', 'logbook.Logger', (['"""BasePriceManager"""'], {}), "('BasePriceManager')\n", (195, 215), False, 'import logbook\n'), ((322, 357), 'zipline.get_calendar', 'zl.get_calendar', ([], {'name': 'calendar_name'}), '(name=calendar_name)\n', (337, 357), True, 'import zipline as zl\n'), ((746, 780... |
from unittest import TestCase
from unittest import skip
from cs3api4lab.api.cs3_share_api import Cs3ShareApi
from cs3api4lab.api.cs3_file_api import Cs3FileApi
from cs3api4lab.config.config_manager import Cs3ConfigManager
from traitlets.config import LoggingConfigurable
class TestCs3ShareApi(TestCase, LoggingConfigur... | [
"cs3api4lab.config.config_manager.Cs3ConfigManager.get_config",
"cs3api4lab.api.cs3_share_api.Cs3ShareApi",
"cs3api4lab.api.cs3_file_api.Cs3FileApi"
] | [((784, 813), 'cs3api4lab.config.config_manager.Cs3ConfigManager.get_config', 'Cs3ConfigManager.get_config', ([], {}), '()\n', (811, 813), False, 'from cs3api4lab.config.config_manager import Cs3ConfigManager\n'), ((837, 857), 'cs3api4lab.api.cs3_file_api.Cs3FileApi', 'Cs3FileApi', (['self.log'], {}), '(self.log)\n', (... |
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 1 23:11:03 2019
@author: Relieak
"""
'''
DCARD 熱門前30文章搜尋
純用 BeautifulSoup 寫法
'''
from bs4 import BeautifulSoup
import requests
import re
url = "https://www.dcard.tw/f/"
html = requests.get(url)
html.encoding = "utf-8"
#print(html.text)
sp = BeautifulSoup(html.text... | [
"bs4.BeautifulSoup",
"requests.get",
"re.compile"
] | [((230, 247), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (242, 247), False, 'import requests\n'), ((297, 336), 'bs4.BeautifulSoup', 'BeautifulSoup', (['html.text', '"""html.parser"""'], {}), "(html.text, 'html.parser')\n", (310, 336), False, 'from bs4 import BeautifulSoup\n'), ((2656, 2676), 're.compile'... |
import random
import sys
print("")
print("4d6, drop lowest:")
print("")
def roll4d6():
global threshold
target_met = False
total = []
for attr in range(0,6):
result = []
raw = []
for roll in range(0,4):
dice = random.randint(1,6)
result.append(dice)
... | [
"random.randint"
] | [((265, 285), 'random.randint', 'random.randint', (['(1)', '(6)'], {}), '(1, 6)\n', (279, 285), False, 'import random\n')] |
from __future__ import print_function
import os
import os.path
from xml.etree import ElementTree
def read_machine_file():
"""
Reads the machine definition xml ROS launch file MCT_CONFIG/machine/mct.machine
Returns a list containg a dictionary of attributes for each machine in the
machine file.
... | [
"os.path.join",
"xml.etree.ElementTree.parse"
] | [((393, 447), 'os.path.join', 'os.path.join', (['mct_config_dir', '"""machine"""', '"""mct.machine"""'], {}), "(mct_config_dir, 'machine', 'mct.machine')\n", (405, 447), False, 'import os\n'), ((459, 494), 'xml.etree.ElementTree.parse', 'ElementTree.parse', (['mct_machine_file'], {}), '(mct_machine_file)\n', (476, 494)... |
#!/usr/local/python/bin/python
# script to check the previously unsolved files
#
# to do:
# Sanity check all the image_ids in the table actually have a png
# quick check shows 1349 in DB and 1353 pngs, 4 out, not bad
#
from create_movie import create_movie
import os,sys,getpass,time
import glob as g
from astropy.io... | [
"os.path.exists",
"pyds9.DS9",
"argparse.ArgumentParser",
"time.sleep",
"astropy.io.fits.open",
"os.chdir",
"create_movie.create_movie",
"collections.defaultdict",
"sys.exit",
"getpass.getuser",
"os.system",
"glob.glob"
] | [((408, 425), 'getpass.getuser', 'getpass.getuser', ([], {}), '()\n', (423, 425), False, 'import os, sys, getpass, time\n'), ((2255, 2270), 'os.chdir', 'os.chdir', (['w_dir'], {}), '(w_dir)\n', (2263, 2270), False, 'import os, sys, getpass, time\n'), ((692, 713), 'os.path.exists', 'os.path.exists', (['w_dir'], {}), '(w... |
from csv import DictReader
from os.path import dirname, join, exists
from os import makedirs, stat
from concurrent.futures import ThreadPoolExecutor, as_completed
import urllib.request
from time import time
def get_file_by_case(case):
D = r'C:\Users\andy\supreme-court-scrap\documents-from-student-decoding'
pa... | [
"csv.DictReader",
"concurrent.futures.ThreadPoolExecutor",
"os.path.join",
"concurrent.futures.as_completed",
"os.path.dirname",
"time.time"
] | [((1378, 1391), 'csv.DictReader', 'DictReader', (['f'], {}), '(f)\n', (1388, 1391), False, 'from csv import DictReader\n'), ((447, 466), 'os.path.join', 'join', (['D', 'year', 'a', 'b'], {}), '(D, year, a, b)\n', (451, 466), False, 'from os.path import dirname, join, exists\n'), ((481, 503), 'os.path.join', 'join', (['... |
from pathlib import Path
from shutil import copyfile
import logging
def move_files(dir_from: Path, dir_to: Path):
logging.info(f"Moving files from '{dir_from}' to '{dir_to}'")
p = dir_from.glob("**/*")
input_paths = [x for x in p if x.is_file()]
for input_path in input_paths:
filename = input_... | [
"shutil.copyfile",
"logging.info"
] | [((120, 181), 'logging.info', 'logging.info', (['f"""Moving files from \'{dir_from}\' to \'{dir_to}\'"""'], {}), '(f"Moving files from \'{dir_from}\' to \'{dir_to}\'")\n', (132, 181), False, 'import logging\n'), ((378, 411), 'shutil.copyfile', 'copyfile', (['input_path', 'output_path'], {}), '(input_path, output_path)\... |
#!/usr/bin/python
#-*-coding=utf-8-*-
import json
import jieba
class emo:
dict = {}
emoVal = {}
emodir = "emo_dict"
def __init__(self,dictname):
self.dict = self.loadDict(dictname)
def loadDict(self,dictname):
path = "./"+self.emodir+"/"+dictname+".json"
print ("l... | [
"json.load"
] | [((412, 424), 'json.load', 'json.load', (['f'], {}), '(f)\n', (421, 424), False, 'import json\n')] |
import random
import numpy as np
from gym_multigrid.multigrid import World
from gym_multigrid.multigrid import DIR_TO_VEC
from gym_multigrid.multigrid import Actions
class Agent:
def __init__(self, agent_id, agent_type=0):
self.id = agent_id
self.total_reward = 0
self.action_probabilities ... | [
"random.choice",
"numpy.arange"
] | [((2837, 2873), 'random.choice', 'random.choice', (['target_ball_positions'], {}), '(target_ball_positions)\n', (2850, 2873), False, 'import random\n'), ((693, 705), 'numpy.arange', 'np.arange', (['(5)'], {}), '(5)\n', (702, 705), True, 'import numpy as np\n')] |
# -*- coding: UTF-8 -*-
import glob
import numpy as np
import pandas as pd
from PIL import Image
import random
# h,w = 60,50
h, w = (60, 50)
size = h * w
# Receding_Hairline Wearing_Necktie Rosy_Cheeks Eyeglasses Goatee Chubby
# Sideburns Blurry Wearing_Hat Double_Chin Pale_Skin Gray_Hair Mustache Bald
... | [
"random.sample",
"PIL.Image.open",
"numpy.array",
"numpy.zeros",
"pandas.read_table",
"glob.glob"
] | [((411, 505), 'pandas.read_table', 'pd.read_table', (['"""./data/list_attr_celeba.txt"""'], {'delim_whitespace': '(True)', 'error_bad_lines': '(False)'}), "('./data/list_attr_celeba.txt', delim_whitespace=True,\n error_bad_lines=False)\n", (424, 505), True, 'import pandas as pd\n'), ((537, 562), 'numpy.array', 'np.a... |
# Generated by Django 3.2.4 on 2021-08-03 15:02
from django.contrib.sites.management import create_default_site
from django.db import migrations
def create_privacy_policy_flatpage(apps, schema_editor):
Site = apps.get_model("sites", "Site")
site = Site.objects.first()
if not site:
create_default_s... | [
"django.contrib.sites.management.create_default_site",
"django.db.migrations.RunPython"
] | [((304, 329), 'django.contrib.sites.management.create_default_site', 'create_default_site', (['None'], {}), '(None)\n', (323, 329), False, 'from django.contrib.sites.management import create_default_site\n'), ((994, 1082), 'django.db.migrations.RunPython', 'migrations.RunPython', (['create_privacy_policy_flatpage', 'de... |
# Generated by Django 3.2.8 on 2021-10-15 16:58
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('app', '0038_auto_20211012_1634'),
]
operations = [
migrations.RenameField(
model_name='device',
old_name='erase_wifi_credent... | [
"django.db.migrations.RemoveField",
"django.db.migrations.RenameField"
] | [((223, 340), 'django.db.migrations.RenameField', 'migrations.RenameField', ([], {'model_name': '"""device"""', 'old_name': '"""erase_wifi_credentials_at"""', 'new_name': '"""last_event_sent_at"""'}), "(model_name='device', old_name=\n 'erase_wifi_credentials_at', new_name='last_event_sent_at')\n", (245, 340), False... |
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from rest_framework import viewsets
from rest_framework.authentication import TokenAuthentication
from rest_framework import filters
from profiles_api import serializers
from profiles_api import mo... | [
"rest_framework.response.Response",
"profiles_api.models.UserProfile.objects.all"
] | [((3382, 3414), 'profiles_api.models.UserProfile.objects.all', 'models.UserProfile.objects.all', ([], {}), '()\n', (3412, 3414), False, 'from profiles_api import models\n'), ((834, 891), 'rest_framework.response.Response', 'Response', (["{'message': 'Hello!', 'an_apiview': an_apiview}"], {}), "({'message': 'Hello!', 'a... |
# -*- coding: utf-8 -*-
import random, json, string, warnings
from typing import Union, List, Set, Dict
from simalign import SentenceAligner
from nltk.translate.phrase_based import phrase_extraction
class CodeMixer(object):
def __init__(self, matrix_lg: str, embedded_lgs: Union[List[str],Set[str]], device='cuda',... | [
"random.choice",
"nltk.translate.phrase_based.phrase_extraction",
"random.random",
"warnings.filterwarnings",
"simalign.SentenceAligner"
] | [((357, 414), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'category': 'FutureWarning'}), "('ignore', category=FutureWarning)\n", (380, 414), False, 'import random, json, string, warnings\n'), ((478, 566), 'simalign.SentenceAligner', 'SentenceAligner', ([], {'model': '"""xlmr"""', 'token_ty... |
#! python3
# To write files and make a directory
import os
# To filter string
import re
# For sleeping
import time
# Googles Text to speech lib
from gtts import gTTS
# File info reader, in this case, it is for determening the length of a mp3
from mutagen.mp3 import MP3
def format_text(text: str):
"""
Rem... | [
"os.makedirs",
"re.compile",
"time.sleep",
"os.getcwd",
"os.path.isfile",
"mutagen.mp3.MP3",
"os.path.isdir",
"gtts.gTTS",
"re.sub"
] | [((406, 431), 're.compile', 're.compile', (['"""[^a-zA-Z ]+"""'], {}), "('[^a-zA-Z ]+')\n", (416, 431), False, 'import re\n'), ((1843, 1869), 'gtts.gTTS', 'gTTS', ([], {'text': 'text', 'lang': '"""en"""'}), "(text=text, lang='en')\n", (1847, 1869), False, 'from gtts import gTTS\n'), ((1920, 1940), 'os.path.isfile', 'os... |
#!/usr/bin/env python
import json
jsonFile = open('temp.json', 'r')
jsonData = json.load(jsonFile)
places = jsonData["places"]
for item in places:
originalArray = places[item]
newArray = ["default"]
for originalPiece in originalArray:
newArray.append(originalPiece)
places[item] = newArray
jsonData["places"] ... | [
"json.load",
"json.dump"
] | [((81, 100), 'json.load', 'json.load', (['jsonFile'], {}), '(jsonFile)\n', (90, 100), False, 'import json\n'), ((372, 404), 'json.dump', 'json.dump', (['jsonData', 'newJsonFile'], {}), '(jsonData, newJsonFile)\n', (381, 404), False, 'import json\n')] |
from setuptools import setup, Extension
setup(ext_modules=[
Extension('_module', sources=["module_wrap.c"])
]) | [
"setuptools.Extension"
] | [((65, 112), 'setuptools.Extension', 'Extension', (['"""_module"""'], {'sources': "['module_wrap.c']"}), "('_module', sources=['module_wrap.c'])\n", (74, 112), False, 'from setuptools import setup, Extension\n')] |
from gaesessions import SessionMiddleware
# suggestion: generate your own random key using os.urandom(64)
# WARNING: Make sure you run os.urandom(64) OFFLINE and copy/paste the output to
# this file. If you use os.urandom() to *dynamically* generate your key at
# runtime then any existing sessions will become junk ev... | [
"os.path.realpath",
"google.appengine.ext.appstats.recording.appstats_wsgi_middleware",
"gaesessions.SessionMiddleware"
] | [((2228, 2273), 'gaesessions.SessionMiddleware', 'SessionMiddleware', (['app'], {'cookie_key': 'COOKIE_KEY'}), '(app, cookie_key=COOKIE_KEY)\n', (2245, 2273), False, 'from gaesessions import SessionMiddleware\n'), ((2282, 2321), 'google.appengine.ext.appstats.recording.appstats_wsgi_middleware', 'recording.appstats_wsg... |
import flask
blueprint = flask.Blueprint('rooms', __name__, template_folder='templates')
from . import routes
| [
"flask.Blueprint"
] | [((26, 89), 'flask.Blueprint', 'flask.Blueprint', (['"""rooms"""', '__name__'], {'template_folder': '"""templates"""'}), "('rooms', __name__, template_folder='templates')\n", (41, 89), False, 'import flask\n')] |
# Debugging
#T# Table of contents
#C# Python debugger (pdb)
#T# Beginning of content
#C# Python debugger (pdb)
# |-------------------------------------------------------------
#T# pdb is the builtin Python debugger, it has breakpoints, stepping through the code, printing the values of variables, post-mortem deb... | [
"pdb.run"
] | [((1058, 1092), 'pdb.run', 'pdb.run', (['"""import S01_Basic_syntax"""'], {}), "('import S01_Basic_syntax')\n", (1065, 1092), False, 'import pdb\n')] |
"""
Created on Sat Mar 23 00:23:27 2019
@author: nahid
"""
#https://docs.scipy.org/doc/numpy/reference/generated/numpy.absolute.html
import numpy as np
import matplotlib.pyplot as plt
x = np.array([-1.2, 1.2])
x = np.absolute(x)
print(x)
print(np.absolute(1 + 2j))
#Plot the function over [-10, 10]:
x = np.linspace(-1... | [
"numpy.abs",
"numpy.absolute",
"matplotlib.pyplot.plot",
"numpy.array",
"numpy.linspace",
"matplotlib.pyplot.show"
] | [((189, 210), 'numpy.array', 'np.array', (['[-1.2, 1.2]'], {}), '([-1.2, 1.2])\n', (197, 210), True, 'import numpy as np\n'), ((215, 229), 'numpy.absolute', 'np.absolute', (['x'], {}), '(x)\n', (226, 229), True, 'import numpy as np\n'), ((306, 331), 'numpy.linspace', 'np.linspace', (['(-10)', '(10)', '(101)'], {}), '(-... |
from __future__ import annotations
import asyncio
import typing
import types
import pandas as pd
import tooltime
from ctc import evm
from ctc import spec
async def async_get_lending_flows(
wallet: spec.Address,
pool_token: spec.ERC20Reference,
protocol: typing.Literal['aave', 'compound', 'rari'],
w... | [
"ctc.evm.async_get_erc20_decimals",
"ctc.protocols.aave_v2_utils.async_get_deposits",
"ctc.protocols.aave_v2_utils.async_get_withdrawals",
"ctc.evm.async_get_block_timestamps",
"ctc.evm.async_get_erc20_balance_of_by_block",
"ctc.evm.async_get_latest_block_number",
"pandas.DataFrame",
"ctc.evm.async_ge... | [((1697, 1761), 'ctc.evm.async_get_block_timestamps', 'evm.async_get_block_timestamps', ([], {'blocks': 'blocks', 'provider': 'provider'}), '(blocks=blocks, provider=provider)\n', (1727, 1761), False, 'from ctc import evm\n'), ((1807, 1848), 'asyncio.create_task', 'asyncio.create_task', (['timestamps_coroutine'], {}), ... |
from PIL import Image, ImageDraw
im = Image.open("a.jpg")
im = im.resize((150,150))
result = im.convert('P', palette=Image.ADAPTIVE, colors=8)
result.putalpha(0)
colors = result.getcolors(150*150)
newimg = Image.new('RGB', (64*8, 64))
draw = ImageDraw.Draw(newimg)
posx = 0
for row, col in colors:
draw.rectangle([po... | [
"PIL.Image.new",
"PIL.ImageDraw.Draw",
"PIL.Image.open"
] | [((39, 58), 'PIL.Image.open', 'Image.open', (['"""a.jpg"""'], {}), "('a.jpg')\n", (49, 58), False, 'from PIL import Image, ImageDraw\n'), ((208, 238), 'PIL.Image.new', 'Image.new', (['"""RGB"""', '(64 * 8, 64)'], {}), "('RGB', (64 * 8, 64))\n", (217, 238), False, 'from PIL import Image, ImageDraw\n'), ((244, 266), 'PIL... |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"recommender.models.GetUserRatedItemsCacheKey",
"google.appengine.ext.deferred.defer",
"recommender.models.UserKey",
"recommender.models.PastRecommendation.query",
"recommender.models.RecommendationSession.query",
"google.appengine.ext.ndb.delete_multi",
"recommender.models.Connection.query"
] | [((1330, 1352), 'google.appengine.ext.ndb.delete_multi', 'ndb.delete_multi', (['keys'], {}), '(keys)\n', (1346, 1352), False, 'from google.appengine.ext import ndb\n'), ((1357, 1397), 'google.appengine.ext.deferred.defer', 'deferred.defer', (['continuation_fn', 'user_id'], {}), '(continuation_fn, user_id)\n', (1371, 13... |
from os.path import abspath, dirname, join
WORLDGEN_ROOT_PATH = abspath(join(dirname(__file__), '..', '..'))
def worldgen_path(*args):
"""
Returns an absolute path from a path relative to the mujoco_worldgen repository
root directory.
"""
return join(WORLDGEN_ROOT_PATH, *args)
| [
"os.path.dirname",
"os.path.join"
] | [((269, 300), 'os.path.join', 'join', (['WORLDGEN_ROOT_PATH', '*args'], {}), '(WORLDGEN_ROOT_PATH, *args)\n', (273, 300), False, 'from os.path import abspath, dirname, join\n'), ((78, 95), 'os.path.dirname', 'dirname', (['__file__'], {}), '(__file__)\n', (85, 95), False, 'from os.path import abspath, dirname, join\n')] |
# encoding: utf-8
import os
import re
import sys
import gzip
import time
import json
import socket
import random
import weakref
import datetime
import functools
import threading
import collections
import urllib.error
import urllib.parse
import urllib.request
import collections.abc
import json_dict
from . import util... | [
"gzip.decompress",
"datetime.timedelta",
"weakref.finalize",
"collections.deque",
"threading.Lock",
"threading.RLock",
"time.perf_counter",
"functools.wraps",
"threading.Condition",
"random.randint",
"json.loads",
"random.choice",
"random.shuffle",
"socks.handlers.ChainProxyHandler",
"so... | [((2788, 2805), 'threading.RLock', 'threading.RLock', ([], {}), '()\n', (2803, 2805), False, 'import threading\n'), ((2880, 2896), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (2894, 2896), False, 'import threading\n'), ((2924, 2940), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (2938, 2940), False, '... |
from project.aquarium.freshwater_aquarium import FreshwaterAquarium # noqa
from project.aquarium.saltwater_aquarium import SaltwaterAquarium # noqa
from project.decoration.decoration_repository import DecorationRepository
from project.decoration.ornament import Ornament # noqa
from project.decoration.plant import Pl... | [
"project.decoration.decoration_repository.DecorationRepository"
] | [((540, 562), 'project.decoration.decoration_repository.DecorationRepository', 'DecorationRepository', ([], {}), '()\n', (560, 562), False, 'from project.decoration.decoration_repository import DecorationRepository\n')] |
import json
from Note import Note
n = Note("Friction", "introduction to friction", "UC Berkeley", 0, True, False, False, "https://google.com", 'lec.pdf')
print(n.toJSON())
| [
"Note.Note"
] | [((39, 158), 'Note.Note', 'Note', (['"""Friction"""', '"""introduction to friction"""', '"""UC Berkeley"""', '(0)', '(True)', '(False)', '(False)', '"""https://google.com"""', '"""lec.pdf"""'], {}), "('Friction', 'introduction to friction', 'UC Berkeley', 0, True, False,\n False, 'https://google.com', 'lec.pdf')\n",... |
# Reference/tutorial to take a look at
# https://help.autodesk.com/view/MOBPRO/2019/ENU/?guid=__py_ref__tasks_2_assign_rigid_body_8py_example_html
# https://help.autodesk.com/view/MOBPRO/2019/ENU/?guid=__files_GUID_A1189AA0_3816_4350_B8F3_5383DEC25A33_htm
# https://mocappys.com/complete-guide-to-poses-in-motionbuilder... | [
"os.path.exists",
"os.listdir",
"os.makedirs",
"os.path.join",
"random.random"
] | [((18487, 18516), 'os.path.join', 'os.path.join', (['rootDir', '"""bvh/"""'], {}), "(rootDir, 'bvh/')\n", (18499, 18516), False, 'import os\n'), ((18919, 18951), 'os.path.join', 'os.path.join', (['rootDir', '"""result/"""'], {}), "(rootDir, 'result/')\n", (18931, 18951), False, 'import os\n'), ((19026, 19068), 'os.path... |
import logging
import pytest
from ophyd.sim import make_fake_device
from pcdsdevices.gon import (BaseGon, Goniometer, GonWithDetArm, Kappa, SamPhi,
XYZStage)
logger = logging.getLogger(__name__)
def test_gon_factory():
logger.debug('test_gon_factory')
assert isinstance(Goniomet... | [
"logging.getLogger",
"pcdsdevices.gon.BaseGon",
"pcdsdevices.gon.SamPhi",
"pcdsdevices.gon.Kappa",
"pcdsdevices.gon.XYZStage",
"pcdsdevices.gon.Goniometer",
"pytest.mark.timeout",
"pcdsdevices.gon.GonWithDetArm",
"ophyd.sim.make_fake_device"
] | [((199, 226), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (216, 226), False, 'import logging\n'), ((816, 838), 'pytest.mark.timeout', 'pytest.mark.timeout', (['(5)'], {}), '(5)\n', (835, 838), False, 'import pytest\n'), ((1730, 1752), 'pytest.mark.timeout', 'pytest.mark.timeout', (['(5... |
#!/usr/bin/env python3
import sys
import os
import argparse
import time
import serial
import csv
import math
import pickle
from collections import defaultdict
import numpy as np
from sklearn.decomposition import PCA, FastICA
from sklearn.svm import SVC
# Graph
WINDOW_WIDTH = 800
WINDOW_HEIGHT = 800
PLOT_SCROLL = 3 ... | [
"pygame.init",
"math.sqrt",
"time.sleep",
"numpy.array",
"sklearn.decomposition.FastICA",
"pygame.font.Font",
"argparse.ArgumentParser",
"sklearn.decomposition.PCA",
"pygame.display.set_mode",
"pygame.display.flip",
"csv.reader",
"csv.writer",
"pickle.load",
"os.path.dirname",
"time.time... | [((19921, 19986), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Electromyography Processor"""'}), "(description='Electromyography Processor')\n", (19944, 19986), False, 'import argparse\n'), ((24584, 24626), 'os.environ.get', 'os.environ.get', (['"""EMGPROC_LOAD_GAME"""', '(False)'], {}... |
import numpy as np
from preprocess import Vectorizer
from flask import render_template, make_response
from google.oauth2.id_token import verify_oauth2_token
from google.auth.transport.requests import Request
from google.cloud import firestore
from os.path import join, abspath, dirname
from random import randint
from pi... | [
"flask.render_template",
"google.cloud.firestore.Client",
"google.auth.transport.requests.Request",
"pickle.load",
"os.path.join",
"numpy.any",
"numpy.count_nonzero",
"numpy.argsort",
"numpy.random.seed",
"os.path.abspath",
"random.randint"
] | [((383, 401), 'google.cloud.firestore.Client', 'firestore.Client', ([], {}), '()\n', (399, 401), False, 'from google.cloud import firestore\n'), ((424, 441), 'os.path.abspath', 'abspath', (['__file__'], {}), '(__file__)\n', (431, 441), False, 'from os.path import join, abspath, dirname\n'), ((583, 599), 'pickle.load', ... |
#-*- coding:utf-8 -*-
import sys, traceback
from core_backend import context
from core_backend.libs.exception import Error
import logging
#logger = Log.getDebugLogger()
#logger.setLevel(logging.INFO)
logger = logging.getLogger(__name__)
class plugin(object):
def __init__(self, handler, session):
self.han... | [
"logging.getLogger"
] | [((210, 237), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (227, 237), False, 'import logging\n')] |
'''
Filename: predict.py
Python Version: 3.6.5
Project: Neutrophil Identifier
Author: <NAME>
Created date: Sep 5, 2018 4:13 PM
-----
Last Modified: Oct 9, 2018 3:48 PM
Modified By: <NAME>
-----
License: MIT
http://www.opensource.org/licenses/MIT
'''
import os
import sys
import logging
from math import ceil
from keras.... | [
"logging.basicConfig",
"keras.models.load_model",
"logging.debug",
"math.ceil",
"os.path.join",
"tables.open_file",
"os.path.basename",
"numpy.savetxt",
"logging.info"
] | [((1965, 2005), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (1984, 2005), False, 'import logging\n'), ((996, 1018), 'keras.models.load_model', 'load_model', (['model_path'], {}), '(model_path)\n', (1006, 1018), False, 'from keras.models import load_model\n'... |
import argparse
import json
from tqdm import tqdm
from common.dataset.reader import JSONLineReader
from common.util.log_helper import LogHelper
def _sent_to_str(sent):
return sent[-2] + "$$$" + str(sent[-1])
def _replace_sent_with_str(sent, string):
segments = string.split(r"$$$")
if len(segments) != 2:... | [
"argparse.ArgumentParser",
"common.util.log_helper.LogHelper.setup",
"common.dataset.reader.JSONLineReader",
"common.util.log_helper.LogHelper.get_logger",
"tqdm.tqdm",
"json.dumps"
] | [((2117, 2134), 'common.util.log_helper.LogHelper.setup', 'LogHelper.setup', ([], {}), '()\n', (2132, 2134), False, 'from common.util.log_helper import LogHelper\n'), ((2148, 2191), 'common.util.log_helper.LogHelper.get_logger', 'LogHelper.get_logger', (['"""fill_gold_sentences"""'], {}), "('fill_gold_sentences')\n", (... |
# Code generated by `typeddictgen`. DO NOT EDIT.
"""V1ISCSIVolumeSourceDict generated type."""
from typing import TypedDict, List
from kubernetes_typed.client import V1LocalObjectReferenceDict
V1ISCSIVolumeSourceDict = TypedDict(
"V1ISCSIVolumeSourceDict",
{
"chapAuthDiscovery": bool,
"chapAut... | [
"typing.TypedDict"
] | [((221, 526), 'typing.TypedDict', 'TypedDict', (['"""V1ISCSIVolumeSourceDict"""', "{'chapAuthDiscovery': bool, 'chapAuthSession': bool, 'fsType': str,\n 'initiatorName': str, 'iqn': str, 'iscsiInterface': str, 'lun': int,\n 'portals': List[str], 'readOnly': bool, 'secretRef':\n V1LocalObjectReferenceDict, 'tar... |
from pytpp.attributes._helper import IterableMeta, Attribute
from pytpp.attributes.workflow import WorkflowAttributes
class AdaptableWorkflowAttributes(WorkflowAttributes, metaclass=IterableMeta):
__config_class__ = "Adaptable Workflow"
adaptable_workflow_text_field_1 = Attribute('Adaptable Workflow Text Field 1', ... | [
"pytpp.attributes._helper.Attribute"
] | [((275, 339), 'pytpp.attributes._helper.Attribute', 'Attribute', (['"""Adaptable Workflow Text Field 1"""'], {'min_version': '"""18.3"""'}), "('Adaptable Workflow Text Field 1', min_version='18.3')\n", (284, 339), False, 'from pytpp.attributes._helper import IterableMeta, Attribute\n'), ((376, 441), 'pytpp.attributes._... |
#!/usr/env/python
"""
Generalized Cyclic Multi-Pass Sweep-line Algorithm
The cyclic multi-pass sweep-line algorithm, simply repeatedly
sweeps across the same Timeline, until a specified number of passes
has been completed or some signal is given to stop sweeping.
Classes:
- CycleSweep
"""
from typing import TypeVar... | [
"typing.TypeVar"
] | [((419, 431), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (426, 431), False, 'from typing import TypeVar, Union\n')] |
import numpy
import pandas as pd
from boo.columns import SHORT_COLUMNS
from boo.errors import UnclassifiableCodeError
QUOTE_CHAR = '"'
EMPTY = int(0)
NUMERIC_COLUMNS = SHORT_COLUMNS.numeric
def adjust_rub(df, cols=NUMERIC_COLUMNS):
rows = (df.unit == "385")
df.loc[rows, cols] = df.loc[rows, cols].multiply(1... | [
"boo.errors.UnclassifiableCodeError"
] | [((2447, 2483), 'boo.errors.UnclassifiableCodeError', 'UnclassifiableCodeError', (['code_string'], {}), '(code_string)\n', (2470, 2483), False, 'from boo.errors import UnclassifiableCodeError\n'), ((2587, 2623), 'boo.errors.UnclassifiableCodeError', 'UnclassifiableCodeError', (['code_string'], {}), '(code_string)\n', (... |
# 3rd party
import pytest
from coincidence.regressions import AdvancedFileRegressionFixture
from consolekit.testing import CliRunner, Result
from domdf_python_tools.paths import in_directory
from github3.exceptions import UnprocessableEntity
# this package
from repo_helper_github.cli import new
@pytest.mark.usefixtu... | [
"domdf_python_tools.paths.in_directory",
"pytest.raises",
"pytest.mark.usefixtures",
"consolekit.testing.CliRunner"
] | [((300, 342), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""module_cassette"""'], {}), "('module_cassette')\n", (323, 342), False, 'import pytest\n'), ((643, 711), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""betamax_github_session"""', '"""module_cassette"""'], {}), "('betamax_github_sessi... |
import numpy as np
import os
import tensorflow as tf
EPS = 1e-8
def placeholder(dim=None):
return tf.placeholder(dtype=tf.float32, shape=(None,dim) if dim else (None,))
def placeholders(*args):
return [placeholder(dim) for dim in args]
def mlp(x, hidden_sizes=(32,), activation=tf.tanh, output_activation=Non... | [
"tensorflow.shape",
"tensorflow.reduce_sum",
"numpy.log",
"tensorflow.multiply",
"tensorflow.nn.softmax",
"tensorflow.keras.initializers.Orthogonal",
"tensorflow.cast",
"tensorflow.log",
"tensorflow.placeholder",
"tensorflow.concat",
"tensorflow.convert_to_tensor",
"tensorflow.variable_scope",... | [((104, 175), 'tensorflow.placeholder', 'tf.placeholder', ([], {'dtype': 'tf.float32', 'shape': '((None, dim) if dim else (None,))'}), '(dtype=tf.float32, shape=(None, dim) if dim else (None,))\n', (118, 175), True, 'import tensorflow as tf\n'), ((338, 375), 'tensorflow.keras.initializers.Orthogonal', 'tf.keras.initial... |
from objects.lighting.lighting_interactions import SwitchLightImmediateInteraction
from objects.object_state_utils import ObjectStateHelper
import sims4
logger = sims4.log.Logger('LightingAndObjectState', default_owner='mkartika')
class SwitchLightAndStateImmediateInteraction(SwitchLightImmediateInteraction):
INST... | [
"objects.object_state_utils.ObjectStateHelper.TunableFactory",
"sims4.log.Logger"
] | [((162, 230), 'sims4.log.Logger', 'sims4.log.Logger', (['"""LightingAndObjectState"""'], {'default_owner': '"""mkartika"""'}), "('LightingAndObjectState', default_owner='mkartika')\n", (178, 230), False, 'import sims4\n'), ((355, 546), 'objects.object_state_utils.ObjectStateHelper.TunableFactory', 'ObjectStateHelper.Tu... |
import mock
def test_setup(GPIO, spidev):
from unicornhatmini import UnicornHATMini
unicornhatmini = UnicornHATMini()
spidev.SpiDev.assert_has_calls((
mock.call(0, 0),
mock.call(0, 1)
), any_order=True)
GPIO.setwarnings.assert_called_once_with(False)
GPIO.setmode.assert_calle... | [
"mock.call",
"unicornhatmini.UnicornHATMini"
] | [((111, 127), 'unicornhatmini.UnicornHATMini', 'UnicornHATMini', ([], {}), '()\n', (125, 127), False, 'from unicornhatmini import UnicornHATMini\n'), ((476, 492), 'unicornhatmini.UnicornHATMini', 'UnicornHATMini', ([], {}), '()\n', (490, 492), False, 'from unicornhatmini import UnicornHATMini\n'), ((174, 189), 'mock.ca... |
import time
from ..base import order as od
from .api import BybitApi
class BybitOrderManager(od.OrderManagerBase):
def __init__(self, api, ws=None, retention=60):
super().__init__(api, ws, retention)
self.ws.subscribe('execution', self.__on_events, True)
self.ws.subscribe('position', self... | [
"time.time"
] | [((998, 1009), 'time.time', 'time.time', ([], {}), '()\n', (1007, 1009), False, 'import time\n')] |
import os
import wget
import paddle
from .tokenizer import Tokenizer
from .model import CLIP
from paddle.vision.transforms import Compose, Resize, CenterCrop, ToTensor, Normalize
tokenizer = Tokenizer()
def get_transforms(image_resolution):
transforms = Compose([
Resize(image_resolution, interpolation='... | [
"paddle.vision.transforms.ToTensor",
"wget.download",
"os.path.exists",
"paddle.vision.transforms.Normalize",
"paddle.vision.transforms.CenterCrop",
"os.path.join",
"os.path.isfile",
"paddle.to_tensor",
"os.mkdir",
"paddle.load",
"paddle.vision.transforms.Resize"
] | [((3125, 3149), 'paddle.to_tensor', 'paddle.to_tensor', (['tokens'], {}), '(tokens)\n', (3141, 3149), False, 'import paddle\n'), ((4277, 4321), 'os.path.join', 'os.path.join', (['"""pretrained_models"""', 'file_name'], {}), "('pretrained_models', file_name)\n", (4289, 4321), False, 'import os\n'), ((4531, 4554), 'paddl... |
# 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",
"warnings.warn",
"pulumi.log.warn"
] | [((16397, 16433), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""targetGroupIds"""'}), "(name='targetGroupIds')\n", (16410, 16433), False, 'import pulumi\n'), ((17299, 17340), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""loadBalancingConfig"""'}), "(name='loadBalancingConfig')\n", (17312, 17340), False, 'im... |
"""
Project resources
Many configuration and scripting resources are extracted here.
"""
from shared.tools.snapshot.utils import encode, hashmapToDict
def extract_project_props(client_context):
global_props = client_context.getGlobalProps()
configuration = {
'permissions': hashmapToDict(global_props.getPe... | [
"shared.tools.snapshot.utils.encode"
] | [((2021, 2042), 'shared.tools.snapshot.utils.encode', 'encode', (['configuration'], {}), '(configuration)\n', (2027, 2042), False, 'from shared.tools.snapshot.utils import encode, hashmapToDict\n'), ((7840, 7852), 'shared.tools.snapshot.utils.encode', 'encode', (['info'], {}), '(info)\n', (7846, 7852), False, 'from sha... |
# -*- coding: utf-8 -*-
"""Polynomial techniques for fitting baselines to experimental data.
Created on Feb. 27, 2021
@author: <NAME>
The function penalized_poly was adapted from MATLAB code from
https://www.mathworks.com/matlabcentral/fileexchange/27429-background-correction
(accessed March 18, 2021), which was lic... | [
"numpy.ones_like",
"numpy.abs",
"numpy.sqrt",
"numpy.minimum",
"math.ceil",
"numpy.argsort",
"numpy.array",
"numpy.dot",
"numpy.zeros",
"numpy.empty",
"numpy.sign",
"numpy.linalg.lstsq",
"numpy.std",
"warnings.warn",
"numpy.maximum",
"numpy.arange"
] | [((9204, 9225), 'numpy.sqrt', 'np.sqrt', (['weight_array'], {}), '(weight_array)\n', (9211, 9225), True, 'import numpy as np\n'), ((9274, 9308), 'numpy.dot', 'np.dot', (['pseudo_inverse', '(sqrt_w * y)'], {}), '(pseudo_inverse, sqrt_w * y)\n', (9280, 9308), True, 'import numpy as np\n'), ((9324, 9344), 'numpy.dot', 'np... |
from django.urls import path
from . import views
urlpatterns = [
path('<int:sproperty_id>/',views.contact,name="contact"),
path('',views.contact_submit,name="contact-submit"),
] | [
"django.urls.path"
] | [((75, 133), 'django.urls.path', 'path', (['"""<int:sproperty_id>/"""', 'views.contact'], {'name': '"""contact"""'}), "('<int:sproperty_id>/', views.contact, name='contact')\n", (79, 133), False, 'from django.urls import path\n'), ((137, 190), 'django.urls.path', 'path', (['""""""', 'views.contact_submit'], {'name': '"... |
#!/usr/bin/env python
#
# Copyright 2010 Google 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 o... | [
"google.appengine.ext.db.FloatProperty",
"google.appengine.ext.db.BooleanProperty",
"google.appengine.ext.db.GeoPtProperty",
"google.appengine.ext.db.IntegerProperty",
"google.appengine.ext.db.ReferenceProperty",
"google.appengine.ext.db.ListProperty",
"google.appengine.ext.db.DateTimeProperty",
"goog... | [((766, 785), 'google.appengine.ext.db.StringProperty', 'db.StringProperty', ([], {}), '()\n', (783, 785), False, 'from google.appengine.ext import db\n'), ((802, 821), 'google.appengine.ext.db.StringProperty', 'db.StringProperty', ([], {}), '()\n', (819, 821), False, 'from google.appengine.ext import db\n'), ((833, 85... |
"""
Running operational space control with the PyGame display, using an exponential
additive signal when to push away from joints.
The target location can be moved by clicking on the background.
"""
import numpy as np
from abr_control.arms import threejoint as arm
# from abr_control.arms import twojoint as arm
from ab... | [
"numpy.hstack",
"abr_control.controllers.OSC",
"abr_control.interfaces.PyGame",
"abr_control.controllers.AvoidJointLimits",
"abr_control.arms.threejoint.Config",
"abr_control.controllers.Damping",
"abr_control.arms.threejoint.ArmSim"
] | [((509, 536), 'abr_control.arms.threejoint.Config', 'arm.Config', ([], {'use_cython': '(True)'}), '(use_cython=True)\n', (519, 536), True, 'from abr_control.arms import threejoint as arm\n'), ((575, 599), 'abr_control.arms.threejoint.ArmSim', 'arm.ArmSim', (['robot_config'], {}), '(robot_config)\n', (585, 599), True, '... |
import itertools
from unittest import TestCase
import numpy as np
from utils.data import ArrayInfo, image_array_to_rgb
from utils.data.mappers import *
class ImageUtilsTestCase(TestCase):
def test_image_array_to_rgb(self):
np.random.seed(1234)
def f(batch_size, n_channels, channel_last, the_ch... | [
"numpy.reshape",
"numpy.testing.assert_equal",
"itertools.product",
"utils.data.ArrayInfo",
"utils.data.image_array_to_rgb",
"numpy.random.randint",
"numpy.random.seed"
] | [((240, 260), 'numpy.random.seed', 'np.random.seed', (['(1234)'], {}), '(1234)\n', (254, 260), True, 'import numpy as np\n'), ((2216, 2375), 'itertools.product', 'itertools.product', (['([], [7], [3, 4])', '(None, 1, 3)', '(None, True, False)', '(True, False)', '(True, False)', '(8, 5)', '(True, False)', '(None, (0, 1)... |
# -*- coding: utf-8 -*-
# closeness-server (c) <NAME>
from closeness_server import create_app
app = create_app()
| [
"closeness_server.create_app"
] | [((101, 113), 'closeness_server.create_app', 'create_app', ([], {}), '()\n', (111, 113), False, 'from closeness_server import create_app\n')] |
from sqlalchemy import Table, Column, Integer, String
from sqlalchemy.orm import mapper
from .database import metadata, db_session
class User(object):
query = db_session.query_property()
def __init__(self, name=None, email=None):
self.name = name
self.email = email
def __repr__(self):
... | [
"sqlalchemy.orm.mapper",
"sqlalchemy.String",
"sqlalchemy.Column"
] | [((538, 557), 'sqlalchemy.orm.mapper', 'mapper', (['User', 'users'], {}), '(User, users)\n', (544, 557), False, 'from sqlalchemy.orm import mapper\n'), ((404, 443), 'sqlalchemy.Column', 'Column', (['"""id"""', 'Integer'], {'primary_key': '(True)'}), "('id', Integer, primary_key=True)\n", (410, 443), False, 'from sqlalc... |
import dash_bootstrap_components as dbc
import dash_html_components as html
"""
Creation of jumbotrons for a better Homepage display
"""
left_jumbotron = dbc.Col(
html.Div(
[
html.H2("Your Favorite Finance Hub", className="display-3"),
html.Hr(className="my-2"),
html.P(
... | [
"dash_bootstrap_components.Row",
"dash_html_components.P",
"dash_html_components.H2",
"dash_html_components.Hr"
] | [((744, 805), 'dash_bootstrap_components.Row', 'dbc.Row', (['[left_jumbotron]'], {'className': '"""align-items-md-stretch"""'}), "([left_jumbotron], className='align-items-md-stretch')\n", (751, 805), True, 'import dash_bootstrap_components as dbc\n'), ((836, 907), 'dash_bootstrap_components.Row', 'dbc.Row', ([], {'chi... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
from numpy import *
import heapq
class solutions:
def childs_with_sugers(self,childs,sugers):
"""
分糖给小朋友,一个小朋友只能拿一块糖,糖不能分割
:param childs:
:param sugers:
:return:
"""
childs=sorted(childs)
sugers=sorted(su... | [
"heapq.heappop",
"heapq.heapify"
] | [((7105, 7130), 'heapq.heapify', 'heapq.heapify', (['self._data'], {}), '(self._data)\n', (7118, 7130), False, 'import heapq\n'), ((7294, 7319), 'heapq.heappop', 'heapq.heappop', (['self._data'], {}), '(self._data)\n', (7307, 7319), False, 'import heapq\n')] |
# -*- coding: utf-8 -*-
# flake8: noqa
# noreorder
"""
Pytube: a very serious Python library for downloading YouTube Videos.
"""
__title__ = 'my_pytube'
__version__ = '9.5.2'
__author__ = '<NAME>'
__license__ = 'MIT License'
__copyright__ = 'Copyright 2019 <NAME>'
#import logging
#import query
#import streams
#import ... | [
"my_pytube.logging.create_logger"
] | [((663, 678), 'my_pytube.logging.create_logger', 'create_logger', ([], {}), '()\n', (676, 678), False, 'from my_pytube.logging import create_logger\n')] |
## @ingroup Methods-Aerodynamics-Airfoil_Panel_Method
# panel_geometry.py
# Created: Mar 2021, <NAME>
# ---------------------------------------
#-------------------------------
# Imports
# ----------------------------------------------------------------------
import SUAVE
from SUAVE.Core import Units
import numpy ... | [
"numpy.zeros",
"numpy.sqrt"
] | [((1778, 1832), 'numpy.sqrt', 'np.sqrt', (['((x[1:] - x[:-1]) ** 2 + (y[1:] - y[:-1]) ** 2)'], {}), '((x[1:] - x[:-1]) ** 2 + (y[1:] - y[:-1]) ** 2)\n', (1785, 1832), True, 'import numpy as np\n'), ((1962, 1996), 'numpy.zeros', 'np.zeros', (['(npanel, 2, nalpha, nRe)'], {}), '((npanel, 2, nalpha, nRe))\n', (1970, 1996)... |
#!/usr/bin/python
"""
(dummy-)Mutates multiple residues on a PDB-formatted structure.
HADDOCK will then reconstruct the residue according to its topology.
Usage: python pdb_multimutate.py pdbFL <mutation list file>
The format of mutation list:
chain resi resn_wt resn_mut
Example: python pdb_multimuta... | [
"os.path.splitext",
"os.path.isfile",
"sys.stderr.write",
"sys.exit",
"re.sub"
] | [((970, 993), 'sys.stderr.write', 'sys.stderr.write', (['USAGE'], {}), '(USAGE)\n', (986, 993), False, 'import sys\n'), ((1002, 1013), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (1010, 1013), False, 'import sys\n'), ((1869, 1981), 'sys.stderr.write', 'sys.stderr.write', (["('WARNING: ' + chain + ':' + resi + ':' +... |
import marshal
from multiprocessing import Condition, Process, Queue, Pipe
import os
from threading import Timer
from types import FunctionType
import pickle
from celery import Celery
from flask import Flask, url_for
from grams.grams import Histogram
from grams.markov import MC
import time
def make_app():
def... | [
"multiprocessing.Process",
"multiprocessing.Pipe",
"grams.markov.MC",
"flask.Flask"
] | [((1155, 1170), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (1160, 1170), False, 'from flask import Flask, url_for\n'), ((864, 881), 'multiprocessing.Pipe', 'Pipe', ([], {'duplex': '(True)'}), '(duplex=True)\n', (868, 881), False, 'from multiprocessing import Condition, Process, Queue, Pipe\n'), ((1009,... |
import abc
import numbers
from typing import Union
import numpy as np
from river import base, optim, utils
VectorLike = Union[utils.VectorDict, np.ndarray]
__all__ = ["Initializer", "Scheduler", "Optimizer", "Loss"]
class Initializer(base.Base, abc.ABC):
"""An initializer is used to set initial weights in a ... | [
"river.optim.schedulers.Constant"
] | [((1421, 1450), 'river.optim.schedulers.Constant', 'optim.schedulers.Constant', (['lr'], {}), '(lr)\n', (1446, 1450), False, 'from river import base, optim, utils\n')] |
#!/usr/bin/env python3
"""Quantize and convert a keras model to tensorflowjs model."""
import argparse
import pathlib
import tempfile
import numpy as np
import tensorflow as tf
import tensorflowjs as tfjs
def main() -> None:
"""Execute the main routine."""
##
# Parse command-line arguments
##
... | [
"argparse.ArgumentParser",
"pathlib.Path"
] | [((329, 373), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__'}), '(description=__doc__)\n', (352, 373), False, 'import argparse\n'), ((654, 683), 'pathlib.Path', 'pathlib.Path', (['args.keras_path'], {}), '(args.keras_path)\n', (666, 683), False, 'import pathlib\n'), ((699, 726), 'p... |
from flask import render_template_string
from werkzeug.test import EnvironBuilder, run_wsgi_app
class TestTemplateGlobals:
def test_static_mode(self, single_use_app):
@single_use_app.route("/test-globals")
def test_globals():
return render_template_string("""{{ static_mode }}""")
... | [
"flask.render_template_string",
"werkzeug.test.EnvironBuilder",
"werkzeug.test.run_wsgi_app"
] | [((895, 933), 'werkzeug.test.EnvironBuilder', 'EnvironBuilder', ([], {'path': '"""/"""', 'method': '"""GET"""'}), "(path='/', method='GET')\n", (909, 933), False, 'from werkzeug.test import EnvironBuilder, run_wsgi_app\n'), ((1009, 1042), 'werkzeug.test.run_wsgi_app', 'run_wsgi_app', (['single_use_app', 'env'], {}), '(... |
#!/usr/bin/env python
########################################################################
# RSA2ELK, by <NAME>
# Converts Netwitness log parser configuration to Logstash configuration
# see https://github.com/blookot/rsa2elk
########################################################################
import config
i... | [
"csv.DictReader",
"re.compile",
"config.allFields.add",
"sys.exit",
"re.sub"
] | [((625, 649), 're.compile', 're.compile', (['""",\'([^\']+)\'"""'], {}), '(",\'([^\']+)\'")\n', (635, 649), False, 'import re\n'), ((2228, 2254), 're.compile', 're.compile', (['"""^[a-zA-Z]+.*"""'], {}), "('^[a-zA-Z]+.*')\n", (2238, 2254), False, 'import re\n'), ((8064, 8105), 're.compile', 're.compile', (['"""\\\\*([^... |
# -*- coding: utf-8 -*-
import os
import shutil
import io
import zipfile
from commons.Utils import path_utils
class ZipHelper(object):
@classmethod
def _get_arcname(cls, old_arcname, new_arcname):
if old_arcname is not None:
return os.path.join(old_arcname, new_arcname)
else:
... | [
"os.path.exists",
"zipfile.ZipFile",
"os.makedirs",
"os.path.join",
"os.path.splitext",
"os.path.split",
"os.path.isfile",
"os.path.isdir",
"commons.Utils.path_utils.get_path_split",
"io.StringIO",
"os.walk"
] | [((419, 437), 'os.path.isdir', 'os.path.isdir', (['src'], {}), '(src)\n', (432, 437), False, 'import os\n'), ((1407, 1426), 'os.path.split', 'os.path.split', (['file'], {}), '(file)\n', (1420, 1426), False, 'import os\n'), ((2139, 2172), 'commons.Utils.path_utils.get_path_split', 'path_utils.get_path_split', (['folder'... |