code stringlengths 20 1.04M | apis list | extract_api stringlengths 75 9.94M |
|---|---|---|
# copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
"json.loads",
"random.shuffle",
"os.path.exists",
"random.choice",
"random.seed",
"traceback.format_exc",
"os.path.join"
] | [((2800, 2822), 'random.seed', 'random.seed', (['self.seed'], {}), '(self.seed)\n', (2811, 2822), False, 'import random\n'), ((2831, 2862), 'random.shuffle', 'random.shuffle', (['self.data_lines'], {}), '(self.data_lines)\n', (2845, 2862), False, 'import random\n'), ((3927, 3965), 'os.path.join', 'os.path.join', (['sel... |
import datasets
import glob
import json
import pandas as pd
import streamlit as st
import sys
import textwrap
from thermostat import load
from thermostat.data.thermostat_configs import builder_configs
nlp = datasets
HTML_WRAPPER = """<div>{}</div>"""
#HTML_WRAPPER = """<div style="overflow-x: auto; border: 1px soli... | [
"streamlit.sidebar.subheader",
"streamlit.table",
"json.dumps",
"streamlit.sidebar.selectbox",
"glob.glob",
"thermostat.load",
"pandas.DataFrame",
"streamlit.subheader",
"streamlit.sidebar.checkbox",
"datasets.append",
"streamlit.text",
"streamlit.sidebar.markdown",
"streamlit.experimental_g... | [((1425, 1459), 'streamlit.experimental_get_query_params', 'st.experimental_get_query_params', ([], {}), '()\n', (1457, 1459), True, 'import streamlit as st\n'), ((650, 951), 'streamlit.markdown', 'st.markdown', (['f"""\n <style>\n .reportview-container .main .block-container{{\n {max_width_str}\n }}\n ... |
#!/usr/bin/env python
from __future__ import absolute_import, division, print_function, unicode_literals
import threading
from WebInterface import WebInterface
from SlideshowController import SlideshowController
from Pi3DDisplayer import Displayer
#from DummyDisplayer import Displayer
controller = SlideshowControlle... | [
"threading.Thread",
"Pi3DDisplayer.Displayer",
"WebInterface.WebInterface",
"SlideshowController.SlideshowController"
] | [((302, 323), 'SlideshowController.SlideshowController', 'SlideshowController', ([], {}), '()\n', (321, 323), False, 'from SlideshowController import SlideshowController\n'), ((337, 368), 'Pi3DDisplayer.Displayer', 'Displayer', (['controller.showQueue'], {}), '(controller.showQueue)\n', (346, 368), False, 'from Pi3DDis... |
from functools import reduce
import operator
import warnings
from collections.abc import Iterable
import numpy as np
import scipy.sparse
import numba
from .._sparse_array import SparseArray
from .._utils import (
isscalar,
normalize_axis,
check_zero_fill_value,
check_consistent_fill_value,
)
def asC... | [
"numpy.sum",
"numpy.empty",
"numpy.isnan",
"numpy.arange",
"numpy.isposinf",
"numpy.true_divide",
"numpy.copy",
"numpy.ndim",
"numpy.ravel_multi_index",
"numpy.stack",
"numpy.isneginf",
"numpy.asarray",
"numpy.issubdtype",
"numpy.vstack",
"numpy.concatenate",
"numpy.zeros",
"numpy.er... | [((24582, 24618), 'numba.jit', 'numba.jit', ([], {'nopython': '(True)', 'nogil': '(True)'}), '(nopython=True, nogil=True)\n', (24591, 24618), False, 'import numba\n'), ((2624, 2634), 'numpy.ndim', 'np.ndim', (['a'], {}), '(a)\n', (2631, 2634), True, 'import numpy as np\n'), ((2648, 2658), 'numpy.ndim', 'np.ndim', (['b'... |
from homeassistant import config_entries
from typing import Any, Dict, Optional
from .const import DOMAIN
import voluptuous as vol
from .sensor import CONF_MAC, CONF_NAME, CONF_SENSORS, SENSOR_TYPES, CONF_MONITORED_CONDITIONS
import homeassistant.helpers.config_validation as cv
CONFIG_FLOW_RUUVI_ADD_SCHEMA = vol.Sche... | [
"voluptuous.Schema",
"voluptuous.Required",
"voluptuous.Optional"
] | [((571, 596), 'voluptuous.Schema', 'vol.Schema', (['config_schema'], {}), '(config_schema)\n', (581, 596), True, 'import voluptuous as vol\n'), ((338, 360), 'voluptuous.Required', 'vol.Required', (['CONF_MAC'], {}), '(CONF_MAC)\n', (350, 360), True, 'import voluptuous as vol\n'), ((381, 404), 'voluptuous.Optional', 'vo... |
# Generated by Django 3.1.13 on 2021-07-20 15:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("core", "0029_auto_20210716_1926"),
]
operations = [
migrations.AddField(
model_name="achievement",
name="descriptio... | [
"django.db.models.TextField"
] | [((342, 387), 'django.db.models.TextField', 'models.TextField', ([], {'default': '""" """', 'max_length': '(255)'}), "(default=' ', max_length=255)\n", (358, 387), False, 'from django.db import migrations, models\n')] |
from consts import *
from Player import Player, PlayerWithMemory
from numpy.random import randint
class Cooperator(Player):
def answer(self, opponent):
return Answer.COOPERATE
class Defector(Player):
def answer(self, opponent):
return Answer.DEFECT
class TitForTat(PlayerWithMemory):
d... | [
"numpy.random.randint"
] | [((1391, 1401), 'numpy.random.randint', 'randint', (['(2)'], {}), '(2)\n', (1398, 1401), False, 'from numpy.random import randint\n')] |
#!/bin/python3
import csv
import json
import sys
# usage: tsv_to_json.py tsv_file
# 0 1 2 3 4 5
fields = ['available', 'type', 'group', 'native', 'botanical', 'common',
# 6 7 8 9
'zones14_17',... | [
"csv.reader",
"json.dumps"
] | [((539, 568), 'csv.reader', 'csv.reader', (['f'], {'delimiter': '"""\t"""'}), "(f, delimiter='\\t')\n", (549, 568), False, 'import csv\n'), ((1555, 1595), 'json.dumps', 'json.dumps', (["{'plants': plants}"], {'indent': '(4)'}), "({'plants': plants}, indent=4)\n", (1565, 1595), False, 'import json\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Recurrent network example. Trains a bidirectional vanilla RNN to output the
sum of two numbers in a sequence of random numbers sampled uniformly from
[0, 1] based on a separate marker sequence.
'''
from __future__ import print_function
import numpy as np
import thea... | [
"numpy.random.uniform",
"lasagne.layers.DenseLayer",
"lasagne.layers.ConcatLayer",
"lasagne.layers.InputLayer",
"lasagne.layers.get_all_params",
"numpy.sum",
"theano.function",
"numpy.zeros",
"theano.tensor.mean",
"numpy.random.randint",
"lasagne.layers.get_output",
"lasagne.updates.adagrad",
... | [((2519, 2550), 'numpy.zeros', 'np.zeros', (['(n_batch, max_length)'], {}), '((n_batch, max_length))\n', (2527, 2550), True, 'import numpy as np\n'), ((2559, 2579), 'numpy.zeros', 'np.zeros', (['(n_batch,)'], {}), '((n_batch,))\n', (2567, 2579), True, 'import numpy as np\n'), ((3681, 3738), 'lasagne.layers.InputLayer',... |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"google.cloud.ndb._runstate.current",
"unittest.mock.Mock",
"unittest.mock.patch",
"pytest.raises",
"google.cloud.ndb.client.Client"
] | [((921, 960), 'unittest.mock.Mock', 'mock.Mock', ([], {'spec': 'credentials.Credentials'}), '(spec=credentials.Credentials)\n', (930, 960), False, 'from unittest import mock\n'), ((973, 1037), 'unittest.mock.patch', 'mock.patch', (['"""google.auth.default"""'], {'return_value': '(creds, project)'}), "('google.auth.defa... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 4 11:36:54 2018
@author: nimishawalgaonkar
"""
import numpy as np
import tensorflow as tf
import gpflow
from gpflow.mean_functions import Zero
from gpflow.param import AutoFlow, DataHolder
from gpflow._settings import settings
float_type = setting... | [
"gpflow.mean_functions.Zero",
"gpflow.model.Model.__init__",
"tensorflow.stack",
"tensorflow.matmul",
"tensorflow.shape",
"tensorflow.random_normal",
"gpflow.param.AutoFlow",
"tensorflow.cholesky"
] | [((1779, 1815), 'gpflow.param.AutoFlow', 'AutoFlow', (['(float_type, [None, None])'], {}), '((float_type, [None, None]))\n', (1787, 1815), False, 'from gpflow.param import AutoFlow, DataHolder\n'), ((2011, 2047), 'gpflow.param.AutoFlow', 'AutoFlow', (['(float_type, [None, None])'], {}), '((float_type, [None, None]))\n'... |
"""
Copyright © 2021 The Johns Hopkins University Applied Physics Laboratory LLC
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to
deal in the Software without restriction, including without limitation the
rights to... | [
"curriculum_tools.MultiEnv",
"curriculum_tools.ScheduleEnv"
] | [((2931, 2985), 'curriculum_tools.ScheduleEnv', 'curriculum_tools.ScheduleEnv', (['sch'], {'by_episode': 'episodic'}), '(sch, by_episode=episodic)\n', (2959, 2985), False, 'import curriculum_tools\n'), ((1937, 1968), 'curriculum_tools.MultiEnv', 'curriculum_tools.MultiEnv', (['envs'], {}), '(envs)\n', (1962, 1968), Fal... |
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------
# Reboots model
# ----------------------------------------------------------------------
# Copyright (C) 2007-2017 The NOC Project
# See LICENSE for details
# ----------------------------------------------------------------... | [
"noc.core.clickhouse.engines.MergeTree",
"noc.sa.models.administrativedomain.AdministrativeDomain.objects.filter",
"noc.sa.models.useraccess.UserAccess.get_domains",
"noc.core.translation.ugettext"
] | [((1367, 1410), 'noc.core.clickhouse.engines.MergeTree', 'MergeTree', (['"""date"""', "('ts', 'managed_object')"], {}), "('date', ('ts', 'managed_object'))\n", (1376, 1410), False, 'from noc.core.clickhouse.engines import MergeTree\n'), ((2508, 2536), 'noc.sa.models.useraccess.UserAccess.get_domains', 'UserAccess.get_d... |
import hashlib
import datetime
from moto.core import ACCOUNT_ID, BaseBackend, BaseModel
from moto.core.utils import BackendDict
from .utils import get_job_id
class Job(BaseModel):
def __init__(self, tier):
self.st = datetime.datetime.now()
if tier.lower() == "expedited":
self.et = ... | [
"moto.core.utils.BackendDict",
"hashlib.md5",
"hashlib.sha256",
"datetime.timedelta",
"datetime.datetime.now"
] | [((7470, 7508), 'moto.core.utils.BackendDict', 'BackendDict', (['GlacierBackend', '"""glacier"""'], {}), "(GlacierBackend, 'glacier')\n", (7481, 7508), False, 'from moto.core.utils import BackendDict\n'), ((233, 256), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (254, 256), False, 'import datetim... |
import os
def notify():
message='''Greetings!!!
Your documents, photos, databases and other important files have been encrypted with the strongest encryption with unique key generated for this computer.
Private decryption key is stored on a secret server and the files cannot be decrypted without the key which you w... | [
"os.getenv"
] | [((551, 568), 'os.getenv', 'os.getenv', (['"""HOME"""'], {}), "('HOME')\n", (560, 568), False, 'import os\n')] |
# Required for rest of hug scripts
from bitshares import BitShares
from bitshares.account import Account
from bitshares.amount import Amount
from bitshares.asset import Asset
from bitshares.blockchain import Blockchain
from bitshares.block import Block
from bitshares.dex import Dex
from bitshares.price import Price
fro... | [
"bitshares.block.Block",
"hug.get",
"bitshares.asset.Asset",
"bitshares.witness.Witness",
"bitshares.witness.Witnesses",
"bitshares.amount.Amount",
"bitshares.dex.Dex",
"bitshares.blockchain.Blockchain",
"bitshares.BitShares",
"bitshares.account.Account",
"requests.get",
"bitshares.market.Mark... | [((1019, 1062), 'bitshares.BitShares', 'BitShares', (['full_node_url'], {'nobroadcast': '(False)'}), '(full_node_url, nobroadcast=False)\n', (1028, 1062), False, 'from bitshares import BitShares\n'), ((1063, 1113), 'bitshares.instance.set_shared_bitshares_instance', 'set_shared_bitshares_instance', (['bitshares_full_no... |
# 主路由
from django.conf.urls import url, include
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
# 配置users路由
url(r'^',include('apps.users.urls',namespace = 'users')),
# 配置contents路由
url(r'^',include('apps.contents.urls',namespace ='contents')),
# 配置verificat... | [
"django.conf.urls.include",
"django.conf.urls.url"
] | [((102, 133), 'django.conf.urls.url', 'url', (['"""^admin/"""', 'admin.site.urls'], {}), "('^admin/', admin.site.urls)\n", (105, 133), False, 'from django.conf.urls import url, include\n'), ((166, 211), 'django.conf.urls.include', 'include', (['"""apps.users.urls"""'], {'namespace': '"""users"""'}), "('apps.users.urls'... |
#!/usr/bin/env python3
# verifiers.py ---
#
# Filename: verifiers.py
# Author: <NAME>
# Created: Mon, 06 Jun 2016 14:51:36 -0400
#
#
# Copyright (c) 2015, <NAME>, University of Pennsylvania
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provid... | [
"utils.z3smt.z3value_to_value",
"exprs.exprs.VariableExpression",
"exprs.exprs.is_application_of",
"z3.Not",
"utils.z3smt.Z3SMTContext",
"utils.basetypes.AbstractMethodError",
"exprs.evaluation.evaluate_expression_raw"
] | [((2527, 2579), 'utils.z3smt.z3value_to_value', 'z3smt.z3value_to_value', (['eval_value', 'var_info_list[i]'], {}), '(eval_value, var_info_list[i])\n', (2549, 2579), False, 'from utils import z3smt\n'), ((5572, 5626), 'utils.basetypes.AbstractMethodError', 'basetypes.AbstractMethodError', (['"""VerifierBase.verify()"""... |
import numpy as np
from ..VideoClip import ImageClip
def mask_or(clip, other_clip):
""" Returns the logical 'or' (max) between two masks.
other_clip can be a mask clip or a picture (np.array).
The result has the duration of 'clip' (if it has any)
"""
# To ensure that 'or' of two ImageCli... | [
"numpy.maximum"
] | [((506, 531), 'numpy.maximum', 'np.maximum', (['f', 'other_clip'], {}), '(f, other_clip)\n', (516, 531), True, 'import numpy as np\n')] |
# vim: expandtab:ts=4:sw=4
from __future__ import absolute_import
import numpy as np
from . import kalman_filter
from . import linear_assignment
from . import iou_matching
from .track import Track
class Tracker:
"""
This is the multi-target tracker.
Parameters
----------
metric : nn_matching.Near... | [
"numpy.asarray",
"numpy.array",
"numpy.logical_or",
"numpy.sqrt"
] | [((1240, 1275), 'numpy.sqrt', 'np.sqrt', (['kalman_filter.chi2inv95[4]'], {}), '(kalman_filter.chi2inv95[4])\n', (1247, 1275), True, 'import numpy as np\n'), ((3271, 3291), 'numpy.asarray', 'np.asarray', (['features'], {}), '(features)\n', (3281, 3291), True, 'import numpy as np\n'), ((3293, 3312), 'numpy.asarray', 'np... |
import importlib
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.urls import path
from users.views import password_reset_redirect
from . import views
urlpatterns = [
url(r"^api/v1/", include("api.urls.deprecated", namespace="api-deprecated"... | [
"django.urls.path",
"importlib.import_module",
"django.conf.urls.url",
"django.conf.urls.include"
] | [((394, 425), 'django.conf.urls.url', 'url', (['"""^admin/"""', 'admin.site.urls'], {}), "('^admin/', admin.site.urls)\n", (397, 425), False, 'from django.conf.urls import include, url\n'), ((503, 538), 'django.conf.urls.url', 'url', (['"""^version"""', 'views.version_info'], {}), "('^version', views.version_info)\n", ... |
#!/usr/bin/env python3
"""
Create list of all CreateCoin accounts in file.
Usage: create_account_list.py <server_address> <output_filename>
"""
import sys
import json
import requests
def main():
if len( sys.argv ) != 3:
exit( "Usage: create_account_list.py <server_address> <output_filename>" )
url = sys.a... | [
"json.dumps"
] | [((866, 885), 'json.dumps', 'json.dumps', (['request'], {}), '(request)\n', (876, 885), False, 'import json\n')] |
import sys
import ast
fit_accuracy = [] # list of lists
fit_val_accuracy = [] # list of lists
test_accuracy = [] # list of numbers
time_train = []
time_test = []
oversample = False
pca = False
rpca = False
mspca = False
prefiltered = False
train_size = 0
pca_p = 0
spikes = 0
with open(sys.argv[1], 'r') as f:
fo... | [
"ast.literal_eval",
"sys.exit"
] | [((1706, 1717), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (1714, 1717), False, 'import sys\n'), ((395, 422), 'ast.literal_eval', 'ast.literal_eval', (['line[13:]'], {}), '(line[13:])\n', (411, 422), False, 'import ast\n'), ((496, 523), 'ast.literal_eval', 'ast.literal_eval', (['line[17:]'], {}), '(line[17:])\n', ... |
import http.server
import socketserver
import threading
import payload
class MiniDiagramHandler(http.server.BaseHTTPRequestHandler):
def do_GET(self):
config = payload.get()
self.send_response(200, message='OK')
self.send_header('Content-Type', 'application/json')
self.send_header(... | [
"socketserver.ThreadingTCPServer",
"payload.get"
] | [((494, 557), 'socketserver.ThreadingTCPServer', 'socketserver.ThreadingTCPServer', (['(ip, port)', 'MiniDiagramHandler'], {}), '((ip, port), MiniDiagramHandler)\n', (525, 557), False, 'import socketserver\n'), ((174, 187), 'payload.get', 'payload.get', ([], {}), '()\n', (185, 187), False, 'import payload\n')] |
import tkinter as tk
import tkinter.ttk as ttk
from tkinter.messagebox import (askyesno, showerror)
from tkinter.filedialog import asksaveasfilename
from matplotlib.backends.backend_tkagg import (FigureCanvasTkAgg, NavigationToolbar2Tk)
import matplotlib as mpl
import xlsxwriter as excel
import os, sys, gc, re
from spe... | [
"tkinter.StringVar",
"tkinter.filedialog.asksaveasfilename",
"tkinter.Text",
"base64.b64decode",
"gc.collect",
"pathlib.Path",
"tkinter.BooleanVar",
"tkinter.Frame",
"tkinter.Label",
"tkinter.Entry",
"os.path.exists",
"tkinter.ttk.Frame",
"tkinter.Toplevel",
"spec2cie.spectrum_container",
... | [((646, 653), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (651, 653), True, 'import tkinter as tk\n'), ((2519, 2560), 'spec2cie.spectrum_container', 'spectrum_container', ([], {'tk_window': 'main_window'}), '(tk_window=main_window)\n', (2537, 2560), False, 'from spec2cie import spectrum_container, plot_container\n'), ((29... |
# coding=utf-8
"""This module, javascript_manager.py, deals with pre-processing javascript files, combining them, and minimizing them."""
from libraries.code_api.source_file_abstraction.code_directories.code_directory import CodeDirectory
from libraries.code_api.source_file_abstraction.code_files.js_file import Gener... | [
"applications.code_manager.layer_applications.javascript_parser.pre_process_constant.parse_out_constants",
"libraries.code_api.source_file_abstraction.code_directories.code_directory.CodeDirectory",
"libraries.universal_code.debugging.raise_exception",
"libraries.universal_code.output_coloring.print_error",
... | [((1947, 1980), 'libraries.code_api.source_file_abstraction.code_files.js_file.GeneratedJSFile', 'GeneratedJSFile', (['"""nexus_local.js"""'], {}), "('nexus_local.js')\n", (1962, 1980), False, 'from libraries.code_api.source_file_abstraction.code_files.js_file import GeneratedJSFile\n'), ((2179, 2239), 'applications.co... |
###########################################################################
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/l... | [
"django.forms.ModelChoiceField",
"starthinker_ui.project.models.Project.objects.filter",
"django.utils.translation.gettext",
"starthinker_ui.recipe.forms_fields.TimezoneField",
"django.db.models.Q"
] | [((1061, 1072), 'django.utils.translation.gettext', '_', (['"""Monday"""'], {}), "('Monday')\n", (1062, 1072), True, 'from django.utils.translation import gettext as _\n'), ((1076, 1088), 'django.utils.translation.gettext', '_', (['"""Tuesday"""'], {}), "('Tuesday')\n", (1077, 1088), True, 'from django.utils.translatio... |
import inspect
import logging
import os
import sys
import webbrowser
import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
from . import client
from . import tornadoHandlers
from . import websocketHandler
class Application:
defaultJ2p2jHead = '''
<meta http-equiv="X-UA-Com... | [
"os.path.isabs",
"os.path.isdir",
"os.getcwd",
"os.path.dirname",
"inspect.getmodule",
"inspect.currentframe",
"os.path.join"
] | [((1430, 1460), 'os.path.isabs', 'os.path.isabs', (['self._htmlStart'], {}), '(self._htmlStart)\n', (1443, 1460), False, 'import os\n'), ((5217, 5260), 'os.path.join', 'os.path.join', (['j2p2jDirName', 'self.staticName'], {}), '(j2p2jDirName, self.staticName)\n', (5229, 5260), False, 'import os\n'), ((1565, 1588), 'os.... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import hashlib
import os
import sys
from os.path import basename
from fontTools.ttLib import TTFont
def write_checksum(filepaths, stdout_write=False, use_ttx=False, include_tables=None, exclude_tables=None, do_not_cleanup=False):
checksum_dict = {}... | [
"sys.stdout.write",
"os.remove",
"fontTools.ttLib.TTFont",
"argparse.ArgumentParser",
"hashlib.sha1",
"os.path.basename",
"os.path.exists",
"sys.stderr.write",
"sys.exit"
] | [((4640, 4767), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'prog': '"""checksum.py"""', 'description': '"""A SHA1 hash checksum list generator and checksum testing script"""'}), "(prog='checksum.py', description=\n 'A SHA1 hash checksum list generator and checksum testing script')\n", (4663, 4767), ... |
# ========================================================================
# Copyright 2020 Emory University
#
# 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/lice... | [
"elit.utils.io_util.get_exitcode_stdout_stderr",
"tempfile.NamedTemporaryFile",
"elit.utils.io_util.get_resource"
] | [((928, 1038), 'elit.utils.io_util.get_resource', 'get_resource', (["('https://github.com/elikip/bist-parser/archive/master.zip' +\n '#bmstparser/src/utils/eval.pl')"], {}), "('https://github.com/elikip/bist-parser/archive/master.zip' +\n '#bmstparser/src/utils/eval.pl')\n", (940, 1038), False, 'from elit.utils.i... |
#from oauthlib.oauth2.rfc6749.clients import backend_application
__author__ = 'Dylan'
from OpenGL.GL import *
from OpenGL.GLU import *
from math import cos, sin, radians
import pygame
from macros import *
import copy
import threading
import numpy as np
loading_objects = 0
class Object:
def __init__(self , width ... | [
"threading.Thread",
"copy.deepcopy",
"math.radians",
"math.sin",
"pygame.image.tostring",
"numpy.array",
"math.cos",
"pygame.font.Font",
"pygame.image.load"
] | [((3525, 3566), 'pygame.image.tostring', 'pygame.image.tostring', (['surface', '"""RGBA"""', '(1)'], {}), "(surface, 'RGBA', 1)\n", (3546, 3566), False, 'import pygame\n'), ((12643, 12729), 'threading.Thread', 'threading.Thread', ([], {'target': 'self.loadFile', 'name': '"""ObjectLoad"""', 'args': '[filename, swapyz]'}... |
import os
import socket
import struct
import time
import logging
from dataclasses import dataclass
from enum import Enum
from string import Template
import subprocess
from typing import Generator
from multiprocessing import Process, Queue
from phd.satellite.mean_table import MeanTable
from phd.satellite.run import Que... | [
"subprocess.Popen",
"phd.satellite.run.QueueData",
"phd.satellite.satellite_pb2.MeanRun",
"socket.socket",
"struct.unpack",
"phd.satellite.run.request_generator",
"phd.satellite.mean_table.MeanTable",
"string.Template",
"os.cpu_count",
"logging.info",
"time.sleep",
"multiprocessing.Queue",
"... | [((412, 578), 'string.Template', 'Template', (['"""/npm/geometry/type gdml\n/npm/geometry/gdml ${gdml}\n/npm/satellite/output socket\n/npm/satellite/port ${port}\n/npm/satellite/detector ${mode}\n"""'], {}), '(\n """/npm/geometry/type gdml\n/npm/geometry/gdml ${gdml}\n/npm/satellite/output socket\n/npm/satellite/por... |
"""
mbed tools
Copyright (c) 2018 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,... | [
"twisted.web.http_headers.Headers",
"twisted.web.client.readBody",
"logging.basicConfig",
"random.uniform",
"twisted.internet.defer.DeferredSemaphore",
"twisted.internet.reactor.addSystemEventTrigger",
"json.dumps",
"twisted.web.client.Agent",
"random.random",
"twisted.python.log.PythonLoggingObse... | [((1127, 1154), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1144, 1154), False, 'import logging\n'), ((3640, 3654), 'twisted.web.client.Agent', 'Agent', (['reactor'], {}), '(reactor)\n', (3645, 3654), False, 'from twisted.web.client import Agent, readBody\n'), ((3725, 3813), 'twisted.... |
import path2insight
def test_bigrams():
data = ["first", "second", "third", "fourth"]
expected = [('first', 'second'), ('second', 'third'), ('third', 'fourth')]
result = list(path2insight.ngrams(data, 2))
assert result == expected
result = list(path2insight.bigrams(data))
assert result == ... | [
"path2insight.bigrams",
"path2insight.ngrams",
"path2insight.trigrams"
] | [((192, 220), 'path2insight.ngrams', 'path2insight.ngrams', (['data', '(2)'], {}), '(data, 2)\n', (211, 220), False, 'import path2insight\n'), ((271, 297), 'path2insight.bigrams', 'path2insight.bigrams', (['data'], {}), '(data)\n', (291, 297), False, 'import path2insight\n'), ((500, 528), 'path2insight.ngrams', 'path2i... |
from gw_bot.helpers.Lambda_Helpers import slack_message
from gw_bot.api.API_OSS_Slack import API_OSS_Slack
from gw_bot.api.commands.Participant_Commands import Participant_Commands
from gw_bot.api.commands.Participant_Commands import send_screenshot_to_slack
class Schedule_Commands:
@staticmethod
def today(... | [
"osbot_aws.apis.Lambda.Lambda",
"gw_bot.api.API_OSS_Slack.API_OSS_Slack",
"gw_bot.helpers.Lambda_Helpers.slack_message",
"gw_bot.api.commands.Participant_Commands.send_screenshot_to_slack"
] | [((364, 472), 'gw_bot.helpers.Lambda_Helpers.slack_message', 'slack_message', (['""":mag_right: Ok, fetching the latest version of today\'s schedule :mag:"""', '[]', 'channel'], {}), '(\n ":mag_right: Ok, fetching the latest version of today\'s schedule :mag:",\n [], channel)\n', (377, 472), False, 'from gw_bot.h... |
from datetime import datetime
from django.test import TestCase
from applications.models import Application
from ..factories._applications import ApplicationFactory
from ..factories._companies import CompanyFactory
from ..factories._openings import OpeningFactory, OpeningWithQuestionFactory
from ..factories._openings ... | [
"datetime.datetime.now",
"applications.models.Application.objects.count"
] | [((1397, 1411), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (1409, 1411), False, 'from datetime import datetime\n'), ((1951, 1978), 'applications.models.Application.objects.count', 'Application.objects.count', ([], {}), '()\n', (1976, 1978), False, 'from applications.models import Application\n')] |
"""Test JSON."""
import unittest
from . import validate_json_format
import os
import fnmatch
class TestSettings(unittest.TestCase):
"""Test JSON settings."""
def _get_json_files(self, pattern, folder='.'):
"""Get JSON files."""
for root, dirnames, filenames in os.walk(folder):
fo... | [
"fnmatch.filter",
"os.walk",
"os.path.join"
] | [((289, 304), 'os.walk', 'os.walk', (['folder'], {}), '(folder)\n', (296, 304), False, 'import os\n'), ((334, 368), 'fnmatch.filter', 'fnmatch.filter', (['filenames', 'pattern'], {}), '(filenames, pattern)\n', (348, 368), False, 'import fnmatch\n'), ((392, 420), 'os.path.join', 'os.path.join', (['root', 'filename'], {}... |
from subprocess import CompletedProcess
from version_helper import Git
def test_construction():
"""Test the Git() constructor"""
assert Git()
def test_call_process():
"""Test the static method _call_process()"""
proc = Git._call_process(['git', '--version'])
assert isinstance(proc, CompletedPro... | [
"version_helper.Git._call_process",
"version_helper.Git.exec_path",
"version_helper.Git"
] | [((147, 152), 'version_helper.Git', 'Git', ([], {}), '()\n', (150, 152), False, 'from version_helper import Git\n'), ((240, 279), 'version_helper.Git._call_process', 'Git._call_process', (["['git', '--version']"], {}), "(['git', '--version'])\n", (257, 279), False, 'from version_helper import Git\n'), ((556, 575), 'ver... |
#coding=utf-8
#
'''
File feature description here
'''
from django import template
register = template.Library()
@register.filter
def sliceplus(list, sliceNum, startIndex=0):
return {'items': list[startIndex:startIndex+sliceNum], 'restNum': len(list[startIndex+sliceNum:])}
| [
"django.template.Library"
] | [((97, 115), 'django.template.Library', 'template.Library', ([], {}), '()\n', (113, 115), False, 'from django import template\n')] |
# -*- coding:utf-8 -*-
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
class PostDoesNotExistError(Exception):
""" Easy to understand naming c... | [
"future.standard_library.install_aliases"
] | [((208, 242), 'future.standard_library.install_aliases', 'standard_library.install_aliases', ([], {}), '()\n', (240, 242), False, 'from future import standard_library\n')] |
import sys
import logging
import structlog
from pathlib import Path
from lxml.etree import _Element, tostring
from structlog.contextvars import merge_contextvars
from opensanctions import settings
from opensanctions.model import Issue
def store_event(logger, log_method, data):
for key, value in data.items():
... | [
"structlog.processors.StackInfoRenderer",
"structlog.processors.UnicodeDecoder",
"structlog.processors.TimeStamper",
"logging.StreamHandler",
"opensanctions.model.Issue.save",
"structlog.dev.ConsoleRenderer",
"lxml.etree.tostring",
"structlog.stdlib.LoggerFactory",
"logging.getLogger"
] | [((1626, 1659), 'logging.StreamHandler', 'logging.StreamHandler', (['sys.stderr'], {}), '(sys.stderr)\n', (1647, 1659), False, 'import logging\n'), ((1738, 1757), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (1755, 1757), False, 'import logging\n'), ((676, 692), 'opensanctions.model.Issue.save', 'Issue.s... |
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='pyPodcastParser',
... | [
"os.path.dirname",
"os.path.join",
"setuptools.find_packages"
] | [((109, 131), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (121, 131), False, 'from os import path\n'), ((192, 221), 'os.path.join', 'path.join', (['here', '"""README.rst"""'], {}), "(here, 'README.rst')\n", (201, 221), False, 'from os import path\n'), ((1386, 1437), 'setuptools.find_packages'... |
from django.shortcuts import render, redirect
from datetime import datetime
from core.views import initRequest
from django.db import connection, transaction
from django.http import HttpResponse
from django.http import HttpResponseRedirect
from django.urls import reverse
import json, re, os
from collections import defau... | [
"re.split",
"core.views.initRequest",
"django.db.connection.cursor",
"json.dumps",
"django.urls.reverse",
"re.search",
"django.shortcuts.render",
"re.sub",
"json.JSONEncoder.default"
] | [((653, 673), 'core.views.initRequest', 'initRequest', (['request'], {}), '(request)\n', (664, 673), False, 'from core.views import initRequest\n'), ((1111, 1130), 'django.db.connection.cursor', 'connection.cursor', ([], {}), '()\n', (1128, 1130), False, 'from django.db import connection, transaction\n'), ((10874, 1094... |
import gc
import os
import sys
from typing import Any, Optional
if sys.version_info > (3, 9):
from collections.abc import MutableSet
else:
from typing import MutableSet
from typing import Tuple
import sqlitecollections as sc
from .common import BenchmarkBase, Comparison
benchmarks_dir = os.path.dirname(os.... | [
"gc.collect",
"os.path.abspath"
] | [((317, 342), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (332, 342), False, 'import os\n'), ((1165, 1177), 'gc.collect', 'gc.collect', ([], {}), '()\n', (1175, 1177), False, 'import gc\n'), ((1186, 1198), 'gc.collect', 'gc.collect', ([], {}), '()\n', (1196, 1198), False, 'import gc\n'), (... |
import os
import weakref
from contextlib import contextmanager
from io import RawIOBase, UnsupportedOperation
from corehq.blobs.exceptions import NotFound
from corehq.blobs.interface import AbstractBlobDB
from corehq.blobs.util import check_safe_key
from corehq.util.datadog.gauges import datadog_bucket_timer
from core... | [
"dimagi.utils.chunked.chunked",
"corehq.blobs.util.check_safe_key",
"os.fstat",
"corehq.util.metrics.metrics_counter",
"botocore.client.Config",
"corehq.blobs.exceptions.NotFound",
"dimagi.utils.logging.notify_exception",
"weakref.ref"
] | [((2233, 2257), 'corehq.blobs.util.check_safe_key', 'check_safe_key', (['meta.key'], {}), '(meta.key)\n', (2247, 2257), False, 'from corehq.blobs.util import check_safe_key\n'), ((3009, 3028), 'corehq.blobs.util.check_safe_key', 'check_safe_key', (['key'], {}), '(key)\n', (3023, 3028), False, 'from corehq.blobs.util im... |
from functools import partial
import jax.numpy as np
from jax import lax, vmap
from fundl.activations import sigmoid, tanh
from fundl.utils import l2_normalize
def mlstm1900(params: dict, x: np.ndarray) -> np.ndarray:
"""
mLSTM layer for UniRep, in which we pass in the entire dataset.
:param params: A ... | [
"functools.partial",
"jax.vmap",
"jax.lax.scan",
"fundl.activations.sigmoid",
"fundl.utils.l2_normalize",
"jax.numpy.matmul",
"jax.numpy.split",
"fundl.activations.tanh",
"jax.numpy.zeros"
] | [((1845, 1877), 'jax.numpy.zeros', 'np.zeros', (["params['wmh'].shape[0]"], {}), "(params['wmh'].shape[0])\n", (1853, 1877), True, 'import jax.numpy as np\n'), ((1888, 1920), 'jax.numpy.zeros', 'np.zeros', (["params['wmh'].shape[0]"], {}), "(params['wmh'].shape[0])\n", (1896, 1920), True, 'import jax.numpy as np\n'), (... |
"""This file contains NodeFlow samplers."""
import sys
import numpy as np
import threading
from numbers import Integral
import traceback
from ..._ffi.function import _init_api
from ... import utils
from ...nodeflow import NodeFlow
from ... import backend as F
try:
import Queue as queue
except ImportError:
im... | [
"traceback.format_exc",
"queue.Queue"
] | [((3909, 3939), 'queue.Queue', 'queue.Queue', (['self.num_prefetch'], {}), '(self.num_prefetch)\n', (3920, 3939), False, 'import queue\n'), ((3965, 3978), 'queue.Queue', 'queue.Queue', ([], {}), '()\n', (3976, 3978), False, 'import queue\n'), ((4002, 4032), 'queue.Queue', 'queue.Queue', (['self.num_prefetch'], {}), '(s... |
import setuptools
setuptools.setup(
name='TagClassifer',
version='0.1.0',
author='tczhong',
author_email='<EMAIL>',
packages= setuptools.find_packages(),
url='http://pypi.python.org/pypi/PackageName/',
license='LICENSE.txt',
description='Filter file name with sub string',
long_description=op... | [
"setuptools.find_packages"
] | [((142, 168), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (166, 168), False, 'import setuptools\n')] |
import abc
import kfp
from kfp import components, dsl, gcp
import wrapt
from typing import Callable, List
from kungfupipelines.step import Step
from kungfupipelines.cli import StepSwitch
def make_sequence(ops: List[dsl.ContainerOp]) -> None:
"""
Links a sequence of pipeline operations so that they are configu... | [
"kungfupipelines.cli.StepSwitch",
"kfp.dsl.pipeline",
"kfp.compiler.Compiler"
] | [((4990, 5038), 'kfp.dsl.pipeline', 'dsl.pipeline', ([], {'name': 'name', 'description': 'description'}), '(name=name, description=description)\n', (5002, 5038), False, 'from kfp import components, dsl, gcp\n'), ((4612, 4635), 'kungfupipelines.cli.StepSwitch', 'StepSwitch', (['name', 'steps'], {}), '(name, steps)\n', (... |
from test.test_support import (TESTFN, run_unittest, import_module, unlink,
requires, _2G, _4G, gc_collect, cpython_only)
import unittest
import os, re, itertools, socket, sys
mmap = import_module('mmap')
PAGESIZE = mmap.PAGESIZE
class MmapTests(unittest.TestCase):
def ... | [
"unittest.skipIf",
"sys.platform.startswith",
"os.unlink",
"unittest.SkipTest",
"socket.socket",
"os.path.exists",
"sys.getsizeof",
"unittest.skipUnless",
"test.test_support.run_unittest",
"test.test_support.unlink",
"itertools.product",
"test.test_support.import_module",
"re.search"
] | [((220, 241), 'test.test_support.import_module', 'import_module', (['"""mmap"""'], {}), "('mmap')\n", (233, 241), False, 'from test.test_support import TESTFN, run_unittest, import_module, unlink, requires, _2G, _4G, gc_collect, cpython_only\n'), ((20912, 20968), 'unittest.skipUnless', 'unittest.skipUnless', (["(os.nam... |
import numpy as np
import labscript_utils.h5_lock
import h5py
from blacs.tab_base_classes import Worker
import labscript_utils.properties
class TekScopeWorker(Worker):
def init(self):
global TekScope
from .TekScope import TekScope
self.scope = TekScope(self.addr, termination=self.termina... | [
"h5py.File"
] | [((845, 867), 'h5py.File', 'h5py.File', (['h5file', '"""r"""'], {}), "(h5file, 'r')\n", (854, 867), False, 'import h5py\n'), ((2271, 2299), 'h5py.File', 'h5py.File', (['self.h5file', '"""r+"""'], {}), "(self.h5file, 'r+')\n", (2280, 2299), False, 'import h5py\n')] |
from dvc.cli import main
def test_viztracer(tmp_dir, dvc, mocker):
viztracer_profile = mocker.patch("dvc._debug.viztracer_profile")
assert main(["status", "--viztracer"]) == 0
args = viztracer_profile.call_args[1]
assert callable(args["path"])
assert args["max_stack_depth"] == -1
assert mai... | [
"dvc.cli.main"
] | [((150, 181), 'dvc.cli.main', 'main', (["['status', '--viztracer']"], {}), "(['status', '--viztracer'])\n", (154, 181), False, 'from dvc.cli import main\n'), ((317, 374), 'dvc.cli.main', 'main', (["['status', '--viztracer', '--viztracer-depth', '5']"], {}), "(['status', '--viztracer', '--viztracer-depth', '5'])\n", (32... |
import math
from collections import OrderedDict
from typing import Dict, List
from typing import OrderedDict as OrderedDictType
from typing import TypeVar
_T1 = TypeVar("_T1")
_T2 = TypeVar("_T2")
def get_rarity_item(item: _T2, distribution: Dict[_T2, float]) -> float:
if item in distribution:
return distribut... | [
"typing.TypeVar"
] | [((162, 176), 'typing.TypeVar', 'TypeVar', (['"""_T1"""'], {}), "('_T1')\n", (169, 176), False, 'from typing import TypeVar\n'), ((183, 197), 'typing.TypeVar', 'TypeVar', (['"""_T2"""'], {}), "('_T2')\n", (190, 197), False, 'from typing import TypeVar\n')] |
# imports
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.shortcuts import render, get_object_or_404
from django.core import signing
from django.contrib.sites.shortcuts import get_current_site
from django.template.loader import render_to_string
from djan... | [
"django.contrib.auth.decorators.login_required",
"django.core.urlresolvers.reverse",
"django.contrib.sites.shortcuts.get_current_site",
"django.template.loader.render_to_string",
"django.contrib.auth.models.User.objects.filter",
"django.shortcuts.get_object_or_404",
"django.shortcuts.render",
"django.... | [((2712, 2728), 'django.contrib.auth.decorators.login_required', 'login_required', ([], {}), '()\n', (2726, 2728), False, 'from django.contrib.auth.decorators import login_required\n'), ((3373, 3389), 'django.contrib.auth.decorators.login_required', 'login_required', ([], {}), '()\n', (3387, 3389), False, 'from django.... |
from typing import Type
from molpal.objectives.base import Objective
def objective(objective, objective_config: str, **kwargs) -> Type[Objective]:
"""Objective factory function"""
if objective == 'docking':
from molpal.objectives.docking import DockingObjective
return DockingObjective(objectiv... | [
"molpal.objectives.lookup.LookupObjective",
"molpal.objectives.docking.DockingObjective"
] | [((295, 339), 'molpal.objectives.docking.DockingObjective', 'DockingObjective', (['objective_config'], {}), '(objective_config, **kwargs)\n', (311, 339), False, 'from molpal.objectives.docking import DockingObjective\n'), ((446, 489), 'molpal.objectives.lookup.LookupObjective', 'LookupObjective', (['objective_config'],... |
from .base_page import BasePage
from .locators import ProductPageLocators
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
class ProductPage(BasePage):
def should_be_right_book_name(self):
btn = self.browser.find_element(*... | [
"selenium.webdriver.support.expected_conditions.alert_is_present",
"selenium.webdriver.support.ui.WebDriverWait"
] | [((425, 446), 'selenium.webdriver.support.expected_conditions.alert_is_present', 'EC.alert_is_present', ([], {}), '()\n', (444, 446), True, 'from selenium.webdriver.support import expected_conditions as EC\n'), ((387, 418), 'selenium.webdriver.support.ui.WebDriverWait', 'WebDriverWait', (['self.browser', '(10)'], {}), ... |
import re
from robobrowser import RoboBrowser
import urllib
import os
from get_vid import *
from support_functions import *
import sys
def get_hot_videos(Type):
hot_videos = {}
br = RoboBrowser(history=True,parser='lxml')
for i in range(1,4):
url = 'http://91porn.com/v.php?category={}&viewtype=basi... | [
"robobrowser.RoboBrowser"
] | [((191, 231), 'robobrowser.RoboBrowser', 'RoboBrowser', ([], {'history': '(True)', 'parser': '"""lxml"""'}), "(history=True, parser='lxml')\n", (202, 231), False, 'from robobrowser import RoboBrowser\n')] |
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets import Slider, Button, RadioButtons
def plot_quiver(vec_map, data, window=10):
fig,axes = plt.subplots(1)
plt.subplots_adjust(left=0.25, bottom=0.25)
vec_new = np.zeros((int(vec_map.shape[0]/10)+1,vec_map.shape[1], vec_map.shape[... | [
"numpy.meshgrid",
"matplotlib.pyplot.show",
"numpy.sum",
"matplotlib.pyplot.axes",
"matplotlib.pyplot.imshow",
"matplotlib.widgets.Slider",
"matplotlib.pyplot.quiver",
"numpy.linspace",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.subplots"
] | [((172, 187), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)'], {}), '(1)\n', (184, 187), True, 'import matplotlib.pyplot as plt\n'), ((192, 235), 'matplotlib.pyplot.subplots_adjust', 'plt.subplots_adjust', ([], {'left': '(0.25)', 'bottom': '(0.25)'}), '(left=0.25, bottom=0.25)\n', (211, 235), True, 'import matpl... |
import subprocess
from dotinstall.installer.pacman_installer import PacmanInstaller
def test_installer_exists(call_mock):
PacmanInstaller().installer_exists()
call_mock.assert_called_once_with(
["which", "pacman"],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
)
def test... | [
"dotinstall.installer.pacman_installer.PacmanInstaller"
] | [((129, 146), 'dotinstall.installer.pacman_installer.PacmanInstaller', 'PacmanInstaller', ([], {}), '()\n', (144, 146), False, 'from dotinstall.installer.pacman_installer import PacmanInstaller\n'), ((360, 377), 'dotinstall.installer.pacman_installer.PacmanInstaller', 'PacmanInstaller', ([], {}), '()\n', (375, 377), Fa... |
"""
Interface to build and run models through command line
"""
import json
import click
from torecsys import __version__
from torecsys.trainer import TorecsysModule
def print_version(ctx, value):
if not value or ctx.resilient_parsing:
return
click.echo(f'The current version is: {__version__}.')
... | [
"json.loads",
"click.option",
"click.echo",
"click.Choice",
"torecsys.trainer.TorecsysModule.build",
"click.group"
] | [((335, 348), 'click.group', 'click.group', ([], {}), '()\n', (346, 348), False, 'import click\n'), ((350, 452), 'click.option', 'click.option', (['"""--version"""'], {'is_flag': '(True)', 'callback': 'print_version', 'expose_value': '(False)', 'is_eager': '(True)'}), "('--version', is_flag=True, callback=print_version... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from os.path import basename, join, realpath
import re
import boto3
from ez_repo.storage import Storage
from ez_repo.error import ExpressionError
S3_RESOURCE = boto3.resource("s3")
class S3Storage(Storage):
"""
Class implementing a S3 storage device.
"""
... | [
"ez_repo.storage.Storage.__init__",
"os.path.basename",
"os.path.realpath",
"boto3.resource",
"re.search",
"re.compile"
] | [((211, 231), 'boto3.resource', 'boto3.resource', (['"""s3"""'], {}), "('s3')\n", (225, 231), False, 'import boto3\n'), ((408, 440), 'ez_repo.storage.Storage.__init__', 'Storage.__init__', (['self', 'endpoint'], {}), '(self, endpoint)\n', (424, 440), False, 'from ez_repo.storage import Storage\n'), ((1350, 1363), 'os.p... |
# -*- coding: utf-8 -*-
"""
@author: <NAME>
@contact: <EMAIL>
@time: 9:11 PM
"""
import sys
if './' not in sys.path: sys.path.append('./')
from screws.freeze.base import FrozenOnly
class _3nCSCG_SpaceAllocator(FrozenOnly):
""""""
@classmethod
def ___space_name___(cls):
return {'polynomials': "_... | [
"sys.path.append"
] | [((118, 139), 'sys.path.append', 'sys.path.append', (['"""./"""'], {}), "('./')\n", (133, 139), False, 'import sys\n')] |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import numpy as np
import unittest
from SimPEG.electromagnetics import natural_source as nsem
from scipy.constants import mu_0
TOLr = 5e-2
TOL = 1e-4
FLR = 1e-20 # "zero", so if residual below this --> pass ... | [
"unittest.main",
"numpy.random.seed",
"numpy.abs",
"SimPEG.electromagnetics.natural_source.utils.test_utils.random",
"SimPEG.electromagnetics.natural_source.utils.test_utils.halfSpace",
"numpy.random.rand",
"SimPEG.electromagnetics.natural_source.utils.test_utils.setupSimpegNSEM_ePrimSec"
] | [((536, 626), 'SimPEG.electromagnetics.natural_source.utils.test_utils.setupSimpegNSEM_ePrimSec', 'nsem.utils.test_utils.setupSimpegNSEM_ePrimSec', (['inputSetup'], {'comp': 'comp', 'singleFreq': 'freq'}), '(inputSetup, comp=comp,\n singleFreq=freq)\n', (582, 626), True, 'from SimPEG.electromagnetics import natural_... |
# Simple demo of the MAX9744 20W class D amplifier I2C control.
# This show how to set the volume of the amplifier.
# Author: <NAME>
import board
import busio
import adafruit_max9744
# Initialize I2C bus.
i2c = busio.I2C(board.SCL, board.SDA)
# Initialize amplifier.
amp = adafruit_max9744.MAX9744(i2c)
... | [
"busio.I2C",
"adafruit_max9744.MAX9744"
] | [((224, 255), 'busio.I2C', 'busio.I2C', (['board.SCL', 'board.SDA'], {}), '(board.SCL, board.SDA)\n', (233, 255), False, 'import busio\n'), ((290, 319), 'adafruit_max9744.MAX9744', 'adafruit_max9744.MAX9744', (['i2c'], {}), '(i2c)\n', (314, 319), False, 'import adafruit_max9744\n')] |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import os, sys, io
import json
import argparse
from pprint import pprint
import optuna
from train_projection_heads import main
# from mock_trainer import main
global gpu_id
global env_name
def _parse_args():
parser = argparse.ArgumentParser(description="distributed ... | [
"train_projection_heads.main",
"pprint.pprint",
"argparse.ArgumentParser",
"optuna.create_study"
] | [((271, 400), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""distributed hyper-parameter search for {gloss,context} projection heads trainer."""'}), "(description=\n 'distributed hyper-parameter search for {gloss,context} projection heads trainer.'\n )\n", (294, 400), False, 'impor... |
# -*- coding: utf-8 -*-
# vim: sw=2 sts=2
###############################################################################
# This file is part of metalibm (https://github.com/kalray/metalibm)
###############################################################################
# MIT License
#
# Copyright (c) 2018 Kalray
#
# ... | [
"metalibm_core.core.ml_operations.Multiplication",
"metalibm_core.core.ml_operations.ExponentExtraction",
"metalibm_core.core.ml_operations.Constant",
"metalibm_core.core.ml_operations.Subtraction",
"metalibm_core.core.ml_operations.FMS",
"metalibm_core.core.ml_operations.FMA",
"metalibm_core.core.ml_op... | [((1725, 1747), 'sollya.SollyaObject', 'sollya.SollyaObject', (['(2)'], {}), '(2)\n', (1744, 1747), False, 'import sollya\n'), ((2750, 2768), 'metalibm_core.core.ml_operations.Subtraction', 'Subtraction', (['(16)', 'm'], {}), '(16, m)\n', (2761, 2768), False, 'from metalibm_core.core.ml_operations import BitLogicRightS... |
from jack import readers
from jack.core import QASetting
fastqa_reader = readers.reader_from_file("./fastqa_reader")
# Test on a file with stored, unformatted data
support = ''
with open('testdata.txt') as myfile:
support = myfile.read()
#question = "Whom does he do?"
#question = "To whom did the Virgin Mary allege... | [
"jack.readers.reader_from_file",
"jack.core.QASetting"
] | [((74, 117), 'jack.readers.reader_from_file', 'readers.reader_from_file', (['"""./fastqa_reader"""'], {}), "('./fastqa_reader')\n", (98, 117), False, 'from jack import readers\n'), ((417, 464), 'jack.core.QASetting', 'QASetting', ([], {'question': 'question', 'support': '[support]'}), '(question=question, support=[supp... |
from app import create_app
from flask_script import Manager
from config import config
config_class = config['development']
app = create_app(config_class)
if __name__ == '__main__':
manager = Manager(app)
manager.run()
| [
"app.create_app",
"flask_script.Manager"
] | [((130, 154), 'app.create_app', 'create_app', (['config_class'], {}), '(config_class)\n', (140, 154), False, 'from app import create_app\n'), ((196, 208), 'flask_script.Manager', 'Manager', (['app'], {}), '(app)\n', (203, 208), False, 'from flask_script import Manager\n')] |
# Copyright 2019 DeepMind Technologies Ltd. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | [
"numpy.ones",
"numpy.zeros",
"numpy.arange",
"numpy.random.choice"
] | [((4430, 4475), 'numpy.zeros', 'np.zeros', (['num_legal_actions'], {'dtype': 'np.float64'}), '(num_legal_actions, dtype=np.float64)\n', (4438, 4475), True, 'import numpy as np\n'), ((5721, 5756), 'numpy.random.choice', 'np.random.choice', (['outcomes'], {'p': 'probs'}), '(outcomes, p=probs)\n', (5737, 5756), True, 'imp... |
"""
Common constants and functions used throughout the package.
"""
import sys
from itertools import count
from math import ceil, floor
from random import random, randint
TITLE = '3-D Rendering Project'
_previous_randint = sys.maxsize
def next_randint(a: int, b: int) -> int:
""" Return random in... | [
"math.floor",
"random.randint",
"math.ceil"
] | [((634, 647), 'random.randint', 'randint', (['a', 'b'], {}), '(a, b)\n', (641, 647), False, 'from random import random, randint\n'), ((1908, 1919), 'math.ceil', 'ceil', (['limit'], {}), '(limit)\n', (1912, 1919), False, 'from math import ceil, floor\n'), ((1964, 1976), 'math.floor', 'floor', (['limit'], {}), '(limit)\n... |
import pandas as pd
from sklearn.linear_model import LogisticRegression
X_train = pd.read_table('ch06/train.feature.txt', header=None)
y_train = pd.read_table('ch06/train.txt', header=None)[1]
clf = LogisticRegression(penalty='l2', solver='sag', random_state=0)
clf.fit(X_train, y_train)
y_train = clf.predict(X_train... | [
"pandas.read_table",
"sklearn.linear_model.LogisticRegression"
] | [((84, 136), 'pandas.read_table', 'pd.read_table', (['"""ch06/train.feature.txt"""'], {'header': 'None'}), "('ch06/train.feature.txt', header=None)\n", (97, 136), True, 'import pandas as pd\n'), ((202, 264), 'sklearn.linear_model.LogisticRegression', 'LogisticRegression', ([], {'penalty': '"""l2"""', 'solver': '"""sag"... |
from setuptools import setup
setup(
name='machineLearning',
version='1.0',
py_modules=['mlks.main'],
install_requires=[
'Click', 'keras', 'matplotlib', 'numpy', 'tensorflow', 'scikit-learn', 'pandas', 'seaborn', 'six'
],
entry_points='''
[console_scripts]
ml=mlks.main:cl... | [
"setuptools.setup"
] | [((30, 355), 'setuptools.setup', 'setup', ([], {'name': '"""machineLearning"""', 'version': '"""1.0"""', 'py_modules': "['mlks.main']", 'install_requires': "['Click', 'keras', 'matplotlib', 'numpy', 'tensorflow', 'scikit-learn',\n 'pandas', 'seaborn', 'six']", 'entry_points': '"""\n [console_scripts]\n ... |
import pytest
@pytest.mark.parametrize("pokemon_name, content",[
("pikachu", "electricity"),
("snorlax", "rotund")
])
# Test overall GET endpoint functionality
def test_api_functionality(get, pokemon_name, content):
"""
GIVEN a Pokemon name
WHEN the response is retrieved
THEN check the sta... | [
"pytest.mark.parametrize"
] | [((16, 122), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""pokemon_name, content"""', "[('pikachu', 'electricity'), ('snorlax', 'rotund')]"], {}), "('pokemon_name, content', [('pikachu', 'electricity'\n ), ('snorlax', 'rotund')])\n", (39, 122), False, 'import pytest\n')] |
import json
import time
from tools import logger as log
def exit_havenbag(**kwargs):
"""
A strategy to exit the haven bag.
Checks if the player is level > 10 and it it's already inside.
:param kwargs: strategy, listener, and orders_queue
:return: the input strategy with a report
"""
stra... | [
"tools.logger.close_logger",
"json.dumps",
"time.sleep",
"time.time",
"tools.logger.get_logger"
] | [((436, 477), 'tools.logger.get_logger', 'log.get_logger', (['__name__', "strategy['bot']"], {}), "(__name__, strategy['bot'])\n", (450, 477), True, 'from tools import logger as log\n'), ((1014, 1025), 'time.time', 'time.time', ([], {}), '()\n', (1023, 1025), False, 'import time\n'), ((1870, 1894), 'tools.logger.close_... |
######################################################################################################################
# Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# ... | [
"lib.scheduler_cli.util.logger.Logger",
"lib.scheduler_cli.boto_retry.get_client_with_retries",
"boto3.Session",
"lib.scheduler_cli.util.custom_resource.CustomResource.handle_request",
"copy.copy",
"json.dumps",
"datetime.datetime.utcnow",
"lib.scheduler_cli.util.custom_resource.CustomResource.__init_... | [((2606, 2651), 'lib.scheduler_cli.util.custom_resource.CustomResource.__init__', 'CustomResource.__init__', (['self', 'event', 'context'], {}), '(self, event, context)\n', (2629, 2651), False, 'from lib.scheduler_cli.util.custom_resource import CustomResource\n'), ((2733, 2750), 'datetime.datetime.utcnow', 'datetime.u... |
# Generated by Django 2.2.1 on 2019-06-22 09:55
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("academy", "0005_auto_20190615_0816"),
]
operations = [
migrations.AlterField(
model_name="grade",
name="status",
... | [
"django.db.models.CharField"
] | [((335, 581), 'django.db.models.CharField', 'models.CharField', ([], {'choices': "[('never-submitted', 'Unsubmitted'), ('sent', 'Sent'), ('grading',\n 'Grading'), ('failed', 'Grading failed'), ('out-of-date', 'Out-of-date'\n ), ('graded', 'Graded')]", 'default': '"""never-submitted"""', 'max_length': '(1024)'}), ... |
# Copyright (c) OpenMMLab. All rights reserved.
import torch.nn as nn
from ..builder import DISTILLERS, build_loss
from .base import BaseDistiller
@DISTILLERS.register_module()
class SelfDistiller(BaseDistiller):
"""Transfer knowledge inside a single model.
Args:
components (dict): The details of th... | [
"torch.nn.ModuleDict"
] | [((619, 634), 'torch.nn.ModuleDict', 'nn.ModuleDict', ([], {}), '()\n', (632, 634), True, 'import torch.nn as nn\n')] |
import pygame
class Player:
def __init__(self, x, y):
self.SIZE = (40, 40)
# creando el rectangulo de nuestro jugador
self.rect = pygame.Rect(x, y, self.SIZE[0], self.SIZE[1])
self.x = x
self.y = y
# velocidad y direccion del jugador.
self.change_x = 0
... | [
"pygame.draw.rect",
"pygame.Rect"
] | [((158, 203), 'pygame.Rect', 'pygame.Rect', (['x', 'y', 'self.SIZE[0]', 'self.SIZE[1]'], {}), '(x, y, self.SIZE[0], self.SIZE[1])\n', (169, 203), False, 'import pygame\n'), ((608, 655), 'pygame.draw.rect', 'pygame.draw.rect', (['screen', 'self.color', 'self.rect'], {}), '(screen, self.color, self.rect)\n', (624, 655), ... |
import pytest
from aws_dataclasses.alexa_skill_event import AlexaSkillEvent
from .util import get_event_dict
@pytest.fixture(scope="module")
def alexa_event_raw():
return get_event_dict("alexa-event.json")
@pytest.fixture(scope="module")
def alexa_event(alexa_event_raw):
return AlexaSkillEvent.from_event(... | [
"aws_dataclasses.alexa_skill_event.AlexaSkillEvent.from_event",
"pytest.fixture"
] | [((114, 144), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (128, 144), False, 'import pytest\n'), ((217, 247), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (231, 247), False, 'import pytest\n'), ((293, 336), 'aws_dataclasses.ale... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | [
"azure.cli.core.commands.client_factory.get_mgmt_service_client"
] | [((556, 619), 'azure.cli.core.commands.client_factory.get_mgmt_service_client', 'get_mgmt_service_client', (['cli_ctx', 'ServiceFabricManagementClient'], {}), '(cli_ctx, ServiceFabricManagementClient)\n', (579, 619), False, 'from azure.cli.core.commands.client_factory import get_mgmt_service_client\n'), ((1910, 1980), ... |
from fractions import Fraction
from itertools import product
import pytest
from omnidice.dice import d6
from omnidice.drv import DRV, p
from omnidice.pools import pool
from omnidice.systems import opend6
def _check(
result, values, botch=Fraction(1, 6), single=True,
totals=None, highest=None,
):
if tota... | [
"omnidice.drv.DRV",
"omnidice.systems.opend6.total",
"omnidice.dice.d6.explode",
"omnidice.systems.opend6.dice",
"omnidice.systems.opend6.test",
"pytest.raises",
"omnidice.pools.pool",
"fractions.Fraction"
] | [((246, 260), 'fractions.Fraction', 'Fraction', (['(1)', '(6)'], {}), '(1, 6)\n', (254, 260), False, 'from fractions import Fraction\n'), ((4417, 4453), 'omnidice.systems.opend6.total', 'opend6.total', (['(2)'], {'botch_cancels': '(False)'}), '(2, botch_cancels=False)\n', (4429, 4453), False, 'from omnidice.systems imp... |
from proposal_config import Config
from RPN_FPN_model import RPN
from RPN_FPN_data_multiprocess import Data
from PIL import Image, ImageDraw
from tqdm import tqdm
import tensorflow as tf
import numpy as np
import scipy.misc
import argparse
import random
import json
import cv2
import sys
import os
class Proposals(obje... | [
"argparse.ArgumentParser",
"tensorflow.gather_nd",
"tensorflow.reshape",
"tensorflow.global_variables",
"os.path.join",
"random.randint",
"tensorflow.logical_and",
"tensorflow.gather",
"os.path.exists",
"tensorflow.concat",
"RPN_FPN_model.RPN",
"tensorflow.placeholder",
"RPN_FPN_data_multipr... | [((9555, 9613), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Generate proposals."""'}), "(description='Generate proposals.')\n", (9578, 9613), False, 'import argparse\n'), ((13031, 13134), 'tensorflow.concat', 'tf.concat', (['[boxes_T_level2, boxes_T_level3, boxes_T_level4, boxes_T_lev... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 3 12:09:24 2021
@author: Thore
Generic algorithms
"""
from mtgss.optimisation import GeneticAlgorithm as ga
import mtgss.tools as t
import numpy as np
from matplotlib import pyplot as plt
if __name__ == '__main__':
#%% Load Card Info
cardl... | [
"mtgss.tools.get_cardlist_from_filename",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"mtgss.tools.get_dict_of_all_ensembles",
"mtgss.tools.CostCalculator",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.legend",
"mtgss.optimisation.GeneticAlgorithm",
"matplotlib.pyplot.figure",
"numpy.ar... | [((326, 387), 'mtgss.tools.get_cardlist_from_filename', 't.get_cardlist_from_filename', (['"""../../tests/resources/dec.cod"""'], {}), "('../../tests/resources/dec.cod')\n", (354, 387), True, 'import mtgss.tools as t\n'), ((445, 484), 'mtgss.tools.get_suppliers_from_cardlist', 't.get_suppliers_from_cardlist', (['cardli... |
"""Frequency series class.
"""
import inspect
import numpy as np
import scipy.optimize
import kontrol.core.math
import kontrol.frequency_series.costs
import kontrol.frequency_series.conversion
class FrequencySeries:
""" Frequency series class
Attributes
----------
f: array
Frequency axis
... | [
"numpy.pad",
"numpy.log",
"numpy.ones",
"numpy.isclose",
"inspect.signature",
"numpy.exp",
"numpy.log10"
] | [((13651, 13679), 'numpy.pad', 'np.pad', (['x', 'pad_width', '"""edge"""'], {}), "(x, pad_width, 'edge')\n", (13657, 13679), True, 'import numpy as np\n'), ((4220, 4234), 'numpy.ones', 'np.ones', (['nargs'], {}), '(nargs)\n', (4227, 4234), True, 'import numpy as np\n'), ((11092, 11102), 'numpy.log', 'np.log', (['x0'], ... |
# -*- coding: utf-8 -*-
'''
Connection library for Amazon S3
:depends: requests
'''
from __future__ import absolute_import, print_function, unicode_literals
# Import Python libs
import logging
# Import 3rd-party libs
try:
import requests
HAS_REQUESTS = True # pylint: disable=W0612
except ImportError:
HA... | [
"salt.ext.six.moves.urllib.parse.quote",
"salt.ext.six.text_type",
"logging.getLogger",
"salt.utils.xmlutil.to_dict",
"requests.request",
"salt._compat.ElementTree.fromstring"
] | [((727, 754), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (744, 754), False, 'import logging\n'), ((3821, 3833), 'salt.ext.six.moves.urllib.parse.quote', '_quote', (['path'], {}), '(path)\n', (3827, 3833), True, 'from salt.ext.six.moves.urllib.parse import quote as _quote\n'), ((8837, ... |
from flask import Flask
from config import Config
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_login import LoginManager
from flask_mail import Mail, Message
from flask_pagedown import PageDown
from flaskext.markdown import Markdown
from flask_wtf.csrf import CSRFProtect
app = F... | [
"flask_wtf.csrf.CSRFProtect",
"flaskext.markdown.Markdown",
"flask.Flask",
"flask_mail.Mail",
"flask_sqlalchemy.SQLAlchemy",
"flask_migrate.Migrate",
"flask_pagedown.PageDown",
"flask_login.LoginManager"
] | [((319, 334), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (324, 334), False, 'from flask import Flask\n'), ((371, 386), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', (['app'], {}), '(app)\n', (381, 386), False, 'from flask_sqlalchemy import SQLAlchemy\n'), ((397, 413), 'flask_migrate.Migrate', 'Migrate',... |
#########################################################
#
# DO NOT EDIT THIS FILE. IT IS GENERATED AUTOMATICALLY. #
# PLEASE LOOK INTO THE README FOR MORE INFORMATION. #
#
#########################################################
# coding: utf-8
# # Getting Caffe1 Models and Datasets
#
# This tutorial will he... | [
"os.path.expanduser",
"os.path.join",
"os.path.exists"
] | [((1162, 1191), 'os.path.expanduser', 'os.path.expanduser', (['"""~/caffe"""'], {}), "('~/caffe')\n", (1180, 1191), False, 'import os\n'), ((3136, 3170), 'os.path.join', 'os.path.join', (['CAFFE_ROOT', '"""models"""'], {}), "(CAFFE_ROOT, 'models')\n", (3148, 3170), False, 'import os\n'), ((3251, 3306), 'os.path.join', ... |
# -*- coding: utf-8 -*-
"""The FileVault Drive Encryption (FVDE) path specification implementation."""
from dfvfs.lib import definitions
from dfvfs.path import factory
from dfvfs.path import path_spec
class FVDEPathSpec(path_spec.PathSpec):
"""FVDE path specification.
Attributes:
encrypted_root_plist (str):... | [
"dfvfs.path.factory.Factory.RegisterPathSpec"
] | [((1944, 1990), 'dfvfs.path.factory.Factory.RegisterPathSpec', 'factory.Factory.RegisterPathSpec', (['FVDEPathSpec'], {}), '(FVDEPathSpec)\n', (1976, 1990), False, 'from dfvfs.path import factory\n')] |
"""creator.py contains the base class for JSON Linked Data Creation"""
__author__ = "<NAME>"
import datetime
import json
class JSONLinkedDataCreator(object):
CONTEXT = {'bf': 'http://bibframe.org/vocab/',
'prov': 'http://www.w3.org/ns/prov#',
'rda': 'http://rdvocab.info',
... | [
"datetime.datetime.utcnow"
] | [((1079, 1105), 'datetime.datetime.utcnow', 'datetime.datetime.utcnow', ([], {}), '()\n', (1103, 1105), False, 'import datetime\n')] |
"""sentence segmentation script for wikipedia."""
import argparse
import glob
import os
import io
import time
import logging
import nltk
from nltk.tokenize import sent_tokenize
from multiprocessing import Pool
parser = argparse.ArgumentParser(description='Sentence tokenizer for BERT documents.')
parser.add_argument('... | [
"argparse.ArgumentParser",
"logging.basicConfig",
"time.time",
"logging.info",
"nltk.tokenize.sent_tokenize",
"io.open",
"multiprocessing.Pool",
"nltk.download",
"os.path.expanduser"
] | [((221, 298), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Sentence tokenizer for BERT documents."""'}), "(description='Sentence tokenizer for BERT documents.')\n", (244, 298), False, 'import argparse\n'), ((746, 768), 'nltk.download', 'nltk.download', (['"""punkt"""'], {}), "('punkt')... |
import logging
import new
import os.path
import shutil
import tempfile
from galaxy.tools.verify.interactor import stage_data_in_history
from .test_toolbox import ToolTestCase
log = logging.getLogger(__name__)
data_managers = None
class DataManagerToolTestCase(ToolTestCase):
"""Test case that runs Data Manager t... | [
"shutil.copy",
"logging.getLogger",
"new.classobj"
] | [((183, 210), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (200, 210), False, 'import logging\n'), ((4800, 4842), 'new.classobj', 'new.classobj', (['name', 'baseclasses', 'namespace'], {}), '(name, baseclasses, namespace)\n', (4812, 4842), False, 'import new\n'), ((2784, 2819), 'shutil.... |
import os
from abc import abstractmethod
from typing import List, Optional
from uuid import uuid4
import PIL
import pytest
import arcade
import arcade.gui
from arcade.gui import UIClickable, UIManager
from arcade.gui.elements.box import UIColorBox
from arcade.gui.layouts.manager import UILayoutManager
from arcade.gui... | [
"uuid.uuid4",
"pytest.param",
"arcade.gui.elements.box.UIColorBox",
"PIL.Image.new"
] | [((2591, 2619), 'pytest.param', 'pytest.param', (['*args'], {'id': 'name'}), '(*args, id=name)\n', (2603, 2619), False, 'import pytest\n'), ((3391, 3440), 'arcade.gui.elements.box.UIColorBox', 'UIColorBox', ([], {'min_size': '(width, height)', 'color': 'color'}), '(min_size=(width, height), color=color)\n', (3401, 3440... |
from boilr import Trainer
from experiment import LVAEExperiment
def main():
experiment = LVAEExperiment()
trainer = Trainer(experiment)
trainer.run()
if __name__ == "__main__":
main()
| [
"experiment.LVAEExperiment",
"boilr.Trainer"
] | [((96, 112), 'experiment.LVAEExperiment', 'LVAEExperiment', ([], {}), '()\n', (110, 112), False, 'from experiment import LVAEExperiment\n'), ((127, 146), 'boilr.Trainer', 'Trainer', (['experiment'], {}), '(experiment)\n', (134, 146), False, 'from boilr import Trainer\n')] |
from imagepy.core.engine import Tool
from skimage.draw import line, circle
def drawline(img, oldp, newp, w, value):
if img.ndim == 2: value = sum(value)/3
oy, ox = line(*[int(round(i)) for i in oldp+newp])
cy, cx = circle(0, 0, w/2+1e-6)
ys = (oy.reshape((-1,1))+cy).clip(0, img.shape[0]-1)
xs = (ox... | [
"skimage.draw.circle"
] | [((228, 255), 'skimage.draw.circle', 'circle', (['(0)', '(0)', '(w / 2 + 1e-06)'], {}), '(0, 0, w / 2 + 1e-06)\n', (234, 255), False, 'from skimage.draw import line, circle\n')] |
import os
from pathlib import Path
import pytest
import pandas as pd
import osmo_jupyter.dataset.source_files as module
@pytest.fixture
def mock_get_experiment_filenames_from_s3(mocker):
return mocker.patch.object(module, "_get_experiment_filenames_from_s3")
def _init_data_dir(parent_dir: Path, directories_to... | [
"pandas.DataFrame",
"pandas.testing.assert_frame_equal",
"osmo_jupyter.dataset.source_files.get_all_experiment_image_filenames",
"pathlib.Path",
"pandas.Series",
"osmo_jupyter.dataset.source_files._get_experiment_data_file_paths_for_type",
"os.path.join",
"osmo_jupyter.dataset.source_files.get_experim... | [((1160, 1262), 'osmo_jupyter.dataset.source_files._get_experiment_data_file_paths_for_type', 'module._get_experiment_data_file_paths_for_type', (['tmp_path', '"""this does NOT exist as a subdirectory"""'], {}), "(tmp_path,\n 'this does NOT exist as a subdirectory')\n", (1207, 1262), True, 'import osmo_jupyter.datas... |
# Copyright 2022 The Flax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | [
"flax.serialization.register_serialization_state",
"jax.tree_util.tree_flatten",
"jax.tree_util.register_pytree_node"
] | [((2716, 2814), 'jax.tree_util.register_pytree_node', 'tree_util.register_pytree_node', (['DotGetter', '(lambda x: ((x._data,), ()))', '(lambda _, data: data[0])'], {}), '(DotGetter, lambda x: ((x._data,), ()), lambda\n _, data: data[0])\n', (2746, 2814), False, 'from jax import tree_util\n'), ((2906, 3025), 'flax.s... |
# -*- coding: utf-8 -*-
from os import getpid as os_getpid
from multiprocessing import Process, Queue
from drummer.sockets.server import SocketServer
class Listener(Process):
""" This worker starts socket server """
def __init__(self, config):
super().__init__()
self.config = config
... | [
"drummer.sockets.server.SocketServer",
"os.getpid",
"multiprocessing.Queue"
] | [((371, 379), 'multiprocessing.Queue', 'Queue', (['(1)'], {}), '(1)\n', (376, 379), False, 'from multiprocessing import Process, Queue\n'), ((438, 446), 'multiprocessing.Queue', 'Queue', (['(1)'], {}), '(1)\n', (443, 446), False, 'from multiprocessing import Process, Queue\n'), ((592, 603), 'os.getpid', 'os_getpid', ([... |
import pytest
import torch
from torch import Tensor
from torch_complex.tensor import ComplexTensor
from espnet2.enh.separator.conformer_separator import ConformerSeparator
@pytest.mark.parametrize("input_dim", [15])
@pytest.mark.parametrize("num_spk", [1, 2])
@pytest.mark.parametrize("adim", [8])
@pytest.mark.parame... | [
"torch_complex.tensor.ComplexTensor",
"espnet2.enh.separator.conformer_separator.ConformerSeparator",
"pytest.raises",
"torch.rand",
"pytest.mark.parametrize",
"torch.tensor"
] | [((176, 218), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""input_dim"""', '[15]'], {}), "('input_dim', [15])\n", (199, 218), False, 'import pytest\n'), ((220, 262), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""num_spk"""', '[1, 2]'], {}), "('num_spk', [1, 2])\n", (243, 262), False, 'import... |
import ismrmrd
import os
import itertools
import logging
import numpy as np
import numpy.fft as fft
import matplotlib.pyplot as plt
import xml.dom.minidom
import base64
import ctypes
import re
import mrdhelper
# Folder for debug output files
debugFolder = "/tmp/share/debug"
def process(connection, config, metadata):... | [
"numpy.stack",
"logging.error",
"numpy.save",
"logging.debug",
"matplotlib.pyplot.get_cmap",
"os.makedirs",
"ismrmrd.get_dtype_from_data_type",
"os.path.exists",
"ismrmrd.Meta.serialize",
"mrdhelper.get_meta_value",
"base64.b64decode",
"ismrmrd.Meta.deserialize",
"logging.info",
"numpy.squ... | [((325, 361), 'logging.info', 'logging.info', (['"""Config: \n%s"""', 'config'], {}), "('Config: \\n%s', config)\n", (337, 361), False, 'import logging\n'), ((2349, 2387), 'numpy.stack', 'np.stack', (['[img.data for img in images]'], {}), '([img.data for img in images])\n', (2357, 2387), True, 'import numpy as np\n'), ... |
import numpy as np
from keras import Sequential
from keras.layers import Dense, GRU, RepeatVector, LSTM, Bidirectional, TimeDistributed
from keras.layers.advanced_activations import LeakyReLU
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelBinarizer, StandardScaler, MinMaxSca... | [
"matplotlib.pyplot.title",
"numpy.load",
"matplotlib.pyplot.show",
"numpy.nan_to_num",
"matplotlib.pyplot.plot",
"seaborn.kdeplot",
"keras.Sequential",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.legend",
"numpy.argmax",
"keras.layers.LSTM",
"keras.layers.GRU",
"numpy.min"... | [((1659, 1675), 'numpy.load', 'np.load', (['"""x.npy"""'], {}), "('x.npy')\n", (1666, 1675), True, 'import numpy as np\n'), ((1719, 1735), 'numpy.nan_to_num', 'np.nan_to_num', (['x'], {}), '(x)\n', (1732, 1735), True, 'import numpy as np\n'), ((1740, 1768), 'numpy.repeat', 'np.repeat', (['x', 'factor'], {'axis': '(0)'}... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.