code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
#!/usr/bin/python3
import pygame
import random
import time
##VARIABLES TO CHANGE
width = 500
height = 500
stats_height = 150
board_size = 5
window_name = "PyLoopover "+str(board_size)+"x"+str(board_size)
scramble_turns = 50
t_round = 3
FPS = 30
##DONT CHANGE THESE BOIS
WHITE = (255,255,255)
BLACK = (0,0,0)
GREEN = (3... | [
"pygame.init",
"pygame.event.set_allowed",
"pygame.display.set_mode",
"time.monotonic",
"pygame.event.wait",
"pygame.draw.rect",
"pygame.display.set_caption",
"pygame.display.update",
"pygame.mixer.quit",
"random.randint"
] | [((3090, 3103), 'pygame.init', 'pygame.init', ([], {}), '()\n', (3101, 3103), False, 'import pygame\n'), ((3105, 3124), 'pygame.mixer.quit', 'pygame.mixer.quit', ([], {}), '()\n', (3122, 3124), False, 'import pygame\n'), ((3172, 3211), 'pygame.display.set_caption', 'pygame.display.set_caption', (['window_name'], {}), '... |
# -*- coding: utf-8 -*-
import numpy as np, pandas as pd, arviz as az, prince, matplotlib.pyplot as plt, seaborn as sns
from cmdstanpy import CmdStanModel
#%% load data
data = pd.read_csv("data/overfitting.csv", index_col = 'case_id')
data.columns
data.info()
feature_names = data.columns.str.startswith("... | [
"arviz.summary",
"pandas.read_csv",
"matplotlib.pyplot.plot",
"arviz.from_cmdstanpy",
"arviz.plot_forest",
"prince.PCA",
"arviz.plot_trace",
"cmdstanpy.CmdStanModel"
] | [((186, 242), 'pandas.read_csv', 'pd.read_csv', (['"""data/overfitting.csv"""'], {'index_col': '"""case_id"""'}), "('data/overfitting.csv', index_col='case_id')\n", (197, 242), True, 'import numpy as np, pandas as pd, arviz as az, prince, matplotlib.pyplot as plt, seaborn as sns\n'), ((2185, 2218), 'cmdstanpy.CmdStanMo... |
# -*- coding: utf-8 -*-
import json
import threading
import os
import time
import mats
import sys
import requests
import traceback
import re
from util import debug, error
class MatsLoader(threading.Thread):
"""
Fire and forget loader for materials - will queue a 'mats' event or
an 'error' event if the lo... | [
"threading.Thread.__init__",
"os.path.exists",
"traceback.format_exc",
"re.compile",
"requests.get",
"sys.exc_info",
"mats.Materials",
"util.error",
"json.load",
"os.path.getmtime",
"time.time",
"json.dump"
] | [((539, 570), 'threading.Thread.__init__', 'threading.Thread.__init__', (['self'], {}), '(self)\n', (564, 570), False, 'import threading\n'), ((1347, 1378), 'threading.Thread.__init__', 'threading.Thread.__init__', (['self'], {}), '(self)\n', (1372, 1378), False, 'import threading\n'), ((1491, 1513), 're.compile', 're.... |
# -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
import os
from scrapy import Request
from scrapy.pipelines.images import ImagesPipeline
from luoxia import settings
class L... | [
"os.path.exists",
"scrapy.Request",
"os.path.join",
"os.makedirs"
] | [((1359, 1418), 'os.path.join', 'os.path.join', (['settings.IMAGES_STORE', "(title + '/' + bookname)"], {}), "(settings.IMAGES_STORE, title + '/' + bookname)\n", (1371, 1418), False, 'import os\n'), ((581, 601), 'os.path.exists', 'os.path.exists', (['path'], {}), '(path)\n', (595, 601), False, 'import os\n'), ((615, 63... |
#! /usr/bin/env python3
# Copyright 2020 Tier IV, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | [
"rclpy.spin",
"case_converter.pascal2snake",
"argparse.ArgumentParser",
"self_pose_listener.SelfPoseListener",
"geometry_msgs.msg.PoseStamped",
"rtree.index.Index",
"math.hypot",
"numpy.argmin",
"rclpy.init",
"rclpy.shutdown"
] | [((5663, 5675), 'rclpy.init', 'rclpy.init', ([], {}), '()\n', (5673, 5675), False, 'import rclpy\n'), ((5690, 5715), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (5713, 5715), False, 'import argparse\n'), ((5854, 5887), 'rclpy.spin', 'rclpy.spin', (['stop_reason2pose_node'], {}), '(stop_reaso... |
import asyncio
import unittest
from .helpers import async_test
class AsyncTestCase(unittest.TestCase):
''' AsyncTestCase allows to test asynchoronus function.
The usage is the same as :code:`unittest.TestCase`. It works with other test frameworks
and runners (eg. `pytest`, `nose`) as well.
AsyncTes... | [
"asyncio.iscoroutinefunction"
] | [((2441, 2474), 'asyncio.iscoroutinefunction', 'asyncio.iscoroutinefunction', (['attr'], {}), '(attr)\n', (2468, 2474), False, 'import asyncio\n')] |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | [
"azure.mgmt.maps.models.MapsAccountCreateParameters",
"knack.log.get_logger",
"knack.prompting.prompt_y_n",
"azure.mgmt.maps.models.Sku",
"knack.util.CLIError"
] | [((569, 589), 'knack.log.get_logger', 'get_logger', (['__name__'], {}), '(__name__)\n', (579, 589), False, 'from knack.log import get_logger\n'), ((1370, 1388), 'azure.mgmt.maps.models.Sku', 'Sku', ([], {'name': 'sku_name'}), '(name=sku_name)\n', (1373, 1388), False, 'from azure.mgmt.maps.models import MapsAccountCreat... |
import sys
import os
from tempfile import TemporaryDirectory
import numpy as np
import tensorflow.compat.v1 as tf
tf.get_logger().setLevel('ERROR') # only show error messages
from recommenders.utils.timer import Timer
from recommenders.utils.constants import SEED
from recommenders.models.deeprec.deeprec_utils import ... | [
"recommenders.models.deeprec.models.sequential.sli_rec.SLI_RECModel",
"os.path.join",
"tensorflow.compat.v1.get_logger",
"os.path.abspath",
"recommenders.datasets.amazon_reviews._create_vocab",
"recommenders.utils.timer.Timer"
] | [((1717, 1763), 'os.path.join', 'os.path.join', (['data_path', '"""train_instances.txt"""'], {}), "(data_path, 'train_instances.txt')\n", (1729, 1763), False, 'import os\n'), ((1778, 1824), 'os.path.join', 'os.path.join', (['data_path', '"""valid_instances.txt"""'], {}), "(data_path, 'valid_instances.txt')\n", (1790, 1... |
#!/usr/bin/env python2
from __future__ import print_function
import atexit
import logging
import sys
import ssg_test_suite.oscap
import ssg_test_suite.virt
from ssg_test_suite.rule import get_viable_profiles
from ssg_test_suite.virt import SnapshotStack
logging.getLogger(__name__).addHandler(logging.NullHandler())
... | [
"logging.NullHandler",
"ssg_test_suite.rule.get_viable_profiles",
"logging.getLogger",
"ssg_test_suite.virt.SnapshotStack",
"sys.exit",
"logging.error",
"atexit.register"
] | [((296, 317), 'logging.NullHandler', 'logging.NullHandler', ([], {}), '()\n', (315, 317), False, 'import logging\n'), ((826, 844), 'ssg_test_suite.virt.SnapshotStack', 'SnapshotStack', (['dom'], {}), '(dom)\n', (839, 844), False, 'from ssg_test_suite.virt import SnapshotStack\n'), ((849, 886), 'atexit.register', 'atexi... |
import mtrain
import numpy as np
import pandas as pd
import random
def simulate_games(num_players=4, domino_size=12, num_games=250, collect_data=True,
debug=False, players=["Random", "Greedy", "Probability", "Neural"],
file_name="PlayData/data4_12_250"):
"""
Runs the m... | [
"numpy.mean",
"random.choice",
"numpy.ndarray",
"pandas.concat",
"pandas.DataFrame",
"pandas.ExcelWriter",
"mtrain.mexicantrain"
] | [((1844, 1880), 'numpy.ndarray', 'np.ndarray', (['(num_players, num_games)'], {}), '((num_players, num_games))\n', (1854, 1880), True, 'import numpy as np\n'), ((1892, 1928), 'numpy.ndarray', 'np.ndarray', (['(num_players, num_games)'], {}), '((num_players, num_games))\n', (1902, 1928), True, 'import numpy as np\n'), (... |
##############################################################################
#
# Below code is inspired on
# https://github.com/facebookresearch/detectron2/blob/master/detectron2/data/datasets/pascal_voc.py
# --------------------------------------------------------
# Detectron2
# Licensed under the Apache 2.0 license... | [
"random.sample",
"xml.etree.ElementTree.parse",
"argparse.ArgumentParser",
"os.path.join",
"cv2.waitKey",
"cv2.destroyAllWindows",
"detectron2.data.MetadataCatalog.get",
"numpy.loadtxt",
"cv2.imread",
"detectron2.data.DatasetCatalog.get"
] | [((2443, 2468), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2466, 2468), False, 'import argparse\n'), ((2808, 2840), 'detectron2.data.DatasetCatalog.get', 'DatasetCatalog.get', (['dataset_name'], {}), '(dataset_name)\n', (2826, 2840), False, 'from detectron2.data import DatasetCatalog, Meta... |
import glob
import time
import random
filelist = glob.glob('/mnt/lustre/chenyuntao1/datasets/imagenet/train/*/*')
random.shuffle(filelist)
begin = time.time()
for i, f in enumerate(filelist):
if i == 10000:
break
with open(f, "rb") as fin:
result = fin.read()
end = time.time()
print("%.1f im... | [
"time.time",
"random.shuffle",
"glob.glob"
] | [((51, 115), 'glob.glob', 'glob.glob', (['"""/mnt/lustre/chenyuntao1/datasets/imagenet/train/*/*"""'], {}), "('/mnt/lustre/chenyuntao1/datasets/imagenet/train/*/*')\n", (60, 115), False, 'import glob\n'), ((116, 140), 'random.shuffle', 'random.shuffle', (['filelist'], {}), '(filelist)\n', (130, 140), False, 'import ran... |
# Copyright (C) 2015-2019 <NAME>
# SPDX-License-Identifier: Apache-2.0
import dolfin
from . import register_boundary_condition, BoundaryConditionCreator
from ocellaris.utils import (
CodedExpression,
OcellarisCppExpression,
OcellarisError,
verify_field_variable_definition,
)
class OcellarisDirichletB... | [
"dolfin.dot",
"ocellaris.utils.OcellarisCppExpression",
"dolfin.assemble",
"ocellaris.utils.verify_field_variable_definition",
"dolfin.Constant",
"ocellaris.utils.OcellarisError",
"dolfin.FacetNormal",
"ocellaris.utils.CodedExpression"
] | [((3418, 3440), 'dolfin.Constant', 'dolfin.Constant', (['value'], {}), '(value)\n', (3433, 3440), False, 'import dolfin\n'), ((7398, 7488), 'ocellaris.utils.OcellarisCppExpression', 'OcellarisCppExpression', (['self.simulation', 'cpp_code', 'description', 'P'], {'return_updater': '(True)'}), '(self.simulation, cpp_code... |
import unittest
from count_split_inversions import count_inversions
class TestCountSplitInversions(unittest.TestCase):
def test_count_inversions(self):
input = [1, 3, 5, 2, 4, 6]
result = count_inversions(input)
self.assertEqual(result, 3)
if __name__ == '__main__':
unittest.main()
| [
"unittest.main",
"count_split_inversions.count_inversions"
] | [((303, 318), 'unittest.main', 'unittest.main', ([], {}), '()\n', (316, 318), False, 'import unittest\n'), ((211, 234), 'count_split_inversions.count_inversions', 'count_inversions', (['input'], {}), '(input)\n', (227, 234), False, 'from count_split_inversions import count_inversions\n')] |
import time
import krpc
conn = krpc.connect(name='Sub-orbital flight')
vessel = conn.space_center.active_vessel
vessel.auto_pilot.target_pitch_and_heading(90, 90)
vessel.auto_pilot.engage()
vessel.control.throttle = 1
time.sleep(1)
print('Launch!')
vessel.control.activate_next_stage()
fuel_amount = conn.get_call(ve... | [
"krpc.connect",
"time.sleep"
] | [((31, 70), 'krpc.connect', 'krpc.connect', ([], {'name': '"""Sub-orbital flight"""'}), "(name='Sub-orbital flight')\n", (43, 70), False, 'import krpc\n'), ((220, 233), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (230, 233), False, 'import time\n'), ((1337, 1350), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)... |
from distutils.version import LooseVersion
from itertools import product
import numpy as np
import pandas as pd
from ..model.event import Event
from ..model.event import EventTeam
from ..model.submission import Submission
from ..model.team import Team
from .team import get_event_team_by_name
from .submission import... | [
"pandas.merge",
"itertools.product",
"pandas.set_option",
"pandas.DataFrame",
"distutils.version.LooseVersion",
"pandas.Timestamp",
"pandas.concat"
] | [((532, 576), 'pandas.set_option', 'pd.set_option', (['"""display.max_colwidth"""', 'width'], {}), "('display.max_colwidth', width)\n", (545, 576), True, 'import pandas as pd\n'), ((4369, 4431), 'pandas.concat', 'pd.concat', (['record_score'], {'axis': '(0)', 'ignore_index': '(True)', 'sort': '(False)'}), '(record_scor... |
#Automate the Boring Stuff with Python
import time, sys
indent = 0 # How many spaces to indent
indent_Increasing = True # Whether the indentation is increasing or not
try:
while True: # The main program loop
print(' ' * indent, end='')
print('********')
time.sleep(0.1) # Pause for 1/10th o... | [
"time.sleep",
"sys.exit"
] | [((284, 299), 'time.sleep', 'time.sleep', (['(0.1)'], {}), '(0.1)\n', (294, 299), False, 'import time, sys\n'), ((613, 623), 'sys.exit', 'sys.exit', ([], {}), '()\n', (621, 623), False, 'import time, sys\n')] |
from django.conf import settings
from django.conf.urls import url, static
from . import views
from . import jobs
urlpatterns = [
url(r'^choose_company/(?P<company_id>.*)/$', views.choose_company, name='choose_company'),
url(r'^cleanlogs/$', jobs.cleanlogs, name='cleanlogs'),
url(r'^primecache/$', job... | [
"django.conf.urls.url"
] | [((136, 229), 'django.conf.urls.url', 'url', (['"""^choose_company/(?P<company_id>.*)/$"""', 'views.choose_company'], {'name': '"""choose_company"""'}), "('^choose_company/(?P<company_id>.*)/$', views.choose_company, name=\n 'choose_company')\n", (139, 229), False, 'from django.conf.urls import url, static\n'), ((23... |
import pytest
from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell
from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion
def test_raise_on_different_metadata():
ref = new_notebook(metadata={'kernelspec': {'lan... | [
"jupytext.compare.test_round_trip_conversion",
"nbformat.v4.nbbase.new_code_cell",
"pytest.mark.parametrize",
"nbformat.v4.nbbase.new_markdown_cell",
"pytest.raises",
"nbformat.v4.nbbase.new_raw_cell",
"jupytext.compare.compare_notebooks"
] | [((701, 768), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""raise_on_first_difference"""', '[True, False]'], {}), "('raise_on_first_difference', [True, False])\n", (724, 768), False, 'import pytest\n'), ((1156, 1223), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""raise_on_first_difference"""... |
import asyncio
import discord
import random
import datetime
from discord.ext import commands
from Cogs import DisplayName
from Cogs import Nullify
def setup(bot):
# Add the bot
bot.add_cog(Actions(bot))
class Actions(commands.Cog):
## class that handles storing and computing action messages
class actionable... | [
"random.choice",
"Cogs.DisplayName.name",
"Cogs.Nullify.clean",
"Cogs.DisplayName.memberForName",
"datetime.date.today",
"discord.ext.commands.command"
] | [((12454, 12489), 'discord.ext.commands.command', 'commands.command', ([], {'pass_context': '(True)'}), '(pass_context=True)\n', (12470, 12489), False, 'from discord.ext import commands\n'), ((12743, 12778), 'discord.ext.commands.command', 'commands.command', ([], {'pass_context': '(True)'}), '(pass_context=True)\n', (... |
from JumpScale import j
class builder():
# @property
# def buildDir(self):
# return j.sal.fs.joinPaths(j.dirs.tmpDir, "jsbuilder")
@property
def cuisine(self):
return j.tools.cuisine.local
# ALL NOT NEEDED ANY LONGER USE bower
# def angular(self):
# version = "1.5... | [
"JumpScale.j.sal.nettools.checkUrlReachable",
"JumpScale.j.tools.cuisine.local.apps.ipfs.start",
"JumpScale.j.tools.cuisine.local.apps.ipfs.install"
] | [((4246, 4287), 'JumpScale.j.tools.cuisine.local.apps.ipfs.install', 'j.tools.cuisine.local.apps.ipfs.install', ([], {}), '()\n', (4285, 4287), False, 'from JumpScale import j\n'), ((4296, 4335), 'JumpScale.j.tools.cuisine.local.apps.ipfs.start', 'j.tools.cuisine.local.apps.ipfs.start', ([], {}), '()\n', (4333, 4335), ... |
"""
kissim.cli.encode
Encode structures (generate fingerprints) from CLI arguments.
"""
import numpy as np
from kissim.api import encode
from kissim.cli.utils import configure_logger
def encode_from_cli(args):
"""
Encode structures.
Parameters
----------
args : argsparse.Namespace
CLI ... | [
"kissim.cli.utils.configure_logger",
"kissim.api.encode",
"numpy.genfromtxt"
] | [((344, 373), 'kissim.cli.utils.configure_logger', 'configure_logger', (['args.output'], {}), '(args.output)\n', (360, 373), False, 'from kissim.cli.utils import configure_logger\n'), ((443, 508), 'kissim.api.encode', 'encode', (['structure_klifs_ids', 'args.output', 'args.local', 'args.ncores'], {}), '(structure_klifs... |
import numpy as np
from util import *
def naiveDistanceProfile(tsA, idx, m, tsB = None):
"""Return the distance profile of query against ts. Use the naive all pairs comparison algorithm.
>>> np.round(naiveDistanceProfile(np.array([0.0, 1.0, -1.0, 0.0]), 0, 4, np.array([-1, 1, 0, 0, -1, 1])), 3)
array([[ 2... | [
"numpy.full",
"doctest.testmod"
] | [((1672, 1689), 'doctest.testmod', 'doctest.testmod', ([], {}), '()\n', (1687, 1689), False, 'import doctest\n'), ((887, 923), 'numpy.full', 'np.full', (['(n - m + 1)', 'idx'], {'dtype': 'float'}), '(n - m + 1, idx, dtype=float)\n', (894, 923), True, 'import numpy as np\n'), ((1581, 1617), 'numpy.full', 'np.full', (['(... |
# encoding: UTF-8
from builtins import str
import psutil
# import sys
# PyQt 4/5 compatibility
try:
from PyQt4.QtGui import QMainWindow, QDialog, QDockWidget, QAction, QHeaderView, QMessageBox, QLabel, QVBoxLayout
from PyQt4 import QtCore
except ImportError:
from PyQt5.QtWidgets import QMainWindow, QDial... | [
"psutil.cpu_percent",
"psutil.virtual_memory",
"PyQt5.QtWidgets.QAction",
"PyQt5.QtWidgets.QMessageBox.question",
"PyQt5.QtWidgets.QLabel",
"PyQt5.QtWidgets.QVBoxLayout",
"PyQt5.QtWidgets.QDockWidget"
] | [((3360, 3385), 'PyQt5.QtWidgets.QAction', 'QAction', (['u"""连接和切换策略"""', 'self'], {}), "(u'连接和切换策略', self)\n", (3367, 3385), False, 'from PyQt5.QtWidgets import QMainWindow, QDialog, QDockWidget, QAction, QHeaderView, QMessageBox, QLabel, QVBoxLayout\n'), ((3484, 3504), 'PyQt5.QtWidgets.QAction', 'QAction', (['u"""退出"... |
from importlib import import_module
from django.conf import settings
from django.core.signals import setting_changed
SOCIALACCOUNT_MODEL = getattr(settings, "REST_AUTH_SOCIALACCOUNT_MODEL", "auth_framework.SocialAccount")
DEFAULTS = {
'UNIQUE_EMAIL': True,
'RESET_PASSWORD_BY': 'pin', # 'url'| 'pin'
'SER... | [
"importlib.import_module",
"django.contrib.auth.get_user_model",
"django.core.exceptions.ImproperlyConfigured",
"django.core.signals.setting_changed.connect"
] | [((4090, 4134), 'django.core.signals.setting_changed.connect', 'setting_changed.connect', (['reload_app_settings'], {}), '(reload_app_settings)\n', (4113, 4134), False, 'from django.core.signals import setting_changed\n'), ((1541, 1563), 'importlib.import_module', 'import_module', (['package'], {}), '(package)\n', (155... |
from typing import Any, Text, Dict, List, Union
from rasa_sdk import Action, Tracker
from rasa_sdk.executor import CollectingDispatcher
from rasa_sdk.forms import FormAction
from rasa_sdk.events import UserUtteranceReverted, UserUttered, FollowupAction
# from rasa_core.events import (UserUtteranceReverted, UserUttered... | [
"logging.getLogger",
"rasa_sdk.events.FollowupAction",
"rasa_sdk.events.UserUttered",
"actionserver.utils.utilities.timestamp",
"json.load",
"json.dump",
"rasa_sdk.events.SlotSet"
] | [((841, 868), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (858, 868), False, 'import logging\n'), ((952, 964), 'json.load', 'json.load', (['f'], {}), '(f)\n', (961, 964), False, 'import json\n'), ((1303, 1410), 'rasa_sdk.events.UserUttered', 'UserUttered', ([], {'text': '"""/greet"""',... |
import plotly.graph_objs as go
class GraphsHelper:
template = "plotly_dark"
'''
Generate a plot for a timeseries
'''
def generate_timeseries_plot(self, dataframe):
pressure_plots = []
for sensor in ["p1", "p2", "p3"]:
series = dataframe[sensor]
scatter = go.... | [
"plotly.graph_objs.Scatter",
"plotly.graph_objs.Layout"
] | [((317, 394), 'plotly.graph_objs.Scatter', 'go.Scatter', ([], {'x': 'dataframe.index', 'y': 'series', 'name': 'f"""Sensor {sensor}"""', 'opacity': '(0.4)'}), "(x=dataframe.index, y=series, name=f'Sensor {sensor}', opacity=0.4)\n", (327, 394), True, 'import plotly.graph_objs as go\n'), ((639, 701), 'plotly.graph_objs.La... |
"""File generated by TLObjects' generator. All changes will be ERASED"""
from ...tl.tlobject import TLRequest
from typing import Optional, List, Union, TYPE_CHECKING
import os
import struct
if TYPE_CHECKING:
from ...tl.types import TypeInputStickerSet, TypeInputUser, TypeInputStickerSetItem, TypeInputDocument
cl... | [
"struct.pack"
] | [((2175, 2207), 'struct.pack', 'struct.pack', (['"""<i"""', 'self.position'], {}), "('<i', self.position)\n", (2186, 2207), False, 'import struct\n'), ((3760, 3832), 'struct.pack', 'struct.pack', (['"""<I"""', '(0 if self.masks is None or self.masks is False else 1)'], {}), "('<I', 0 if self.masks is None or self.masks... |
# Importar a classe da língua inglesa (English) e criar um objeto nlp
from ____ import ____
nlp = ____
# Processar o texto
doc = ____("I like tree kangaroos and narwhals.")
# Selecionar o primeiro token
first_token = doc[____]
# Imprimir o texto do primeito token
print(first_token.____)
| [
"____.____"
] | [((130, 173), '____.____', '____', (['"""I like tree kangaroos and narwhals."""'], {}), "('I like tree kangaroos and narwhals.')\n", (134, 173), False, 'from ____ import ____\n')] |
from tests.integration.create_token import create_token
from tests.integration.integration_test_case import IntegrationTestCase
class TestHappyPath(IntegrationTestCase):
def test_happy_path_203(self):
self.happy_path('0203', '1')
def test_happy_path_205(self):
self.happy_path('0205', '1')
... | [
"tests.integration.create_token.create_token"
] | [((404, 437), 'tests.integration.create_token.create_token', 'create_token', (['form_type_id', 'eq_id'], {}), '(form_type_id, eq_id)\n', (416, 437), False, 'from tests.integration.create_token import create_token\n')] |
import uuid
from typing import List, Dict, Any
import unittest
from selfhost_client import SelfHostClient, DatasetType
class TestIntegrationDatasetsClient(unittest.TestCase):
"""
Run these tests individually because Self-Host will return HTTP 429 Too Many Requests otherwise.
"""
@classmethod
de... | [
"selfhost_client.SelfHostClient",
"uuid.uuid4"
] | [((384, 477), 'selfhost_client.SelfHostClient', 'SelfHostClient', ([], {'base_url': '"""http://127.0.0.1:8080"""', 'username': '"""test"""', 'password': '"""<PASSWORD>"""'}), "(base_url='http://127.0.0.1:8080', username='test', password=\n '<PASSWORD>')\n", (398, 477), False, 'from selfhost_client import SelfHostCli... |
from setuptools import setup, find_packages
setup(
name="soccergen",
version="0.1",
packages=find_packages(),
# Project uses reStructuredText, so ensure that the docutils get
# installed or upgraded on the target machine
install_requires=["gfootball>=2.8",],
# metadata to display on PyPI
... | [
"setuptools.find_packages"
] | [((106, 121), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (119, 121), False, 'from setuptools import setup, find_packages\n')] |
from itertools import product
from unittest.mock import patch
import pytest
import numpy as np
import pandas as pd
from pandas.util.testing import assert_frame_equal
from sm.engine.annotation.fdr import FDR, run_fdr_ranking
from sm.engine.formula_parser import format_modifiers
FDR_CONFIG = {'decoy_sample_size': 2}
... | [
"pandas.Series",
"numpy.isclose",
"sm.engine.annotation.fdr.FDR",
"sm.engine.formula_parser.format_modifiers",
"itertools.product",
"sm.engine.annotation.fdr.run_fdr_ranking",
"pytest.mark.parametrize",
"pandas.DataFrame",
"unittest.mock.patch"
] | [((322, 385), 'unittest.mock.patch', 'patch', (['"""sm.engine.annotation.fdr.DECOY_ADDUCTS"""', "['+He', '+Li']"], {}), "('sm.engine.annotation.fdr.DECOY_ADDUCTS', ['+He', '+Li'])\n", (327, 385), False, 'from unittest.mock import patch\n'), ((1185, 1286), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""anal... |
from logging import getLogger
getLogger('flake8').propagate = False
| [
"logging.getLogger"
] | [((31, 50), 'logging.getLogger', 'getLogger', (['"""flake8"""'], {}), "('flake8')\n", (40, 50), False, 'from logging import getLogger\n')] |
from __future__ import absolute_import
import hashlib
import logging
import os
from django.utils.encoding import smart_str
from common.conf.settings import TEMPORARY_DIRECTORY
from common.utils import fs_cleanup
from .exceptions import OfficeConversionError, UnknownFileFormat
from .literals import (DEFAULT_PAGE_NUM... | [
"logging.getLogger",
"os.path.exists",
"hashlib.sha256",
"common.utils.fs_cleanup",
"os.path.join",
"django.utils.encoding.smart_str"
] | [((659, 686), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (676, 686), False, 'import logging\n'), ((1770, 1801), 'os.path.exists', 'os.path.exists', (['output_filepath'], {}), '(output_filepath)\n', (1784, 1801), False, 'import os\n'), ((1090, 1135), 'os.path.join', 'os.path.join', (['... |
import functools
from collections import OrderedDict
from typing import Any, Callable, Dict, List, Mapping, Sequence, Tuple, Union, cast
import torch
from ignite.engine import Engine, EventEnum, Events
from ignite.handlers.timing import Timer
class BasicTimeProfiler:
"""
BasicTimeProfiler can be used to pro... | [
"collections.OrderedDict",
"torch.as_tensor",
"torch.mean",
"torch.stack",
"torch.max",
"functools.wraps",
"torch.min",
"torch.tensor",
"torch.sum",
"torch.argmin",
"pandas.DataFrame",
"torch.zeros",
"ignite.handlers.timing.Timer",
"torch.std",
"typing.cast",
"torch.arange",
"torch.a... | [((1246, 1253), 'ignite.handlers.timing.Timer', 'Timer', ([], {}), '()\n', (1251, 1253), False, 'from ignite.handlers.timing import Timer\n'), ((1287, 1294), 'ignite.handlers.timing.Timer', 'Timer', ([], {}), '()\n', (1292, 1294), False, 'from ignite.handlers.timing import Timer\n'), ((1332, 1339), 'ignite.handlers.tim... |
from __future__ import (division)
from pomegranate import *
from pomegranate.io import DataGenerator
from pomegranate.io import DataFrameGenerator
from nose.tools import with_setup
from nose.tools import assert_almost_equal
from nose.tools import assert_equal
from nose.tools import assert_not_equal
from nose.tools im... | [
"numpy.testing.assert_array_almost_equal",
"nose.tools.assert_almost_equal",
"nose.tools.with_setup",
"pomegranate.io.DataGenerator",
"pickle.dumps",
"pandas.DataFrame",
"nose.tools.assert_equal"
] | [((3258, 3307), 'nose.tools.with_setup', 'with_setup', (['setup_multivariate_gaussian', 'teardown'], {}), '(setup_multivariate_gaussian, teardown)\n', (3268, 3307), False, 'from nose.tools import with_setup\n'), ((3449, 3495), 'nose.tools.with_setup', 'with_setup', (['setup_multivariate_mixed', 'teardown'], {}), '(setu... |
import base64
import os
import sys
import PyPDF2
svg = '''<svg id="write-document" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<rect id="write-doc-background" width="100%" height="100%" fill="#808080"/>
<defs id="write-defs">
<script type="text/writeconfig">
<int name="docFormatVer... | [
"os.path.dirname",
"os.system",
"PyPDF2.PdfFileReader",
"os.path.basename"
] | [((708, 744), 'PyPDF2.PdfFileReader', 'PyPDF2.PdfFileReader', (['pdf_path', '"""rb"""'], {}), "(pdf_path, 'rb')\n", (728, 744), False, 'import PyPDF2\n'), ((956, 992), 'os.system', 'os.system', (['"""mkdir -p /tmp/pdf2write"""'], {}), "('mkdir -p /tmp/pdf2write')\n", (965, 992), False, 'import os\n'), ((2207, 2241), 'o... |
from typing import Dict, List, cast
from py_headless_daw.project.parameter import Parameter, ParameterValueType, ParameterRangeType
class HavingParameters:
def __init__(self):
self._parameters: Dict[str, Parameter] = {}
super().__init__()
def has_parameter(self, name: str) -> bool:
... | [
"py_headless_daw.project.parameter.Parameter",
"typing.cast"
] | [((706, 753), 'py_headless_daw.project.parameter.Parameter', 'Parameter', (['name', 'value', 'param_type', 'value_range'], {}), '(name, value, param_type, value_range)\n', (715, 753), False, 'from py_headless_daw.project.parameter import Parameter, ParameterValueType, ParameterRangeType\n'), ((1230, 1260), 'typing.cast... |
# -*- coding: utf-8 -*-
#
#
from __future__ import print_function
import csv
import os
import re
import sys
import arrow
from gsheets import Sheets
CURRENT_PATH = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
DEBUG = os.environ.get('DEBUG', "0") == "1"
AS_CSV = os.environ.get('CSV', "0") == "1"
COL... | [
"os.path.exists",
"gsheets.Sheets.from_files",
"re.compile",
"csv.writer",
"os.path.join",
"os.environ.get",
"arrow.now",
"os.getcwd",
"os.path.realpath",
"arrow.get"
] | [((237, 265), 'os.environ.get', 'os.environ.get', (['"""DEBUG"""', '"""0"""'], {}), "('DEBUG', '0')\n", (251, 265), False, 'import os\n'), ((282, 308), 'os.environ.get', 'os.environ.get', (['"""CSV"""', '"""0"""'], {}), "('CSV', '0')\n", (296, 308), False, 'import os\n'), ((1149, 1198), 'os.path.join', 'os.path.join', ... |
# -*- coding: utf-8 -*-
from cms.models import Page, Title, CMSPlugin, Placeholder
from cms.utils import get_language_from_request
from django.http import Http404
from django.shortcuts import get_object_or_404
def revert_plugins(request, version_id, obj):
from reversion.models import Version
version = get_obj... | [
"cms.utils.get_language_from_request",
"django.shortcuts.get_object_or_404",
"cms.models.Title.objects.get",
"cms.models.CMSPlugin.objects.filter"
] | [((313, 354), 'django.shortcuts.get_object_or_404', 'get_object_or_404', (['Version'], {'pk': 'version_id'}), '(Version, pk=version_id)\n', (330, 354), False, 'from django.shortcuts import get_object_or_404\n'), ((583, 617), 'cms.utils.get_language_from_request', 'get_language_from_request', (['request'], {}), '(reques... |
import os, sys, cdms2, vcs, vcs.testing.regression as regression
dataset = cdms2.open(os.path.join(vcs.sample_data,"clt.nc"))
data = dataset("clt")
canvas = regression.init()
isoline = canvas.createisoline()
isoline.label="y"
texts=[]
colors = []
for i in range(10):
text = canvas.createtext()
text.color = 50 +... | [
"os.path.splitext",
"vcs.testing.regression.init",
"os.path.join",
"sys.exit",
"os.path.abspath",
"vcs.testing.regression.run_wo_terminate"
] | [((158, 175), 'vcs.testing.regression.init', 'regression.init', ([], {}), '()\n', (173, 175), True, 'import os, sys, cdms2, vcs, vcs.testing.regression as regression\n'), ((573, 602), 'os.path.splitext', 'os.path.splitext', (['sys.argv[1]'], {}), '(sys.argv[1])\n', (589, 602), False, 'import os, sys, cdms2, vcs, vcs.te... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 5 05:47:03 2018
@author: zg
"""
import numpy as np
#from scipy import io
import scipy.io
#import pickle
from sklearn.model_selection import StratifiedKFold
#import sklearn
from scipy.sparse import spdiags
from scipy.spatial import distance
#impo... | [
"sklearn.model_selection.StratifiedKFold",
"numpy.array",
"numpy.argsort",
"numpy.nanmean",
"copy.deepcopy",
"numpy.where",
"numpy.float64",
"numpy.sort",
"numpy.argmin",
"numpy.eye",
"numpy.argmax",
"numpy.fill_diagonal",
"numpy.finfo",
"sklearn.svm.SVC",
"numpy.copy",
"numpy.unique",... | [((4652, 4676), 'numpy.fill_diagonal', 'np.fill_diagonal', (['sim', '(0)'], {}), '(sim, 0)\n', (4668, 4676), True, 'import numpy as np\n'), ((5076, 5111), 'numpy.logical_or', 'np.logical_or', (['aRankNet', 'aRankNet.T'], {}), '(aRankNet, aRankNet.T)\n', (5089, 5111), True, 'import numpy as np\n'), ((5200, 5233), 'numpy... |
#########################
#########################
# Need to account for limit in input period
#########################
#########################
# Baseline M67 long script -- NO crowding
# New script copied from quest - want to take p and ecc from each population (all, obs, rec) and put them into separate file
# Do... | [
"numpy.log10",
"numpy.sqrt",
"pandas.read_csv",
"numpy.array",
"numpy.arange",
"numpy.histogram",
"astropy.modeling.models.PowerLaw1D",
"os.listdir",
"numpy.diff",
"numpy.concatenate",
"pandas.DataFrame",
"matplotlib.use",
"scipy.integrate.quad",
"astropy.modeling.fitting.LevMarLSQFitter",... | [((710, 731), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (724, 731), False, 'import matplotlib\n'), ((1380, 1431), 'astropy.modeling.models.PowerLaw1D', 'models.PowerLaw1D', ([], {'amplitude': '(0.5)', 'x_0': '(1)', 'alpha': '(-1.0)'}), '(amplitude=0.5, x_0=1, alpha=-1.0)\n', (1397, 1431), Fa... |
from django.urls import path
from rest_framework_simplejwt.views import (
TokenObtainPairView,
TokenRefreshView,
TokenVerifyView
)
urlpatterns = [
path('obtain/', TokenObtainPairView.as_view(), name='token_obtain_pair'),
path('refresh/', TokenRefreshView.as_view(), name='token_refresh'),
path('... | [
"rest_framework_simplejwt.views.TokenVerifyView.as_view",
"rest_framework_simplejwt.views.TokenObtainPairView.as_view",
"rest_framework_simplejwt.views.TokenRefreshView.as_view"
] | [((180, 209), 'rest_framework_simplejwt.views.TokenObtainPairView.as_view', 'TokenObtainPairView.as_view', ([], {}), '()\n', (207, 209), False, 'from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView, TokenVerifyView\n'), ((259, 285), 'rest_framework_simplejwt.views.TokenRefreshView.as_view', ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the knowledge base."""
import unittest
from plaso.containers import artifacts
from plaso.engine import knowledge_base
from tests import test_lib as shared_test_lib
class KnowledgeBaseTest(shared_test_lib.BaseTestCase):
"""Tests for the knowledge base.""... | [
"plaso.engine.knowledge_base.KnowledgeBase",
"plaso.containers.artifacts.HostnameArtifact",
"plaso.containers.artifacts.SystemConfigurationArtifact",
"plaso.containers.artifacts.UserAccountArtifact",
"unittest.main",
"plaso.containers.artifacts.EnvironmentVariableArtifact",
"plaso.containers.artifacts.T... | [((14511, 14526), 'unittest.main', 'unittest.main', ([], {}), '()\n', (14524, 14526), False, 'import unittest\n'), ((2660, 2690), 'plaso.engine.knowledge_base.KnowledgeBase', 'knowledge_base.KnowledgeBase', ([], {}), '()\n', (2688, 2690), False, 'from plaso.engine import knowledge_base\n'), ((2857, 2887), 'plaso.engine... |
import numpy as np
from itertools import product
from typing import List
from src.config import ConfigChess
from src.chess.board import Board
from src.chess.move import Move
def get_all_possible_moves() -> List[Move]:
all_possible_moves = set()
array = np.zeros((ConfigChess.board_size, ConfigChess.board_size... | [
"numpy.zeros",
"src.chess.board.Board.piece_symbol_to_int",
"src.chess.board.Board"
] | [((715, 745), 'src.chess.board.Board.piece_symbol_to_int', 'Board.piece_symbol_to_int', (['"""P"""'], {}), "('P')\n", (740, 745), False, 'from src.chess.board import Board\n'), ((885, 915), 'src.chess.board.Board.piece_symbol_to_int', 'Board.piece_symbol_to_int', (['"""p"""'], {}), "('p')\n", (910, 915), False, 'from s... |
from random import gauss
class MultiRotor:
"""Simple vertical dynamics for a multirotor vehicle."""
GRAVITY = -9.81
def __init__(
self, altitude=10, velocity=0, mass=1.54, emc=10.0, dt=0.05, noise=0.1
):
"""
Args:
altitude (float): initial altitude of the vehicle... | [
"random.gauss"
] | [((1595, 1615), 'random.gauss', 'gauss', (['(0)', 'self.noise'], {}), '(0, self.noise)\n', (1600, 1615), False, 'from random import gauss\n')] |
import sys
import os.path
import timeit
sys.path.insert( 0, os.path.normpath(os.path.join( os.path.dirname( __file__ ), '..') ))
from aql_tests import skip, AqlTestCase, runLocalTests
from aql.util_types import UniqueList, SplitListType, List, ValueListType
#//=======================================================... | [
"aql.util_types.UniqueList",
"aql_tests.runLocalTests",
"aql.util_types.List",
"aql.util_types.ValueListType",
"aql.util_types.SplitListType"
] | [((4754, 4769), 'aql_tests.runLocalTests', 'runLocalTests', ([], {}), '()\n', (4767, 4769), False, 'from aql_tests import skip, AqlTestCase, runLocalTests\n'), ((424, 454), 'aql.util_types.UniqueList', 'UniqueList', (['[1, 2, 3, 2, 1, 3]'], {}), '([1, 2, 3, 2, 1, 3])\n', (434, 454), False, 'from aql.util_types import U... |
# config params
KB = 1024
MB = 1024*KB
GB = 1024*MB
# name of meta root dir
META_DIR = ".metasync"
# batching time for daemon
SYNC_WAIT = 3
# blob size
BLOB_UNIT = 32*MB
# Increase of Paxos proposal number
PAXOS_PNUM_INC = 10
# authentication directory
import os
AUTH_DIR = os.path.join(os.path.expanduser("~"), "... | [
"os.path.expanduser"
] | [((294, 317), 'os.path.expanduser', 'os.path.expanduser', (['"""~"""'], {}), "('~')\n", (312, 317), False, 'import os\n')] |
import unittest
from py.tests.utils import test
from py import valid_parentheses as vp
class TestValidParentheses(unittest.TestCase):
@test(vp.Solution.is_valid)
def test_valid_parentheses(self) -> None:
test("()", result=True)
test("()[]{}", result=True)
test("(]", ... | [
"py.tests.utils.test"
] | [((142, 168), 'py.tests.utils.test', 'test', (['vp.Solution.is_valid'], {}), '(vp.Solution.is_valid)\n', (146, 168), False, 'from py.tests.utils import test\n'), ((223, 246), 'py.tests.utils.test', 'test', (['"""()"""'], {'result': '(True)'}), "('()', result=True)\n", (227, 246), False, 'from py.tests.utils import test... |
from django import forms
from fobi.base import FormFieldPlugin, form_element_plugin_registry
from .forms import HouseholdTenureForm
class HouseholdTenurePlugin(FormFieldPlugin):
"""HouseholdTenurePlugin."""
uid = "household_tenure"
name = "What year did you move into your current address?"
form = H... | [
"django.forms.widgets.NumberInput",
"fobi.base.form_element_plugin_registry.register"
] | [((793, 853), 'fobi.base.form_element_plugin_registry.register', 'form_element_plugin_registry.register', (['HouseholdTenurePlugin'], {}), '(HouseholdTenurePlugin)\n', (830, 853), False, 'from fobi.base import FormFieldPlugin, form_element_plugin_registry\n'), ((675, 710), 'django.forms.widgets.NumberInput', 'forms.wid... |
from bottle import TEMPLATE_PATH, route, run, template, redirect, get, post, request, response, auth_basic, Bottle, abort, error, static_file
import bottle
import controller
from controller import dobi_parcele_za_prikaz, dobi_info_parcele, dodaj_gosta_na_rezervacijo, naredi_rezervacijo, dobi_rezervacijo_po_id, zakljuci... | [
"controller.naredi_rezervacijo",
"bottle.template",
"controller.dobi_postavke_racuna",
"controller.dobi_rezervacijo_po_id",
"bottle.post",
"controller.dodaj_gosta_na_rezervacijo",
"datetime.date.today",
"datetime.timedelta",
"datetime.datetime.fromisoformat",
"bottle.get",
"bottle.run",
"bottl... | [((386, 401), 'bottle.get', 'bottle.get', (['"""/"""'], {}), "('/')\n", (396, 401), False, 'import bottle\n'), ((439, 459), 'bottle.get', 'bottle.get', (['"""/domov"""'], {}), "('/domov')\n", (449, 459), False, 'import bottle\n'), ((598, 633), 'bottle.get', 'bottle.get', (['"""/parcela/<id_parcele>"""'], {}), "('/parce... |
#!/usr/bin/env python
import vtk
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# Use the painter to draw using colors.
# This is not a pipeline object. It will support pipeline objects.
# Please do not use this object directly.
imageCanvas = vtk.vtkImageCanvasSource2D()
imageCanvas.SetNumb... | [
"vtk.util.misc.vtkGetDataRoot",
"vtk.vtkImageViewer",
"vtk.vtkImageHSVToRGB",
"vtk.vtkImageRGBToHSV",
"vtk.vtkImageCanvasSource2D",
"vtk.vtkImageCast"
] | [((90, 106), 'vtk.util.misc.vtkGetDataRoot', 'vtkGetDataRoot', ([], {}), '()\n', (104, 106), False, 'from vtk.util.misc import vtkGetDataRoot\n'), ((272, 300), 'vtk.vtkImageCanvasSource2D', 'vtk.vtkImageCanvasSource2D', ([], {}), '()\n', (298, 300), False, 'import vtk\n'), ((1831, 1853), 'vtk.vtkImageRGBToHSV', 'vtk.vt... |
# Copyright 2020 - 2021 MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in wri... | [
"monai.handlers.SurfaceDistance",
"ignite.engine.Engine",
"numpy.zeros",
"unittest.main",
"torch.zeros_like",
"torch.ones"
] | [((1895, 1927), 'torch.zeros_like', 'torch.zeros_like', (['sampler_sphere'], {}), '(sampler_sphere)\n', (1911, 1927), False, 'import torch\n'), ((1285, 1319), 'numpy.zeros', 'np.zeros', (['im_shape'], {'dtype': 'np.int32'}), '(im_shape, dtype=np.int32)\n', (1293, 1319), True, 'import numpy as np\n'), ((3383, 3398), 'un... |
#!/usr/bin/env python3
import sys
import logging
import yaml
import pandas as pd
import numpy as np
from collections import defaultdict
from sklearn.model_selection import train_test_split
from sklearn.ensemble import IsolationForest
from sklearn.impute import SimpleImputer
from anoflows.hpo import find_best_flows
... | [
"logging.getLogger",
"numpy.mean",
"anoflows.anoflow_bagging.AnoFlowBagging",
"sklearn.model_selection.train_test_split",
"sklearn.ensemble.IsolationForest",
"logging.info",
"numpy.isin",
"numpy.array",
"collections.defaultdict",
"sklearn.impute.SimpleImputer",
"numpy.std",
"logging.error",
... | [((556, 576), 'data_loading.load_data', 'load_data', (['spec_file'], {}), '(spec_file)\n', (565, 576), False, 'from data_loading import load_data\n'), ((729, 746), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (740, 746), False, 'from collections import defaultdict\n'), ((2144, 2183), 'logging.i... |
#!/usr/bin/env python3
#
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Extracts random constraints from reference files."""
import argparse
import random
import sys
from sacrebleu imp... | [
"argparse.ArgumentParser",
"random.seed"
] | [((2429, 2454), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2452, 2454), False, 'import argparse\n'), ((600, 622), 'random.seed', 'random.seed', (['args.seed'], {}), '(args.seed)\n', (611, 622), False, 'import random\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import csv
import furl
import json
import re
import sys
from collections import defaultdict
def filter_records_without_url(records: []) -> []:
return [r for r in records if any(r.get("urls"))]
def build_furl(url: str) -> furl.furl:
try:
... | [
"argparse.ArgumentParser",
"csv.writer",
"collections.defaultdict",
"json.load",
"re.sub",
"furl.furl"
] | [((608, 650), 're.sub', 're.sub', (['"""^www[0-9]*\\\\."""', '""""""', 'furl_obj.host'], {}), "('^www[0-9]*\\\\.', '', furl_obj.host)\n", (614, 650), False, 'import re\n'), ((720, 736), 'collections.defaultdict', 'defaultdict', (['set'], {}), '(set)\n', (731, 736), False, 'from collections import defaultdict\n'), ((442... |
# ==================================================================================================
# Copyright 2012 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | [
"twitter.pants.targets.exportable_jvm_library.ExportableJvmLibrary.__init__",
"twitter.pants.targets.exportable_jvm_library.ExportableJvmLibrary._as_jar_dependency"
] | [((2028, 2116), 'twitter.pants.targets.exportable_jvm_library.ExportableJvmLibrary.__init__', 'ExportableJvmLibrary.__init__', (['self', 'name', 'sources', 'provides', 'dependencies', 'excludes'], {}), '(self, name, sources, provides, dependencies,\n excludes)\n', (2057, 2116), False, 'from twitter.pants.targets.exp... |
# -*- coding: utf-8 -*-
#!/usr/bin/env python
#
# Copyright 2018-2020 BigML
#
# 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 requi... | [
"json.loads",
"nose.tools.eq_",
"world.world.api.update_pca",
"datetime.datetime.utcnow",
"bigml.api.get_status",
"time.sleep",
"datetime.timedelta",
"world.world.api.create_pca",
"world.world.dataset.get",
"read_pca_steps.i_get_the_pca",
"world.world.pcas.append"
] | [((1076, 1095), 'nose.tools.eq_', 'eq_', (['name', 'pca_name'], {}), '(name, pca_name)\n', (1079, 1095), False, 'from nose.tools import eq_, assert_less\n'), ((1192, 1221), 'world.world.dataset.get', 'world.dataset.get', (['"""resource"""'], {}), "('resource')\n", (1209, 1221), False, 'from world import world\n'), ((12... |
'''
<NAME> 2/20/21
sandwich-maker.py uses pyinputplus to validate user input for sandwich preferences
'''
import pyinputplus as ip
def get_cost(food_name):
'''gets the cost of items in sandwich_builder'''
food_dict = {
'sourdough':1.75,
'rye':2.0,
'wheat':1.50,
'white':1.25,... | [
"pyinputplus.inputYesNo",
"pyinputplus.inputInt",
"pyinputplus.inputChoice"
] | [((862, 937), 'pyinputplus.inputChoice', 'ip.inputChoice', (["['sourdough', 'rye', 'wheat', 'white']"], {'prompt': 'bread_prompt'}), "(['sourdough', 'rye', 'wheat', 'white'], prompt=bread_prompt)\n", (876, 937), True, 'import pyinputplus as ip\n'), ((1054, 1129), 'pyinputplus.inputChoice', 'ip.inputChoice', (["['chicke... |
notice = """
Cone Demo
-----------------------------------
| Copyright 2022 by <NAME> |
| [<EMAIL>] |
|-----------------------------------|
| We make absolutely no warranty |
| of any kind, expressed or implied |
|-----------------------------------|
| This graphics library outputs |... | [
"Python_BMP.BITMAPlib.conevertandsurface",
"Python_BMP.BITMAPlib.rotvec3D",
"Python_BMP.BITMAPlib.newBMP",
"Python_BMP.BITMAPlib.centercoord",
"os.path.dirname",
"Python_BMP.BITMAPlib.getRGBfactors",
"subprocess.call",
"Python_BMP.BITMAPlib.saveBMP",
"Python_BMP.BITMAPlib.plot3Dsolid"
] | [((773, 795), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (785, 795), False, 'from os import path\n'), ((943, 961), 'Python_BMP.BITMAPlib.newBMP', 'newBMP', (['mx', 'my', '(24)'], {}), '(mx, my, 24)\n', (949, 961), False, 'from Python_BMP.BITMAPlib import newBMP, centercoord, plot3Dsolid, get... |
import sqlite3
import subprocess, datetime
from flask import Flask, request, session, g, redirect, url_for, \
abort, render_template, flash
from contextlib import closing
from tquery import get_latest_record
from config import *
app = Flask(__name__)
app.config.from_object(__name__)... | [
"flask.flash",
"sqlite3.connect",
"flask.Flask",
"flask.session.get",
"flask.abort",
"tquery.get_latest_record",
"flask.url_for",
"flask.g.db.commit",
"datetime.datetime.now",
"subprocess.call",
"flask.g.db.execute",
"flask.session.pop"
] | [((272, 287), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (277, 287), False, 'from flask import Flask, request, session, g, redirect, url_for, abort, render_template, flash\n'), ((373, 412), 'sqlite3.connect', 'sqlite3.connect', (["app.config['DATABASE']"], {}), "(app.config['DATABASE'])\n", (388, 412),... |
"""Helper functions to tests."""
import numpy as np
def norm(vs: np.array) -> float:
"""Compute the norm of a vector."""
return np.sqrt(np.dot(vs, vs))
def create_random_matrix(size: int) -> np.array:
"""Create a numpy random matrix."""
return np.random.normal(size=size ** 2).reshape(size, size)
... | [
"numpy.random.normal",
"numpy.dot"
] | [((147, 161), 'numpy.dot', 'np.dot', (['vs', 'vs'], {}), '(vs, vs)\n', (153, 161), True, 'import numpy as np\n'), ((265, 297), 'numpy.random.normal', 'np.random.normal', ([], {'size': '(size ** 2)'}), '(size=size ** 2)\n', (281, 297), True, 'import numpy as np\n'), ((705, 739), 'numpy.dot', 'np.dot', (['matrix', 'eigen... |
#pylint:disable=no-member
import cv2 as cv
import numpy as np
img = cv.imread('/Users/webileapp/Desktop/niharika_files/projects/opencv_course_master/Resources/Photos/cats.jpg')
cv.imshow('Cats', img)
#
blank = np.zeros(img.shape[:2], dtype='uint8')
cv.imshow('Blank', blank)
gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY)... | [
"cv2.drawContours",
"cv2.threshold",
"cv2.Canny",
"cv2.imshow",
"numpy.zeros",
"cv2.waitKey",
"cv2.cvtColor",
"cv2.findContours",
"cv2.GaussianBlur",
"cv2.imread"
] | [((70, 188), 'cv2.imread', 'cv.imread', (['"""/Users/webileapp/Desktop/niharika_files/projects/opencv_course_master/Resources/Photos/cats.jpg"""'], {}), "(\n '/Users/webileapp/Desktop/niharika_files/projects/opencv_course_master/Resources/Photos/cats.jpg'\n )\n", (79, 188), True, 'import cv2 as cv\n'), ((179, 201... |
"""
Micro webapp based on WebOb, Jinja2, WSGI with a simple router
"""
import os
import hmac
import hashlib
import mimetypes
from wsgiref.simple_server import WSGIServer, WSGIRequestHandler
from webob import Request
from webob import Response
from jinja2 import Environment, FileSystemLoader
class MicroServer(obje... | [
"wsgiref.simple_server.WSGIServer",
"webob.Request",
"os.path.join",
"os.path.realpath",
"os.path.dirname",
"mimetypes.guess_type",
"jinja2.FileSystemLoader",
"webob.Response"
] | [((1522, 1538), 'webob.Request', 'Request', (['environ'], {}), '(environ)\n', (1529, 1538), False, 'from webob import Request\n'), ((1563, 1573), 'webob.Response', 'Response', ([], {}), '()\n', (1571, 1573), False, 'from webob import Response\n'), ((3802, 3844), 'wsgiref.simple_server.WSGIServer', 'WSGIServer', (["('',... |
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
from django.core.urlresolvers import reverse
from django.shortcuts import render
from django.http import HttpResponseRedirect
from core.models import Po... | [
"django.shortcuts.render",
"core.models.Post.objects.get",
"backend.forms.PostForm",
"core.models.Category.objects.all",
"core.models.Tag.objects.get",
"django.core.urlresolvers.reverse",
"core.models.Post.objects.all",
"backend.forms.TagForm",
"core.models.Tag.objects.all",
"django.contrib.auth.d... | [((424, 440), 'django.contrib.auth.decorators.login_required', 'login_required', ([], {}), '()\n', (438, 440), False, 'from django.contrib.auth.decorators import login_required\n'), ((575, 591), 'django.contrib.auth.decorators.login_required', 'login_required', ([], {}), '()\n', (589, 591), False, 'from django.contrib.... |
import dataclasses
import io
import multiprocessing as _mp
import uuid
import zipfile
from concurrent.futures import Future
from multiprocessing.connection import Connection
from typing import List, Optional, Tuple
import numpy
from tiktorch import log
from tiktorch.rpc import Shutdown
from tiktorch.rpc import mp as ... | [
"tiktorch.server.reader.eval_model_zip",
"tiktorch.rpc.mp.create_client",
"multiprocessing.Process",
"resource.getrlimit",
"tiktorch.log.configure",
"io.BytesIO",
"uuid.uuid4",
"resource.setrlimit",
"tiktorch.rpc.mp.MPServer",
"tiktorch.rpc.Shutdown",
"multiprocessing.Pipe"
] | [((2405, 2433), 'tiktorch.rpc.mp.MPServer', 'MPServer', (['session_proc', 'conn'], {}), '(session_proc, conn)\n', (2413, 2433), False, 'from tiktorch.rpc.mp import MPServer\n'), ((2640, 2650), 'multiprocessing.Pipe', '_mp.Pipe', ([], {}), '()\n', (2648, 2650), True, 'import multiprocessing as _mp\n'), ((2662, 2842), 'm... |
import unittest
import tests.settings_mock as settings_mock
from tests.activity.classes_mock import FakeLogger
from workflow.workflow_IngestAcceptedSubmission import workflow_IngestAcceptedSubmission
class TestWorkflowIngestAcceptedSubmission(unittest.TestCase):
def setUp(self):
self.workflow = workflow_I... | [
"tests.activity.classes_mock.FakeLogger"
] | [((372, 384), 'tests.activity.classes_mock.FakeLogger', 'FakeLogger', ([], {}), '()\n', (382, 384), False, 'from tests.activity.classes_mock import FakeLogger\n')] |
from urllib import urlencode
import urlparse
from django.shortcuts import Http404, redirect
from django.contrib.auth.views import logout
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import login_required
from vumi.utils import load_class_by_strin... | [
"urlparse.parse_qs",
"go.base.utils.vumi_api",
"django.contrib.messages.info",
"django.core.urlresolvers.reverse",
"django.shortcuts.redirect",
"urllib.urlencode",
"django.contrib.messages.add_message",
"django.contrib.auth.views.logout",
"vumi.utils.load_class_by_string"
] | [((526, 536), 'go.base.utils.vumi_api', 'vumi_api', ([], {}), '()\n', (534, 536), False, 'from go.base.utils import vumi_api\n'), ((2263, 2298), 'vumi.utils.load_class_by_string', 'load_class_by_string', (['callback_name'], {}), '(callback_name)\n', (2283, 2298), False, 'from vumi.utils import load_class_by_string\n'),... |
"""Read, write, create Brainvoyager VMR file format."""
import struct
import numpy as np
from bvbabel.utils import (read_variable_length_string,
write_variable_length_string)
# =============================================================================
def read_vmr(filename):
"""Read... | [
"bvbabel.utils.write_variable_length_string",
"numpy.reshape",
"struct.pack",
"numpy.zeros",
"numpy.transpose",
"bvbabel.utils.read_variable_length_string"
] | [((3535, 3605), 'numpy.zeros', 'np.zeros', (["(header['DimZ'] * header['DimY'] * header['DimX'])"], {'dtype': '"""<B"""'}), "(header['DimZ'] * header['DimY'] * header['DimX'], dtype='<B')\n", (3543, 3605), True, 'import numpy as np\n'), ((3752, 3822), 'numpy.reshape', 'np.reshape', (['data_img', "(header['DimZ'], heade... |
# 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... | [
"score.score",
"mxnet.test_utils.download",
"mxnet.metric.create",
"mxnet.test_utils.list_gpus"
] | [((1002, 1078), 'mxnet.test_utils.download', 'mx.test_utils.download', (['"""http://data.mxnet.io/data/val-5k-256.rec"""', 'VAL_DATA'], {}), "('http://data.mxnet.io/data/val-5k-256.rec', VAL_DATA)\n", (1024, 1078), True, 'import mxnet as mx\n'), ((1595, 1618), 'mxnet.metric.create', 'mx.metric.create', (['"""acc"""'], ... |
# (c) Copyright [2018-2022] Micro Focus or one of its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | [
"verticapy.plot.ts_plot",
"verticapy.learn.ensemble.RandomForestClassifier",
"math.floor",
"verticapy.plot.bar",
"verticapy.plot.spider",
"sys.getsizeof",
"math.log",
"verticapy.learn.neighbors.KernelDensity",
"verticapy.plot.gen_cmap",
"verticapy.plot.range_curve_vdf",
"verticapy.learn.ensemble... | [((21802, 21871), 'verticapy.plot.bar', 'bar', (['self', 'method', 'of', 'max_cardinality', 'nbins', 'h'], {'ax': 'ax'}), '(self, method, of, max_cardinality, nbins, h, ax=ax, **style_kwds)\n', (21805, 21871), False, 'from verticapy.plot import bar\n'), ((23663, 23735), 'verticapy.plot.boxplot', 'boxplot', (['self', 'b... |
import os
import logging
from tempfile import mkstemp, mkdtemp
from shutil import rmtree
from zipfile import ZipFile, ZIP_DEFLATED
from datetime import datetime
from boto.s3.connection import S3Connection
from boto.s3.key import Key
__version__ = "0.1.8"
__author__ = "<NAME>"
__email__ = "<EMAIL>"
logger = logging.ge... | [
"logging.getLogger",
"logging.basicConfig",
"logging.NullHandler",
"zipfile.ZipFile",
"os.path.join",
"boto.s3.connection.S3Connection",
"boto.s3.key.Key",
"datetime.datetime.now",
"tempfile.mkdtemp",
"shutil.rmtree",
"os.path.abspath",
"tempfile.mkstemp",
"os.walk",
"os.remove"
] | [((310, 337), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (327, 337), False, 'import logging\n'), ((356, 377), 'logging.NullHandler', 'logging.NullHandler', ([], {}), '()\n', (375, 377), False, 'import logging\n'), ((663, 690), 'logging.basicConfig', 'logging.basicConfig', ([], {}), '(... |
# Generated by Django 2.0.2 on 2019-03-08 13:03
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Delivery',
fields=[
('create_time', models.... | [
"django.db.models.DateTimeField",
"django.db.models.AutoField",
"django.db.models.CharField",
"django.db.models.BooleanField"
] | [((313, 373), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'auto_now_add': '(True)', 'verbose_name': '"""创建时间"""'}), "(auto_now_add=True, verbose_name='创建时间')\n", (333, 373), False, 'from django.db import migrations, models\n'), ((408, 464), 'django.db.models.DateTimeField', 'models.DateTimeField', (... |
"""Test deCONZ diagnostics."""
from unittest.mock import patch
from pydeconz.websocket import STATE_RUNNING
from homeassistant.const import Platform
from .test_gateway import DECONZ_CONFIG, setup_deconz_integration
from tests.components.diagnostics import get_diagnostics_for_config_entry
async def test_entry_dia... | [
"tests.components.diagnostics.get_diagnostics_for_config_entry",
"unittest.mock.patch"
] | [((610, 725), 'unittest.mock.patch', 'patch', (['"""homeassistant.helpers.system_info.async_get_system_info"""'], {'return_value': "{'get_system_info': 'fake data'}"}), "('homeassistant.helpers.system_info.async_get_system_info',\n return_value={'get_system_info': 'fake data'})\n", (615, 725), False, 'from unittest.... |
from __future__ import print_function # For Py2/3 compatibility
import async_eel
import random
import asyncio
loop = asyncio.get_event_loop()
@async_eel.expose
async def py_random():
return random.random()
async def print_num(n):
"""callback of js_random"""
print('Got this from Javascript:', n)
asyn... | [
"async_eel.init",
"async_eel.js_random",
"traceback.print_exc",
"random.random",
"asyncio.get_event_loop",
"async_eel.start"
] | [((119, 143), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (141, 143), False, 'import asyncio\n'), ((198, 213), 'random.random', 'random.random', ([], {}), '()\n', (211, 213), False, 'import random\n'), ((351, 372), 'async_eel.init', 'async_eel.init', (['"""web"""'], {}), "('web')\n", (365, 372... |
from dataset.baseset import BaseSet
import random, cv2
import numpy as np
class iNaturalist(BaseSet):
def __init__(self, mode='train', cfg=None, transform=None):
super(iNaturalist, self).__init__(mode, cfg, transform)
random.seed(0)
self.class_dict = self._get_class_dict()
... | [
"random.choice",
"random.randint",
"random.seed",
"numpy.arange"
] | [((248, 262), 'random.seed', 'random.seed', (['(0)'], {}), '(0)\n', (259, 262), False, 'import random, cv2\n'), ((1059, 1088), 'random.choice', 'random.choice', (['sample_indexes'], {}), '(sample_indexes)\n', (1072, 1088), False, 'import random, cv2\n'), ((651, 690), 'random.randint', 'random.randint', (['(0)', '(self.... |
# -*- coding: utf-8 -*-
import mock
from nose.tools import * # noqa (PEP8 asserts)
import hmac
import hashlib
from StringIO import StringIO
from django.core.exceptions import ValidationError
from django.db import IntegrityError
import furl
from framework.auth import get_or_create_user
from framework.auth.core impo... | [
"website.util.web_url_for",
"osf.models.AbstractNode.objects.all",
"addons.wiki.models.WikiVersion.objects.get_for_node",
"StringIO.StringIO",
"mock.patch",
"osf_tests.factories.UserFactory",
"website.conferences.utils.upload_attachment",
"osf.models.OSFUser.objects.filter",
"website.conferences.uti... | [((799, 825), 'furl.furl', 'furl.furl', (['settings.DOMAIN'], {}), '(settings.DOMAIN)\n', (808, 825), False, 'import furl\n'), ((843, 857), 'furl.furl', 'furl.furl', (['url'], {}), '(url)\n', (852, 857), False, 'import furl\n'), ((971, 987), 'furl.furl', 'furl.furl', (['first'], {}), '(first)\n', (980, 987), False, 'im... |
import socketserver
import socket
import sys
import threading
import json
import queue
import time
import datetime
import traceback
class TCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer):
def server_bind(self):
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
self.soc... | [
"threading.Thread.__init__",
"socket.socket",
"json.dumps",
"time.sleep",
"traceback.print_exc"
] | [((1097, 1140), 'threading.Thread.__init__', 'threading.Thread.__init__', (['self', '*arg'], {}), '(self, *arg, **kw)\n', (1122, 1140), False, 'import threading\n'), ((3331, 3392), 'json.dumps', 'json.dumps', (['connection'], {'sort_keys': '(True)', 'separators': "(',', ':')"}), "(connection, sort_keys=True, separators... |
# -*- coding: ascii -*-
import sys
import json
def check(data):
OnOffstart = data.find(b"OnOff")
if OnOffstart != -1:
fxName=""
OnOffblockSize = 0x30
for j in range(12):
if data[OnOffstart + j + OnOffblockSize] == 0x00:
break
fxName ... | [
"json.dump"
] | [((3647, 3673), 'json.dump', 'json.dump', (['tD', 'f'], {'indent': '(4)'}), '(tD, f, indent=4)\n', (3656, 3673), False, 'import json\n')] |
# 随机6位密码 a-zA-Z0-9下划线
import random
source = ''
lower_char = [chr(x) for x in range(ord('a'), ord('z') + 1)]
upper_char = [chr(x) for x in range(ord('A'), ord('Z') + 1)]
number_char = [chr(x) for x in range(ord('0'), ord('9') + 1)]
source += "".join(lower_char)
source += "".join(upper_char)
source += "".join(number_ch... | [
"random.sample"
] | [((400, 425), 'random.sample', 'random.sample', (['source', '(20)'], {}), '(source, 20)\n', (413, 425), False, 'import random\n')] |
from django.test import TestCase
from rest_framework.test import APIRequestFactory
from .models import GBIC, GBICType
from .views import GBICListViewSet
# Create your tests here.
class GBICTest(TestCase):
def test_gbic_view_set(self):
request = APIRequestFactory().get("")
gbic_detail = GBICListVi... | [
"rest_framework.test.APIRequestFactory"
] | [((260, 279), 'rest_framework.test.APIRequestFactory', 'APIRequestFactory', ([], {}), '()\n', (277, 279), False, 'from rest_framework.test import APIRequestFactory\n'), ((765, 784), 'rest_framework.test.APIRequestFactory', 'APIRequestFactory', ([], {}), '()\n', (782, 784), False, 'from rest_framework.test import APIReq... |
import inspect
from typing import List, Union, Set, Any
import numpy as np
from fruits.cache import Cache, CoquantileCache
from fruits.scope import force_input_shape, FitTransform
from fruits.core.callback import AbstractCallback
from fruits.signature.iss import SignatureCalculator, CachePlan
from fruits.words.word i... | [
"fruits.signature.iss.CachePlan",
"numpy.random.choice",
"fruits.signature.iss.SignatureCalculator",
"numpy.array",
"numpy.random.randint",
"fruits.scope.force_input_shape",
"inspect.isclass",
"fruits.cache.CoquantileCache",
"numpy.nan_to_num"
] | [((6257, 6299), 'numpy.nan_to_num', 'np.nan_to_num', (['result'], {'copy': '(False)', 'nan': '(0.0)'}), '(result, copy=False, nan=0.0)\n', (6270, 6299), True, 'import numpy as np\n'), ((15954, 15971), 'fruits.cache.CoquantileCache', 'CoquantileCache', ([], {}), '()\n', (15969, 15971), False, 'from fruits.cache import C... |
"""Provide trimming of input reads from Fastq or BAM files.
"""
import os
import sys
import tempfile
from bcbio.utils import (file_exists, safe_makedir,
replace_suffix, append_stem, is_pair,
replace_directory, map_wrap)
from bcbio.log import logger
from bcbio.bam impor... | [
"bcbio.utils.safe_makedir",
"bcbio.utils.file_exists",
"bcbio.utils.is_pair",
"Bio.Seq.Seq",
"bcbio.provenance.do.run",
"os.path.join",
"bcbio.utils.append_stem",
"bcbio.pipeline.config_utils.get_program",
"bcbio.bam.fastq.filter_reads_by_length",
"bcbio.bam.fastq.filter_single_reads_by_length",
... | [((917, 967), 'bcbio.pipeline.config_utils.get_resources', 'config_utils.get_resources', (['"""AlienTrimmer"""', 'config'], {}), "('AlienTrimmer', config)\n", (943, 967), False, 'from bcbio.pipeline import config_utils\n'), ((1251, 1296), 'bcbio.pipeline.config_utils.get_jar', 'config_utils.get_jar', (['"""AlienTrimmer... |
import numpy as np
from sklearn.metrics import fbeta_score, roc_curve, auc, confusion_matrix
from sklearn.decomposition import PCA
from sklearn import random_projection
from sklearn import svm
from sklearn.ensemble import IsolationForest
import matplotlib.pyplot as plt
from keras.layers import Dense, Input, Dropout
fro... | [
"matplotlib.pyplot.ylabel",
"sklearn.metrics.auc",
"sklearn.ensemble.AdaBoostClassifier",
"sklearn.metrics.roc_curve",
"keras.layers.Dense",
"matplotlib.pyplot.semilogy",
"sklearn.decomposition.PCA",
"sklearn.random_projection.SparseRandomProjection",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot... | [((6712, 6744), 'keras.layers.Input', 'Input', ([], {'shape': '(x_train.shape[1],)'}), '(shape=(x_train.shape[1],))\n', (6717, 6744), False, 'from keras.layers import Dense, Input, Dropout\n'), ((6920, 6948), 'keras.models.Model', 'Model', (['input_vector', 'decoded'], {}), '(input_vector, decoded)\n', (6925, 6948), Fa... |
# encoding: utf-8
import unittest
import os
import sys
sys.path.append(os.getcwd())
from notifo import Notifo, send_message
class TestNotifyUser(unittest.TestCase):
def setUp(self):
self.provider = "test_provider"
self.provider_banned = "test_provider_msg_banned"
self.user = "test_user"
... | [
"unittest.main",
"notifo.Notifo",
"notifo.send_message",
"os.getcwd"
] | [((71, 82), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (80, 82), False, 'import os\n'), ((1738, 1753), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1751, 1753), False, 'import unittest\n'), ((662, 736), 'notifo.send_message', 'send_message', (['self.sender', 'self.sender_token'], {'to': 'self.user', 'msg': '""... |
from typing import List
from presidio_analyzer import EntityRecognizer, RecognizerResult, AnalysisExplanation
from presidio_analyzer.nlp_engine import NlpArtifacts
from hebsafeharbor.common.terms_recognizer import TermsRecognizer
class LexiconBasedRecognizer(EntityRecognizer):
"""
A class which extends the E... | [
"presidio_analyzer.AnalysisExplanation",
"hebsafeharbor.common.terms_recognizer.TermsRecognizer"
] | [((1415, 1443), 'hebsafeharbor.common.terms_recognizer.TermsRecognizer', 'TermsRecognizer', (['phrase_list'], {}), '(phrase_list)\n', (1430, 1443), False, 'from hebsafeharbor.common.terms_recognizer import TermsRecognizer\n'), ((2536, 2597), 'presidio_analyzer.AnalysisExplanation', 'AnalysisExplanation', (['self.name',... |
# encoding: utf-8
#
# Copyright (C) 2018 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | [
"ycmd.tests.clangd.RunAfterInitialized",
"pprint.pprint",
"hamcrest.contains_string",
"ycmd.tests.test_utils.ErrorMatcher",
"hamcrest.matches_regexp",
"hamcrest.has_entries",
"ycmd.tests.clangd.PathToTestFile",
"hamcrest.equal_to",
"ycmd.tests.test_utils.BuildRequest",
"ycmd.tests.test_utils.Combi... | [((1957, 1971), 'ycmd.tests.clangd.IsolatedYcmd', 'IsolatedYcmd', ([], {}), '()\n', (1969, 1971), False, 'from ycmd.tests.clangd import IsolatedYcmd, SharedYcmd, PathToTestFile, RunAfterInitialized\n'), ((2034, 2093), 'ycmd.tests.clangd.PathToTestFile', 'PathToTestFile', (['"""GoTo_Clang_ZeroBasedLineAndColumn_test.cc"... |
"""
Config class containing all the settings for running sentiment scoring tool
"""
import jsonpickle
class Config(object):
"""Container for sentiment scoring tool settings.
"""
def __init__(self):
"""Initializes the Config instance.
"""
#Elasticsearch settings
self.elasti... | [
"jsonpickle.decode"
] | [((987, 1010), 'jsonpickle.decode', 'jsonpickle.decode', (['json'], {}), '(json)\n', (1004, 1010), False, 'import jsonpickle\n')] |
# 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... | [
"mindspore.log.info",
"util.save_and_check_md5",
"numpy.mean",
"util.diff_mse",
"mindspore.dataset.vision.py_transforms.Resize",
"mindspore.dataset.vision.py_transforms.ToPIL",
"util.visualize_list",
"mindspore.dataset.vision.c_transforms.Resize",
"mindspore.dataset.vision.py_transforms.Invert",
"... | [((1160, 1196), 'mindspore.log.info', 'logger.info', (['"""Test Invert Python op"""'], {}), "('Test Invert Python op')\n", (1171, 1196), True, 'from mindspore import log as logger\n'), ((1235, 1293), 'mindspore.dataset.ImageFolderDataset', 'ds.ImageFolderDataset', ([], {'dataset_dir': 'DATA_DIR', 'shuffle': '(False)'})... |
from parameterized import parameterized
from numpy.testing import TestCase
from .. import candy
class TestCollectCandies(TestCase):
@parameterized.expand(
[(5, 5, 12,
[[2, 1, 1, 1, 1], [2, 2, 1, 1, 1], [1, 2, 1, 1, 1],
[2, 2, 1, 1, 3], [2, 2, 2, 2, 2]])]
)
def test_candy(self... | [
"parameterized.parameterized.expand"
] | [((140, 266), 'parameterized.parameterized.expand', 'parameterized.expand', (['[(5, 5, 12, [[2, 1, 1, 1, 1], [2, 2, 1, 1, 1], [1, 2, 1, 1, 1], [2, 2, 1, 1,\n 3], [2, 2, 2, 2, 2]])]'], {}), '([(5, 5, 12, [[2, 1, 1, 1, 1], [2, 2, 1, 1, 1], [1, 2, \n 1, 1, 1], [2, 2, 1, 1, 3], [2, 2, 2, 2, 2]])])\n', (160, 266), Fal... |
from __future__ import absolute_import, unicode_literals, print_function
import mock
import unittest
import d43_aws_tools as aws_tools
from boto3.dynamodb.conditions import Attr
class DynamoDBHandlerTests(unittest.TestCase):
@classmethod
def setUpClass(cls):
with mock.patch("d43_aws_tools.dynamodb_han... | [
"d43_aws_tools.dynamodb_handler.DynamoDBHandler",
"mock.MagicMock"
] | [((463, 479), 'mock.MagicMock', 'mock.MagicMock', ([], {}), '()\n', (477, 479), False, 'import mock\n'), ((378, 434), 'd43_aws_tools.dynamodb_handler.DynamoDBHandler', 'aws_tools.dynamodb_handler.DynamoDBHandler', (['"""table_name"""'], {}), "('table_name')\n", (420, 434), True, 'import d43_aws_tools as aws_tools\n'), ... |
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | [
"tensorflow.compat.v1.keras.layers.Flatten",
"os.path.join",
"tensorflow.compat.v1.keras.layers.ReLU",
"tensorflow.compat.v1.add_to_collection",
"copy.deepcopy",
"low_rank_local_connectivity.utils.position_channels",
"tensorflow.compat.v1.keras.layers.Dense",
"tensorflow.compat.v1.keras.layers.GlobalA... | [((1396, 1417), 'copy.deepcopy', 'copy.deepcopy', (['config'], {}), '(config)\n', (1409, 1417), False, 'import copy\n'), ((5475, 5497), 'tensorflow.compat.v1.keras.layers.ReLU', 'tf.keras.layers.ReLU', ([], {}), '()\n', (5495, 5497), True, 'import tensorflow.compat.v1 as tf\n'), ((5836, 5939), 'tensorflow.compat.v1.ker... |
import datetime
import json
import os
from pathlib import Path
from types import SimpleNamespace
from typing import List
from typing import NamedTuple, Union, Optional, Callable
from uuid import uuid3, NAMESPACE_DNS
from dateutil.parser import parse
_VIDEO_SUFFIXES = [".mkv", ".mp4"]
_IMAGE_SUFFIXES = [".jpg"]
_PERMI... | [
"dateutil.parser.parse",
"json.dumps",
"pathlib.Path"
] | [((1047, 1063), 'dateutil.parser.parse', 'parse', (['timestamp'], {}), '(timestamp)\n', (1052, 1063), False, 'from dateutil.parser import parse\n'), ((6220, 6505), 'json.dumps', 'json.dumps', (["{'event_id': x.event_id, 'timestamp': x.timestamp, 'camera_name': x.\n camera_name, 'high_res_image_path': x.high_res_imag... |
# Generated by Django 2.2.1 on 2019-09-27 14:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('schoolio', '0004_auto_20190927_0405'),
]
operations = [
migrations.AlterField(
model_name='student_assessment',
name... | [
"django.db.models.CharField",
"django.db.models.IntegerField"
] | [((358, 400), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'blank': '(True)', 'null': '(True)'}), '(blank=True, null=True)\n', (377, 400), False, 'from django.db import migrations, models\n'), ((544, 586), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'blank': '(True)', 'null': '(True)'... |
import random
print("Title : Eat, Drink, And Be Sick")
noun = []
for i in range(4):
n = input("Enter noun : ")
noun.append(n)
plural = []
for i in range(6):
pn = input("Enter plural noun : ")
plural.append(pn)
adjective = []
for i in range(2):
a = input("Enter adjective : ")
adjective.append(a)
... | [
"random.choice"
] | [((493, 512), 'random.choice', 'random.choice', (['noun'], {}), '(noun)\n', (506, 512), False, 'import random\n'), ((559, 583), 'random.choice', 'random.choice', (['adjective'], {}), '(adjective)\n', (572, 583), False, 'import random\n'), ((654, 678), 'random.choice', 'random.choice', (['adjective'], {}), '(adjective)\... |
import numpy
g = open('/home/srallaba/mgc/transposed/arctic_a0404.mgc','w')
x = numpy.loadtxt('/home/srallaba/mgc_spaces/arctic_a0404.mgc')
numpy.savetxt(g, numpy.transpose(x))
g.close()
| [
"numpy.loadtxt",
"numpy.transpose"
] | [((82, 141), 'numpy.loadtxt', 'numpy.loadtxt', (['"""/home/srallaba/mgc_spaces/arctic_a0404.mgc"""'], {}), "('/home/srallaba/mgc_spaces/arctic_a0404.mgc')\n", (95, 141), False, 'import numpy\n'), ((159, 177), 'numpy.transpose', 'numpy.transpose', (['x'], {}), '(x)\n', (174, 177), False, 'import numpy\n')] |
from rest_framework.response import Response
from rest_framework.views import APIView
from django_redis import get_redis_connection
from goods.models import SKU
from decimal import Decimal
from rest_framework.generics import CreateAPIView,ListAPIView
from rest_framework.mixins import ListModelMixin
from orders.serializ... | [
"django_redis.get_redis_connection",
"orders.serializers.OrderShowSerializer",
"goods.models.SKU.objects.filter",
"orders.models.OrderGoods.objects.filter",
"orders.models.OrderInfo.objects.get",
"orders.models.OrderInfo.objects.filter",
"rest_framework.response.Response",
"users.models.User.objects.g... | [((777, 805), 'django_redis.get_redis_connection', 'get_redis_connection', (['"""cart"""'], {}), "('cart')\n", (797, 805), False, 'from django_redis import get_redis_connection\n'), ((1156, 1190), 'goods.models.SKU.objects.filter', 'SKU.objects.filter', ([], {'id__in': 'sku_ids'}), '(id__in=sku_ids)\n', (1174, 1190), F... |
import argparse
import errno
import logging
import os
import platform
import signal
import sys
from collections import OrderedDict
from contextlib import closing
from distutils.version import StrictVersion
from functools import partial
from gettext import gettext
from itertools import chain
from pathlib import Path
fro... | [
"logging.getLogger",
"streamlink.logger.root.setLevel",
"streamlink.utils.named_pipe.NamedPipe",
"streamlink.logger.root.isEnabledFor",
"streamlink.cache.Cache",
"streamlink.Streamlink",
"time.sleep",
"platform.release",
"contextlib.closing",
"sys.exit",
"streamlink_cli.utils.ignored",
"stream... | [((1732, 1767), 'logging.getLogger', 'logging.getLogger', (['"""streamlink.cli"""'], {}), "('streamlink.cli')\n", (1749, 1767), False, 'import logging\n'), ((2765, 2785), 'streamlink_cli.output.FileOutput', 'FileOutput', (['filename'], {}), '(filename)\n', (2775, 2785), False, 'from streamlink_cli.output import FileOut... |