code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
"""Embedded DSL for assembling logic circuits.
Embedded domain-specific combinator library for
assembling abstract definitions of logic circuits
and synthesizing circuits from those definitions.
"""
from __future__ import annotations
from typing import Sequence
import doctest
from parts import parts
from circuit impo... | [
"doctest.testmod",
"parts.parts",
"circuit.circuit"
] | [((38084, 38101), 'doctest.testmod', 'doctest.testmod', ([], {}), '()\n', (38099, 38101), False, 'import doctest\n'), ((37671, 37680), 'circuit.circuit', 'circuit', ([], {}), '()\n', (37678, 37680), False, 'from circuit import op, gate, circuit, signature\n'), ((35533, 35558), 'parts.parts', 'parts', (['self'], {'lengt... |
import discord
import random
from datetime import datetime
import pandas as pd
import matplotlib.pyplot as plt
import csv
async def plot_user_activity(client, ctx):
plt.style.use('fivethirtyeight')
df = pd.read_csv('innovators.csv', encoding= 'unicode_escape')
author = df['author'].to_list()
... | [
"matplotlib.pyplot.savefig",
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.close",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.title",
"discord.File"
] | [((180, 212), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""fivethirtyeight"""'], {}), "('fivethirtyeight')\n", (193, 212), True, 'import matplotlib.pyplot as plt\n'), ((223, 279), 'pandas.read_csv', 'pd.read_csv', (['"""innovators.csv"""'], {'encoding': '"""unicode_escape"""'}), "('innovators.csv', encoding='u... |
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
SECRET_KEY = os.getenv('SECRET_KEY', '')
DEBUG = False
class DevelopmentConfig(Config):
DEBUG = True
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'flask_main.db')
SQLALCHEMY_TRACK_MODIFICATIONS = False... | [
"os.path.dirname",
"os.path.join",
"os.getenv"
] | [((37, 62), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (52, 62), False, 'import os\n'), ((96, 123), 'os.getenv', 'os.getenv', (['"""SECRET_KEY"""', '""""""'], {}), "('SECRET_KEY', '')\n", (105, 123), False, 'import os\n'), ((239, 277), 'os.path.join', 'os.path.join', (['basedir', '"""flas... |
"""Methods for working with ontologies and the OLS."""
from urllib.parse import quote_plus
import requests
OLS_API_ROOT = "http://www.ebi.ac.uk/ols/api"
# Curie means something like CL:0000001
def _ontology_name(curie):
"""Get the name of the ontology from the curie, CL or UBERON for example."""
return cur... | [
"urllib.parse.quote_plus",
"requests.get"
] | [((1646, 1663), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (1658, 1663), False, 'import requests\n'), ((2550, 2567), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (2562, 2567), False, 'import requests\n'), ((597, 612), 'urllib.parse.quote_plus', 'quote_plus', (['url'], {}), '(url)\n', (607, 6... |
from __future__ import print_function
import httplib2
import os
import sys
import pickle
from apiclient import discovery
from apiclient import errors
from oauth2client import client
from oauth2client import tools
from oauth2client.file import Storage
try:
import argparse
flags = argparse.ArgumentParser(parents... | [
"os.path.exists",
"os.makedirs",
"argparse.ArgumentParser",
"os.path.join",
"oauth2client.client.flow_from_clientsecrets",
"oauth2client.tools.run",
"oauth2client.file.Storage",
"httplib2.Http",
"oauth2client.tools.run_flow",
"apiclient.discovery.build",
"os.path.expanduser"
] | [((936, 959), 'os.path.expanduser', 'os.path.expanduser', (['"""~"""'], {}), "('~')\n", (954, 959), False, 'import os\n'), ((980, 1018), 'os.path.join', 'os.path.join', (['home_dir', '""".credentials"""'], {}), "(home_dir, '.credentials')\n", (992, 1018), False, 'import os\n'), ((1116, 1176), 'os.path.join', 'os.path.j... |
import numpy as np
import sys
## ROCKSTAR ##
halostruct1 = np.dtype([('id',np.int64),
('pos',np.float32,(6,)),
('corevel',np.float32,(3,)),
('bulkvel',np.float32,(3,)),
('m',np.float32),
('r',np.floa... | [
"numpy.dtype",
"sys.exit"
] | [((60, 1145), 'numpy.dtype', 'np.dtype', (["[('id', np.int64), ('pos', np.float32, (6,)), ('corevel', np.float32, (3,)),\n ('bulkvel', np.float32, (3,)), ('m', np.float32), ('r', np.float32), (\n 'child_r', np.float32), ('vmax_r', np.float32), ('mgrav', np.float32),\n ('vmax', np.float32), ('rvmax', np.float32... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""ics2entropiawiki
Read an ics file with the entropia events and insert them in to the
entropia homepage wiki.
Example:
$ ics2entropiawiki.py --config /etc/ics2entropiawiki/config.ini
Inserts events not in the past to the "Termine" Wiki page and appends past
... | [
"configparser.ConfigParser",
"locale.setlocale",
"argparse.ArgumentParser",
"dateutil.tz.tzlocal",
"mwclient.Site",
"requests.get",
"re.findall",
"datetime.timedelta"
] | [((1649, 1694), 'locale.setlocale', 'locale.setlocale', (['locale.LC_ALL', '"""de_DE.utf8"""'], {}), "(locale.LC_ALL, 'de_DE.utf8')\n", (1665, 1694), False, 'import locale\n'), ((5330, 5359), 'mwclient.Site', 'Site', (['"""entropia.de"""'], {'path': '"""/"""'}), "('entropia.de', path='/')\n", (5334, 5359), False, 'from... |
import os
import cflearn
import platform
import unittest
from cfdata.tabular import TabularDataset
num_jobs = 0 if platform.system() == "Linux" else 2
logging_folder = "__test_zoo__"
class TestZoo(unittest.TestCase):
@staticmethod
def _test_zoo_core(model: str) -> None:
x, y = TabularDataset.iris().... | [
"cflearn.evaluate",
"cfdata.tabular.TabularDataset.iris",
"os.path.join",
"cflearn.Zoo",
"platform.system",
"cflearn.make",
"unittest.main",
"cflearn._rmtree"
] | [((931, 946), 'unittest.main', 'unittest.main', ([], {}), '()\n', (944, 946), False, 'import unittest\n'), ((117, 134), 'platform.system', 'platform.system', ([], {}), '()\n', (132, 134), False, 'import platform\n'), ((344, 388), 'os.path.join', 'os.path.join', (['logging_folder', 'f"""__{model}__"""'], {}), "(logging_... |
# -*- coding: utf-8 -*-
# Copyright (c) 2013 <NAME>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merg... | [
"nearpy.hashes.RandomBinaryProjections",
"nearpy.hashes.HashPermutationMapper",
"numpy.zeros",
"nearpy.distances.CosineDistance",
"time.time",
"numpy.random.randn",
"nearpy.hashes.HashPermutations"
] | [((1613, 1624), 'time.time', 'time.time', ([], {}), '()\n', (1622, 1624), False, 'import time\n'), ((1681, 1707), 'nearpy.hashes.HashPermutations', 'HashPermutations', (['"""permut"""'], {}), "('permut')\n", (1697, 1707), False, 'from nearpy.hashes import RandomBinaryProjections, HashPermutations, HashPermutationMapper... |
from discord.ext import commands, tasks # Bot Commands Frameworkをインポート
import traceback # エラー表示のためにインポート
import os
import discord
import r
TOKEN = os.environ['DISCORD_BOT_TOKEN']
prefix = os.environ['DISCORD_BOT_PREFIX'] #プレフィックス
# 読み込むコグの名前を格納しておく。
INITIAL_EXTENSIONS = [
'cogs.eval',
'cogs.glchat',
'cogs... | [
"r.connect",
"traceback.print_exc",
"discord.Game"
] | [((1218, 1229), 'r.connect', 'r.connect', ([], {}), '()\n', (1227, 1229), False, 'import r\n'), ((795, 816), 'traceback.print_exc', 'traceback.print_exc', ([], {}), '()\n', (814, 816), False, 'import traceback\n'), ((1145, 1202), 'discord.Game', 'discord.Game', ([], {'name': 'f"""Ping:{self.ws.latency * 1000:.0f}ms"""'... |
import shutil
from pathlib import Path
from unittest import TestCase
from unittest.mock import Mock
from unittest.mock import patch
from foliant.config.downloadfile import download_file
from foliant.config.downloadfile import get_file_ext_from_url
from foliant.config.downloadfile import get_file_name_from_url
class... | [
"foliant.config.downloadfile.get_file_name_from_url",
"unittest.mock.Mock",
"foliant.config.downloadfile.get_file_ext_from_url",
"pathlib.Path",
"foliant.config.downloadfile.download_file",
"shutil.rmtree",
"unittest.mock.patch"
] | [((584, 643), 'unittest.mock.patch', 'patch', (['"""foliant.config.downloadfile.urlopen"""'], {'autospec': '(True)'}), "('foliant.config.downloadfile.urlopen', autospec=True)\n", (589, 643), False, 'from unittest.mock import patch\n'), ((1221, 1280), 'unittest.mock.patch', 'patch', (['"""foliant.config.downloadfile.url... |
import matplotlib.pyplot as plt
import numpy as np
from fears.utils import results_manager, plotter, dir_manager
import os
suffix = '07212021_0001'
data_folder = 'results_' + suffix
exp_info_file = 'experiment_info_' + suffix + '.p'
exp_folders,exp_info = results_manager.get_experiment_results(data_folder,
... | [
"numpy.flip",
"fears.utils.results_manager.get_data",
"os.listdir",
"fears.utils.results_manager.get_experiment_results",
"numpy.max",
"fears.utils.plotter.plot_timecourse_to_axes",
"numpy.argwhere",
"matplotlib.pyplot.subplots"
] | [((258, 324), 'fears.utils.results_manager.get_experiment_results', 'results_manager.get_experiment_results', (['data_folder', 'exp_info_file'], {}), '(data_folder, exp_info_file)\n', (296, 324), False, 'from fears.utils import results_manager, plotter, dir_manager\n'), ((512, 526), 'numpy.flip', 'np.flip', (['k_abs'],... |
# Copyright (c) 1999-2008 <NAME> and <NAME>
# Copyright (c) 2009 The Hewlett-Packard Development Company
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retai... | [
"slicc.symbols.Type.Type"
] | [((2387, 2458), 'slicc.symbols.Type.Type', 'Type', (['self.symtab', 'ident', 'self.location', 'self.pairs', 'self.state_machine'], {}), '(self.symtab, ident, self.location, self.pairs, self.state_machine)\n', (2391, 2458), False, 'from slicc.symbols.Type import Type\n')] |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import ray
from ray.rllib.ddpg2.models import DDPGModel
from ray.rllib.models.catalog import ModelCatalog
from ray.rllib.optimizers import PolicyEvaluator
from ray.rllib.utils.filter import ... | [
"numpy.ones_like",
"ray.remote",
"ray.rllib.utils.filter.NoFilter",
"ray.rllib.ddpg2.models.DDPGModel"
] | [((2374, 2399), 'ray.remote', 'ray.remote', (['DDPGEvaluator'], {}), '(DDPGEvaluator)\n', (2384, 2399), False, 'import ray\n'), ((712, 749), 'ray.rllib.ddpg2.models.DDPGModel', 'DDPGModel', (['registry', 'self.env', 'config'], {}), '(registry, self.env, config)\n', (721, 749), False, 'from ray.rllib.ddpg2.models import... |
from math import sqrt
from skimage import data
from skimage.feature import blob_dog, blob_log, blob_doh
from skimage.color import rgb2gray
from skimage import io
import matplotlib.pyplot as plt
image = io.imread("star.jpg")
image_gray = rgb2gray(image)
blobs_log = blob_log(image_gray, max_sigma=30, num_sigma=10, th... | [
"skimage.color.rgb2gray",
"matplotlib.pyplot.Circle",
"skimage.feature.blob_dog",
"math.sqrt",
"skimage.io.imread",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.tight_layout",
"skimage.feature.blob_doh",
"skimage.feature.blob_log",
"matplotlib.pyplot.show"
] | [((205, 226), 'skimage.io.imread', 'io.imread', (['"""star.jpg"""'], {}), "('star.jpg')\n", (214, 226), False, 'from skimage import io\n'), ((240, 255), 'skimage.color.rgb2gray', 'rgb2gray', (['image'], {}), '(image)\n', (248, 255), False, 'from skimage.color import rgb2gray\n'), ((269, 332), 'skimage.feature.blob_log'... |
# -*- coding: utf-8 -*-
r"""
Dirichlet characters
A :class:`DirichletCharacter` is the extension of a homomorphism
.. MATH::
(\ZZ/N\ZZ)^* \to R^*,
for some ring `R`, to the map `\ZZ/N\ZZ \to R` obtained by sending
those `x\in\ZZ/N\ZZ` with `\gcd(N,x)>1` to `0`.
EXAMPLES::
sage: G = DirichletGroup(35)
... | [
"sage.categories.all.Objects",
"sage.rings.complex_mpfr.ComplexField",
"sage.structure.element.MultiplicativeGroupElement.__init__",
"webbrowser.open",
"sage.rings.number_field.number_field.is_CyclotomicField",
"sage.categories.groups.Groups",
"sage.rings.complex_mpfr.is_ComplexField",
"sage.lfunction... | [((3225, 3246), 'sage.rings.all.RationalField', 'rings.RationalField', ([], {}), '()\n', (3244, 3246), True, 'import sage.rings.all as rings\n'), ((4241, 4257), 'sage.rings.all.Integer', 'rings.Integer', (['d'], {}), '(d)\n', (4254, 4257), True, 'import sage.rings.all as rings\n'), ((4328, 4355), 'sage.arith.all.fundam... |
"""
Module for sending Push Notifications
"""
import logging
import requests
from django.conf import settings
from ...models import PushNotificationTranslation
from ...models import Region
from ...constants import push_notifications as pnt_const
logger = logging.getLogger(__name__)
# pylint: disable=too-few-public... | [
"logging.getLogger",
"requests.post"
] | [((258, 285), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (275, 285), False, 'import logging\n'), ((4140, 4198), 'requests.post', 'requests.post', (['self.fcm_url'], {'json': 'payload', 'headers': 'headers'}), '(self.fcm_url, json=payload, headers=headers)\n', (4153, 4198), False, 'imp... |
#coding:utf-8
#
# id: functional.index.create.03
# title: CREATE ASC INDEX
# decription: CREATE ASC INDEX
#
# Dependencies:
# CREATE DATABASE
# CREATE TABLE
# SHOW INDEX
# tracker_id:
# min_versions: []
# versions: 1.0
# qm... | [
"pytest.mark.version",
"firebird.qa.db_factory",
"firebird.qa.isql_act"
] | [((563, 608), 'firebird.qa.db_factory', 'db_factory', ([], {'sql_dialect': '(3)', 'init': 'init_script_1'}), '(sql_dialect=3, init=init_script_1)\n', (573, 608), False, 'from firebird.qa import db_factory, isql_act, Action\n'), ((689, 751), 'firebird.qa.isql_act', 'isql_act', (['"""db_1"""', 'test_script_1'], {'substit... |
import numpy as np
from defdap.quat import Quat
hex_syms = Quat.symEqv("hexagonal")
# subset of hexagonal symmetries that give unique orientations when the
# Burgers transformation is applied
unq_hex_syms = [
hex_syms[0],
hex_syms[5],
hex_syms[4],
hex_syms[2],
hex_syms[10],
hex_syms[11]
]
cubi... | [
"numpy.array",
"defdap.quat.Quat.symEqv",
"defdap.quat.Quat.fromEulerAngles"
] | [((60, 84), 'defdap.quat.Quat.symEqv', 'Quat.symEqv', (['"""hexagonal"""'], {}), "('hexagonal')\n", (71, 84), False, 'from defdap.quat import Quat\n'), ((329, 349), 'defdap.quat.Quat.symEqv', 'Quat.symEqv', (['"""cubic"""'], {}), "('cubic')\n", (340, 349), False, 'from defdap.quat import Quat\n'), ((789, 823), 'defdap.... |
# -*- coding: utf-8 -*-
from __future__ import division, unicode_literals, print_function, absolute_import
from pint.util import (UnitsContainer)
from pint.converters import (ScaleConverter, OffsetConverter)
from pint.definitions import (Definition, PrefixDefinition, UnitDefinition,
Dime... | [
"pint.definitions.DimensionDefinition",
"pint.definitions.Definition.from_string",
"pint.util.UnitsContainer"
] | [((1118, 1161), 'pint.definitions.Definition.from_string', 'Definition.from_string', (['"""kilo- = 1e-3 = k-"""'], {}), "('kilo- = 1e-3 = k-')\n", (1140, 1161), False, 'from pint.definitions import Definition, PrefixDefinition, UnitDefinition, DimensionDefinition, AliasDefinition\n'), ((1469, 1524), 'pint.definitions.D... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 26 16:34:21 2018
@author: LiHongWang
"""
import os
import tensorflow as tf
from model import fcn_vgg
from model import fcn_mobile
from model import fcn_resnet_v2
from data import input_data
slim = tf.contrib.slim
def main():
num_classes... | [
"os.path.exists",
"tensorflow.device",
"tensorflow.ConfigProto",
"tensorflow.Graph",
"os.makedirs",
"tensorflow.train.RMSPropOptimizer",
"tensorflow.logging.set_verbosity",
"tensorflow.contrib.framework.get_or_create_global_step",
"model.fcn_mobile.fcn_mobv1",
"tensorflow.summary.histogram",
"da... | [((440, 465), 'os.path.exists', 'os.path.exists', (['train_dir'], {}), '(train_dir)\n', (454, 465), False, 'import os\n'), ((476, 498), 'os.makedirs', 'os.makedirs', (['train_dir'], {}), '(train_dir)\n', (487, 498), False, 'import os\n'), ((567, 615), 'tensorflow.contrib.framework.get_or_create_global_step', 'tf.contri... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import codecs
from setuptools import find_packages, setup
setup(
name='filetype',
version='1.0.7',
description='Infer file type and MIME type of any file/buffer. '
'No external dependencies.',
long_description=codecs.open('README.rst', 'r',... | [
"codecs.open",
"setuptools.find_packages"
] | [((1441, 1510), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['dist', 'build', 'docs', 'tests', 'examples']"}), "(exclude=['dist', 'build', 'docs', 'tests', 'examples'])\n", (1454, 1510), False, 'from setuptools import find_packages, setup\n'), ((290, 355), 'codecs.open', 'codecs.open', (['"""README.r... |
from tools.geofunc import GeoFunc
import pandas as pd
import json
def getData(index):
'''报错数据集有(空心):han,jakobs1,jakobs2 '''
'''形状过多暂时未处理:shapes、shirt、swim、trousers'''
name=["ga","albano","blaz1","blaz2","dighe1","dighe2","fu","han","jakobs1","jakobs2","mao","marques","shapes","shirts","swim","trousers"]
... | [
"tools.geofunc.GeoFunc.normData",
"json.loads",
"pandas.read_csv"
] | [((479, 522), 'pandas.read_csv', 'pd.read_csv', (["('data/' + name[index] + '.csv')"], {}), "('data/' + name[index] + '.csv')\n", (490, 522), True, 'import pandas as pd\n'), ((627, 655), 'json.loads', 'json.loads', (["df['polygon'][i]"], {}), "(df['polygon'][i])\n", (637, 655), False, 'import json\n'), ((668, 704), 'to... |
#############################################################################
#
# VFRAME
# MIT License
# Copyright (c) 2020 <NAME> and VFRAME
# https://vframe.io
#
#############################################################################
import click
@click.command('')
@click.option('-i', '--input', 'opt_dir_i... | [
"click.option",
"click.command",
"cv2.blur",
"vframe.utils.file_utils.glob_multi",
"pathos.multiprocessing.cpu_count",
"cv2.imread",
"pathos.multiprocessing.ProcessingPool"
] | [((261, 278), 'click.command', 'click.command', (['""""""'], {}), "('')\n", (274, 278), False, 'import click\n'), ((280, 338), 'click.option', 'click.option', (['"""-i"""', '"""--input"""', '"""opt_dir_in"""'], {'required': '(True)'}), "('-i', '--input', 'opt_dir_in', required=True)\n", (292, 338), False, 'import click... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import os
import matplotlib.pyplot as plt
import CurveFit
import shutil
#find all DIRECTORIES containing non-hidden files ending in FILENAME
def getDataDirectories(DIRECTORY, FILENAME="valLoss.txt"):
directories=[]
for directory in os.scand... | [
"os.path.exists",
"os.makedirs",
"pandas.read_csv",
"os.scandir",
"numpy.array"
] | [((312, 333), 'os.scandir', 'os.scandir', (['DIRECTORY'], {}), '(DIRECTORY)\n', (322, 333), False, 'import os\n'), ((668, 689), 'os.scandir', 'os.scandir', (['DIRECTORY'], {}), '(DIRECTORY)\n', (678, 689), False, 'import os\n'), ((1388, 1409), 'os.scandir', 'os.scandir', (['SEARCHDIR'], {}), '(SEARCHDIR)\n', (1398, 140... |
import os.path
import time
import logging
import yaml
from piecrust.processing.base import Processor
logger = logging.getLogger(__name__)
class _ConcatInfo(object):
timestamp = 0
files = None
delim = "\n"
class ConcatProcessor(Processor):
PROCESSOR_NAME = 'concat'
def __init__(self):
... | [
"logging.getLogger",
"time.time",
"yaml.load"
] | [((112, 139), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (129, 139), False, 'import logging\n'), ((1416, 1427), 'time.time', 'time.time', ([], {}), '()\n', (1425, 1427), False, 'import time\n'), ((1787, 1800), 'yaml.load', 'yaml.load', (['fp'], {}), '(fp)\n', (1796, 1800), False, 'imp... |
import FWCore.ParameterSet.Config as cms
#
# module to make the MaxSumPtWMass jet combination
#
findTtSemiLepJetCombMaxSumPtWMass = cms.EDProducer("TtSemiLepJetCombMaxSumPtWMass",
## jet input
jets = cms.InputTag("selectedPatJets"),
## lepton input
leps = cms.InputTag("selectedPatMuons"),
## ma... | [
"FWCore.ParameterSet.Config.string",
"FWCore.ParameterSet.Config.double",
"FWCore.ParameterSet.Config.InputTag",
"FWCore.ParameterSet.Config.int32",
"FWCore.ParameterSet.Config.bool"
] | [((211, 242), 'FWCore.ParameterSet.Config.InputTag', 'cms.InputTag', (['"""selectedPatJets"""'], {}), "('selectedPatJets')\n", (223, 242), True, 'import FWCore.ParameterSet.Config as cms\n'), ((277, 309), 'FWCore.ParameterSet.Config.InputTag', 'cms.InputTag', (['"""selectedPatMuons"""'], {}), "('selectedPatMuons')\n", ... |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | [
"numpy.fromfile",
"argparse.ArgumentParser",
"mindspore.context.set_context",
"os.path.join",
"numpy.max",
"numpy.exp",
"numpy.sum",
"numpy.array",
"mindspore.load_checkpoint",
"numpy.concatenate",
"src.ms_utils.calculate_auc"
] | [((876, 908), 'numpy.max', 'np.max', (['x'], {'axis': '(1)', 'keepdims': '(True)'}), '(x, axis=1, keepdims=True)\n', (882, 908), True, 'import numpy as np\n'), ((967, 984), 'numpy.exp', 'np.exp', (['(x - t_max)'], {}), '(x - t_max)\n', (973, 984), True, 'import numpy as np\n'), ((1039, 1073), 'numpy.sum', 'np.sum', (['... |
import re
import numpy as np
from collections import OrderedDict
import pykeops
import pykeops.config
############################################################
# define backend
############################################################
class SetBackend():
"""
This class is used to centralized the op... | [
"re.split",
"collections.OrderedDict"
] | [((362, 399), 'collections.OrderedDict', 'OrderedDict', (["[('CPU', 0), ('GPU', 1)]"], {}), "([('CPU', 0), ('GPU', 1)])\n", (373, 399), False, 'from collections import OrderedDict\n'), ((408, 443), 'collections.OrderedDict', 'OrderedDict', (["[('1D', 0), ('2D', 1)]"], {}), "([('1D', 0), ('2D', 1)])\n", (419, 443), Fals... |
#-----------------------------------------------------------------------------
# Copyright (c) 2005-2017, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this s... | [
"PyInstaller.utils.hooks.is_module_satisfies",
"PyInstaller.utils.hooks.qt_menu_nib_dir",
"PyInstaller.compat.getsitepackages",
"os.path.join",
"PyInstaller.utils.hooks.get_module_file_attribute",
"PyInstaller.utils.hooks.get_module_attribute"
] | [((1685, 1739), 'PyInstaller.utils.hooks.get_module_attribute', 'get_module_attribute', (['"""PyQt5.QtCore"""', '"""QT_VERSION_STR"""'], {}), "('PyQt5.QtCore', 'QT_VERSION_STR')\n", (1705, 1739), False, 'from PyInstaller.utils.hooks import get_module_attribute, is_module_satisfies, qt_menu_nib_dir, get_module_file_attr... |
from vyper import ast as vy_ast
def test_output_class():
old_node = vy_ast.parse_to_ast("foo = 42")
new_node = vy_ast.Int.from_node(old_node, value=666)
assert isinstance(new_node, vy_ast.Int)
def test_source():
old_node = vy_ast.parse_to_ast("foo = 42")
new_node = vy_ast.Int.from_node(old_node... | [
"vyper.ast.parse_to_ast",
"vyper.ast.Int.from_node",
"vyper.ast.compare_nodes"
] | [((74, 105), 'vyper.ast.parse_to_ast', 'vy_ast.parse_to_ast', (['"""foo = 42"""'], {}), "('foo = 42')\n", (93, 105), True, 'from vyper import ast as vy_ast\n'), ((121, 162), 'vyper.ast.Int.from_node', 'vy_ast.Int.from_node', (['old_node'], {'value': '(666)'}), '(old_node, value=666)\n', (141, 162), True, 'from vyper im... |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | [
"aiida.orm.Dict",
"aiida.orm.load_node",
"aiida.orm.QueryBuilder",
"aiida.orm.Computer",
"aiida.orm.FolderData",
"aiida.common.exceptions.InputValidationError",
"aiida.orm.CalcFunctionNode",
"aiida.orm.Log",
"aiida.orm.CalcJobNode",
"aiida.restapi.run_api.configure_api",
"aiida.orm.StructureData... | [((1413, 1454), 'aiida.restapi.run_api.configure_api', 'configure_api', ([], {'catch_internal_server': '(True)'}), '(catch_internal_server=True)\n', (1426, 1454), False, 'from aiida.restapi.run_api import configure_api\n'), ((1630, 1658), 'aiida.orm.StructureData', 'orm.StructureData', ([], {'cell': 'cell'}), '(cell=ce... |
# https://www.acmicpc.net/problem/13023
import sys
sys.setrecursionlimit(999999999)
def dfs_all():
is_possible = [False]
for node in range(N):
visited = [False for _ in range(N)]
dfs(node, 0, visited, is_possible)
if is_possible[0]:
return 1
return 0
def dfs(cur, ... | [
"sys.setrecursionlimit"
] | [((52, 84), 'sys.setrecursionlimit', 'sys.setrecursionlimit', (['(999999999)'], {}), '(999999999)\n', (73, 84), False, 'import sys\n')] |
# This file is part of postcipes
# (c) <NAME>
# The code is released under the MIT Licence.
# See LICENCE.txt and the Legal section in the README for more information
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from .postcipe import Postcipe
import turbu... | [
"turbulucid.Case",
"turbulucid.edge_lengths",
"numpy.sqrt",
"turbulucid.isoline"
] | [((548, 562), 'turbulucid.Case', 'tbl.Case', (['path'], {}), '(path)\n', (556, 562), True, 'import turbulucid as tbl\n'), ((803, 839), 'turbulucid.edge_lengths', 'tbl.edge_lengths', (['self.case', '"""inlet"""'], {}), "(self.case, 'inlet')\n", (819, 839), True, 'import turbulucid as tbl\n'), ((1069, 1115), 'turbulucid.... |
# vi: ts=4 sw=4
'''AreaDetector Devices
`areaDetector`_ detector abstractions
.. _areaDetector: https://areadetector.github.io/master/index.html
'''
import warnings
from .base import (ADBase, ADComponent as C)
from . import cam
__all__ = ['DetectorBase',
'AreaDetector',
'AdscDetector',
... | [
"warnings.warn"
] | [((2736, 2823), 'warnings.warn', 'warnings.warn', (['""".dispatch is deprecated, use .generate_datum instead"""'], {'stacklevel': '(2)'}), "('.dispatch is deprecated, use .generate_datum instead',\n stacklevel=2)\n", (2749, 2823), False, 'import warnings\n')] |
import os
from functools import wraps
from os.path import join as join_path
from dash import Dash
from flask import make_response, render_template_string, redirect
excluded_resources_endpoints = (
'static', '_dash_assets.static', '/_favicon.ico', '/login', '/logout',
'/_user', '/auth')
def add_routes(app,... | [
"os.path.join",
"functools.wraps",
"flask.redirect",
"flask.render_template_string",
"os.path.abspath"
] | [((2264, 2309), 'os.path.join', 'join_path', (['pyfile_path', '"""templates"""', 'filename'], {}), "(pyfile_path, 'templates', filename)\n", (2273, 2309), True, 'from os.path import join as join_path\n'), ((1175, 1213), 'flask.render_template_string', 'render_template_string', (['login_template'], {}), '(login_template... |
# Generated by Django 4.0.1 on 2022-04-07 01:20
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('model_api', '0004_remove_order_created_remove_order_id_and_more'),
]
operations = [
migrations.RemoveField(
model_name='order',
... | [
"django.db.migrations.RemoveField",
"django.db.models.AutoField",
"django.db.models.CharField"
] | [((264, 330), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""order"""', 'name': '"""dateTimeCreated"""'}), "(model_name='order', name='dateTimeCreated')\n", (286, 330), False, 'from django.db import migrations, models\n'), ((472, 539), 'django.db.models.AutoField', 'models.AutoFie... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2015-12-21 12:22
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.... | [
"django.db.models.DateField",
"django.db.models.TextField",
"django.db.models.IntegerField",
"django.db.models.ForeignKey",
"django.db.models.SlugField",
"django.db.models.AutoField",
"django.db.models.PositiveIntegerField",
"django.db.models.DateTimeField",
"django.db.migrations.swappable_dependenc... | [((309, 366), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (340, 366), False, 'from django.db import migrations, models\n'), ((6611, 6699), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'on_delete': 'djang... |
# This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from flask import redirect
from indico.modules.events.abstracts.models.abstracts import Abstract
from ind... | [
"indico.web.flask.util.url_for",
"indico.modules.events.abstracts.models.abstracts.Abstract.find"
] | [((606, 671), 'indico.web.flask.util.url_for', 'url_for', (["('abstracts.' + endpoint)", 'abstract'], {'management': 'management'}), "('abstracts.' + endpoint, abstract, management=management)\n", (613, 671), False, 'from indico.web.flask.util import url_for\n'), ((515, 570), 'indico.modules.events.abstracts.models.abs... |
from parsel import Selector
import requests, json, re
params = {
"q": "<NAME>",
"tbm": "bks",
"gl": "us",
"hl": "en"
}
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.87 Safari/537.36",
}
html = requests.get("https://www... | [
"requests.get",
"parsel.Selector"
] | [((295, 389), 'requests.get', 'requests.get', (['"""https://www.google.com/search"""'], {'params': 'params', 'headers': 'headers', 'timeout': '(30)'}), "('https://www.google.com/search', params=params, headers=\n headers, timeout=30)\n", (307, 389), False, 'import requests, json, re\n'), ((396, 420), 'parsel.Selecto... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import io
import json
import os
import random
import re
import string
import time
from functools import wraps
from hashlib import sha1
import six
try:
from secrets import choice
except ImportError:
from random import choice
str... | [
"json.loads",
"random.choice",
"re.compile",
"json.dumps",
"six.binary_type",
"re.match",
"functools.wraps",
"os.path.dirname",
"six.text_type",
"hashlib.sha1",
"time.time",
"random.randint"
] | [((399, 423), 're.compile', 're.compile', (['"""regex_test"""'], {}), "('regex_test')\n", (409, 423), False, 'import re\n'), ((868, 906), 're.match', 're.match', (['"""^[A-Za-z0-9]{3,32}$"""', 'token'], {}), "('^[A-Za-z0-9]{3,32}$', token)\n", (876, 906), False, 'import re\n'), ((990, 1003), 'functools.wraps', 'wraps',... |
# Copyright 2015 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... | [
"platform.system"
] | [((5500, 5518), 'platform.system', '_platform.system', ([], {}), '()\n', (5516, 5518), True, 'import platform as _platform\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Test Tango device server for use with scaling tests."""
import sys
import time
import argparse
import tango
from tango.server import run
from TestDevice import TestDevice
def init_callback():
"""Report server start up times.
This callback is executed post ... | [
"tango.server.run",
"argparse.ArgumentParser",
"tango.Database",
"time.sleep",
"time.time",
"tango.DbDevInfo"
] | [((421, 437), 'tango.Database', 'tango.Database', ([], {}), '()\n', (435, 437), False, 'import tango\n'), ((908, 924), 'tango.Database', 'tango.Database', ([], {}), '()\n', (922, 924), False, 'import tango\n'), ((1313, 1329), 'tango.Database', 'tango.Database', ([], {}), '()\n', (1327, 1329), False, 'import tango\n'), ... |
from pathlib import Path
import pytest
from haystack.document_store.elasticsearch import ElasticsearchDocumentStore
from haystack.pipeline import TranslationWrapperPipeline, JoinDocuments, ExtractiveQAPipeline, Pipeline, FAQPipeline, \
DocumentSearchPipeline, RootNode
from haystack.retriever.dense import DensePas... | [
"haystack.pipeline.ExtractiveQAPipeline",
"haystack.pipeline.FAQPipeline",
"pathlib.Path",
"haystack.retriever.sparse.ElasticsearchRetriever",
"haystack.retriever.dense.DensePassageRetriever",
"pytest.mark.parametrize",
"haystack.pipeline.DocumentSearchPipeline",
"pytest.raises",
"haystack.pipeline.... | [((398, 487), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""document_store_with_docs"""', "['elasticsearch']"], {'indirect': '(True)'}), "('document_store_with_docs', ['elasticsearch'],\n indirect=True)\n", (421, 487), False, 'import pytest\n'), ((1477, 1607), 'pytest.mark.parametrize', 'pytest.mark.pa... |
# pylint: disable=protected-access
"""
Test the wrappers for the C API.
"""
import os
from contextlib import contextmanager
import numpy as np
import numpy.testing as npt
import pandas as pd
import pytest
import xarray as xr
from packaging.version import Version
from pygmt import Figure, clib
from pygmt.clib.conversio... | [
"pygmt.clib.Session",
"numpy.array",
"pygmt.Figure",
"numpy.arange",
"os.path.exists",
"numpy.flip",
"pygmt.helpers.GMTTempFile",
"numpy.testing.assert_allclose",
"pygmt.clib.conversion.dataarray_to_matrix",
"numpy.linspace",
"numpy.logspace",
"numpy.ones",
"numpy.flipud",
"numpy.fliplr",
... | [((14171, 14218), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""dtype"""', '[str, object]'], {}), "('dtype', [str, object])\n", (14194, 14218), False, 'import pytest\n'), ((14965, 15012), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""dtype"""', '[str, object]'], {}), "('dtype', [str, object]... |
from __future__ import annotations
from datetime import timedelta
import operator
from sys import getsizeof
from typing import (
TYPE_CHECKING,
Any,
Callable,
Hashable,
List,
cast,
)
import warnings
import numpy as np
from pandas._libs import index as libindex
from pandas._libs.lib import no_... | [
"pandas.core.construction.extract_array",
"pandas.compat.numpy.function.validate_argsort",
"pandas.core.dtypes.common.is_scalar",
"numpy.arange",
"pandas.compat.numpy.function.validate_min",
"pandas.core.indexes.numeric.Int64Index",
"pandas.core.common.any_not_none",
"sys.getsizeof",
"numpy.asarray"... | [((10265, 10288), 'pandas.util._decorators.doc', 'doc', (['Int64Index.get_loc'], {}), '(Int64Index.get_loc)\n', (10268, 10288), False, 'from pandas.util._decorators import cache_readonly, doc\n'), ((12844, 12868), 'pandas.util._decorators.doc', 'doc', (['Int64Index.__iter__'], {}), '(Int64Index.__iter__)\n', (12847, 12... |
import torch
import torch.nn as nn
class NeuralNet(nn.Module):
def __init__(self, input_size, hidden_size, num_classes):
super(NeuralNet, self).__init__()
self.l1 = nn.Linear(input_size, hidden_size)
self.l2 = nn.Linear(hidden_size, hidden_size)
self.l3 = nn.Linear(hidden_size, h... | [
"torch.nn.ReLU",
"torch.nn.Linear"
] | [((187, 221), 'torch.nn.Linear', 'nn.Linear', (['input_size', 'hidden_size'], {}), '(input_size, hidden_size)\n', (196, 221), True, 'import torch.nn as nn\n'), ((241, 276), 'torch.nn.Linear', 'nn.Linear', (['hidden_size', 'hidden_size'], {}), '(hidden_size, hidden_size)\n', (250, 276), True, 'import torch.nn as nn\n'),... |
""" Logging functions for the ``jwql`` automation platform.
This module provides decorators to log the execution of modules. Log
files are written to the ``logs/`` directory in the ``jwql`` central
storage area, named by module name and timestamp, e.g.
``monitor_filesystem/monitor_filesystem_2018-06-20-15:22:51.log`... | [
"logging.basicConfig",
"traceback.format_exc",
"importlib.import_module",
"time.clock",
"os.getuid",
"os.path.join",
"logging.warning",
"functools.wraps",
"sys.version.replace",
"os.path.dirname",
"datetime.datetime.now",
"logging.critical",
"time.time",
"getpass.getuser",
"socket.gethos... | [((2388, 2537), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': 'log_file', 'format': '"""%(asctime)s %(levelname)s: %(message)s"""', 'datefmt': '"""%m/%d/%Y %H:%M:%S %p"""', 'level': 'logging.INFO'}), "(filename=log_file, format=\n '%(asctime)s %(levelname)s: %(message)s', datefmt=\n '%m/%d/%Y %H... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020-2021 by <NAME>. All rights reserved. This file is part
# of the Robot Operating System project, released under the MIT License. Please
# see the LICENSE file included as part of this package.
#
# author: <NAME>
# created: 2020-09-19
# modified: 2020-0... | [
"colorsys.hsv_to_rgb",
"lib.logger.Logger",
"ioexpander.IOE",
"colorama.init"
] | [((412, 418), 'colorama.init', 'init', ([], {}), '()\n', (416, 418), False, 'from colorama import init, Fore, Style\n'), ((856, 876), 'lib.logger.Logger', 'Logger', (['"""ioe"""', 'level'], {}), "('ioe', level)\n", (862, 876), False, 'from lib.logger import Logger\n'), ((2329, 2360), 'ioexpander.IOE', 'io.IOE', ([], {'... |
from django import template
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.template import loader
@login_required(login_url="/login/")
def index(request):
context = {}
context["segment"] = "index"
html_template = loader.get_template("index.html"... | [
"django.template.loader.get_template",
"django.contrib.auth.decorators.login_required"
] | [((161, 196), 'django.contrib.auth.decorators.login_required', 'login_required', ([], {'login_url': '"""/login/"""'}), "(login_url='/login/')\n", (175, 196), False, 'from django.contrib.auth.decorators import login_required\n'), ((389, 424), 'django.contrib.auth.decorators.login_required', 'login_required', ([], {'logi... |
import random
import string
import os
from IPython.display import display, HTML
from .utils import html_loader
from .utils import get_content
from jinja2 import Template
class JupyterSlides:
def __init__(
self,
content_path='./content.yaml',
table_contents=False
):
self.set_ba... | [
"random.choice",
"jinja2.Template",
"os.getcwd",
"os.path.isfile",
"os.path.realpath",
"IPython.display.HTML"
] | [((870, 881), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (879, 881), False, 'import os\n'), ((1373, 1421), 'os.path.isfile', 'os.path.isfile', (['f"""{self.template_dir}/init.html"""'], {}), "(f'{self.template_dir}/init.html')\n", (1387, 1421), False, 'import os\n'), ((1782, 1840), 'os.path.isfile', 'os.path.isfile', ... |
from decimal import Decimal
from fixtures import * # noqa: F401,F403
from fixtures import TEST_NETWORK
from flaky import flaky # noqa: F401
from pyln.client import RpcError, Millisatoshi
from utils import (
only_one, wait_for, sync_blockheight, EXPERIMENTAL_FEATURES, COMPAT,
VALGRIND
)
import os
import pytes... | [
"utils.only_one",
"subprocess.check_call",
"os.openpty",
"unittest.skipIf",
"os.path.join",
"time.sleep",
"pyln.client.Millisatoshi",
"pytest.raises",
"decimal.Decimal",
"utils.sync_blockheight"
] | [((371, 487), 'unittest.skipIf', 'unittest.skipIf', (["(TEST_NETWORK != 'regtest')", '"""Test relies on a number of example addresses valid only in regtest"""'], {}), "(TEST_NETWORK != 'regtest',\n 'Test relies on a number of example addresses valid only in regtest')\n", (386, 487), False, 'import unittest\n'), ((89... |
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
#
import collections
import os
imp... | [
"fairseq.progress_bar.progress_bar",
"torch.cuda.device_count",
"torch.cuda.is_available",
"fairseq.data.load_with_check",
"os.path.exists",
"fairseq.options.add_dataset_args",
"fairseq.utils.build_criterion",
"fairseq.options.add_checkpoint_args",
"fairseq.sequence_generator.SequenceGenerator",
"... | [((654, 683), 'fairseq.options.get_parser', 'options.get_parser', (['"""Trainer"""'], {}), "('Trainer')\n", (672, 683), False, 'from fairseq import bleu, data, options, utils\n'), ((703, 735), 'fairseq.options.add_dataset_args', 'options.add_dataset_args', (['parser'], {}), '(parser)\n', (727, 735), False, 'from fairse... |
from django.core.management.base import BaseCommand
from django.utils import termcolors
from jsonschema import Draft4Validator
from jsonschema.exceptions import SchemaError
import json
class Command(BaseCommand):
can_import_settings = True
@property
def _jsonschema_exist(self):
from django.conf ... | [
"jsonschema.Draft4Validator.check_schema",
"django.utils.termcolors.make_style",
"json.dumps"
] | [((1013, 1046), 'django.utils.termcolors.make_style', 'termcolors.make_style', ([], {'fg': '"""green"""'}), "(fg='green')\n", (1034, 1046), False, 'from django.utils import termcolors\n'), ((1063, 1094), 'django.utils.termcolors.make_style', 'termcolors.make_style', ([], {'fg': '"""red"""'}), "(fg='red')\n", (1084, 109... |
import cv2, time
import numpy as np
import Tkinter
"""
Wraps up some interfaces to opencv user interface methods (displaying
image frames, event handling, etc).
If desired, an alternative UI could be built and imported into get_pulse.py
instead. Opencv is used to perform much of the data analysis, but there is no
re... | [
"Tkinter.Label",
"cv2.merge",
"cv2.destroyWindow",
"numpy.argmax",
"numpy.array",
"numpy.zeros",
"cv2.cvtColor",
"cv2.resize",
"cv2.waitKey"
] | [((468, 495), 'cv2.resize', 'cv2.resize', (['*args'], {}), '(*args, **kwargs)\n', (478, 495), False, 'import cv2, time\n'), ((583, 628), 'cv2.cvtColor', 'cv2.cvtColor', (['output_frame', 'cv2.COLOR_BGR2RGB'], {}), '(output_frame, cv2.COLOR_BGR2RGB)\n', (595, 628), False, 'import cv2, time\n'), ((845, 879), 'cv2.destroy... |
# -*- coding: utf-8 -*-
# Natural Language Toolkit: Transformation-based learning
#
# Copyright (C) 2001-2018 NLTK Project
# Author: <NAME> <<EMAIL>>
# based on previous (nltk2) version by
# <NAME>, <NAME>, <NAME>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
from __future__ import print_fu... | [
"collections.Counter",
"inspect.getmembers",
"collections.defaultdict"
] | [((5303, 5364), 'inspect.getmembers', 'inspect.getmembers', (['sys.modules[__name__]', 'inspect.isfunction'], {}), '(sys.modules[__name__], inspect.isfunction)\n', (5321, 5364), False, 'import inspect\n'), ((8385, 8401), 'collections.defaultdict', 'defaultdict', (['set'], {}), '(set)\n', (8396, 8401), False, 'from coll... |
import json
import logging
import sys
import numpy as np
import torch
from task_config import SuperGLUE_LABEL_MAPPING
from snorkel.mtl.data import MultitaskDataset
sys.path.append("..") # Adds higher directory to python modules path.
logger = logging.getLogger(__name__)
TASK_NAME = "WSC"
def get_char_index(tex... | [
"logging.getLogger",
"json.loads",
"snorkel.mtl.data.MultitaskDataset",
"torch.LongTensor",
"numpy.array",
"sys.path.append"
] | [((167, 188), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (182, 188), False, 'import sys\n'), ((249, 276), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (266, 276), False, 'import logging\n'), ((7278, 7658), 'snorkel.mtl.data.MultitaskDataset', 'MultitaskDataset... |
import re
import json
__all__ = ["Simplimental"]
class Simplimental:
def __init__(self, text="This is not a bad idea"):
self.text = text
with open('simplimental/data/afinn.json') as data_file:
self.dictionary = json.load(data_file)
no_punctunation = re.sub(r"[^a-zA-Z ]+", " ", self.text)
self.toke... | [
"json.load",
"re.sub"
] | [((270, 307), 're.sub', 're.sub', (['"""[^a-zA-Z ]+"""', '""" """', 'self.text'], {}), "('[^a-zA-Z ]+', ' ', self.text)\n", (276, 307), False, 'import re\n'), ((228, 248), 'json.load', 'json.load', (['data_file'], {}), '(data_file)\n', (237, 248), False, 'import json\n')] |
# This example shows how to read or modify the Axes Optimization settings using the RoboDK API and a JSON string.
# You can select "Axes optimization" in a robot machining menu or the robot parameters to view the axes optimization settings.
# It is possible to update the axes optimization settings attached to a robot o... | [
"json.loads",
"json.dumps"
] | [((2415, 2435), 'json.dumps', 'json.dumps', (['ToUpdate'], {}), '(ToUpdate)\n', (2425, 2435), False, 'import json\n'), ((3335, 3356), 'json.loads', 'json.loads', (['json_data'], {}), '(json_data)\n', (3345, 3356), False, 'import json\n'), ((3555, 3576), 'json.loads', 'json.loads', (['json_data'], {}), '(json_data)\n', ... |
# Generated by Django 3.1 on 2020-09-08 07:43
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='OpeningSystem',
fields=[
... | [
"django.db.models.TextField",
"django.db.models.IntegerField",
"django.db.models.ForeignKey",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((340, 433), '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", (356, 433), False, 'from django.db import migrations, models\... |
from robotpy_ext.control.toggle import Toggle
from robotpy_ext.misc.precise_delay import NotifierDelay
class FakeJoystick:
def __init__(self):
self._pressed = [False] * 2
def getRawButton(self, num):
return self._pressed[num]
def press(self, num):
self._pressed[num] = True
d... | [
"robotpy_ext.control.toggle.Toggle",
"robotpy_ext.misc.precise_delay.NotifierDelay"
] | [((448, 467), 'robotpy_ext.control.toggle.Toggle', 'Toggle', (['joystick', '(0)'], {}), '(joystick, 0)\n', (454, 467), False, 'from robotpy_ext.control.toggle import Toggle\n'), ((488, 507), 'robotpy_ext.control.toggle.Toggle', 'Toggle', (['joystick', '(1)'], {}), '(joystick, 1)\n', (494, 507), False, 'from robotpy_ext... |
'''
This file contains test cases for tflearn
'''
import tensorflow.compat.v1 as tf
import tflearn
import unittest
class TestActivations(unittest.TestCase):
'''
This class contains test cases for the functions in tflearn/activations.py
'''
PLACES = 4 # Number of places to match when testing fl... | [
"tensorflow.compat.v1.placeholder",
"tflearn.leaky_relu",
"tensorflow.compat.v1.constant",
"unittest.main",
"tflearn.activation",
"tensorflow.compat.v1.Session"
] | [((2857, 2872), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2870, 2872), False, 'import unittest\n'), ((425, 461), 'tensorflow.compat.v1.placeholder', 'tf.placeholder', (['tf.float32'], {'shape': '()'}), '(tf.float32, shape=())\n', (439, 461), True, 'import tensorflow.compat.v1 as tf\n'), ((526, 560), 'tensorf... |
#!/usr/bin/python3
# *****************************************************************************
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ... | [
"json.dumps",
"subprocess.run",
"sys.exit"
] | [((1086, 1154), 'subprocess.run', 'subprocess.run', (['"""cd /root; fab install-libs"""'], {'shell': '(True)', 'check': '(True)'}), "('cd /root; fab install-libs', shell=True, check=True)\n", (1100, 1154), False, 'import subprocess\n'), ((2173, 2236), 'subprocess.run', 'subprocess.run', (['"""chmod 666 /response/*"""']... |
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [
"easydict.EasyDict"
] | [((844, 990), 'easydict.EasyDict', 'edict', (["{'task': 'NER', 'num_labels': 41, 'data_file': '', 'schema_file': None,\n 'finetune_ckpt': '', 'use_crf': False, 'clue_benchmark': False}"], {}), "({'task': 'NER', 'num_labels': 41, 'data_file': '', 'schema_file':\n None, 'finetune_ckpt': '', 'use_crf': False, 'clue_... |
# -*- coding: utf-8 -*-
# utopia-cms 2020. <NAME>.
from django.core.management import BaseCommand
from django.db.utils import IntegrityError
from apps import core_articleviewedby_mdb
from core.models import ArticleViewedBy
class Command(BaseCommand):
help = "Moves article viewed by data from mongodb to Django m... | [
"core.models.ArticleViewedBy.objects.create",
"core.models.ArticleViewedBy.objects.get",
"apps.core_articleviewedby_mdb.posts.find_one_and_delete"
] | [((386, 440), 'apps.core_articleviewedby_mdb.posts.find_one_and_delete', 'core_articleviewedby_mdb.posts.find_one_and_delete', (['{}'], {}), '({})\n', (436, 440), False, 'from apps import core_articleviewedby_mdb\n'), ((989, 1043), 'apps.core_articleviewedby_mdb.posts.find_one_and_delete', 'core_articleviewedby_mdb.pos... |
import torch
import torch.nn as nn
from torch.optim import SGD
import MinkowskiEngine as ME
from MinkowskiEngine.modules.resnet_block import BasicBlock, Bottleneck
from examples.common import data_loader
from examples.resnet import ResNetBase
class MinkUNetBase(ResNetBase):
BLOCK = None
PLANES = None
D... | [
"MinkowskiEngine.MinkowskiReLU",
"MinkowskiEngine.cat",
"torch.nn.CrossEntropyLoss",
"torch.load",
"examples.common.data_loader",
"MinkowskiEngine.MinkowskiConvolution",
"MinkowskiEngine.MinkowskiBatchNorm",
"torch.cuda.is_available",
"MinkowskiEngine.MinkowskiConvolutionTranspose",
"examples.resn... | [((6981, 7002), 'torch.nn.CrossEntropyLoss', 'nn.CrossEntropyLoss', ([], {}), '()\n', (7000, 7002), True, 'import torch.nn as nn\n'), ((675, 730), 'examples.resnet.ResNetBase.__init__', 'ResNetBase.__init__', (['self', 'in_channels', 'out_channels', 'D'], {}), '(self, in_channels, out_channels, D)\n', (694, 730), False... |
"""TODO."""
from setuptools import setup
setup(
name='nginx-access-tailer',
version='0.1',
author='swfrench',
url='https://github.com/swfrench/nginx-tailer',
packages=['nginx_access_tailer',],
license='BSD three-clause license',
entry_points={
'console_scripts': ['nginx-access-tail... | [
"setuptools.setup"
] | [((43, 497), 'setuptools.setup', 'setup', ([], {'name': '"""nginx-access-tailer"""', 'version': '"""0.1"""', 'author': '"""swfrench"""', 'url': '"""https://github.com/swfrench/nginx-tailer"""', 'packages': "['nginx_access_tailer']", 'license': '"""BSD three-clause license"""', 'entry_points': "{'console_scripts': ['ngi... |
#!/usr/bin/env python
# -*- coding: utf-8 -*
import os
from setuptools import find_packages, setup
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
with open('requirements.txt') as f:
install_requires = f.read().splitlines()
setup(
name... | [
"os.path.abspath",
"setuptools.find_packages"
] | [((396, 436), 'setuptools.find_packages', 'find_packages', (['"""src"""'], {'exclude': "('tests',)"}), "('src', exclude=('tests',))\n", (409, 436), False, 'from setuptools import find_packages, setup\n'), ((182, 207), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (197, 207), False, 'import o... |
import collections
import unittest
import driver
from driver.protocol import *
_server = ('localhost', 11211)
_dead_retry = 30
_socket_timeout = 3
_max_receive_size = 4096
class MockConnection(object):
def __init__(self,
server=_server,
dead_retry=30,
socket_tim... | [
"collections.deque",
"driver.Client"
] | [((521, 540), 'collections.deque', 'collections.deque', ([], {}), '()\n', (538, 540), False, 'import collections\n'), ((571, 590), 'collections.deque', 'collections.deque', ([], {}), '()\n', (588, 590), False, 'import collections\n'), ((1188, 1210), 'driver.Client', 'driver.Client', (['_server'], {}), '(_server)\n', (1... |
# --------------
# Import packages
import numpy as np
import pandas as pd
from scipy.stats import mode
path
# code starts here
bank = pd.read_csv(path)
categorical_var = bank.select_dtypes(include = 'object')
print(categorical_var)
numerical_var = bank.select_dtypes(include = 'number')
print(numerical_var)
# code... | [
"pandas.read_csv"
] | [((139, 156), 'pandas.read_csv', 'pd.read_csv', (['path'], {}), '(path)\n', (150, 156), True, 'import pandas as pd\n')] |
# This file is part of Patsy
# Copyright (C) 2013 <NAME> <<EMAIL>>
# See file LICENSE.txt for license information.
# Regression tests for fixed bugs (when not otherwise better covered somewhere
# else)
from patsy import (EvalEnvironment, dmatrix, build_design_matrices,
PatsyError, Origin)
def test... | [
"patsy.dmatrix",
"patsy.EvalEnvironment.capture",
"patsy.build_design_matrices",
"patsy.Origin"
] | [((470, 495), 'patsy.EvalEnvironment.capture', 'EvalEnvironment.capture', ([], {}), '()\n', (493, 495), False, 'from patsy import EvalEnvironment, dmatrix, build_design_matrices, PatsyError, Origin\n'), ((640, 662), 'patsy.dmatrix', 'dmatrix', (['formula', 'data'], {}), '(formula, data)\n', (647, 662), False, 'from pat... |
__all__ = ['imread', 'imsave']
import numpy as np
from PIL import Image
from ...util import img_as_ubyte, img_as_uint
def imread(fname, dtype=None, img_num=None, **kwargs):
"""Load an image from file.
Parameters
----------
fname : str or file
File name or file-like-object.
dtype : numpy ... | [
"PIL.Image.open",
"PIL.Image.new",
"numpy.diff",
"numpy.asanyarray",
"numpy.array",
"PIL.Image.fromstring",
"PIL.Image.frombytes"
] | [((7329, 7347), 'numpy.asanyarray', 'np.asanyarray', (['arr'], {}), '(arr)\n', (7342, 7347), True, 'import numpy as np\n'), ((1049, 1066), 'PIL.Image.open', 'Image.open', (['fname'], {}), '(fname)\n', (1059, 1066), False, 'from PIL import Image\n'), ((3457, 3473), 'numpy.array', 'np.array', (['frames'], {}), '(frames)\... |
# -*- coding: utf-8 -*-
"""
Linear chain of reactions.
"""
from __future__ import print_function, division
import tellurium as te
model = '''
model feedback()
// Reactions:
J0: $X0 -> S1; (VM1 * (X0 - S1/Keq1))/(1 + X0 + S1 + S4^h);
J1: S1 -> S2; (10 * S1 - 2 * S2) / (1 + S1 + S2);
J2: S2 -> S3; (10 * S2... | [
"tellurium.loada"
] | [((622, 637), 'tellurium.loada', 'te.loada', (['model'], {}), '(model)\n', (630, 637), True, 'import tellurium as te\n')] |
# This version of the bitcoin experiment imports data preprocessed in Matlab, and uses the GCN baseline
# The point of this script is to do link prediction
# Imports and aliases
import pickle
import torch as t
import torch.nn as nn
import torch.nn.functional as F
import torchvision
import torchvision.datasets as datas... | [
"embedding_help_functions.load_data",
"embedding_help_functions.split_data",
"embedding_help_functions.compute_f1",
"embedding_help_functions.compute_MAP_MRR",
"torch.nn.CrossEntropyLoss",
"embedding_help_functions.create_node_features",
"torch.argmax",
"torch.tensor",
"numpy.zeros",
"embedding_he... | [((1080, 1158), 'embedding_help_functions.load_data', 'ehf.load_data', (['data_loc', 'mat_f_name', 'S_train', 'S_val', 'S_test'], {'transformed': '(False)'}), '(data_loc, mat_f_name, S_train, S_val, S_test, transformed=False)\n', (1093, 1158), True, 'import embedding_help_functions as ehf\n'), ((1217, 1291), 'embedding... |
# -*- coding: utf-8 -*-
#!/usr/bin/env python3
from PKC_Classes import NetworkUser, KDC
from DES import DES
from RSA_Class import RSA
import socket
import os
import sys
import threading
import time
if sys.version_info[0] < 3:
raise Exception("Must be using Python 3")
def reply_conn(conn, addr):
print('Accep... | [
"socket.socket",
"time.sleep",
"RSA_Class.RSA",
"sys.exit",
"threading.Thread",
"DES.DES"
] | [((804, 809), 'DES.DES', 'DES', ([], {}), '()\n', (807, 809), False, 'from DES import DES\n'), ((811, 824), 'RSA_Class.RSA', 'RSA', (['(9973)', '(97)'], {}), '(9973, 97)\n', (814, 824), False, 'from RSA_Class import RSA\n'), ((1007, 1056), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {})... |
"""empty message
Revision ID: 0084_add_job_stats
Revises: 0083_add_perm_types_and_svc_perm
Create Date: 2017-05-12 13:16:14.147368
"""
# revision identifiers, used by Alembic.
revision = "0084_add_job_stats"
down_revision = "0083_add_perm_types_and_svc_perm"
import sqlalchemy as sa
from alembic import op
from sqlal... | [
"sqlalchemy.ForeignKeyConstraint",
"sqlalchemy.DateTime",
"alembic.op.drop_table",
"alembic.op.f",
"sqlalchemy.PrimaryKeyConstraint",
"sqlalchemy.dialects.postgresql.UUID",
"sqlalchemy.BigInteger"
] | [((1575, 1606), 'alembic.op.drop_table', 'op.drop_table', (['"""job_statistics"""'], {}), "('job_statistics')\n", (1588, 1606), False, 'from alembic import op\n'), ((1244, 1292), 'sqlalchemy.ForeignKeyConstraint', 'sa.ForeignKeyConstraint', (["['job_id']", "['jobs.id']"], {}), "(['job_id'], ['jobs.id'])\n", (1267, 1292... |
import torch
import os
from torch import nn
import numpy as np
import torch.nn.functional
from termcolor import colored
from .logger import get_logger
def save_model(net, optim, scheduler, recorder, is_best=False):
model_dir = os.path.join(recorder.work_dir, 'ckpt')
os.system('mkdir -p {}'.format(model_dir))
... | [
"torch.load",
"os.path.join"
] | [((232, 271), 'os.path.join', 'os.path.join', (['recorder.work_dir', '"""ckpt"""'], {}), "(recorder.work_dir, 'ckpt')\n", (244, 271), False, 'import os\n'), ((1624, 1645), 'torch.load', 'torch.load', (['model_dir'], {}), '(model_dir)\n', (1634, 1645), False, 'import torch\n'), ((1002, 1023), 'torch.load', 'torch.load',... |
from __future__ import division
from timeit import default_timer as timer
import csv
import numpy as np
import itertools
from munkres import Munkres, print_matrix, make_cost_matrix
import sys
from classes import *
from functions import *
from math import sqrt
import Tkinter as tk
import tkFileDialog as filedialog
root... | [
"numpy.reshape",
"numpy.amax",
"timeit.default_timer",
"Tkinter.Tk",
"numpy.asarray",
"numpy.array",
"munkres.Munkres",
"tkFileDialog.askopenfilename",
"numpy.savetxt",
"numpy.transpose",
"csv.reader"
] | [((323, 330), 'Tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (328, 330), True, 'import Tkinter as tk\n'), ((356, 422), 'tkFileDialog.askopenfilename', 'filedialog.askopenfilename', ([], {'title': '"""Please select the posting file"""'}), "(title='Please select the posting file')\n", (382, 422), True, 'import tkFileDialog as ... |
__all__ = ["load"]
import imp
import importlib
def load(name, path):
"""Load and initialize a module implemented as a Python source file and return its module object"""
if hasattr(importlib, "machinery"):
loader = importlib.machinery.SourceFileLoader(name, path)
return loader.load_module()
... | [
"imp.load_source",
"importlib.machinery.SourceFileLoader"
] | [((330, 357), 'imp.load_source', 'imp.load_source', (['name', 'path'], {}), '(name, path)\n', (345, 357), False, 'import imp\n'), ((234, 282), 'importlib.machinery.SourceFileLoader', 'importlib.machinery.SourceFileLoader', (['name', 'path'], {}), '(name, path)\n', (270, 282), False, 'import importlib\n')] |
from fastapi import APIRouter
router = APIRouter()
@router.get("/")
def working():
return {"Working"}
| [
"fastapi.APIRouter"
] | [((40, 51), 'fastapi.APIRouter', 'APIRouter', ([], {}), '()\n', (49, 51), False, 'from fastapi import APIRouter\n')] |
import logging
import numpy
from ..Fragments import Fragments
from ..typing import SpectrumType
logger = logging.getLogger("matchms")
def add_losses(spectrum_in: SpectrumType, loss_mz_from=0.0, loss_mz_to=1000.0) -> SpectrumType:
"""Derive losses based on precursor mass.
Parameters
----------
spect... | [
"logging.getLogger",
"numpy.where"
] | [((107, 135), 'logging.getLogger', 'logging.getLogger', (['"""matchms"""'], {}), "('matchms')\n", (124, 135), False, 'import logging\n'), ((1156, 1224), 'numpy.where', 'numpy.where', (['((losses_mz >= loss_mz_from) & (losses_mz <= loss_mz_to))'], {}), '((losses_mz >= loss_mz_from) & (losses_mz <= loss_mz_to))\n', (1167... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import platform
import unittest
import rspub.util.resourcefilter as rf
def on_windows():
opsys = platform.system()
return opsys == "Windows"
class TestPredicates(unittest.TestCase):
def test_directory_pattern_filter_empty(self):
dpf = r... | [
"rspub.util.resourcefilter.directory_pattern_predicate",
"rspub.util.resourcefilter.filename_pattern_predicate",
"rspub.util.gates.and_",
"os.path.join",
"rspub.util.gates.gate",
"os.path.realpath",
"platform.system",
"rspub.util.resourcefilter.last_modified_after_predicate",
"os.path.expanduser"
] | [((162, 179), 'platform.system', 'platform.system', ([], {}), '()\n', (177, 179), False, 'import platform\n'), ((319, 351), 'rspub.util.resourcefilter.directory_pattern_predicate', 'rf.directory_pattern_predicate', ([], {}), '()\n', (349, 351), True, 'import rspub.util.resourcefilter as rf\n'), ((711, 748), 'rspub.util... |
# uncompyle6 version 2.11.3
# Python bytecode 2.7 (62211)
# Decompiled from: Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)]
# Embedded file name: scripts/common/dossiers2/custom/cache.py
import nations
from items import vehicles
def getCache():
global _g_cache
return _g_cache
def ... | [
"items.vehicles.makeVehicleTypeCompDescrByName",
"items.vehicles.getUnlocksSources",
"items.vehicles.g_list.getList",
"items.vehicles.g_cache.vehicle"
] | [((542, 570), 'items.vehicles.getUnlocksSources', 'vehicles.getUnlocksSources', ([], {}), '()\n', (568, 570), False, 'from items import vehicles\n'), ((641, 675), 'items.vehicles.g_list.getList', 'vehicles.g_list.getList', (['nationIdx'], {}), '(nationIdx)\n', (664, 675), False, 'from items import vehicles\n'), ((1675,... |
from django.conf import settings
from django.core import serializers
from django.utils import timezone
import requests
from Posts.commentModel import Comments
#from Posts.commentView import add_Comment
from rest_framework import status
from rest_framework.decorators import api_view, authentication_classes, permission_c... | [
"rest_framework.decorators.permission_classes",
"Posts.commentModel.Comments.objects.all",
"rest_framework.decorators.authentication_classes",
"requests.get",
"Posts.commentModel.Comments.objects.get",
"django.utils.timezone.now",
"Author.serializers.LikeSerializer",
"rest_framework.response.Response"... | [((4040, 4057), 'rest_framework.decorators.api_view', 'api_view', (["['GET']"], {}), "(['GET'])\n", (4048, 4057), False, 'from rest_framework.decorators import api_view, authentication_classes, permission_classes\n'), ((4060, 4106), 'rest_framework.decorators.authentication_classes', 'authentication_classes', (['[Custo... |
import unittest
from worldengine.plates import Step, center_land, world_gen
from worldengine.world import World
from tests.draw_test import TestBase
class TestGeneration(TestBase):
def setUp(self):
super(TestGeneration, self).setUp()
def test_world_gen_does_not_explode_badly(self):
# FIXME ... | [
"unittest.main",
"worldengine.plates.center_land",
"worldengine.plates.Step.get_by_name",
"worldengine.world.World.from_pickle_file"
] | [((1507, 1522), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1520, 1522), False, 'import unittest\n'), ((1143, 1210), 'worldengine.world.World.from_pickle_file', 'World.from_pickle_file', (["('%s/plates_279.world' % self.tests_data_dir)"], {}), "('%s/plates_279.world' % self.tests_data_dir)\n", (1165, 1210), Fa... |
from tensorflow.keras import *
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers, Sequential,regularizers
from tensorflow.keras.layers import Dropout
# from tensorflow.keras import *
# 定义一个3x3卷积!kernel_initializer='he_normal','glorot_normal'
from tensorflow.python... | [
"tensorflow.keras.layers.Conv3D",
"tensorflow.keras.layers.Reshape",
"tensorflow.keras.layers.Conv2D",
"tensorflow.nn.relu",
"tensorflow.keras.Sequential",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.layers.MaxPool2D",
"tensorflow.keras.layers.add",
"tensorflow.reduce_max",
"tensorflow.ke... | [((4670, 4682), 'tensorflow.keras.Sequential', 'Sequential', ([], {}), '()\n', (4680, 4682), False, 'from tensorflow.keras import layers, Sequential, regularizers\n'), ((831, 862), 'tensorflow.keras.layers.GlobalAveragePooling2D', 'layers.GlobalAveragePooling2D', ([], {}), '()\n', (860, 862), False, 'from tensorflow.ke... |
"""Bioconductor run git transition code.
This module assembles the classes for the SVN --> Git transition
can be run in a sequential manner.
It runs the following aspects fo the Bioconductor transition.
Note: Update the SVN dump
1. Run Bioconductor Software package transition
2. Run Bioconductor Experiment Data pac... | [
"logging.basicConfig",
"src.run_transition.run_software_transition",
"src.svn_dump_update.svn_experiment_root_update",
"src.run_transition.run_experiment_data_transition",
"src.run_transition.run_workflow_transition",
"src.run_transition.run_updates",
"src.run_transition.run_manifest_transition",
"tim... | [((727, 847), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': '"""transition.log"""', 'format': '"""%(levelname)s %(asctime)s %(message)s"""', 'level': 'logging.DEBUG'}), "(filename='transition.log', format=\n '%(levelname)s %(asctime)s %(message)s', level=logging.DEBUG)\n", (746, 847), False, 'impor... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# This test is based on the test suite implemented for Recommenders project
# https://github.com/Microsoft/Recommenders/tree/master/tests
import papermill as pm
import pytest
import scrapbook as sb
from utils_cv.common.data... | [
"scrapbook.read_notebook",
"utils_cv.common.data.unzip_url"
] | [((870, 903), 'scrapbook.read_notebook', 'sb.read_notebook', (['OUTPUT_NOTEBOOK'], {}), '(OUTPUT_NOTEBOOK)\n', (886, 903), True, 'import scrapbook as sb\n'), ((1418, 1451), 'scrapbook.read_notebook', 'sb.read_notebook', (['OUTPUT_NOTEBOOK'], {}), '(OUTPUT_NOTEBOOK)\n', (1434, 1451), True, 'import scrapbook as sb\n'), (... |
from reportlab.lib.units import inch
from reportlab.platypus import SimpleDocTemplate, Spacer
from reportlab.rl_config import defaultPageSize
from reportlab.lib.units import inch
from reportlab.platypus.flowables import Flowable
def generate_order(job, path, door_style, doors=[], drawers=[]):
PAGE_HEIGHT = defaul... | [
"reportlab.platypus.SimpleDocTemplate",
"reportlab.platypus.flowables.Flowable.__init__",
"reportlab.platypus.Spacer"
] | [((13558, 13605), 'reportlab.platypus.SimpleDocTemplate', 'SimpleDocTemplate', (['f"""{path}/{name}-{STYLE}.pdf"""'], {}), "(f'{path}/{name}-{STYLE}.pdf')\n", (13575, 13605), False, 'from reportlab.platypus import SimpleDocTemplate, Spacer\n'), ((10743, 10766), 'reportlab.platypus.flowables.Flowable.__init__', 'Flowabl... |
from bs4 import BeautifulSoup
import logging
import pandas as pd
import csv
import re
import requests
from urllib.parse import urljoin
logging.basicConfig(format="%(asctime)s %(levelname)s:%(message)s", level=logging.INFO)
def get_html(url):
return requests.get(url).text
class SenateCrawler:
def __init__(... | [
"logging.basicConfig",
"requests.get",
"logging.exception",
"pandas.DataFrame",
"logging.info"
] | [((137, 229), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s %(levelname)s:%(message)s"""', 'level': 'logging.INFO'}), "(format='%(asctime)s %(levelname)s:%(message)s', level=\n logging.INFO)\n", (156, 229), False, 'import logging\n'), ((257, 274), 'requests.get', 'requests.get', (['ur... |
# -*- coding: utf-8 -*-
"""
Lacework Container Registries API wrapper.
"""
import logging
logger = logging.getLogger(__name__)
class ContainerRegistriesAPI(object):
"""
Lacework Container Registries API.
"""
def __init__(self, session):
"""
Initializes the ContainerRegistriesAPI obj... | [
"logging.getLogger"
] | [((101, 128), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (118, 128), False, 'import logging\n')] |
import json
import re
import responses
from werkzeug.test import Client
from werkzeug.wrappers import Response
from satosa.proxy_server import make_app
from satosa.satosa_config import SATOSAConfig
class TestConsent:
def test_full_flow(self, satosa_config_dict, consent_module_config):
api_url = "https:/... | [
"satosa.satosa_config.SATOSAConfig",
"json.dumps",
"responses.RequestsMock"
] | [((1099, 1123), 'responses.RequestsMock', 'responses.RequestsMock', ([], {}), '()\n', (1121, 1123), False, 'import responses\n'), ((1686, 1710), 'responses.RequestsMock', 'responses.RequestsMock', ([], {}), '()\n', (1708, 1710), False, 'import responses\n'), ((676, 708), 'satosa.satosa_config.SATOSAConfig', 'SATOSAConf... |
import argparse
import glob
import os
import pickle
from pathlib import Path
import numpy as np
from PIL import Image
from tqdm import tqdm
from src.align.align_trans import get_reference_facial_points, warp_and_crop_face
# sys.path.append("../../")
from src.align.detector import detect_faces
if __name__ == "__main... | [
"PIL.Image.fromarray",
"PIL.Image.open",
"pickle.dump",
"argparse.ArgumentParser",
"src.align.align_trans.get_reference_facial_points",
"pathlib.Path",
"src.align.detector.detect_faces",
"tqdm.tqdm",
"os.getcwd",
"os.chdir",
"numpy.array",
"os.system",
"glob.glob"
] | [((338, 391), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""face alignment"""'}), "(description='face alignment')\n", (361, 391), False, 'import argparse\n'), ((1351, 1362), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (1360, 1362), False, 'import os\n'), ((1416, 1437), 'os.chdir', 'os.c... |
from srtvoiceext import extract
if __name__ == '__main__':
ext = extract('video.mkv', 'subtitles.srt', 'outdir') | [
"srtvoiceext.extract"
] | [((70, 117), 'srtvoiceext.extract', 'extract', (['"""video.mkv"""', '"""subtitles.srt"""', '"""outdir"""'], {}), "('video.mkv', 'subtitles.srt', 'outdir')\n", (77, 117), False, 'from srtvoiceext import extract\n')] |
# encoding: utf-8
import urwid
import time, os, copy
from rpg_game.utils import log, mod, distance
from rpg_game.constants import *
from urwid import raw_display
SIZE = lambda scr=raw_display.Screen(): scr.get_cols_rows()
MIN_HEADER_HEIGHT = 3
MAX_MENU_WIDTH = 48
FOOTER_HEIGHT = 4
PALETTE = [
("line",... | [
"urwid.Columns",
"urwid.LineBox",
"urwid.raw_display.Screen",
"urwid.SimpleFocusListWalker",
"rpg_game.utils.distance",
"urwid.SimpleListWalker",
"urwid.connect_signal",
"copy.deepcopy",
"urwid.AttrMap",
"urwid.Text"
] | [((25258, 25307), 'urwid.AttrMap', 'urwid.AttrMap', (['btn', 'attr_map'], {'focus_map': 'focus_map'}), '(btn, attr_map, focus_map=focus_map)\n', (25271, 25307), False, 'import urwid\n'), ((183, 203), 'urwid.raw_display.Screen', 'raw_display.Screen', ([], {}), '()\n', (201, 203), False, 'from urwid import raw_display\n'... |
from numpy import inf, nan
from sklearn.linear_model import LinearRegression as Op
from lale.docstrings import set_docstrings
from lale.operators import make_operator
class LinearRegressionImpl:
def __init__(self, **hyperparams):
self._hyperparams = hyperparams
self._wrapped_model = Op(**self._hy... | [
"lale.operators.make_operator",
"lale.docstrings.set_docstrings",
"sklearn.linear_model.LinearRegression"
] | [((4721, 4776), 'lale.docstrings.set_docstrings', 'set_docstrings', (['LinearRegressionImpl', '_combined_schemas'], {}), '(LinearRegressionImpl, _combined_schemas)\n', (4735, 4776), False, 'from lale.docstrings import set_docstrings\n'), ((4796, 4850), 'lale.operators.make_operator', 'make_operator', (['LinearRegressio... |
import numpy as np
from keras.applications.inception_v3 import InceptionV3
from keras.initializers import RandomNormal
from keras.layers import (BatchNormalization, Conv2D, Conv2DTranspose, Conv3D,
Cropping2D, Dense, Flatten, GlobalAveragePooling2D,
Input, Lambda, Max... | [
"keras.layers.Conv2D",
"numpy.max",
"keras.layers.Dense",
"keras.layers.Input",
"keras.models.Model",
"keras.applications.inception_v3.InceptionV3",
"keras.layers.GlobalAveragePooling2D",
"keras.layers.BatchNormalization",
"numpy.arange"
] | [((1786, 1810), 'numpy.max', 'np.max', (['input_shape[0:2]'], {}), '(input_shape[0:2])\n', (1792, 1810), True, 'import numpy as np\n'), ((2022, 2066), 'keras.layers.Input', 'Input', ([], {'shape': 'input_shape', 'name': '"""input_layer"""'}), "(shape=input_shape, name='input_layer')\n", (2027, 2066), False, 'from keras... |
#!/bin/env python
"""Drop and create a new database with schema."""
from sqlalchemy_utils.functions import database_exists, create_database, drop_database
from flunkybot.db import engine, base
from flunkybot.models import * # noqa
db_url = engine.url
if database_exists(db_url):
drop_database(db_url)
create_datab... | [
"sqlalchemy_utils.functions.create_database",
"sqlalchemy_utils.functions.drop_database",
"sqlalchemy_utils.functions.database_exists",
"flunkybot.db.base.metadata.drop_all",
"flunkybot.db.base.metadata.create_all"
] | [((257, 280), 'sqlalchemy_utils.functions.database_exists', 'database_exists', (['db_url'], {}), '(db_url)\n', (272, 280), False, 'from sqlalchemy_utils.functions import database_exists, create_database, drop_database\n'), ((308, 331), 'sqlalchemy_utils.functions.create_database', 'create_database', (['db_url'], {}), '... |
"""This script renames the forthcoming section in changelog files with the upcoming version and the current date"""
from __future__ import print_function
import argparse
import datetime
import docutils.core
import os
import re
import sys
from catkin_pkg.changelog import CHANGELOG_FILENAME, get_changelog_from_path
fr... | [
"os.path.exists",
"re.escape",
"catkin_pkg.packages.find_packages",
"argparse.ArgumentParser",
"os.path.join",
"catkin_pkg.changelog.get_changelog_from_path",
"datetime.date.today",
"catkin_pkg.changelog_generator.FORTHCOMING_LABEL.lower",
"catkin_pkg.package_version.bump_version",
"re.subn"
] | [((1770, 1829), 're.subn', 're.subn', (['pattern', 'replace_section', 'data'], {'flags': 're.MULTILINE'}), '(pattern, replace_section, data, flags=re.MULTILINE)\n', (1777, 1829), False, 'import re\n'), ((2038, 2169), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Tag the forthcoming sect... |
import os
import unittest
import torch
import torch.distributed as dist
from torch.multiprocessing import Process
import torch.nn as nn
from machina.optims import DistributedAdamW
def init_processes(rank, world_size,
function, backend='tcp'):
os.environ['MASTER_ADDR'] = '127.0.0.1'
os.env... | [
"torch.multiprocessing.Process",
"torch.distributed.init_process_group",
"torch.nn.Linear",
"torch.ones"
] | [((354, 420), 'torch.distributed.init_process_group', 'dist.init_process_group', (['backend'], {'rank': 'rank', 'world_size': 'world_size'}), '(backend, rank=rank, world_size=world_size)\n', (377, 420), True, 'import torch.distributed as dist\n'), ((612, 628), 'torch.nn.Linear', 'nn.Linear', (['(10)', '(1)'], {}), '(10... |