code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import os
from discord.ext.commands import Bot
from Flare import Flare
bot = Bot("~~")
bot.add_cog(Flare(bot))
@bot.command("ping")
async def ping_pong(ctx):
ctx.send("pong")
bot.run(os.environ.get("BOT_TOKEN"))
| [
"discord.ext.commands.Bot",
"os.environ.get",
"Flare.Flare"
] | [((79, 88), 'discord.ext.commands.Bot', 'Bot', (['"""~~"""'], {}), "('~~')\n", (82, 88), False, 'from discord.ext.commands import Bot\n'), ((102, 112), 'Flare.Flare', 'Flare', (['bot'], {}), '(bot)\n', (107, 112), False, 'from Flare import Flare\n'), ((194, 221), 'os.environ.get', 'os.environ.get', (['"""BOT_TOKEN"""']... |
import setuptools
ver = {}
with open('OpenControl/_version.py') as fd:
exec(fd.read(), ver)
version = ver.get('__version__')
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="OpenControl",
version=version,
author="VNOpenAI",
author_e... | [
"setuptools.find_packages"
] | [((815, 841), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (839, 841), False, 'import setuptools\n')] |
'''See the shared Google Drive documentation for an inheritance diagram that
shows the relationships between the classes defined in this file.
'''
import numpy as np
import socket
import time
from riglib import source
from ismore import settings, udp_feedback_client
import ismore_bmi_lib
from utils.constants import *... | [
"numpy.abs",
"time.ctime",
"socket.socket",
"numpy.hstack",
"os.path.expandvars",
"ismore.filter.Filter",
"numpy.logical_and",
"scipy.signal.butter",
"riglib.sink.sinks.register",
"numpy.array",
"numpy.zeros",
"numpy.isnan",
"numpy.sign",
"numpy.nonzero",
"time.time",
"riglib.source.Da... | [((12073, 12115), 'numpy.array', 'np.array', (['[cm_to_mm, cm_to_mm, rad_to_deg]'], {}), '([cm_to_mm, cm_to_mm, rad_to_deg])\n', (12081, 12115), True, 'import numpy as np\n'), ((12180, 12214), 'numpy.array', 'np.array', (['[np.inf, np.inf, np.inf]'], {}), '([np.inf, np.inf, np.inf])\n', (12188, 12214), True, 'import nu... |
import logging
import pytest
from ocs_ci.framework.testlib import tier1, skipif_ui_not_support, ui
from ocs_ci.ocs.ui.pvc_ui import PvcUI
from ocs_ci.framework.testlib import skipif_ocs_version
from ocs_ci.framework.pytest_customization.marks import green_squad
from ocs_ci.ocs.resources.pvc import get_all_pvc_objs, ge... | [
"logging.getLogger",
"ocs_ci.helpers.helpers.create_pod",
"ocs_ci.ocs.resources.pod.get_fio_rw_iops",
"ocs_ci.ocs.ui.pvc_ui.PvcUI",
"ocs_ci.ocs.resources.pvc.get_all_pvc_objs",
"pytest.param",
"ocs_ci.framework.testlib.skipif_ui_not_support",
"ocs_ci.framework.testlib.skipif_ocs_version",
"ocs_ci.he... | [((640, 667), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (657, 667), False, 'import logging\n'), ((675, 701), 'ocs_ci.framework.testlib.skipif_ocs_version', 'skipif_ocs_version', (['"""<4.6"""'], {}), "('<4.6')\n", (693, 701), False, 'from ocs_ci.framework.testlib import skipif_ocs_ve... |
from sys import exit
from colour import *
from rs.reaction_system import ReactionSystem
class ReactionSystemWithConcentrations(ReactionSystem):
def __init__(self):
self.reactions = []
self.meta_reactions = dict()
self.permanent_entities = dict()
self.background_set = []
... | [
"rs.reaction_system.ReactionSystem",
"sys.exit"
] | [((1936, 1943), 'sys.exit', 'exit', (['(1)'], {}), '(1)\n', (1940, 1943), False, 'from sys import exit\n'), ((9620, 9636), 'rs.reaction_system.ReactionSystem', 'ReactionSystem', ([], {}), '()\n', (9634, 9636), False, 'from rs.reaction_system import ReactionSystem\n')] |
# Copyright <NAME> 2004. Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
from __future__ import print_function
'''
>>> from iterator_ext import *
>>> from input_iterator import *
>>> x = list_int()
>>> x.push_back(1)
... | [
"sys.modules.get",
"sys.exit"
] | [((1297, 1313), 'sys.exit', 'sys.exit', (['status'], {}), '(status)\n', (1305, 1313), False, 'import sys\n'), ((1136, 1161), 'sys.modules.get', 'sys.modules.get', (['__name__'], {}), '(__name__)\n', (1151, 1161), False, 'import sys\n')] |
# -*- Python -*-
# license
# license.
# ======================================================================
"""Looks name up in the [geonames database](http://www.geonames.org/).
[GeoNames Search Webservice API](http://www.geonames.org/export/geonames-search.html)
"""
import sys, os, urllib.request, json, time
fro... | [
"logging.getLogger",
"time.sleep"
] | [((374, 401), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (391, 401), False, 'import logging\n'), ((2104, 2131), 'time.sleep', 'time.sleep', (['seconds_to_wait'], {}), '(seconds_to_wait)\n', (2114, 2131), False, 'import sys, os, urllib.request, json, time\n')] |
# Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from openvino.tools.mo.front.common.partial_infer.utils import mo_array
from openvino.tools.mo.ops.proposal import ProposalOp
from openvino.tools.mo.front.caffe.collect_attributes import merge_attrs
from openvino.tools.mo.front.extractor... | [
"openvino.tools.mo.ops.proposal.ProposalOp.update_node_stat",
"openvino.tools.mo.front.caffe.collect_attributes.merge_attrs",
"openvino.tools.mo.front.common.partial_infer.utils.mo_array"
] | [((969, 1001), 'openvino.tools.mo.front.caffe.collect_attributes.merge_attrs', 'merge_attrs', (['param', 'update_attrs'], {}), '(param, update_attrs)\n', (980, 1001), False, 'from openvino.tools.mo.front.caffe.collect_attributes import merge_attrs\n'), ((1054, 1101), 'openvino.tools.mo.ops.proposal.ProposalOp.update_no... |
# -*- coding: utf-8 -*-
# mk42
# mk42/apps/users/migrations/0003_auto_20170614_0038.py
# Generated by Django 1.11.2 on 2017-06-14 00:38
from __future__ import unicode_literals
from django.db import (
migrations,
models,
)
class Migration(migrations.Migration):
dependencies = [
("users", "0002... | [
"django.db.models.CharField"
] | [((478, 603), 'django.db.models.CharField', 'models.CharField', ([], {'choices': "[('en', 'English'), ('uk', 'Українська')]", 'default': '"""en"""', 'max_length': '(5)', 'verbose_name': '"""language"""'}), "(choices=[('en', 'English'), ('uk', 'Українська')], default\n ='en', max_length=5, verbose_name='language')\n"... |
import pickle
import pandas as pd
import torch
import torch.nn as nn
import torchvision.transforms as T
from torch.utils import data
from torch.utils.data import random_split
from torch.utils.data.dataloader import DataLoader
from torch.utils.data.dataset import Dataset
from datasets.celeba import CelebA1000
from dat... | [
"torch.manual_seed",
"pandas.read_csv",
"torch.utils.data.random_split",
"datasets.facescrub.FaceScrub",
"pickle.load",
"torchvision.transforms.Normalize",
"datasets.celeba.CelebA1000",
"datasets.stanford_dogs.StanfordDogs"
] | [((448, 502), 'torchvision.transforms.Normalize', 'T.Normalize', ([], {'mean': '[0.5, 0.5, 0.5]', 'std': '[0.5, 0.5, 0.5]'}), '(mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5])\n', (459, 502), True, 'import torchvision.transforms as T\n'), ((703, 726), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (72... |
from __future__ import print_function, absolute_import, division #makes KratosMultiphysics backward compatible with python 2.6 and 2.7
from KratosMultiphysics import *
from KratosMultiphysics.IncompressibleFluidApplication import *
from KratosMultiphysics.FluidDynamicsApplication import *
from KratosMultiphysics.Exter... | [
"KratosMultiphysics.MappingApplication.MapperFactory.CreateMapper",
"process_factory.KratosProcessFactory"
] | [((5636, 5749), 'KratosMultiphysics.MappingApplication.MapperFactory.CreateMapper', 'KratosMapping.MapperFactory.CreateMapper', (['main_model_part_bg', 'main_model_part_bf', 'Projectparameters_Mapper[0]'], {}), '(main_model_part_bg,\n main_model_part_bf, Projectparameters_Mapper[0])\n', (5676, 5749), True, 'import K... |
"""
提供几种常用的控制器。
这些验证器通常需要提供一些参数进行一次调用,返回的结果才是真正的验证器,其中的技巧在于通过闭包使要控制的对象能够被内部函数访问。
版本: 1.3.0+
"""
import re
from nonebot import CommandSession
from nonebot.helpers import render_expression
def handle_cancellation(session: CommandSession):
"""
在用户发送 `算了`、`不用了`、`取消吧`、`停` 之类的话的时候,结束当前传入的命令会话(调用 `session.finish(... | [
"re.match",
"nonebot.helpers.render_expression"
] | [((888, 932), 're.match', 're.match', (['"""^那?[算别不停]\\\\w{0,3}了?吧?$"""', 'sentence'], {}), "('^那?[算别不停]\\\\w{0,3}了?吧?$', sentence)\n", (896, 932), False, 'import re\n'), ((950, 992), 're.match', 're.match', (['"""^那?(?:[给帮]我)?取消了?吧?$"""', 'sentence'], {}), "('^那?(?:[给帮]我)?取消了?吧?$', sentence)\n", (958, 992), False, 'im... |
import argparse
import numpy as np
import glob
import re
from log import print_to_file
from scipy.fftpack import fftn, ifftn
from skimage.feature import peak_local_max, canny
from skimage.transform import hough_circle
import pickle as pickle
from paths import TRAIN_DATA_PATH, LOGS_PATH, PKL_TRAIN_DATA_PATH, PK... | [
"numpy.sqrt",
"scipy.fftpack.fftn",
"numpy.array",
"numpy.argsort",
"numpy.arange",
"re.search",
"numpy.mean",
"argparse.ArgumentParser",
"numpy.max",
"numpy.exp",
"log.print_to_file",
"glob.glob",
"numpy.abs",
"numpy.float32",
"pickle.dump",
"numpy.sum",
"numpy.zeros",
"skimage.fe... | [((482, 558), 'numpy.array', 'np.array', (['[[percentual_coordinate[0]], [percentual_coordinate[1]], [0], [1]]'], {}), '([[percentual_coordinate[0]], [percentual_coordinate[1]], [0], [1]])\n', (490, 558), True, 'import numpy as np\n'), ((3780, 3814), 'numpy.zeros', 'np.zeros', (['(ximagesize, yimagesize)'], {}), '((xim... |
# -*- coding: utf-8 -*-
"""Main module."""
import os
from google.cloud import bigquery
from pbq.query import Query
from google.cloud import bigquery_storage_v1beta1
from google.cloud.exceptions import NotFound
from google.api_core.exceptions import BadRequest
import pandas as pd
import datetime
class PBQ(object):
... | [
"google.cloud.bigquery.QueryJobConfig",
"datetime.datetime.now",
"google.cloud.bigquery_storage_v1beta1.BigQueryStorageClient",
"google.cloud.bigquery.LoadJobConfig",
"google.cloud.bigquery.Table",
"google.cloud.bigquery.TimePartitioning",
"os.system",
"google.cloud.bigquery.Client",
"pandas.to_date... | [((3002, 3050), 'google.cloud.bigquery_storage_v1beta1.BigQueryStorageClient', 'bigquery_storage_v1beta1.BigQueryStorageClient', ([], {}), '()\n', (3048, 3050), False, 'from google.cloud import bigquery_storage_v1beta1\n'), ((3634, 3659), 'google.cloud.bigquery.QueryJobConfig', 'bigquery.QueryJobConfig', ([], {}), '()\... |
import re
import types
from functools import partial
LITERAL_TYPE = types.StringTypes + (int, float, long, bool, )
class Spec(object):
"""
This object, when overridden with an object that implements a file format
specification, will perform validation on a given parsed version of the
format input.
... | [
"functools.partial",
"re.match"
] | [((2456, 2498), 'functools.partial', 'partial', (['self._err_message', 'self.err.error'], {}), '(self._err_message, self.err.error)\n', (2463, 2498), False, 'from functools import partial\n'), ((2522, 2566), 'functools.partial', 'partial', (['self._err_message', 'self.err.warning'], {}), '(self._err_message, self.err.w... |
from setuptools import setup
setup(
name='lsearch',
version='1.0',
description='The Head First Python Search Tools', author='<NAME>', author_email='<EMAIL>',
url='headfirstlabs.com',
py_modules=['lsearch'],
)
| [
"setuptools.setup"
] | [((30, 216), 'setuptools.setup', 'setup', ([], {'name': '"""lsearch"""', 'version': '"""1.0"""', 'description': '"""The Head First Python Search Tools"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'url': '"""headfirstlabs.com"""', 'py_modules': "['lsearch']"}), "(name='lsearch', version='1.0', descrip... |
import json
import logging
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Tuple, Type, Union
import werkzeug
from flask import Blueprint, Flask, Response, abort, jsonify
from flask.views import MethodView
from flask_cors import CORS
from gevent.pywsgi import WSGIServer
from geventwebsocket i... | [
"logging.getLogger",
"rotkehlchen.api.v1.resources.create_blueprint",
"rotkehlchen.logging.RotkehlchenLogsAdapter",
"flask_cors.CORS",
"flask.Flask",
"json.dumps",
"rotkehlchen.api.rest.wrap_in_fail_result",
"gevent.pywsgi.WSGIServer",
"flask.abort",
"geventwebsocket.Resource",
"flask.jsonify"
] | [((11731, 11758), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (11748, 11758), False, 'import logging\n'), ((11765, 11795), 'rotkehlchen.logging.RotkehlchenLogsAdapter', 'RotkehlchenLogsAdapter', (['logger'], {}), '(logger)\n', (11787, 11795), False, 'from rotkehlchen.logging import Rot... |
import numpy as np
pos = []
normals = []
p = [[-0.4722227, -0.24517583, -0.6370031]]
n = [[2.02215104e-04, -3.23903880e-05, 9.99999979e-01]]
pos.append(p)
normals.append(n)
p = [[-0.2549828, -0.24587737, -0.63704705]]
n = [[2.02215104e-04, -3.23903880e-05, 9.99999979e-01]]
pos.append(p)
normals.append(n)
p = [[-0.2... | [
"numpy.array"
] | [((1222, 1234), 'numpy.array', 'np.array', (['px'], {}), '(px)\n', (1230, 1234), True, 'import numpy as np\n'), ((1295, 1307), 'numpy.array', 'np.array', (['nx'], {}), '(nx)\n', (1303, 1307), True, 'import numpy as np\n')] |
import setuptools
setuptools.setup(
name="qualityforward",
version="1.1",
author="<NAME>",
author_email="<EMAIL>",
description="Python library for QualityForward API",
long_description="This is python library for QualityForward API. QualityForward is cloud based test management service.",
... | [
"setuptools.find_packages"
] | [((422, 448), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (446, 448), False, 'import setuptools\n')] |
from django.db import models
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin, AbstractUser
from django.utils import timezone
from django.utils.translation import gettext as _
from django import forms
from django.contrib.auth.hashers import make_password
from django.contrib.auth import get_user... | [
"django.utils.translation.gettext",
"django.db.models.IntegerField",
"django.utils.timezone.now",
"datetime.datetime.now",
"django.db.models.DateTimeField",
"datetime.datetime.timedelta",
"django.db.models.CharField"
] | [((675, 707), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(200)'}), '(max_length=200)\n', (691, 707), False, 'from django.db import models\n'), ((726, 758), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(200)'}), '(max_length=200)\n', (742, 758), False, 'from django.d... |
import numpy
with open ("dic.txt", "w", encoding="utf-8") as dic:
for x in range(5, 790, 1):
if 92 < x <= 113:
dic.write('"'+str(x)+'"'+":"+ '"'+'1'+'",')
elif 113 < x <= 133:
dic.write('"'+str(x)+'"'+":"+ '"'+'2'+'",')
elif 133 < x <= 153:
dic.w... | [
"numpy.arange"
] | [((4023, 4049), 'numpy.arange', 'numpy.arange', (['(0)', '(1.7)', '(0.01)'], {}), '(0, 1.7, 0.01)\n', (4035, 4049), False, 'import numpy\n')] |
# -*- coding: utf-8 -*-
'''
=============
scrim.globals
=============
Defines variables passed into the python script via Environment Variables by
scrim scripts. If SCRIM_SHELL is None, then the python script was not executed
by a scrim script.
SHELLS (list): list of available shells
SCRIM_SHELL (str): Parent ... | [
"os.environ.get"
] | [((841, 876), 'os.environ.get', 'os.environ.get', (['"""SCRIM_SHELL"""', 'None'], {}), "('SCRIM_SHELL', None)\n", (855, 876), False, 'import os\n'), ((890, 924), 'os.environ.get', 'os.environ.get', (['"""SCRIM_PATH"""', 'None'], {}), "('SCRIM_PATH', None)\n", (904, 924), False, 'import os\n'), ((1007, 1043), 'os.enviro... |
import csnd6
class Control:
def __init__(self, volume, frequency):
engine = csnd6.Csound()
engine.SetOption("-odac")
engine.Compile("osc.csd")
thread = csnd6.CsoundPerformanceThread(engine)
thread.Play()
self.engine = engine
self.thread = th... | [
"csnd6.Csound",
"csnd6.CsoundPerformanceThread"
] | [((89, 103), 'csnd6.Csound', 'csnd6.Csound', ([], {}), '()\n', (101, 103), False, 'import csnd6\n'), ((191, 228), 'csnd6.CsoundPerformanceThread', 'csnd6.CsoundPerformanceThread', (['engine'], {}), '(engine)\n', (220, 228), False, 'import csnd6\n')] |
# [LICENSE]
# Copyright (c) 2020, Alliance for Sustainable Energy.
# All rights reserved.
#
# Redistribution and use in source and binary forms,
# with or without modification, are permitted provided
# that the following conditions are met:
#
# 1. Redistributions of source code must retain the above
# copyright no... | [
"pytest.fixture"
] | [((1818, 1863), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""', 'autouse': '(True)'}), "(scope='session', autouse=True)\n", (1832, 1863), False, 'import pytest\n')] |
from django.db import models
# Create your models here.
class Tipo(models.Model):
descrizione = models.CharField(blank=False, null=False, max_length=128)
def __unicode__(self):
return "{}".format(self.descrizione)
class Meta:
verbose_name_plural = 'Tipi'
class Marca(models.Model):
... | [
"django.db.models.DateField",
"django.db.models.CharField",
"django.db.models.ForeignKey"
] | [((104, 161), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(False)', 'null': '(False)', 'max_length': '(128)'}), '(blank=False, null=False, max_length=128)\n', (120, 161), False, 'from django.db import models\n'), ((336, 393), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(False... |
import pickle
from time import sleep
import googleapiclient.errors
from transliterate import translit
from logs.logging import get_logger
from api_google.google_api_sheets import get_sheets_service, get_multiple_ranges
from api_google.google_api_directory import get_directory_service, get_users_for_domain, \
get_... | [
"pickle.dump",
"pickle.load",
"logs.logging.get_logger",
"time.sleep",
"api_google.google_api_sheets.get_sheets_service",
"api_google.google_api_directory.get_directory_service"
] | [((591, 668), 'logs.logging.get_logger', 'get_logger', (['"""sync_sheets_and_groups"""', "sync_sheets_and_groups['logging_level']"], {}), "('sync_sheets_and_groups', sync_sheets_and_groups['logging_level'])\n", (601, 668), False, 'from logs.logging import get_logger\n'), ((9521, 9564), 'time.sleep', 'sleep', (["sync_sh... |
#!/usr/bin/env python
# Copyright (c) 2020 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""
Lidar/BB check for CARLA
This script obtains the LiDAR's point cloud cor... | [
"numpy.dtype",
"numpy.ones",
"carla.Transform",
"carla.Vector3D",
"carla.Location",
"numpy.any",
"numpy.array",
"carla.Client",
"numpy.savetxt",
"queue.Queue",
"carla.Rotation",
"glob.glob"
] | [((7225, 7278), 'carla.Transform', 'carla.Transform', (['actor_tr.location', 'actor_tr.rotation'], {}), '(actor_tr.location, actor_tr.rotation)\n', (7240, 7278), False, 'import carla\n'), ((12931, 12962), 'carla.Client', 'carla.Client', (['"""localhost"""', '(2000)'], {}), "('localhost', 2000)\n", (12943, 12962), False... |
# <NAME>
# Software Engineering 001
# jumble_solver.py
# 2/17/2021
# Assignment:
# Consider the game "Jumble"
# https://www.sandiegouniontribune.com/sd-jumble-daily-htmlstory.html
# Create a Python program to find the individual words in Jumble puzzles such
# that INJURE prints after entering the following: solve("JNU... | [
"PyDictionary.PyDictionary",
"random.shuffle"
] | [((540, 554), 'PyDictionary.PyDictionary', 'PyDictionary', ([], {}), '()\n', (552, 554), False, 'from PyDictionary import PyDictionary\n'), ((727, 741), 'random.shuffle', 'shuffle', (['chars'], {}), '(chars)\n', (734, 741), False, 'from random import shuffle\n')] |
# Copyright (c) 2018 <NAME>, Inc.
#
# This file is part of Mycroft Skills Manager
# (see https://github.com/MycroftAI/mycroft-skills-manager).
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional informa... | [
"logging.getLogger",
"pako.PakoManager",
"git.Repo.clone_from",
"msm.exceptions.PipRequirementsException",
"msm.exceptions.AlreadyInstalled",
"os.path.exists",
"shutil.move",
"threading.Lock",
"msm.git_to_msm_exceptions",
"subprocess.Popen",
"functools.wraps",
"msm.util.Git",
"subprocess.cal... | [((1772, 1799), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1789, 1799), False, 'import logging\n'), ((2091, 2102), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (2100, 2102), False, 'import os\n'), ((2107, 2126), 'os.chdir', 'os.chdir', (['directory'], {}), '(directory)\n', (2115, 2126... |
#tshark -r input.pcap -qz "follow,tcp,raw,0"
import struct
import sys
import binascii
import subprocess
result = subprocess.Popen( ["tshark", "-r", sys.argv[1], "-qz", "follow,tcp,raw,0"],
stdout=subprocess.PIPE)
sys.stdout.buffer.write(b"FPC\x80")
for i in range(4):
result.stdout.rea... | [
"subprocess.Popen",
"sys.stdout.buffer.write",
"binascii.unhexlify"
] | [((115, 217), 'subprocess.Popen', 'subprocess.Popen', (["['tshark', '-r', sys.argv[1], '-qz', 'follow,tcp,raw,0']"], {'stdout': 'subprocess.PIPE'}), "(['tshark', '-r', sys.argv[1], '-qz', 'follow,tcp,raw,0'],\n stdout=subprocess.PIPE)\n", (131, 217), False, 'import subprocess\n'), ((244, 279), 'sys.stdout.buffer.wri... |
"""
Created: November 11, 2020
Author: <NAME>
Python Version 3.9
This program is meant to make the process of collecting the different filters from AIJ excel spreadsheets faster.
The user enters however many nights they have and the program goes through and checks those text files for the
different columns for,HJD, Am... | [
"pandas.DataFrame",
"os.path.exists",
"pandas.read_csv"
] | [((4117, 4190), 'pandas.DataFrame', 'pd.DataFrame', (["{'HJD': new_hjd, 'AMag': new_amag, 'AMag Error': new_error}"], {}), "({'HJD': new_hjd, 'AMag': new_amag, 'AMag Error': new_error})\n", (4129, 4190), True, 'import pandas as pd\n'), ((3072, 3105), 'pandas.read_csv', 'pd.read_csv', (['file'], {'delimiter': '"""\t"""'... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-09-02 05:23
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('songwriter', '0005_auto_20170824_1726'),
]
operations = [
migrations.AlterModelOpti... | [
"django.db.migrations.AlterModelOptions"
] | [((295, 392), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""author"""', 'options': "{'ordering': ['lastname', 'firstname']}"}), "(name='author', options={'ordering': [\n 'lastname', 'firstname']})\n", (323, 392), False, 'from django.db import migrations\n'), ((432, 506),... |
"""Loading MNIST dataset.
"""
import struct
import numpy as np
class MNIST:
"""
Loading MNIST dataset.
In the directory of MNIST dataset, there should be the following files:
- Training set:
- train-images-idx3-ubyte
- train-labels-idx1-ubyte
- Test set:
... | [
"matplotlib.pyplot.imshow",
"numpy.reshape",
"random.randrange",
"struct.unpack_from",
"numpy.asarray",
"numpy.zeros",
"numpy.vectorize",
"numpy.moveaxis",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show"
] | [((7734, 7766), 'random.randrange', 'random.randrange', (['data.batch_num'], {}), '(data.batch_num)\n', (7750, 7766), False, 'import random\n'), ((8294, 8304), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (8302, 8304), True, 'import matplotlib.pyplot as plt\n'), ((7475, 7507), 'random.randrange', 'random.ran... |
import threading, queue, time, os, pickle
# from queue import Queue
import numpy as np
import tensorflow as tf
import sarnet_td3.common.tf_util as U
from tensorflow.python.keras.backend import set_session
lock = threading.Lock()
class MultiTrainTD3(threading.Thread):
def __init__(self, input_queue, output_queue, ... | [
"threading.Thread.__init__",
"os.path.exists",
"numpy.mean",
"pickle.dump",
"sarnet_td3.common.tf_util.save_state",
"threading.Lock",
"tensorflow.compat.v1.get_default_session",
"os.path.join",
"time.sleep",
"numpy.stack",
"numpy.zeros",
"numpy.array",
"os.mkdir",
"numpy.expand_dims",
"q... | [((212, 228), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (226, 228), False, 'import threading, queue, time, os, pickle\n'), ((23871, 23905), 'tensorflow.compat.v1.get_default_session', 'tf.compat.v1.get_default_session', ([], {}), '()\n', (23903, 23905), True, 'import tensorflow as tf\n'), ((351, 404), 'thre... |
from flask import Flask, request, render_template
from sklearn.externals import joblib
from feature import *
pipeline = joblib.load('pipeline.sav')
app = Flask(__name__)
@app.route('/')
def home():
return render_template('index.html')
@app.route('/api',methods=['POST'])
def get_delay():
result=request.fo... | [
"flask.render_template",
"sklearn.externals.joblib.load",
"flask.Flask"
] | [((122, 149), 'sklearn.externals.joblib.load', 'joblib.load', (['"""pipeline.sav"""'], {}), "('pipeline.sav')\n", (133, 149), False, 'from sklearn.externals import joblib\n'), ((157, 172), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (162, 172), False, 'from flask import Flask, request, render_template\n... |
from plaid import Client
from backend.link_token import LinkToken
from general_falcon_webserver import WebApp
client = Client(client_id='5e2e3527dd6924001167e8e8', secret='<KEY>', environment='sandbox')
app = WebApp()
app.add_route('link', LinkToken(client))
app.launch_webserver()
| [
"plaid.Client",
"general_falcon_webserver.WebApp",
"backend.link_token.LinkToken"
] | [((121, 209), 'plaid.Client', 'Client', ([], {'client_id': '"""5e2e3527dd6924001167e8e8"""', 'secret': '"""<KEY>"""', 'environment': '"""sandbox"""'}), "(client_id='5e2e3527dd6924001167e8e8', secret='<KEY>', environment=\n 'sandbox')\n", (127, 209), False, 'from plaid import Client\n'), ((212, 220), 'general_falcon_... |
#
# Copyright 2018, 2020 <NAME>
# 2019-2020 <NAME>
# 2015-2016 <NAME>
#
# ### MIT license
#
# 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 ... | [
"PyCo.Tools.CharacterisePeriodicSurface",
"scipy.optimize.fminbound",
"numpy.log",
"PyCo.Tools.RandomSurfaceGaussian",
"matplotlib.pyplot.figure",
"numpy.linspace",
"numpy.isfinite",
"numpy.zeros_like",
"matplotlib.pyplot.show"
] | [((1421, 1433), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (1431, 1433), True, 'import matplotlib.pyplot as plt\n'), ((1524, 1566), 'PyCo.Tools.CharacterisePeriodicSurface', 'Tools.CharacterisePeriodicSurface', (['surface'], {}), '(surface)\n', (1557, 1566), True, 'import PyCo.Tools as Tools\n'), ((181... |
import threading
import requests
import json
import os
from nose.tools import *
from server import Httpd
app_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "app")
class TestServerlessMock(object):
def test_ok(self):
ok_(True)
def setUp(self):
self.httpd = Httpd(app_path, 0)... | [
"os.path.realpath",
"threading.Thread",
"json.dumps",
"server.Httpd"
] | [((146, 172), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (162, 172), False, 'import os\n'), ((302, 320), 'server.Httpd', 'Httpd', (['app_path', '(0)'], {}), '(app_path, 0)\n', (307, 320), False, 'from server import Httpd\n'), ((338, 388), 'threading.Thread', 'threading.Thread', ([], {'t... |
# Generated by Django 3.1.12 on 2021-06-24 18:12
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('trip', '0006_remove_travelmodel_driver'),
]
operations = [
migrations.AddField(
model_name='tr... | [
"django.db.models.PositiveSmallIntegerField",
"django.db.models.ForeignKey"
] | [((381, 424), 'django.db.models.PositiveSmallIntegerField', 'models.PositiveSmallIntegerField', ([], {'default': '(0)'}), '(default=0)\n', (413, 424), False, 'from django.db import migrations, models\n'), ((549, 712), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'on_delete': 'django.db.models.deletion.PROT... |
#!/usr/bin/python
import sys
import os
import shutil
from glob import glob
from PyQt5.QtCore import (Qt, qInstallMessageHandler, QtInfoMsg, QtCriticalMsg, QtDebugMsg,
QtWarningMsg, QtFatalMsg, QSettings, pyqtSlot, QStandardPaths, QUrl)
from PyQt5.QtGui import QIcon, QDesktopServices
from PyQt... | [
"PyQt5.QtGui.QIcon",
"PyQt5.QtCore.QUrl.fromLocalFile",
"P13pt.spectrumfitter.plotter.Plotter",
"PyQt5.QtWidgets.QProgressDialog",
"PyQt5.QtWidgets.QApplication.processEvents",
"PyQt5.QtWidgets.QApplication",
"sys.exit",
"PyQt5.QtWidgets.QDockWidget",
"PyQt5.QtWidgets.QFileDialog.getOpenFileName",
... | [((7840, 7850), 'PyQt5.QtCore.pyqtSlot', 'pyqtSlot', ([], {}), '()\n', (7848, 7850), False, 'from PyQt5.QtCore import Qt, qInstallMessageHandler, QtInfoMsg, QtCriticalMsg, QtDebugMsg, QtWarningMsg, QtFatalMsg, QSettings, pyqtSlot, QStandardPaths, QUrl\n'), ((11290, 11300), 'PyQt5.QtCore.pyqtSlot', 'pyqtSlot', ([], {}),... |
from pycket.error import SchemeException
from rpython.tool.pairtype import extendabletype
from rpython.rlib import jit, objectmodel
class W_ProtoObject(object):
""" abstract base class of both actual values (W_Objects) and multiple
return values (Values)"""
_attrs_ = []
_settled_ = True
... | [
"rpython.rlib.objectmodel.compute_hash"
] | [((2382, 2412), 'rpython.rlib.objectmodel.compute_hash', 'objectmodel.compute_hash', (['self'], {}), '(self)\n', (2406, 2412), False, 'from rpython.rlib import jit, objectmodel\n')] |
import numpy as np
from stable_baselines import PPO2
from stable_baselines.common.policies import CnnPolicy
from stable_baselines.a2c.utils import conv, linear, conv_to_fc
from src.envs import CMDP, FrozenLakeEnvCustomMap
from src.envs.frozen_lake.frozen_maps import MAPS
from src.students import LagrangianStudent, i... | [
"stable_baselines.a2c.utils.conv_to_fc",
"numpy.sqrt",
"src.envs.FrozenLakeEnvCustomMap",
"stable_baselines.a2c.utils.conv",
"src.teacher.create_intervention",
"tensorflow.compat.v1.logging.set_verbosity",
"src.envs.frozen_lake.utils.add_teacher"
] | [((741, 803), 'tensorflow.compat.v1.logging.set_verbosity', 'tf.compat.v1.logging.set_verbosity', (['tf.compat.v1.logging.ERROR'], {}), '(tf.compat.v1.logging.ERROR)\n', (775, 803), True, 'import tensorflow as tf\n'), ((1242, 1278), 'src.envs.FrozenLakeEnvCustomMap', 'FrozenLakeEnvCustomMap', ([], {}), '(**env_kwargs)\... |
name = "scanapi"
import click
import logging
from scanapi.tree.api_tree import APITree
from scanapi.reporter import Reporter
from scanapi.requests_maker import RequestsMaker
from scanapi.settings import SETTINGS
from scanapi.yaml_loader import load_yaml
@click.command()
@click.option(
"-s",
"--spec-path",
... | [
"logging.getLogger",
"logging.basicConfig",
"click.Choice",
"click.option",
"scanapi.tree.api_tree.APITree",
"scanapi.yaml_loader.load_yaml",
"scanapi.requests_maker.RequestsMaker",
"click.Path",
"scanapi.reporter.Reporter",
"click.command",
"scanapi.settings.SETTINGS.update"
] | [((259, 274), 'click.command', 'click.command', ([], {}), '()\n', (272, 274), False, 'import click\n'), ((408, 458), 'click.option', 'click.option', (['"""-o"""', '"""--output-path"""', '"""output_path"""'], {}), "('-o', '--output-path', 'output_path')\n", (420, 458), False, 'import click\n'), ((611, 655), 'click.optio... |
# 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 ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | [
"logging.debug",
"DBImportOperation.common_operations.operation",
"datetime.datetime.now",
"sys.exit",
"logging.error",
"DBImportConfig.import_config.config"
] | [((1331, 1383), 'logging.debug', 'logging.debug', (['"""Executing etl_operations.__init__()"""'], {}), "('Executing etl_operations.__init__()')\n", (1344, 1383), False, 'import logging\n'), ((1535, 1583), 'DBImportOperation.common_operations.operation', 'common_operations.operation', (['Hive_DB', 'Hive_Table'], {}), '(... |
import numpy as np
import os
from scanorama import *
from scipy.sparse import vstack
from process import load_names
from experiments import *
from utils import *
NAMESPACE = 'zeisel'
METHOD = 'svd'
DIMRED = 100
data_names = [
'data/mouse_brain/zeisel/amygdala',
'data/mouse_brain/zeisel/cerebellum',
'data... | [
"scipy.sparse.vstack",
"ample.srs",
"process.load_names",
"numpy.array",
"differential_entropies.differential_entropies",
"mouse_brain_astrocyte.astro_oligo_violin"
] | [((1047, 1081), 'process.load_names', 'load_names', (['data_names'], {'norm': '(False)'}), '(data_names, norm=False)\n', (1057, 1081), False, 'from process import load_names\n'), ((1149, 1165), 'scipy.sparse.vstack', 'vstack', (['datasets'], {}), '(datasets)\n', (1155, 1165), False, 'from scipy.sparse import vstack\n')... |
import fcntl
import os
import socket
import struct
import warnings
import subprocess
import logging
import base64
logger = logging.getLogger(__name__)
# Dummy socket used for fcntl functions
_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
class AddrMeta(type):
@property
def maxvalue(cls):
... | [
"logging.getLogger",
"os.path.exists",
"socket.socket",
"os.makedirs",
"os.waitpid",
"subprocess.run",
"struct.pack",
"socket.inet_aton",
"warnings.warn",
"socket.inet_ntoa"
] | [((124, 151), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (141, 151), False, 'import logging\n'), ((203, 251), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_DGRAM'], {}), '(socket.AF_INET, socket.SOCK_DGRAM)\n', (216, 251), False, 'import socket\n'), ((2152, 2171),... |
from collections import defaultdict
def return_default():
return 0
REAL=open("18.txt").readlines()
SAMPLE=open("18.sample").readlines()
OPEN="."
TREE="|"
LUMBERYARD="#"
import copy
def safe_grid_get(grid, x, y, missing=None):
if x < 0 or y < 0:
return missing
if y >= len(grid):
return m... | [
"collections.defaultdict",
"copy.deepcopy"
] | [((519, 546), 'collections.defaultdict', 'defaultdict', (['return_default'], {}), '(return_default)\n', (530, 546), False, 'from collections import defaultdict\n'), ((1250, 1277), 'collections.defaultdict', 'defaultdict', (['return_default'], {}), '(return_default)\n', (1261, 1277), False, 'from collections import defa... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('activity_log', '0003_activitylog_extra_data'),
]
operations = [
migrations.AlterField(
... | [
"django.db.models.DateTimeField",
"django.db.models.GenericIPAddressField",
"django.db.models.CharField"
] | [((397, 497), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'default': 'django.utils.timezone.now', 'verbose_name': '"""datetime"""', 'db_index': '(True)'}), "(default=django.utils.timezone.now, verbose_name=\n 'datetime', db_index=True)\n", (417, 497), False, 'from django.db import models, migrati... |
import numpy
import pytest
import os
from shutil import rmtree
from numpy.testing import assert_allclose
import scipy.stats
import scipy.integrate
import scipy.special
from fgivenx.mass import PMF, compute_pmf
def gaussian_pmf(y, mu=0, sigma=1):
return scipy.special.erfc(numpy.abs(y-mu)/numpy.sqrt(2)/sigma)
def... | [
"numpy.random.normal",
"numpy.abs",
"fgivenx.mass.compute_pmf",
"fgivenx.mass.PMF",
"numpy.sqrt",
"numpy.testing.assert_allclose",
"numpy.zeros_like",
"shutil.rmtree",
"os.path.isfile",
"numpy.linspace",
"numpy.outer",
"pytest.raises",
"numpy.random.seed",
"numpy.random.uniform",
"numpy.... | [((342, 362), 'numpy.random.seed', 'numpy.random.seed', (['(0)'], {}), '(0)\n', (359, 362), False, 'import numpy\n'), ((394, 419), 'numpy.random.randn', 'numpy.random.randn', (['nsamp'], {}), '(nsamp)\n', (412, 419), False, 'import numpy\n'), ((428, 459), 'numpy.random.uniform', 'numpy.random.uniform', (['(-3)', '(3)',... |
"""Config flow for Vera."""
from __future__ import annotations
from collections.abc import Mapping
import logging
import re
from typing import Any
import pyvera as pv
from requests.exceptions import RequestException
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.config_entries i... | [
"logging.getLogger",
"voluptuous.Required",
"pyvera.VeraController",
"re.compile",
"homeassistant.helpers.entity_registry.async_get"
] | [((586, 607), 're.compile', 're.compile', (['"""[^0-9]+"""'], {}), "('[^0-9]+')\n", (596, 607), False, 'import re\n'), ((618, 645), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (635, 645), False, 'import logging\n'), ((3752, 3775), 'homeassistant.helpers.entity_registry.async_get', 'er.... |
from pprint import pprint
import SCons.Builder
from SCons.Script import *
import json
import os
import copy
import collections
import xml.etree.ElementTree as ET
from mplabx import MPLABXProperties
MAKEFILE_TEXT = '''
MKDIR=mkdir
CP=cp
CCADMIN=CCadmin
RANLIB=ranlib
build: .build-post
.build-pre:
.build-post: .build-i... | [
"xml.etree.ElementTree.indent",
"os.path.split",
"xml.etree.ElementTree.Element",
"xml.etree.ElementTree.SubElement",
"xml.etree.ElementTree.ElementTree",
"collections.defaultdict",
"os.path.abspath",
"xml.etree.ElementTree.fromstring",
"os.path.relpath"
] | [((1424, 1460), 'collections.defaultdict', 'collections.defaultdict', (['nested_dict'], {}), '(nested_dict)\n', (1447, 1460), False, 'import collections\n'), ((2310, 2351), 'xml.etree.ElementTree.fromstring', 'ET.fromstring', (['CONFIGURATION_ELEMENT_TEXT'], {}), '(CONFIGURATION_ELEMENT_TEXT)\n', (2323, 2351), True, 'i... |
#! /usr/bin/env python
# Author: <NAME>
# Contact: <EMAIL>
# Revision: $Revision: 3915 $
# Date: $Date: 2005-10-02 03:06:42 +0200 (Sun, 02 Oct 2005) $
# Copyright: This module has been placed in the public domain.
"""
Tests for docutils.transforms.peps.
"""
from __init__ import DocutilsTestSupport
from docutils.tran... | [
"unittest.main",
"docutils.parsers.rst.Parser",
"__init__.DocutilsTestSupport.TransformTestSuite"
] | [((419, 427), 'docutils.parsers.rst.Parser', 'Parser', ([], {}), '()\n', (425, 427), False, 'from docutils.parsers.rst import Parser\n'), ((436, 482), '__init__.DocutilsTestSupport.TransformTestSuite', 'DocutilsTestSupport.TransformTestSuite', (['parser'], {}), '(parser)\n', (474, 482), False, 'from __init__ import Doc... |
# Generated by Django 4.0.2 on 2022-03-15 22:43
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('rental_property', '0010_alter_rentalunit_status'),
]
operations = [
migrations.AlterModelOptions(
name='rentalunit',
options... | [
"django.db.migrations.AlterModelOptions"
] | [((240, 342), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""rentalunit"""', 'options': "{'verbose_name_plural': 'Rental Houses'}"}), "(name='rentalunit', options={\n 'verbose_name_plural': 'Rental Houses'})\n", (268, 342), False, 'from django.db import migrations\n')] |
from datetime import datetime
import base64
import os
import re
import requests
import sys
import urllib.parse
import xmltodict
import xbmc
import xbmcgui
import xbmcplugin
import xbmcaddon
import xbmcvfs
__PLUGIN_ID__ = "plugin.audio.podcasts"
# see https://forum.kodi.tv/showthread.php?tid=112916
_MONTHS = ["Jan", ... | [
"xmltodict.parse",
"base64.urlsafe_b64decode",
"xbmcplugin.setResolvedUrl",
"xbmc.log",
"re.match",
"xbmc.getInfoLabel",
"os.path.join",
"re.findall",
"datetime.datetime.now",
"xbmcaddon.Addon",
"xbmcgui.ListItem",
"xbmcgui.Dialog",
"re.sub",
"xbmcplugin.endOfDirectory",
"xbmcplugin.addS... | [((529, 562), 'xbmcaddon.Addon', 'xbmcaddon.Addon', ([], {'id': '__PLUGIN_ID__'}), '(id=__PLUGIN_ID__)\n', (544, 562), False, 'import xbmcaddon\n'), ((2400, 2436), 'xbmcgui.ListItem', 'xbmcgui.ListItem', ([], {'label': "item['name']"}), "(label=item['name'])\n", (2416, 2436), False, 'import xbmcgui\n'), ((4894, 4993), ... |
import re
import time
from lemoncheesecake.events import TestSessionSetupEndEvent, TestSessionTeardownEndEvent, \
TestEndEvent, SuiteSetupEndEvent, SuiteTeardownEndEvent, SuiteEndEvent, SteppedEvent
from lemoncheesecake.reporting.report import ReportLocation
DEFAULT_REPORT_SAVING_STRATEGY = "at_each_failed_test"
... | [
"lemoncheesecake.reporting.report.ReportLocation.in_suite_teardown",
"re.compile",
"lemoncheesecake.reporting.report.ReportLocation.in_test_session_setup",
"time.time",
"lemoncheesecake.reporting.report.ReportLocation.in_test",
"lemoncheesecake.reporting.report.ReportLocation.in_test_session_teardown",
... | [((413, 447), 'lemoncheesecake.reporting.report.ReportLocation.in_test', 'ReportLocation.in_test', (['event.test'], {}), '(event.test)\n', (435, 447), False, 'from lemoncheesecake.reporting.report import ReportLocation\n'), ((510, 552), 'lemoncheesecake.reporting.report.ReportLocation.in_suite_setup', 'ReportLocation.i... |
"""Genshin chronicle notes."""
import datetime
import typing
import pydantic
from genshin.models.genshin import character
from genshin.models.model import Aliased, APIModel
__all__ = ["Expedition", "ExpeditionCharacter", "Notes"]
def _process_timedelta(time: typing.Union[int, datetime.timedelta, datetime.datetime]... | [
"datetime.datetime",
"genshin.models.model.Aliased",
"datetime.datetime.fromtimestamp",
"pydantic.root_validator",
"pydantic.validator",
"datetime.datetime.now",
"datetime.timedelta"
] | [((988, 1015), 'genshin.models.model.Aliased', 'Aliased', (['"""avatar_side_icon"""'], {}), "('avatar_side_icon')\n", (995, 1015), False, 'from genshin.models.model import Aliased, APIModel\n'), ((1107, 1131), 'genshin.models.model.Aliased', 'Aliased', (['"""remained_time"""'], {}), "('remained_time')\n", (1114, 1131),... |
# 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 ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | [
"tvm.tir.schedule.Schedule",
"tvm.meta_schedule.default_config.schedule_rules",
"tvm.tir.schedule.Trace",
"tvm.ir.assert_structural_equal",
"tvm.target.Target",
"tvm.ir.IRModule",
"tvm.meta_schedule.space_generator.PostOrderApply"
] | [((5272, 5305), 'tvm.tir.schedule.Schedule', 'Schedule', ([], {'mod': 'conv2d_winograd_cpu'}), '(mod=conv2d_winograd_cpu)\n', (5280, 5305), False, 'from tvm.tir.schedule import Schedule, Trace\n'), ((5495, 5518), 'tvm.ir.IRModule', 'IRModule', (["{'main': mod}"], {}), "({'main': mod})\n", (5503, 5518), False, 'from tvm... |
#!/usr/bin/env python
import argparse
from igf_data.task_tracking.igf_slack import IGF_slack
from igf_data.process.data_transfer.sync_seqrun_data_on_remote import Sync_seqrun_data_from_remote
parser = argparse.ArgumentParser()
parser.add_argument('-r','--remote_server', required=True, help='Remote server address')
par... | [
"argparse.ArgumentParser",
"igf_data.task_tracking.igf_slack.IGF_slack"
] | [((202, 227), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (225, 227), False, 'import argparse\n'), ((944, 980), 'igf_data.task_tracking.igf_slack.IGF_slack', 'IGF_slack', ([], {'slack_config': 'slack_config'}), '(slack_config=slack_config)\n', (953, 980), False, 'from igf_data.task_tracking.... |
from typing import Callable, Iterable, TypeVar
T = TypeVar('T')
Num = TypeVar('Num', int, float)
def sumBy(array: Iterable[T], iteratee: Callable[[T], Num] = None, start: Num = 0) -> Num:
if iteratee is None:
return sum([y for y in array], start)
return sum([iteratee(y) for y in array], start)
| [
"typing.TypeVar"
] | [((52, 64), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (59, 64), False, 'from typing import Callable, Iterable, TypeVar\n'), ((71, 97), 'typing.TypeVar', 'TypeVar', (['"""Num"""', 'int', 'float'], {}), "('Num', int, float)\n", (78, 97), False, 'from typing import Callable, Iterable, TypeVar\n')] |
import grpc
from consts import PORT, SERVER_CERT
from grpc_generated_files import api_pb2, api_pb2_grpc
def main(stub):
request = api_pb2.ApiRequest(
name="Shivam",
message="Hey there!"
)
response = stub.ApiEndpoint(request)
print(response)
if __name__ == "__main__":
with open(S... | [
"grpc.ssl_channel_credentials",
"grpc_generated_files.api_pb2.ApiRequest",
"grpc.secure_channel",
"grpc_generated_files.api_pb2_grpc.ApiStub"
] | [((137, 192), 'grpc_generated_files.api_pb2.ApiRequest', 'api_pb2.ApiRequest', ([], {'name': '"""Shivam"""', 'message': '"""Hey there!"""'}), "(name='Shivam', message='Hey there!')\n", (155, 192), False, 'from grpc_generated_files import api_pb2, api_pb2_grpc\n'), ((387, 428), 'grpc.ssl_channel_credentials', 'grpc.ssl_... |
import pyblish.api
import avalon.api
from openpype.api import version_up
from openpype.action import get_errored_plugins_from_data
class IncrementCurrentFile(pyblish.api.InstancePlugin):
"""Increment the current file.
Saves the current scene with an increased version number.
"""
label = "Increment... | [
"openpype.action.get_errored_plugins_from_data",
"openpype.api.version_up"
] | [((922, 960), 'openpype.action.get_errored_plugins_from_data', 'get_errored_plugins_from_data', (['context'], {}), '(context)\n', (951, 960), False, 'from openpype.action import get_errored_plugins_from_data\n'), ((1549, 1573), 'openpype.api.version_up', 'version_up', (['current_file'], {}), '(current_file)\n', (1559, ... |
from builtins import str
from builtins import range
from robust.simulations.simulate import filter_gamma_result_dict
from SimPleAC_save import load_obj
import pickle as pickle
import numpy as np
import matplotlib.pyplot as plt
from SimPleAC_pof_simulate import pof_parameters
if __name__ == "__main__":
# Retrieving... | [
"matplotlib.pyplot.show",
"SimPleAC_pof_simulate.pof_parameters",
"builtins.str",
"numpy.max",
"builtins.range",
"numpy.min",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplots",
"robust.simulations.simulate.filter_gamma_result_dict",
"SimPleAC_save.load_obj"
] | [((659, 675), 'SimPleAC_pof_simulate.pof_parameters', 'pof_parameters', ([], {}), '()\n', (673, 675), False, 'from SimPleAC_pof_simulate import pof_parameters\n'), ((868, 883), 'builtins.range', 'range', (['nmargins'], {}), '(nmargins)\n', (873, 883), False, 'from builtins import range\n'), ((1093, 1149), 'SimPleAC_sav... |
#!/usr/bin/env python
from __future__ import absolute_import
import numpy as np
import os
import pytest
import tempfile
import training_data
class TestTrainingData():
def test_add(self):
td = training_data.training_data()
assert np.array_equal(td.get_x(), np.empty([0, 4, 4], dtype=np.int))
... | [
"pytest.approx",
"numpy.allclose",
"numpy.ones",
"os.path.join",
"pytest.main",
"training_data.training_data",
"numpy.array",
"os.rmdir",
"tempfile.mkdtemp",
"numpy.empty",
"numpy.zeros",
"numpy.full",
"numpy.dtype",
"os.remove"
] | [((22956, 22969), 'pytest.main', 'pytest.main', ([], {}), '()\n', (22967, 22969), False, 'import pytest\n'), ((208, 237), 'training_data.training_data', 'training_data.training_data', ([], {}), '()\n', (235, 237), False, 'import training_data\n'), ((1140, 1169), 'training_data.training_data', 'training_data.training_da... |
import json
import os
from os.path import join
from random import shuffle
import numpy as np
from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer
from sklearn.preprocessing import MinMaxScaler, normalize
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import cros... | [
"os.listdir",
"os.path.join",
"sklearn.linear_model.LogisticRegression",
"numpy.squeeze",
"numpy.zeros",
"transformers.BartTokenizer.from_pretrained",
"sklearn.preprocessing.normalize"
] | [((576, 622), 'numpy.zeros', 'np.zeros', (['tokenizer.vocab_size'], {'dtype': 'np.int16'}), '(tokenizer.vocab_size, dtype=np.int16)\n', (584, 622), True, 'import numpy as np\n'), ((1803, 1860), 'transformers.BartTokenizer.from_pretrained', 'BartTokenizer.from_pretrained', (['"""facebook/bart-large-xsum"""'], {}), "('fa... |
import unittest, tempfile
from pygromos.simulations.hpc_queuing.job_scheduling.schedulers import simulation_scheduler
from pygromos.data.simulation_parameters_templates import template_md
from pygromos.data.topology_templates import blank_topo_template
from pygromos.simulations.hpc_queuing.submission_systems import D... | [
"pygromos.simulations.hpc_queuing.job_scheduling.schedulers.simulation_scheduler.do",
"tempfile.mkdtemp",
"pygromos.files.gromos_system.gromos_system.Gromos_System"
] | [((640, 707), 'tempfile.mkdtemp', 'tempfile.mkdtemp', ([], {'dir': 'out_test_root_dir', 'prefix': '"""scheduling_Dummy_"""'}), "(dir=out_test_root_dir, prefix='scheduling_Dummy_')\n", (656, 707), False, 'import unittest, tempfile\n'), ((848, 1049), 'pygromos.files.gromos_system.gromos_system.Gromos_System', 'Gromos_Sys... |
# -*- coding: utf-8 -*-
"""
Created on Sat Dec 30 17:03:01 2017
@author: misakawa
"""
from pattern_matching import Match, when, var, T, t, _, overwrite
from numpy.random import randint
@overwrite(var[(t == int) | (t == float)], var[(t == int) | (t == float)])
def add(a, b):
return a + b
@when(var[t == str], v... | [
"pattern_matching.t.when",
"pattern_matching.overwrite",
"pattern_matching.when",
"numpy.random.randint",
"pattern_matching.var.when",
"pattern_matching.Match"
] | [((190, 263), 'pattern_matching.overwrite', 'overwrite', (['var[(t == int) | (t == float)]', 'var[(t == int) | (t == float)]'], {}), '(var[(t == int) | (t == float)], var[(t == int) | (t == float)])\n', (199, 263), False, 'from pattern_matching import Match, when, var, T, t, _, overwrite\n'), ((299, 333), 'pattern_matc... |
# ----------------------------------------------------------------------
# |
# | EnvironmentDiffs.py
# |
# | <NAME> <<EMAIL>>
# | 2018-06-02 22:19:34
# |
# ----------------------------------------------------------------------
# |
# | Copyright <NAME> 2018-22.
# | Distributed under the Boost Software... | [
"CommonEnvironment.CommandLine.Main",
"textwrap.dedent",
"os.getenv",
"json.dumps",
"os.path.join",
"os.path.split",
"os.path.isfile",
"CommonEnvironment.CommandLine.Constraints",
"os.path.isdir",
"json.load",
"CommonEnvironment.ThisFullpath",
"six.iteritems"
] | [((917, 949), 'CommonEnvironment.ThisFullpath', 'CommonEnvironment.ThisFullpath', ([], {}), '()\n', (947, 949), False, 'import CommonEnvironment\n'), ((979, 1010), 'os.path.split', 'os.path.split', (['_script_fullpath'], {}), '(_script_fullpath)\n', (992, 1010), False, 'import os\n'), ((1188, 1231), 'CommonEnvironment.... |
from datetime import datetime
from os.path import join
from tests.base import TestCase, main, assets, copy_of_directory
from ocrd_utils import (
initLogging,
VERSION,
MIMETYPE_PAGE
)
from ocrd_models import OcrdMets
# pylint: disable=protected-access,deprecated-method,too-many-public-methods
class TestOcr... | [
"tests.base.assets.path_to",
"tests.base.main",
"ocrd_utils.initLogging",
"os.path.join",
"ocrd_models.OcrdMets.empty_mets",
"datetime.datetime.now",
"ocrd_models.OcrdMets",
"tests.base.assets.url_of"
] | [((7830, 7836), 'tests.base.main', 'main', ([], {}), '()\n', (7834, 7836), False, 'from tests.base import TestCase, main, assets, copy_of_directory\n'), ((457, 470), 'ocrd_utils.initLogging', 'initLogging', ([], {}), '()\n', (468, 470), False, 'from ocrd_utils import initLogging, VERSION, MIMETYPE_PAGE\n'), ((855, 876)... |
"""
Environment for basic obstacle avoidance controlling a robotic arm from UR.
In this environment the obstacle is only moving up and down in a vertical line in front of the robot.
The goal is for the robot to stay within a predefined minimum distance to the moving obstacle.
When feasible the robot should continue to... | [
"numpy.random.default_rng",
"numpy.min",
"robo_gym_server_modules.robot_server.grpc_msgs.python.robot_server_pb2.State",
"numpy.square",
"numpy.array",
"numpy.zeros",
"numpy.linalg.norm",
"robo_gym.envs.simulation_wrapper.Simulation.__init__"
] | [((3080, 3196), 'robo_gym_server_modules.robot_server.grpc_msgs.python.robot_server_pb2.State', 'robot_server_pb2.State', ([], {'state': 'state', 'float_params': 'float_params', 'string_params': 'string_params', 'state_dict': 'rs_state'}), '(state=state, float_params=float_params,\n string_params=string_params, stat... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pyqtgraph as pg
import numpy as np
class CustomWidget(pg.GraphicsWindow):
pg.setConfigOption('background', 'w')
pg.setConfigOption('foreground', 'k')
def __init__(self, parent=None, **kargs):
pg.GraphicsWindow.__init__(self, **kargs)
sel... | [
"pyqtgraph.setConfigOption",
"numpy.zeros",
"pyqtgraph.GraphicsWindow.__init__"
] | [((133, 170), 'pyqtgraph.setConfigOption', 'pg.setConfigOption', (['"""background"""', '"""w"""'], {}), "('background', 'w')\n", (151, 170), True, 'import pyqtgraph as pg\n'), ((175, 212), 'pyqtgraph.setConfigOption', 'pg.setConfigOption', (['"""foreground"""', '"""k"""'], {}), "('foreground', 'k')\n", (193, 212), True... |
"""Tests for collapsible definition lists.
When the option ``html_collapsible_definitions``
is ``True``, some HTML classes should be added
to some definition lists but not all of them.
"""
from pathlib import Path
import pytest
from sphinx.application import Sphinx
from .util import parse_html
@pytest.mark.sphinx... | [
"pytest.mark.sphinx",
"pathlib.Path"
] | [((302, 425), 'pytest.mark.sphinx', 'pytest.mark.sphinx', (['"""html"""'], {'testroot': '"""collapsible"""', 'confoverrides': "{'html_theme': 'sphinxawesome_theme'}", 'freshenv': '(True)'}), "('html', testroot='collapsible', confoverrides={\n 'html_theme': 'sphinxawesome_theme'}, freshenv=True)\n", (320, 425), False... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from network import NN
from evaluate import accuracy
def read_data(fpath):
iris = pd.read_csv(fpath)
iris.loc[iris['species'] == 'virginica', 'species'] = 0
iris.loc[iris['species'] == 'versicolor', 'species'] = 1
iris.loc[iris['sp... | [
"numpy.random.shuffle",
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.title",
"evaluate.accuracy",
"numpy.arange",
"matplotlib.pyplot.show"
] | [((159, 177), 'pandas.read_csv', 'pd.read_csv', (['fpath'], {}), '(fpath)\n', (170, 177), True, 'import pandas as pd\n'), ((519, 587), 'matplotlib.pyplot.scatter', 'plt.scatter', (['X[:, 0]', 'X[:, 1]'], {'c': 'y[:, 0]', 's': '(40)', 'cmap': 'plt.cm.Spectral'}), '(X[:, 0], X[:, 1], c=y[:, 0], s=40, cmap=plt.cm.Spectral... |
import unittest
import unittest.mock
from programy.storage.entities.nodes import NodesStore
class NodesStoreTest(unittest.TestCase):
def test_load(self):
store = NodesStore()
with self.assertRaises(NotImplementedError):
collector = unittest.mock.Mock()
store.load(collecto... | [
"programy.storage.entities.nodes.NodesStore",
"unittest.mock.Mock"
] | [((178, 190), 'programy.storage.entities.nodes.NodesStore', 'NodesStore', ([], {}), '()\n', (188, 190), False, 'from programy.storage.entities.nodes import NodesStore\n'), ((268, 288), 'unittest.mock.Mock', 'unittest.mock.Mock', ([], {}), '()\n', (286, 288), False, 'import unittest\n')] |
import graphviz
def convert_to_visualize(graph_ir, vgraph):
for name, graph in graph_ir.items():
if name == '_training_config':
continue
with vgraph.subgraph(name='cluster'+name) as subgraph:
subgraph.attr(color='blue')
cell_node = {}
ioput = {'_inpu... | [
"graphviz.Digraph"
] | [((1710, 1764), 'graphviz.Digraph', 'graphviz.Digraph', (['"""G"""'], {'filename': '"""vgraph"""', 'format': '"""jpg"""'}), "('G', filename='vgraph', format='jpg')\n", (1726, 1764), False, 'import graphviz\n')] |
import unittest
class PrefixNotIncluded(unittest.TestCase):
def test_not_included(self):
pass
if __name__ == '__main__':
unittest.main()
| [
"unittest.main"
] | [((139, 154), 'unittest.main', 'unittest.main', ([], {}), '()\n', (152, 154), False, 'import unittest\n')] |
'''
This is the class to create a scrolling background.
Because the background was so large, it was made to be a .jpg.
'''
import pygame, os
class Background(pygame.sprite.Sprite):
# Initialize the sprite.
def __init__(self,disp):
pygame.sprite.Sprite.__init__(self)
self.image = pygame... | [
"pygame.sprite.Sprite.__init__",
"os.path.join"
] | [((257, 292), 'pygame.sprite.Sprite.__init__', 'pygame.sprite.Sprite.__init__', (['self'], {}), '(self)\n', (286, 292), False, 'import pygame, os\n'), ((332, 377), 'os.path.join', 'os.path.join', (['"""images"""', '"""spacebackground.jpg"""'], {}), "('images', 'spacebackground.jpg')\n", (344, 377), False, 'import pygam... |
# -*- coding: utf-8 -*-
"""Linear module for dqn algorithms
- Author: <NAME>
- Contact: <EMAIL>
"""
import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from rl_algorithms.common.helper_functions import numpy2floattensor
device = torch.device("cuda:0" if torch.cuda.is_a... | [
"torch.nn.functional.linear",
"numpy.random.normal",
"math.sqrt",
"torch.Tensor",
"torch.cuda.is_available"
] | [((305, 330), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (328, 330), False, 'import torch\n'), ((3051, 3177), 'torch.nn.functional.linear', 'F.linear', (['x', '(self.weight_mu + self.weight_sigma * self.weight_epsilon)', '(self.bias_mu + self.bias_sigma * self.bias_epsilon)'], {}), '(x, sel... |
# Advent of Code - 2015 - Day 7
# --- Day 7: Some Assembly Required ---
# This year, Santa brought little Bobby Tables a set of wires and bitwise logic gates! Unfortunately, little Bobby is a little under the recommended age range, and he needs help assembling the circuit.
# Each wire has an identifier (some lowerca... | [
"time.perf_counter",
"math.isnan"
] | [((8497, 8516), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (8514, 8516), False, 'import time, math\n'), ((10704, 10723), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (10721, 10723), False, 'import time, math\n'), ((4004, 4022), 'math.isnan', 'math.isnan', (['input1'], {}), '(input1)\n', ... |
import logging
import pytest
from . import auth
from hydroengine_service import dgds_functions
logger = logging.getLogger(__name__)
class TestDGDSFunctions:
@pytest.mark.parametrize('source, start_date, end_date, limit',
[
('projects/dgds-gee/bathym... | [
"logging.getLogger",
"pytest.mark.parametrize",
"hydroengine_service.dgds_functions.get_image_collection_info"
] | [((107, 134), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (124, 134), False, 'import logging\n'), ((167, 1097), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""source, start_date, end_date, limit"""', "[('projects/dgds-gee/bathymetry/gebco/2019', None, None, 10), (\n 'pr... |
from tweepy import StreamListener, OAuthHandler, Stream
from configs import Configs
import sys
class StdOutListener(StreamListener):
def __init__(self, kafka_producer, topic):
super().__init__()
self.kafka_producer = kafka_producer
self.topic = topic
""" A listener handles tweets tha... | [
"tweepy.Stream",
"configs.Configs",
"confluent_kafka.Producer",
"sys.exit",
"tweepy.OAuthHandler"
] | [((1395, 1404), 'configs.Configs', 'Configs', ([], {}), '()\n', (1402, 1404), False, 'from configs import Configs\n'), ((701, 712), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (709, 712), False, 'import sys\n'), ((845, 904), 'tweepy.OAuthHandler', 'OAuthHandler', (['configs.consumer_key', 'configs.consumer_secret']... |
"""
Stability analysis of the
D2Q4 solver for the advection equation
d_t(u) + c_x d_x(u) + c_y d_y(u) = 0
"""
import sympy as sp
import pylbm
# pylint: disable=invalid-name
# symbolic variables
U, X, Y = sp.symbols('U, X, Y')
# symbolic parameters
LA, CX, CY = sp.symbols('lambda, cx, cy', constants=True)
S_... | [
"sympy.symbols",
"pylbm.Stability",
"pylbm.Scheme"
] | [((215, 236), 'sympy.symbols', 'sp.symbols', (['"""U, X, Y"""'], {}), "('U, X, Y')\n", (225, 236), True, 'import sympy as sp\n'), ((273, 317), 'sympy.symbols', 'sp.symbols', (['"""lambda, cx, cy"""'], {'constants': '(True)'}), "('lambda, cx, cy', constants=True)\n", (283, 317), True, 'import sympy as sp\n'), ((329, 365... |
from numpy import reshape
def vec(x):
return reshape(x, (-1,) + x.shape[2:], order="F")
def unvec(x, shape):
return reshape(x, shape, order="F")
| [
"numpy.reshape"
] | [((51, 93), 'numpy.reshape', 'reshape', (['x', '((-1,) + x.shape[2:])'], {'order': '"""F"""'}), "(x, (-1,) + x.shape[2:], order='F')\n", (58, 93), False, 'from numpy import reshape\n'), ((128, 156), 'numpy.reshape', 'reshape', (['x', 'shape'], {'order': '"""F"""'}), "(x, shape, order='F')\n", (135, 156), False, 'from n... |
# -*- coding: utf-8 -*-
# *******************************************************
# Copyright (c) VMware, Inc. 2020-2021. All Rights Reserved.
# SPDX-License-Identifier: MIT
# *******************************************************
# *
# * DISCLAIMER. THIS PROGRAM IS PROVIDED TO YOU "AS IS" WITHOUT
# * WARRANTIES OR C... | [
"cbc_binary_toolkit.schemas.EngineResponseSchema.validate",
"pytest.mark.parametrize",
"pytest.raises",
"cbc_binary_toolkit.engine.LocalEngineManager",
"pytest.fixture",
"cbc_binary_toolkit.config.Config.load"
] | [((1051, 1082), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (1065, 1082), False, 'import pytest\n'), ((1884, 1954), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""input"""', '[MISSING_FIELDS_BINARY_METADATA, {}]'], {}), "('input', [MISSING_FIELDS_BINARY_META... |
from flask import Flask, render_template, request
app = Flask(__name__)
@app.route("/")
def hello():
return render_template("index.html", name="WORLD!")
@app.route("/about")
def about():
return render_template("about.html")
| [
"flask.render_template",
"flask.Flask"
] | [((57, 72), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (62, 72), False, 'from flask import Flask, render_template, request\n'), ((112, 156), 'flask.render_template', 'render_template', (['"""index.html"""'], {'name': '"""WORLD!"""'}), "('index.html', name='WORLD!')\n", (127, 156), False, 'from flask im... |
import os
import cv2
import albumentations as A
from albumentations.pytorch import ToTensorV2
from torch.utils.data import Dataset, DataLoader
from sklearn.model_selection import train_test_split
__all__ = ['CatDogDataset', 'fetch_dataloader']
class CatDogDataset(Dataset):
def __init__(self, file_paths, ... | [
"albumentations.pytorch.ToTensorV2",
"os.listdir",
"sklearn.model_selection.train_test_split",
"os.path.join",
"albumentations.RandomCrop",
"albumentations.Normalize",
"cv2.cvtColor",
"albumentations.CenterCrop",
"albumentations.HorizontalFlip",
"cv2.imread",
"albumentations.SmallestMaxSize"
] | [((1004, 1035), 'os.path.join', 'os.path.join', (['data_dir', '"""train"""'], {}), "(data_dir, 'train')\n", (1016, 1035), False, 'import os\n'), ((1391, 1483), 'sklearn.model_selection.train_test_split', 'train_test_split', (['train_file_paths', 'train_labels'], {'stratify': 'train_labels', 'random_state': '(42)'}), '(... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 17 16:12:56 2020
@author: dylanroyston
"""
# import/configure packages
import numpy as np
import pandas as pd
#import pyarrow as pa
import librosa
import librosa.display
from pathlib import Path
#import Ipython.display as ipd
#import matplotlib.pyp... | [
"pandas.Series",
"librosa.feature.melspectrogram",
"boto3.client",
"audioread.audio_open",
"os.environ.get",
"os.path.abspath",
"pyspark.SparkConf",
"librosa.power_to_db",
"boto3.resource",
"tinytag.TinyTag.get",
"pandas.concat",
"time.time",
"pandas.DataFrame",
"pyspark.SparkContext",
"... | [((833, 854), 'pyspark.SparkContext', 'SparkContext', (['"""local"""'], {}), "('local')\n", (845, 854), False, 'from pyspark import SparkConf, SparkContext, SQLContext\n'), ((1048, 1071), 'pyspark.SparkContext', 'SparkContext', ([], {'conf': 'conf'}), '(conf=conf)\n', (1060, 1071), False, 'from pyspark import SparkConf... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
"""
Скрипт выводит список ip государственных организаций.
"""
import ipaddress
import sys
import requests
rs = requests.get('https://jarib.github.io/anon-history/RuGovEdits/ru/latest/ranges.json')
# Проверка удачного запроса и полученных д... | [
"ipaddress.ip_network",
"requests.get",
"sys.exit"
] | [((191, 281), 'requests.get', 'requests.get', (['"""https://jarib.github.io/anon-history/RuGovEdits/ru/latest/ranges.json"""'], {}), "(\n 'https://jarib.github.io/anon-history/RuGovEdits/ru/latest/ranges.json')\n", (203, 281), False, 'import requests\n'), ((461, 471), 'sys.exit', 'sys.exit', ([], {}), '()\n', (469, ... |
# Copyright (c) 2015-2020, Swiss Federal Institute of Technology (ETH Zurich)
# 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 retain the above copyright... | [
"itertools.chain",
"signal.signal",
"inspect.isabstract",
"subprocess.list2cmdline",
"re.compile",
"datetime.datetime.now",
"random.choices",
"signal.alarm"
] | [((24516, 24534), 'subprocess.list2cmdline', '_list2cmdline', (['seq'], {}), '(seq)\n', (24529, 24534), True, 'from subprocess import list2cmdline as _list2cmdline\n'), ((29757, 29802), 'signal.signal', 'signal.signal', (['signal.SIGALRM', 'signal_handler'], {}), '(signal.SIGALRM, signal_handler)\n', (29770, 29802), Fa... |
from django.contrib.auth import get_user_model
from rest_auth.registration.serializers import (
RegisterSerializer as BaseRegisterSerializer,
)
from rest_auth.registration.serializers import (
SocialLoginSerializer as BaseSocialLoginSerializer,
)
from rest_auth.serializers import LoginSerializer as BaseLoginSer... | [
"django.contrib.auth.get_user_model",
"rest_framework.serializers.EmailField",
"rest_framework.serializers.CharField"
] | [((3424, 3440), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (3438, 3440), False, 'from django.contrib.auth import get_user_model\n'), ((2399, 2436), 'rest_framework.serializers.EmailField', 'serializers.EmailField', ([], {'required': '(True)'}), '(required=True)\n', (2421, 2436), False, 'f... |
import os
import shutil
import sys
import tarfile
def include_package(envoy_api_protos, rst_file_path, prefix):
# `envoy_api_rst_files` is a list of file paths for .proto.rst files
# generated by protodoc
#
# we are only interested in the proto files generated for envoy protos,
# not for non-envoy... | [
"os.path.dirname",
"tarfile.open",
"os.path.join",
"shutil.copy"
] | [((1634, 1675), 'os.path.join', 'os.path.join', (['"""rst-out/api-v3"""', 'canonical'], {}), "('rst-out/api-v3', canonical)\n", (1646, 1675), False, 'import os\n'), ((1789, 1823), 'shutil.copy', 'shutil.copy', (['rst_file_path', 'target'], {}), '(rst_file_path, target)\n', (1800, 1823), False, 'import shutil\n'), ((192... |
import os
from collections import OrderedDict, defaultdict
from conans.model.ref import PackageReference
from conans.util.files import save
class RowResult(object):
def __init__(self, remote, reference, data):
self.remote = remote
self.reference = reference
self._data = data
@propert... | [
"conans.model.ref.PackageReference.loads",
"collections.OrderedDict",
"os.path.dirname",
"collections.defaultdict",
"conans.util.files.save"
] | [((5024, 5058), 'os.path.dirname', 'os.path.dirname', (['template.filename'], {}), '(template.filename)\n', (5039, 5058), False, 'import os\n'), ((5161, 5190), 'conans.util.files.save', 'save', (['table_filename', 'content'], {}), '(table_filename, content)\n', (5165, 5190), False, 'from conans.util.files import save\n... |
from typing import Dict
import numpy as np
import tensorflow as tf
import verres as V
class ConstantSchedule(tf.keras.optimizers.schedules.LearningRateSchedule):
def __init__(self, learning_rate: float):
super().__init__()
self.learning_rate = float(learning_rate)
def __call__(self, step):... | [
"numpy.linspace",
"numpy.empty"
] | [((1143, 1205), 'numpy.empty', 'np.empty', (['(self.cycle_length * steps_per_epoch)'], {'dtype': '"""float32"""'}), "(self.cycle_length * steps_per_epoch, dtype='float32')\n", (1151, 1205), True, 'import numpy as np\n'), ((1725, 1801), 'numpy.linspace', 'np.linspace', (['current_lr', 'next_lr'], {'num': 'steps', 'endpo... |
import json
import string
from datetime import datetime
import deap
import numpy as np
import hmm
from discriminator import Discriminator
from ea import EA
import random_search
DEFAULT_PARAMS = {
# Discriminator CNN model
"model": "CNNModel3",
# Algorithm Parameters
"states": 5,
"symbols": 5,
... | [
"discriminator.Discriminator",
"random_search.run",
"hmm.total_l2_diff",
"numpy.array",
"datetime.datetime.now",
"deap.tools.selBest",
"hmm.random_hmm",
"json.dump"
] | [((1444, 1467), 'hmm.random_hmm', 'hmm.random_hmm', (['x', 'y', 's'], {}), '(x, y, s)\n', (1458, 1467), False, 'import hmm\n'), ((1567, 1590), 'hmm.random_hmm', 'hmm.random_hmm', (['x', 'y', 's'], {}), '(x, y, s)\n', (1581, 1590), False, 'import hmm\n'), ((1600, 1746), 'discriminator.Discriminator', 'Discriminator', ([... |
#!/usr/bin/env python3
'''
This code traverses a directories of evaluation log files and
record evaluation scores as well as plotting the results.
'''
import os
import argparse
import json
import copy
from shutil import copyfile
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from utils import... | [
"matplotlib.pyplot.savefig",
"pandas.read_csv",
"os.path.join",
"seaborn.scatterplot",
"pandas.DataFrame"
] | [((659, 753), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': "['state_machine_id', 'state_machine_name', 'timesteps', 'rot_error']"}), "(columns=['state_machine_id', 'state_machine_name', 'timesteps',\n 'rot_error'])\n", (671, 753), True, 'import pandas as pd\n'), ((2020, 2047), 'pandas.read_csv', 'pd.read_csv... |
from os import path
from typing import Union
from datetime import datetime
from flask import Flask, request, redirect, render_template
from flask_wtf import CSRFProtect
from werkzeug.utils import secure_filename
from data import db_session
from data.posts import Posts
from forms.edit_post_form import EditPostForm
... | [
"flask.render_template",
"flask.Flask",
"forms.edit_post_form.EditPostForm",
"data.posts.Posts",
"os.path.join",
"flask.redirect",
"data.db_session.create_session",
"datetime.datetime.now",
"data.posts.Posts.id.desc",
"werkzeug.utils.secure_filename",
"flask_wtf.CSRFProtect",
"data.db_session.... | [((327, 342), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (332, 342), False, 'from flask import Flask, request, redirect, render_template\n'), ((399, 415), 'flask_wtf.CSRFProtect', 'CSRFProtect', (['app'], {}), '(app)\n', (410, 415), False, 'from flask_wtf import CSRFProtect\n'), ((653, 680), 'data.db_s... |
# ----------------------------------------------------------------------------
# Copyright 2014 Nervana Systems Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.o... | [
"logging.getLogger",
"nervanagpu.NervanaGPU",
"numpy.random.normal",
"pycuda.driver.pagelocked_empty",
"pycuda.driver.Stream",
"pycuda.driver.Device",
"pycuda.driver.memcpy_htod_async",
"pycuda.driver.init",
"neon.diagnostics.timing_decorators.FlopsDecorator",
"numpy.random.seed",
"numpy.random.... | [((1219, 1246), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1236, 1246), False, 'import logging\n'), ((1654, 1664), 'pycuda.driver.init', 'drv.init', ([], {}), '()\n', (1662, 1664), True, 'import pycuda.driver as drv\n'), ((1765, 1789), 'atexit.register', 'atexit.register', (['ctx.pop... |
# -*- encoding: utf-8 -*-
import os
import pickle
import sys
import time
import glob
import unittest
import unittest.mock
import numpy as np
import pandas as pd
import sklearn.datasets
from smac.scenario.scenario import Scenario
from smac.facade.roar_facade import ROAR
from autosklearn.util.backend import Backend
fro... | [
"numpy.array",
"autosklearn.util.logging_.get_logger",
"unittest.main",
"unittest.mock.patch",
"autosklearn.pipeline.util.get_dataset",
"os.path.split",
"smac.facade.roar_facade.ROAR",
"os.unlink",
"pandas.DataFrame",
"autosklearn.data.xy_data_manager.XYDataManager",
"numpy.allclose",
"unittes... | [((774, 799), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (789, 799), False, 'import os\n'), ((14263, 14335), 'unittest.mock.patch', 'unittest.mock.patch', (['"""autosklearn.evaluation.ExecuteTaFuncWithQueue.run"""'], {}), "('autosklearn.evaluation.ExecuteTaFuncWithQueue.run')\n", (14282, ... |
"""
This implements an abstrace base class Ring .
Rationale:
Goal is to separate the datatype specification from the algorithms and containers for the following reasons:
1) It allows to directly use the algorithms *without* overhead. E.g. calling mul(z.data, x.data, y.data)
has much le... | [
"numpy.isscalar"
] | [((2205, 2222), 'numpy.isscalar', 'numpy.isscalar', (['x'], {}), '(x)\n', (2219, 2222), False, 'import numpy\n')] |
####################################
# author: <NAME>
# course: 2020 Complete Python Bootcamps: From Zero to Hero in Python
# purpose: lecture notes
# description: Section 15 - Web Scraping
# other: N/A
####################################
# RULES
# 1. always try to get permission before scraping, otherwise I might be... | [
"bs4.BeautifulSoup",
"requests.get"
] | [((608, 642), 'requests.get', 'requests.get', (['"""http://example.com"""'], {}), "('http://example.com')\n", (620, 642), False, 'import requests\n'), ((743, 781), 'bs4.BeautifulSoup', 'bs4.BeautifulSoup', (['result.text', '"""lxml"""'], {}), "(result.text, 'lxml')\n", (760, 781), False, 'import bs4\n'), ((1520, 1576),... |
#!/usr/bin/env python3
import sys
import os
import re
import json
import traceback
import pkg_resources
import tarfile
from collections import OrderedDict
import anchore_engine.analyzers.utils, anchore_engine.utils
def get_python_evidence(tfl, member, memberhash, evidence):
global binary_package_el
full... | [
"os.path.exists",
"collections.OrderedDict",
"json.dumps",
"os.path.join",
"re.match",
"os.path.dirname",
"os.path.basename",
"sys.exit",
"traceback.print_exc"
] | [((5244, 5283), 'os.path.join', 'os.path.join', (['unpackdir', '"""squashed.tar"""'], {}), "(unpackdir, 'squashed.tar')\n", (5256, 5283), False, 'import os\n'), ((10208, 10219), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (10216, 10219), False, 'import sys\n'), ((372, 398), 'os.path.basename', 'os.path.basename', (... |