code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import matplotlib.pyplot as plt
import networkx as nx
import numpy
plt.ion()
# test
def plot_neural_network(mek):
G = nx.DiGraph(numpy.transpose(mek.nn.links))
mylabels = dict(zip(range(len(mek.nn.neurons)),
[to_string(i)+'\n#'
+ str(ix)+'' for (ix, i) in enum... | [
"networkx.layout.spring_layout",
"networkx.relabel_nodes",
"matplotlib.pyplot.gca",
"networkx.draw_networkx_nodes",
"networkx.draw_networkx_labels",
"matplotlib.pyplot.ion",
"numpy.transpose",
"networkx.draw_networkx_edges",
"matplotlib.pyplot.show"
] | [((68, 77), 'matplotlib.pyplot.ion', 'plt.ion', ([], {}), '()\n', (75, 77), True, 'import matplotlib.pyplot as plt\n'), ((354, 383), 'networkx.relabel_nodes', 'nx.relabel_nodes', (['G', 'mylabels'], {}), '(G, mylabels)\n', (370, 383), True, 'import networkx as nx\n'), ((394, 425), 'networkx.layout.spring_layout', 'nx.l... |
import sys
import json
import asyncio
import aiohttp
from aiohttp import web
from urllib.parse import urlparse
class SimpleWebServer:
def __init__(self):
self.loop = asyncio.get_event_loop()
self.app = web.Application(loop=self.loop)
async def check_ack(self):
asyncio.sleep(1)
... | [
"aiohttp.web.run_app",
"json.loads",
"urllib.parse.urlparse",
"aiohttp.web.Application",
"aiohttp.web.route",
"aiohttp.web.HTTPOk",
"asyncio.sleep",
"aiohttp.web.HTTPBadRequest",
"asyncio.get_event_loop",
"json.dump"
] | [((180, 204), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (202, 204), False, 'import asyncio\n'), ((224, 255), 'aiohttp.web.Application', 'web.Application', ([], {'loop': 'self.loop'}), '(loop=self.loop)\n', (239, 255), False, 'from aiohttp import web\n'), ((296, 312), 'asyncio.sleep', 'asynci... |
import csv
import numpy as np
import os
infile = "dopamine_processed.csv"
outfile = "dopamine.csv"
if os.path.exists(outfile):
os.remove(outfile)
with open(infile, 'r', newline='') as f:
i=0
reader = csv.reader(f,delimiter=',')
for row in reader:
with open(outfile, 'a', newline='') as w:
... | [
"os.path.exists",
"csv.writer",
"csv.reader",
"os.remove"
] | [((102, 125), 'os.path.exists', 'os.path.exists', (['outfile'], {}), '(outfile)\n', (116, 125), False, 'import os\n'), ((131, 149), 'os.remove', 'os.remove', (['outfile'], {}), '(outfile)\n', (140, 149), False, 'import os\n'), ((212, 240), 'csv.reader', 'csv.reader', (['f'], {'delimiter': '""","""'}), "(f, delimiter=',... |
"""The sample file to be run in runmanager.
This is the minimal sample that you can load from runmanager to see if your
code is working properly.
"""
from labscript import *
# from user_devices.dummy_device.labscript_devices import DummyDevice
from labscript_devices.DummyPseudoclock.labscript_devices import DummyPse... | [
"user_devices.DummyIntermediateDevices.labscript_devices.DummyIntermediateDevice",
"labscript_devices.DummyPseudoclock.labscript_devices.DummyPseudoclock"
] | [((431, 468), 'labscript_devices.DummyPseudoclock.labscript_devices.DummyPseudoclock', 'DummyPseudoclock', (['"""dummy_pseudoclock"""'], {}), "('dummy_pseudoclock')\n", (447, 468), False, 'from labscript_devices.DummyPseudoclock.labscript_devices import DummyPseudoclock\n'), ((651, 744), 'user_devices.DummyIntermediate... |
import torch
def reparametrize(mu, log_var, device):
"""
Reparametrize based on input mean and log variance
Parameters
----------
mu : torch.tensor
The mean.
log_var : torch.tensor
The log variance.
device : str
The device on which to put the data.
Returns
... | [
"torch.zeros",
"torch.rand_like",
"torch.exp"
] | [((403, 427), 'torch.exp', 'torch.exp', (['(0.5 * log_var)'], {}), '(0.5 * log_var)\n', (412, 427), False, 'import torch\n'), ((440, 462), 'torch.rand_like', 'torch.rand_like', (['sigma'], {}), '(sigma)\n', (455, 462), False, 'import torch\n'), ((1640, 1660), 'torch.zeros', 'torch.zeros', (['B', 'n', 'n'], {}), '(B, n,... |
from django.shortcuts import render,redirect,get_object_or_404,HttpResponseRedirect
from django.contrib.auth.decorators import login_required
from django.contrib.auth import login, authenticate
from .forms import *
from .models import NeighborHood,Profile,Post,Business
from django.contrib.sites.shortcuts import get_cu... | [
"django.shortcuts.render",
"django.contrib.auth.authenticate",
"django.contrib.messages.error",
"django.shortcuts.get_object_or_404",
"django.contrib.auth.login",
"django.contrib.messages.info",
"django.contrib.auth.forms.AuthenticationForm",
"django.shortcuts.redirect",
"django.contrib.auth.decorat... | [((1012, 1056), 'django.contrib.auth.decorators.login_required', 'login_required', ([], {'login_url': '"""/accounts/login/"""'}), "(login_url='/accounts/login/')\n", (1026, 1056), False, 'from django.contrib.auth.decorators import login_required\n'), ((2165, 2209), 'django.contrib.auth.decorators.login_required', 'logi... |
###############################################################################
#
# IBT: Isolated Build Tool
# Copyright (C) 2016, <NAME>. All rights reserved.
#
# Simple wrappers around Docker etc. for fully isolated build environments
#
###############################################################################
... | [
"ibt.util.get_user_info"
] | [((521, 547), 'ibt.util.get_user_info', 'get_user_info', (['working_dir'], {}), '(working_dir)\n', (534, 547), False, 'from ibt.util import get_user_info\n')] |
"""This is a cog for a discord.py bot.
It hides the help command and adds these commands:
helpall show all commands (including all hidden ones)
The commands will output to the current channel or to a dm channel
according to the pm_help kwarg of the bot.
Only users that have an admin role can use the ... | [
"itertools.groupby",
"discord.Embed",
"discord.ext.commands.command",
"discord.ext.commands.DefaultHelpCommand"
] | [((4723, 4773), 'discord.ext.commands.command', 'commands.command', ([], {'aliases': "['halpall']", 'hidden': '(True)'}), "(aliases=['halpall'], hidden=True)\n", (4739, 4773), False, 'from discord.ext import commands\n'), ((838, 858), 'discord.Embed', 'Embed', ([], {'color': '(3066993)'}), '(color=3066993)\n', (843, 85... |
import sys, statistics
def solution(N):
m = int(round(statistics.mean(N))) # average for (n - i)**2
d = int(statistics.median(N)) # average for abs(n - i)
return min(sum((n - i)**2 + abs(n - i) for n in N) for i in range(m, d, (d > m) - (d < m))) // 2
print(solution([int(n) for n in sys.stdin.read(... | [
"statistics.median",
"sys.stdin.read",
"statistics.mean"
] | [((118, 138), 'statistics.median', 'statistics.median', (['N'], {}), '(N)\n', (135, 138), False, 'import sys, statistics\n'), ((59, 77), 'statistics.mean', 'statistics.mean', (['N'], {}), '(N)\n', (74, 77), False, 'import sys, statistics\n'), ((305, 321), 'sys.stdin.read', 'sys.stdin.read', ([], {}), '()\n', (319, 321)... |
# Copyright 2021 The T5 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 writi... | [
"itertools.cycle",
"itertools.islice",
"t5.models.utils.write_lines_to_file",
"tensorflow.compat.v1.io.gfile.makedirs",
"torch.utils.tensorboard.writer.SummaryWriter",
"torch.load",
"absl.logging.info",
"os.path.join",
"tensorflow.compat.v1.io.gfile.exists",
"tensorflow.compat.v1.data.Dataset.from... | [((3534, 3658), 'mesh_tensorflow.transformer.dataset.pack_or_pad', 'transformer_dataset.pack_or_pad', (['dataset', 'sequence_length'], {'pack': '(False)', 'feature_keys': 'output_features', 'ensure_eos': 'eos_keys'}), '(dataset, sequence_length, pack=False,\n feature_keys=output_features, ensure_eos=eos_keys)\n', (3... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 17 17:59:36 2018
@author: avelinojaver
"""
import numpy as np
import cv2
from functools import partial
import json
from pathlib import Path
import pandas as pd
from tierpsy.analysis.ske_create.helperIterROI import generateMoviesROI
mask_file = ... | [
"tierpsy.analysis.ske_create.helperIterROI.generateMoviesROI",
"pathlib.Path"
] | [((320, 430), 'pathlib.Path', 'Path', (['"""/Users/avelinojaver/OneDrive - Nexus365/worms/Bertie_movies/CX11314_Ch1_04072017_103259.hdf5"""'], {}), "(\n '/Users/avelinojaver/OneDrive - Nexus365/worms/Bertie_movies/CX11314_Ch1_04072017_103259.hdf5'\n )\n", (324, 430), False, 'from pathlib import Path\n'), ((981, 1... |
import time
class Wait(object):
def __init__(self):
pass
def wait_for_state_change(self, expected_status, from_status):
for i in range(0, 20):
if expected_status != from_status:
break
time.sleep(1)
| [
"time.sleep"
] | [((251, 264), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (261, 264), False, 'import time\n')] |
"""
Overview
--------
general info about this module
Classes and Inheritance Structure
----------------------------------------------
.. inheritance-diagram::
Summary
---------
.. autosummary::
list of the module you want
Module API
----------
"""
from __future__ import absolute_import, division, print... | [
"numpy.float",
"astropy.coordinates.Angle",
"astropy.time.TimeDelta",
"builtins.super",
"builtins.str",
"numpy.append",
"astropy.time.Time",
"ast.literal_eval",
"numpy.int"
] | [((2855, 2881), 'numpy.append', 'np.append', (['self.msk', '(False)'], {}), '(self.msk, False)\n', (2864, 2881), True, 'import numpy as np\n'), ((12208, 12241), 'astropy.time.Time', 'astropyTime', (['value'], {'format': 'format'}), '(value, format=format)\n', (12219, 12241), True, 'from astropy.time import Time as astr... |
#!/usr/bin/python
# R2D2 Python source code to control the Sphero R2D2 droic
# Author: <NAME>
# Version: 1.0
# Date: Sept, 2019
# License: LGPL 3.0
#
# Based on the reverse engineering work
# "Scripting Sphero's Star Wars Droids"
# by ~bbraun.
#
# Thanks to <NAME> who inspired the live chroma key
# methodological appro... | [
"sys.stdin.read",
"tty.setcbreak",
"pygatt.GATTToolBackend"
] | [((2982, 3006), 'pygatt.GATTToolBackend', 'pygatt.GATTToolBackend', ([], {}), '()\n', (3004, 3006), False, 'import pygatt\n'), ((3867, 3891), 'tty.setcbreak', 'tty.setcbreak', (['sys.stdin'], {}), '(sys.stdin)\n', (3880, 3891), False, 'import tty\n'), ((3990, 4007), 'sys.stdin.read', 'sys.stdin.read', (['(1)'], {}), '(... |
# -*- coding: utf-8 -*-
import numpy as np
from scipy.signal import fftconvolve
def energy(traces, duration, dt=1):
"""
Compute an mean-squared energy measurement for each point of a
seismic section.
:param traces: The data array to use for calculating MS energy.
Must be 1D or 2D n... | [
"numpy.zeros",
"scipy.signal.fftconvolve",
"numpy.ones",
"numpy.ndim"
] | [((651, 673), 'numpy.zeros', 'np.zeros', (['traces.shape'], {}), '(traces.shape)\n', (659, 673), True, 'import numpy as np\n'), ((752, 770), 'numpy.ones', 'np.ones', (['n_samples'], {}), '(n_samples)\n', (759, 770), True, 'import numpy as np\n'), ((779, 794), 'numpy.ndim', 'np.ndim', (['signal'], {}), '(signal)\n', (78... |
import smtplib
from flask_babel import gettext as _
from flask_mail import Mail
from .app import app
from .errors import ViewError
mail = Mail(app)
def try_send_mail(msg):
try:
mail.send(msg)
except smtplib.SMTPServerDisconnected:
raise ViewError(_("Der Server ist nicht korrekt konfigurier... | [
"flask_mail.Mail",
"flask_babel.gettext"
] | [((142, 151), 'flask_mail.Mail', 'Mail', (['app'], {}), '(app)\n', (146, 151), False, 'from flask_mail import Mail\n'), ((277, 323), 'flask_babel.gettext', '_', (['"""Der Server ist nicht korrekt konfiguriert"""'], {}), "('Der Server ist nicht korrekt konfiguriert')\n", (278, 323), True, 'from flask_babel import gettex... |
#!/usr/bin/env python3
from setuptools import setup
setup(
name='savedump',
version="0.1.0",
packages=[
"savedump",
],
entry_points={
'console_scripts': ['savedump=savedump.savedump:main'],
},
author='Delphix Platform Team',
author_email='<EMAIL>',
description='A... | [
"setuptools.setup"
] | [((54, 380), 'setuptools.setup', 'setup', ([], {'name': '"""savedump"""', 'version': '"""0.1.0"""', 'packages': "['savedump']", 'entry_points': "{'console_scripts': ['savedump=savedump.savedump:main']}", 'author': '"""Delphix Platform Team"""', 'author_email': '"""<EMAIL>"""', 'description': '"""Archive linux crash dum... |
import re
import pandas as pd
from constant import shenzhen_data_csv_path
def shape_data(header, body):
"""
该方法用于从pdf获取数据的时候塑造dataframe形式的数据
:param header:
:param body:
:return:
"""
pd.set_option('display.max_rows', None)
df = pd.DataFrame(body)
df.columns = header
return df
... | [
"pandas.DataFrame",
"re.compile",
"pandas.read_csv",
"pandas.set_option"
] | [((214, 253), 'pandas.set_option', 'pd.set_option', (['"""display.max_rows"""', 'None'], {}), "('display.max_rows', None)\n", (227, 253), True, 'import pandas as pd\n'), ((263, 281), 'pandas.DataFrame', 'pd.DataFrame', (['body'], {}), '(body)\n', (275, 281), True, 'import pandas as pd\n'), ((608, 647), 'pandas.set_opti... |
import sys
sys.path.append('..')
import external_test
external_test.runExternalTest()
| [
"external_test.runExternalTest",
"sys.path.append"
] | [((11, 32), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (26, 32), False, 'import sys\n'), ((54, 85), 'external_test.runExternalTest', 'external_test.runExternalTest', ([], {}), '()\n', (83, 85), False, 'import external_test\n')] |
#
# This file is part of LUNA.
#
# Copyright (c) 2020 <NAME> <<EMAIL>>
# SPDX-License-Identifier: BSD-3-Clause
""" Integrated logic analysis helpers. """
import io
import os
import sys
import math
import unittest
import tempfile
import subprocess
from abc import ABCMeta, abstractmethod
from nmigen ... | [
"vcd.gtkw.GTKWSave",
"nmigen.Signal",
"nmigen.DomainRenamer",
"apollo.support.bits.bits.from_bytes",
"os.urandom",
"subprocess.run",
"nmigen.hdl.ast.Rose",
"nmigen.Signal.like",
"nmigen.Module",
"nmigen.lib.cdc.FFSynchronizer",
"nmigen.Cat",
"serial.Serial",
"tempfile.gettempdir",
"unittes... | [((34447, 34462), 'unittest.main', 'unittest.main', ([], {}), '()\n', (34460, 34462), False, 'import unittest\n'), ((2492, 2505), 'nmigen.Cat', 'Cat', (['*signals'], {}), '(*signals)\n', (2495, 2505), False, 'from nmigen import Signal, Module, Cat, Elaboratable, Memory, ClockDomain, DomainRenamer\n'), ((2843, 2913), 'n... |
import os.path
import time
from moler.config import load_config
from moler.device.device import DeviceFactory
from moler.util.moler_test import MolerTest
def outage_callback(device_name, ping_times):
MolerTest.info("Network outage on {}".format(device_name))
ping_times["lost_connection_time"] = time.time()
... | [
"time.sleep",
"time.time",
"moler.util.moler_test.MolerTest.info",
"moler.device.device.DeviceFactory.get_device"
] | [((306, 317), 'time.time', 'time.time', ([], {}), '()\n', (315, 317), False, 'import time\n'), ((361, 389), 'moler.util.moler_test.MolerTest.info', 'MolerTest.info', (['"""Ping works"""'], {}), "('Ping works')\n", (375, 389), False, 'from moler.util.moler_test import MolerTest\n'), ((857, 900), 'moler.device.device.Dev... |
import django_filters
from snippets.models import File, Snippet, Label, SnippetLabel
class FileFilter(django_filters.FilterSet):
class Meta:
model = File
fields = [
'snippet',
'language',
]
class SnippetFilter(django_filters.FilterSet):
favorite = django_fi... | [
"django_filters.BooleanFilter",
"django_filters.NumberFilter"
] | [((311, 390), 'django_filters.BooleanFilter', 'django_filters.BooleanFilter', ([], {'method': '"""filter_is_favorite"""', 'label': '"""Is favorite?"""'}), "(method='filter_is_favorite', label='Is favorite?')\n", (339, 390), False, 'import django_filters\n'), ((408, 485), 'django_filters.BooleanFilter', 'django_filters.... |
import json
import demistomock as demisto
from MyToDoTasksWidget import get_open_to_do_tasks_of_current_user
def test_open_to_do_tasks_of_current_user(mocker):
'''
Given:
- Mock response of 'internalHttpRequest' to '/v2/statistics/widgets/query' that includes an open task and
a close task
... | [
"json.dumps",
"MyToDoTasksWidget.get_open_to_do_tasks_of_current_user"
] | [((1790, 1828), 'MyToDoTasksWidget.get_open_to_do_tasks_of_current_user', 'get_open_to_do_tasks_of_current_user', ([], {}), '()\n', (1826, 1828), False, 'from MyToDoTasksWidget import get_open_to_do_tasks_of_current_user\n'), ((1435, 1455), 'json.dumps', 'json.dumps', (['res_body'], {}), '(res_body)\n', (1445, 1455), F... |
from Interface.StudentCommandLineInterface import CLI
from HelperLibrary.StorageFunctions import StorageFunctions
from HelperLibrary.MarkSheet import MarkSheet
from datetime import datetime
class StudentController:
def __init__(self, student, table_name):
self.student = student
self.table_name = ... | [
"datetime.datetime",
"HelperLibrary.StorageFunctions.StorageFunctions",
"HelperLibrary.MarkSheet.MarkSheet",
"Interface.StudentCommandLineInterface.CLI",
"datetime.datetime.now"
] | [((12241, 12286), 'datetime.datetime', 'datetime', (['birth_year', 'birth_month', 'birth_date'], {}), '(birth_year, birth_month, birth_date)\n', (12249, 12286), False, 'from datetime import datetime\n'), ((14906, 14951), 'datetime.datetime', 'datetime', (['leave_year', 'leave_month', 'leave_date'], {}), '(leave_year, l... |
import random
import os
from decimal import *
os.getcwd()
os.chdir('..')
os.chdir('..')
parent=os.getcwd()
#seed = 15
path1="Model/label2.2gram.lm"
filename1=os.path.join(parent,path1)
with open(filename1,'r',encoding='utf-8') as f:
text=f.read().split('\n')
dict_val={}
words=[]
new_text=[]
for i in range (0,l... | [
"os.chdir",
"random.choice",
"os.path.join",
"os.getcwd"
] | [((46, 57), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (55, 57), False, 'import os\n'), ((58, 72), 'os.chdir', 'os.chdir', (['""".."""'], {}), "('..')\n", (66, 72), False, 'import os\n'), ((73, 87), 'os.chdir', 'os.chdir', (['""".."""'], {}), "('..')\n", (81, 87), False, 'import os\n'), ((95, 106), 'os.getcwd', 'os.ge... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Project: Azimuthal integration
# https://github.com/silx-kit/pyFAI
#
# Copyright (C) 2003-2018 European Synchrotron Radiation Facility, Grenoble,
# France
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of... | [
"logging.getLogger",
"scipy.optimize.optimize.fmin",
"numpy.log",
"numpy.ascontiguousarray",
"scipy.interpolate.interp1d",
"numpy.array",
"scipy.optimize.optimize.fminbound",
"fabio.open",
"fabio.factory",
"numpy.where",
"numpy.sort",
"scipy.ndimage.label",
"numpy.maximum",
"weakref.WeakKe... | [((2111, 2138), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (2128, 2138), False, 'import logging\n'), ((11662, 11705), 'scipy.ndimage.morphology.binary_dilation', 'ndimage.morphology.binary_dilation', (['invalid'], {}), '(invalid)\n', (11696, 11705), False, 'from scipy import ndimage\n... |
from django.shortcuts import render
import datetime
from datetime import date
import calendar
from schedule.models import Event, period_choices, cart_choice
from django.views.generic import UpdateView, TemplateView, ListView
from schedule.forms import ReservationForm
from django.http import HttpResponseRedirect, HttpRe... | [
"django.http.HttpResponseRedirect",
"schedule.models.Event.objects.get",
"schedule.models.Event.objects.all",
"django.http.HttpResponse",
"json.dumps",
"datetime.timedelta",
"schedule.models.Event.objects.filter",
"calendar.monthrange",
"schedule.models.Event",
"datetime.date.today"
] | [((5040, 5072), 'django.http.HttpResponseRedirect', 'HttpResponseRedirect', (['"""/week/0/"""'], {}), "('/week/0/')\n", (5060, 5072), False, 'from django.http import HttpResponseRedirect, HttpResponse\n'), ((7738, 7752), 'django.http.HttpResponse', 'HttpResponse', ([], {}), '()\n', (7750, 7752), False, 'from django.htt... |
import os
print("""
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki... | [
"os.environ.get"
] | [((3338, 3360), 'os.environ.get', 'os.environ.get', (['"""PORT"""'], {}), "('PORT')\n", (3352, 3360), False, 'import os\n'), ((3362, 3384), 'os.environ.get', 'os.environ.get', (['"""PORT"""'], {}), "('PORT')\n", (3376, 3384), False, 'import os\n')] |
# -*- coding: utf-8 -*-
"""
This file is part of pyCMBS.
(c) 2012- <NAME>
For COPYING and LICENSE details, please refer to the LICENSE file
"""
import os
import glob
import unittest
class TestCodingStandards(unittest.TestCase):
"""
test coding standards: check for license
"""
def test_PythonFiles_Have... | [
"os.path.join",
"os.path.realpath",
"os.path.dirname",
"os.path.basename",
"os.walk"
] | [((1027, 1051), 'os.path.join', 'os.path.join', (['dirpath', 'f'], {}), '(dirpath, f)\n', (1039, 1051), False, 'import os\n'), ((1180, 1204), 'os.path.join', 'os.path.join', (['dirpath', 'f'], {}), '(dirpath, f)\n', (1192, 1204), False, 'import os\n'), ((1999, 2025), 'os.path.basename', 'os.path.basename', (['filename'... |
from typing import Optional
import requests
from mstrio.connection import Connection
from mstrio.utils.error_handlers import ErrorHandler
@ErrorHandler(err_msg='Error while creating the package holder')
def create_package_holder(connection: Connection, project_id: Optional[str] = None,
err... | [
"mstrio.utils.error_handlers.ErrorHandler"
] | [((143, 206), 'mstrio.utils.error_handlers.ErrorHandler', 'ErrorHandler', ([], {'err_msg': '"""Error while creating the package holder"""'}), "(err_msg='Error while creating the package holder')\n", (155, 206), False, 'from mstrio.utils.error_handlers import ErrorHandler\n'), ((1041, 1118), 'mstrio.utils.error_handlers... |
# This module deals with test data representation for the third task
#########################################################################################
import os
from dialent.common.util import normalize
from dialent.common.util import safeOpen
from dialent.objects.fact import Fact
#########################... | [
"dialent.objects.fact.Fact.fromTest",
"dialent.common.util.normalize",
"os.path.join",
"dialent.common.util.safeOpen"
] | [((681, 715), 'os.path.join', 'os.path.join', (['dir', "(name + '.task3')"], {}), "(dir, name + '.task3')\n", (693, 715), False, 'import os\n'), ((979, 997), 'dialent.common.util.safeOpen', 'safeOpen', (['filename'], {}), '(filename)\n', (987, 997), False, 'from dialent.common.util import safeOpen\n'), ((1082, 1101), '... |
import os
filename = os.path.dirname(__file__) + "\\input"
arrayList = []
with open(filename) as file:
for line in file:
arrayList.append(line.rstrip())
width = len(arrayList[0].rstrip())
print(f'len {width}')
gamma_nums = arrayList
for r in range(width):
start = 0
x = []
for line in gamma_num... | [
"os.path.dirname"
] | [((22, 47), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (37, 47), False, 'import os\n')] |
import os, sys
sys.path.insert(0, os.path.join(os.getcwd(), '..', 'Imagination'))
sys.path.insert(0, os.path.join(os.getcwd(), '..', 'xmode'))
from keymaster.starter import activate
activate() | [
"keymaster.starter.activate",
"os.getcwd"
] | [((183, 193), 'keymaster.starter.activate', 'activate', ([], {}), '()\n', (191, 193), False, 'from keymaster.starter import activate\n'), ((47, 58), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (56, 58), False, 'import os, sys\n'), ((114, 125), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (123, 125), False, 'import os, s... |
# Generated by Django 3.0.11 on 2020-11-19 10:40
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('dcodex_lectionary', '0030_auto_20201119_2131'),
]
operations = [
migrations.RenameField(
model_name='movableday',
old_name=... | [
"django.db.migrations.RenameField"
] | [((238, 328), 'django.db.migrations.RenameField', 'migrations.RenameField', ([], {'model_name': '"""movableday"""', 'old_name': '"""period"""', 'new_name': '"""season"""'}), "(model_name='movableday', old_name='period', new_name\n ='season')\n", (260, 328), False, 'from django.db import migrations\n')] |
import numpy as np
import os
from utils import *
from keras.preprocessing.image import ImageDataGenerator
from keras.preprocessing import image
from model import Deeplabv3
import keras
from tensorflow.python.keras.layers import *
from tensorflow.python.keras.layers.convolutional import Deconvolution2D
from numpy impor... | [
"random.randrange",
"tensorflow.python.keras.callbacks.ReduceLROnPlateau",
"model.Deeplabv3",
"tensorflow.python.keras.optimizers.Adam",
"keras.preprocessing.image.ImageDataGenerator",
"random.seed"
] | [((575, 594), 'random.randrange', 'randrange', (['(1)', '(10000)'], {}), '(1, 10000)\n', (584, 594), False, 'from random import seed, sample, randrange\n'), ((638, 685), 'model.Deeplabv3', 'Deeplabv3', ([], {'input_shape': '(256, 256, 3)', 'classes': '(2)'}), '(input_shape=(256, 256, 3), classes=2)\n', (647, 685), Fals... |
# Copyright 1997 - 2018 by IXIA Keysight
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, p... | [
"ixnetwork_restpy.testplatform.sessions.ixnetwork.vport.protocols.pimsm.router.interface.joinprune.learnedmgrstate.learnedmgrstate.LearnedMgrState"
] | [((2369, 2390), 'ixnetwork_restpy.testplatform.sessions.ixnetwork.vport.protocols.pimsm.router.interface.joinprune.learnedmgrstate.learnedmgrstate.LearnedMgrState', 'LearnedMgrState', (['self'], {}), '(self)\n', (2384, 2390), False, 'from ixnetwork_restpy.testplatform.sessions.ixnetwork.vport.protocols.pimsm.router.int... |
# -*- coding: utf-8 -*-
import os
import sys
import time
import random
from subprocess import Popen, PIPE
from django.utils import termcolors
TYPING_SPEED = 50
def simulate_command_type(commands, shell=False):
for command in commands.split('&& '):
if not command.startswith('source'):
simulate... | [
"os.path.exists",
"django.utils.termcolors.make_style",
"subprocess.Popen",
"random.random",
"os.system",
"sys.stdout.flush",
"sys.stdout.write"
] | [((395, 435), 'sys.stdout.write', 'sys.stdout.write', (['"""breno@localhost: ~$ """'], {}), "('breno@localhost: ~$ ')\n", (411, 435), False, 'import sys\n'), ((466, 485), 'sys.stdout.write', 'sys.stdout.write', (['c'], {}), '(c)\n', (482, 485), False, 'import sys\n'), ((494, 512), 'sys.stdout.flush', 'sys.stdout.flush'... |
import humps
import pytest
from django import test
from django.contrib.auth.models import User
from django.urls import reverse
def test_profile_updates_correctly(
profile_admin_client: test.Client, user: User, update_profile_params
):
url = f"{reverse('admin_update_profile')}?email={user.email}"
res = pro... | [
"pytest.mark.parametrize",
"humps.camelize",
"django.urls.reverse"
] | [((577, 702), 'pytest.mark.parametrize', 'pytest.mark.parametrize', ([], {'argnames': '"""method, status"""', 'argvalues': "[('get', 400), ('put', 400), ('post', 405), ('patch', 400)]"}), "(argnames='method, status', argvalues=[('get', 400),\n ('put', 400), ('post', 405), ('patch', 400)])\n", (600, 702), False, 'imp... |
#!/usr/bin/env python
__author__ = "<NAME>"
__copyrights__ = "Copyright 2018, the python-uds project"
__credits__ = ["<NAME>"]
__license__ = "MIT"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Development"
import cProfile
import sys
from functools import reduce
# ----------------------------------... | [
"functools.reduce",
"sys.setrecursionlimit",
"cProfile.Profile"
] | [((2512, 2539), 'sys.setrecursionlimit', 'sys.setrecursionlimit', (['(4000)'], {}), '(4000)\n', (2533, 2539), False, 'import sys\n'), ((515, 533), 'cProfile.Profile', 'cProfile.Profile', ([], {}), '()\n', (531, 533), False, 'import cProfile\n'), ((1567, 1607), 'functools.reduce', 'reduce', (['(lambda x, y: (x << 8) + y... |
import os
from fixtures import TempDir
from testtools import ExpectedException, TestCase, run_test_with
from testtools.assertions import assert_that
from testtools.matchers import (
Contains, DirExists, Equals, FileContains, FileExists, MatchesStructure)
from testtools.twistedsupport import (
AsynchronousDefe... | [
"testtools.twistedsupport.flush_logged_errors",
"testtools.ExpectedException",
"testtools.matchers.FileExists",
"testtools.matchers.Equals",
"testtools.matchers.Contains",
"txacme.urls.LETSENCRYPT_STAGING_DIRECTORY.asText",
"testtools.matchers.FileContains",
"testtools.matchers.DirExists",
"marathon... | [((2630, 2673), 'testtools.twistedsupport.flush_logged_errors', 'flush_logged_errors', (['ConnectionRefusedError'], {}), '(ConnectionRefusedError)\n', (2649, 2673), False, 'from testtools.twistedsupport import AsynchronousDeferredRunTest, flush_logged_errors\n'), ((1379, 1433), 'testtools.twistedsupport.AsynchronousDef... |
#!/usr/local/bin/python
# UUT is running continuous pre/post snapshots
# subscribe to the snapshots and save all the data.
import threading
import epics
import argparse
import time
import datetime
import os
NCHAN = 16
# WF record, raw binary (shorts)
WFNAME = ":1:AI:WF:{:02d}"
# alt WF record, VOLTS. Kindof harder t... | [
"epics.PV",
"os.makedirs",
"argparse.ArgumentParser",
"time.sleep",
"datetime.datetime.now",
"os.path.isdir",
"threading.Thread"
] | [((2149, 2204), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""acq400 multivent"""'}), "(description='acq400 multivent')\n", (2172, 2204), False, 'import argparse\n'), ((1703, 1795), 'epics.PV', 'epics.PV', (["(self.name + ':1:AI:WF:01:UPDATES')"], {'auto_monitor': '(True)', 'callback': ... |
from __future__ import annotations
from abc import abstractmethod
from logging import getLogger
from typing import (
TYPE_CHECKING,
Any,
Dict,
Generic,
List,
Optional,
Type,
TypeVar,
cast,
)
from django.conf import settings
from django.core.cache import cache
from django.db import ... | [
"logging.getLogger",
"typing.cast",
"typing.TypeVar"
] | [((395, 414), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (404, 414), False, 'from logging import getLogger\n'), ((496, 508), 'typing.TypeVar', 'TypeVar', (['"""D"""'], {}), "('D')\n", (503, 508), False, 'from typing import TYPE_CHECKING, Any, Dict, Generic, List, Optional, Type, TypeVar, cast... |
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/gaogaotiantian/watchpoints/blob/master/NOTICE.txt
import unittest
import inspect
from watchpoints.util import getline, getargnodes
class TestUtil(unittest.TestCase):
def test_getline(self):
... | [
"watchpoints.util.getline",
"watchpoints.util.getargnodes",
"inspect.currentframe"
] | [((407, 421), 'watchpoints.util.getline', 'getline', (['frame'], {}), '(frame)\n', (414, 421), False, 'from watchpoints.util import getline, getargnodes\n'), ((358, 380), 'inspect.currentframe', 'inspect.currentframe', ([], {}), '()\n', (378, 380), False, 'import inspect\n'), ((763, 785), 'inspect.currentframe', 'inspe... |
# -*- coding: utf-8 -*-
from amplify.agent.common.util.math import median
from unittest import TestCase
from hamcrest import *
__author__ = "<NAME>"
__copyright__ = "Copyright (C) Nginx, Inc. All rights reserved."
__license__ = ""
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
class MathTestCase(TestCase):
de... | [
"amplify.agent.common.util.math.median"
] | [((384, 404), 'amplify.agent.common.util.math.median', 'median', (['[1, 3, 5, 7]'], {}), '([1, 3, 5, 7])\n', (390, 404), False, 'from amplify.agent.common.util.math import median\n'), ((460, 480), 'amplify.agent.common.util.math.median', 'median', (['[1, 5, 7, 3]'], {}), '([1, 5, 7, 3])\n', (466, 480), False, 'from amp... |
import numpy as np
from scipy.misc import toimage
from scipy.ndimage.filters import gaussian_filter
from os import mkdir
from os.path import dirname, join
from time import time
from keras.models import Model
from keras.layers import Dense
from keras import backend as K
from keras.applications.vgg16 import VGG16
# de... | [
"numpy.clip",
"keras.applications.vgg16.VGG16",
"scipy.ndimage.filters.gaussian_filter",
"keras.backend.learning_phase",
"keras.backend.gradients",
"numpy.array",
"numpy.linalg.norm",
"keras.layers.Dense",
"keras.backend.image_data_format",
"os.mkdir",
"keras.models.Model",
"numpy.random.norma... | [((710, 746), 'numpy.array', 'np.array', (['[103.939, 116.779, 123.68]'], {}), '([103.939, 116.779, 123.68])\n', (718, 746), True, 'import numpy as np\n'), ((372, 389), 'os.path.dirname', 'dirname', (['__file__'], {}), '(__file__)\n', (379, 389), False, 'from os.path import dirname, join\n'), ((407, 425), 'os.mkdir', '... |
import json, urllib.parse
import requests as reqs
prefixes = '''
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX noInferences: <http://www.ontotext.com/explicit>
PR... | [
"requests.post",
"requests.get"
] | [((771, 798), 'requests.get', 'reqs.get', (['(getLink + encoded)'], {}), '(getLink + encoded)\n', (779, 798), True, 'import requests as reqs\n'), ((1157, 1185), 'requests.post', 'reqs.post', (['(upLink + encoded_)'], {}), '(upLink + encoded_)\n', (1166, 1185), True, 'import requests as reqs\n')] |
'''
This is a sample class for a model. You may choose to use it as-is or make any changes to it.
This has been provided just to give you an idea of how to structure your model class.
'''
import cv2
import numpy as np
import logging as log
from openvino.inference_engine import IENetwork, IECore
import warnings
import ... | [
"math.cos",
"openvino.inference_engine.IECore",
"logging.error",
"cv2.resize",
"math.sin",
"openvino.inference_engine.IENetwork",
"warnings.filterwarnings"
] | [((325, 358), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (348, 358), False, 'import warnings\n'), ((1486, 1537), 'openvino.inference_engine.IENetwork', 'IENetwork', (['self.model_structure', 'self.model_weights'], {}), '(self.model_structure, self.model_weights)\n', (1... |
from tumor_data.SYNDataLoader import *
from tensorboardX import SummaryWriter
from torchsummaryX import summary
from driver.helper.base_syn_helper import BaseTrainHelper
class SYNHelper_Kumar(BaseTrainHelper):
def __init__(self, generator, discriminator,
criterions, config):
super(SYNHelp... | [
"tensorboardX.SummaryWriter"
] | [((497, 539), 'tensorboardX.SummaryWriter', 'SummaryWriter', (['self.config.tensorboard_dir'], {}), '(self.config.tensorboard_dir)\n', (510, 539), False, 'from tensorboardX import SummaryWriter\n')] |
import torch
import torch.nn as nn
import torch.nn.functional as F
class mobilenet(nn.Module):
def __init__(self):
super(mobilenet, self).__init__()
self.conv_1 = nn.Sequential(
nn.Conv2d(3, 64, kernel_size=3, stride=1, padding=1),
nn.BatchNorm2d(64),
nn.ReLU()
... | [
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.functional.avg_pool2d",
"torch.nn.Conv2d",
"torch.nn.Linear"
] | [((745, 763), 'torch.nn.Linear', 'nn.Linear', (['(512)', '(10)'], {}), '(512, 10)\n', (754, 763), True, 'import torch.nn as nn\n'), ((1604, 1624), 'torch.nn.functional.avg_pool2d', 'F.avg_pool2d', (['out', '(2)'], {}), '(out, 2)\n', (1616, 1624), True, 'import torch.nn.functional as F\n'), ((212, 264), 'torch.nn.Conv2d... |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
from azure.ai.ml.constants import SearchSpace
from marshmallow import fields, post_load, pre_dump, ValidationError
from azure.ai.ml._schema... | [
"azure.ai.ml._schema.core.fields.StringTransformedEnum",
"marshmallow.ValidationError",
"marshmallow.fields.Integer",
"azure.ai.ml.sweep.Randint"
] | [((487, 559), 'azure.ai.ml._schema.core.fields.StringTransformedEnum', 'StringTransformedEnum', ([], {'required': '(True)', 'allowed_values': 'SearchSpace.RANDINT'}), '(required=True, allowed_values=SearchSpace.RANDINT)\n', (508, 559), False, 'from azure.ai.ml._schema.core.fields import StringTransformedEnum\n'), ((572... |
#!/usr/bin/env python3
"""
Advent of Code 2020 Day 20: Jurassic Jigsaw
https://adventofcode.com/2020/day/20
Solution by <NAME>
"""
import re
from functools import reduce
SEA_MONSTER_PROFILE = """
..................#.
#....##....##....###
.#..#..#..#..#..#..."""
class Tile:
def __init__(self, id: int, content)... | [
"functools.reduce",
"re.fullmatch",
"re.search"
] | [((2941, 3005), 'functools.reduce', 'reduce', (['(lambda a, b: a if a.id < b.id else b)', 'self.initial_tiles'], {}), '(lambda a, b: a if a.id < b.id else b, self.initial_tiles)\n', (2947, 3005), False, 'from functools import reduce\n'), ((12452, 12483), 're.search', 're.search', (['"""Tile (\\\\d+):"""', 'line'], {}),... |
import json
import logging
import os
import sys
from argparse import ArgumentParser
import re
import numpy as np
import pandas as pd
import torch
from transformers import GPT2Tokenizer
from src.data.cleaning import mask_not_na, inds_unique, mask_long_enough
from src.data.nli import TransformersSeqPairDataset
from src... | [
"logging.getLogger",
"src.data.nli.TransformersSeqPairDataset",
"logging.StreamHandler",
"pandas.read_csv",
"src.data.cleaning.inds_unique",
"logging.info",
"os.path.exists",
"argparse.ArgumentParser",
"src.data.cleaning.mask_not_na",
"numpy.random.seed",
"numpy.random.permutation",
"src.data.... | [((380, 396), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (394, 396), False, 'from argparse import ArgumentParser\n'), ((1810, 1829), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (1827, 1829), False, 'import logging\n'), ((2809, 2842), 'pandas.read_csv', 'pd.read_csv', (['args.paraphra... |
import numpy as np
from pyspark.sql import SparkSession
from pyspark import SparkContext, SparkConf
from TransEmodule import utils
def check_entities(x, map):
if x in map:
return map[x]
else:
return None
def calculate_rankings(rank_list):
flat = rank_list.map(lambda x: x[0]).persist()
... | [
"numpy.mean",
"TransEmodule.utils.get_id_by_value",
"numpy.where",
"TransEmodule.utils.load_dataset",
"pyspark.SparkConf",
"numpy.square",
"numpy.argsort",
"TransEmodule.utils.restore",
"numpy.concatenate",
"pyspark.SparkContext"
] | [((4227, 4325), 'TransEmodule.utils.restore', 'utils.restore', (['"""/home/ubuntu/entity_embedding_999.pkl"""', '"""/home/ubuntu/label_embedding_999.pkl"""'], {}), "('/home/ubuntu/entity_embedding_999.pkl',\n '/home/ubuntu/label_embedding_999.pkl')\n", (4240, 4325), False, 'from TransEmodule import utils\n'), ((4429... |
"""Submit jobs to Sun Grid Engine."""
# pylint: disable=invalid-name
import os
import subprocess
from . import tracker
def submit(args):
"""Job submission script for SGE."""
if args.jobname is None:
args.jobname = ('dmlc%d.' % args.num_workers) + args.command[0].split('/')[-1]
if args.sge_log_dir... | [
"os.path.exists",
"os.path.isdir",
"os.mkdir",
"subprocess.check_call"
] | [((387, 419), 'os.path.exists', 'os.path.exists', (['args.sge_log_dir'], {}), '(args.sge_log_dir)\n', (401, 419), False, 'import os\n'), ((580, 606), 'os.mkdir', 'os.mkdir', (['args.sge_log_dir'], {}), '(args.sge_log_dir)\n', (588, 606), False, 'import os\n'), ((1472, 1510), 'subprocess.check_call', 'subprocess.check_c... |
# -*- coding: utf-8 -*-
"""
Created on Mon 2018.02.28:00:00:00
@author: <NAME>
Abstrac:
Examples of experiments from different labs.
"""
##########################################################################################################################################################################... | [
"CBEDataAnalysis.AnaTimeData",
"pylab.rc",
"pylab.tight_layout",
"pylab.plot",
"pylab.savefig",
"pylab.xlabel",
"pylab.legend",
"CBEDataAnalysis.PlotIndPost",
"pylab.close",
"pylab.figure",
"CBEDataAnalysis.AnaBF",
"DilExp.GetKDE",
"pylab.xlim",
"pandas.read_excel",
"pylab.ylabel"
] | [((498, 517), 'pylab.rc', 'rc', (['"""font"""'], {'size': '(18)'}), "('font', size=18)\n", (500, 517), False, 'from pylab import plot, rc, figure, close, savefig, xlim, ylabel, xlabel, tight_layout, legend\n'), ((1326, 1435), 'CBEDataAnalysis.AnaTimeData', 'AnaTimeData', ([], {'CBEData': 'CBEData', 'experiment': 'exper... |
import time
import json
from wptserve.utils import isomorphic_decode, isomorphic_encode
def main(request, response):
headers = [(b'Content-Type', b'application/javascript'),
(b'Cache-Control', b'max-age=86400'),
(b'Last-Modified', isomorphic_encode(time.strftime(u"%a, %d %b %Y %H:%M:... | [
"wptserve.utils.isomorphic_decode",
"time.time",
"time.gmtime"
] | [((765, 776), 'time.time', 'time.time', ([], {}), '()\n', (774, 776), False, 'import time\n'), ((802, 825), 'wptserve.utils.isomorphic_decode', 'isomorphic_decode', (['test'], {}), '(test)\n', (819, 825), False, 'from wptserve.utils import isomorphic_decode, isomorphic_encode\n'), ((329, 342), 'time.gmtime', 'time.gmti... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# (C) Copyright 2015 Nuxeo SA (http://nuxeo.com/) and contributors.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the GNU Lesser General Public License
# (LGPL) version 2.1 which accompanies this distribution, ... | [
"logging.getLogger",
"logging.basicConfig",
"argparse.FileType",
"argparse.ArgumentParser",
"os.path.join",
"redis.RedisWriter",
"logging.shutdown",
"utils.download"
] | [((1542, 1567), 'logging.getLogger', 'logging.getLogger', (['module'], {}), '(module)\n', (1559, 1567), False, 'import logging\n'), ((1576, 1688), 'logging.basicConfig', 'logging.basicConfig', ([], {'stream': 'sys.stderr', 'level': 'logging.DEBUG', 'format': '"""%(name)s (%(levelname)s): %(message)s"""'}), "(stream=sys... |
from random import randint
class Column(object):
def __init__(self, columns = 5):
super(Column, self).__init__()
self.columns = columns
def encrypt(self, payload):
matrix = []
payload = payload.replace(' ', '')
complete = False
while True:
row = []
... | [
"random.randint"
] | [((702, 722), 'random.randint', 'randint', (['(97)', '(26 + 97)'], {}), '(97, 26 + 97)\n', (709, 722), False, 'from random import randint\n')] |
""""""
# Standard library modules.
import csv
import io
import functools
# Third party modules.
from qtpy import QtCore, QtGui, QtWidgets, QtWebEngineWidgets
import xlsxwriter
# Local modules.
from pymontecarlo_gui.settings import SettingsBasedField
from pymontecarlo_gui.widgets.dialog import ExecutionProgressDialog... | [
"qtpy.QtCore.QMimeData",
"pymontecarlo.formats.document.DocumentBuilder",
"qtpy.QtWidgets.QTabWidget",
"qtpy.QtGui.QIcon.fromTheme",
"qtpy.QtWidgets.QToolBar",
"qtpy.QtWidgets.QVBoxLayout",
"csv.writer",
"qtpy.QtWebEngineWidgets.QWebEngineView",
"qtpy.QtWidgets.QTableView",
"qtpy.QtWidgets.QAction... | [((955, 993), 'qtpy.QtWidgets.QAction', 'QtWidgets.QAction', (['"""Copy to clipboard"""'], {}), "('Copy to clipboard')\n", (972, 993), False, 'from qtpy import QtCore, QtGui, QtWidgets, QtWebEngineWidgets\n'), ((1211, 1236), 'qtpy.QtWidgets.QAction', 'QtWidgets.QAction', (['"""Save"""'], {}), "('Save')\n", (1228, 1236)... |
# -*- coding: UTF-8 -*-
import os
import sys
import subprocess
import argparse
import re
import configparser
import logging
import copy
import psutil
if sys.version_info[0] < 3:
import struct
import tensorflow as tf
from tensorflow.core.framework import graph_pb2
# level=logging.INFO only logging.debug info,leve... | [
"logging.debug",
"configparser.ConfigParser",
"tensorflow.gfile.FastGFile",
"copy.deepcopy",
"tensorflow.gfile.GFile",
"logging.info",
"tensorflow.core.framework.graph_pb2.GraphDef",
"os.path.exists",
"os.listdir",
"argparse.ArgumentParser",
"tensorflow.GraphDef",
"os.popen",
"subprocess.che... | [((369, 408), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (388, 408), False, 'import logging\n'), ((1430, 1449), 'logging.info', 'logging.info', (['title'], {}), '(title)\n', (1442, 1449), False, 'import logging\n'), ((1454, 1472), 'logging.debug', 'logging.d... |
import asyncio
import time
from collections import namedtuple
from http import HTTPStatus
import pytest
from aiojenkins.exceptions import JenkinsError
from aiojenkins.jenkins import Jenkins
from tests import CreateJob, get_host, get_login, get_password, is_ci_server
@pytest.mark.asyncio
async def test_invalid_host... | [
"tests.get_password",
"aiojenkins.jenkins.Jenkins",
"collections.namedtuple",
"asyncio.sleep",
"tests.get_login",
"tests.CreateJob",
"tests.get_host",
"pytest.raises",
"tests.is_ci_server",
"gc.collect",
"pytest.skip",
"time.time"
] | [((3899, 3911), 'gc.collect', 'gc.collect', ([], {}), '()\n', (3909, 3911), False, 'import gc\n'), ((340, 367), 'pytest.raises', 'pytest.raises', (['JenkinsError'], {}), '(JenkinsError)\n', (353, 367), False, 'import pytest\n'), ((387, 401), 'aiojenkins.jenkins.Jenkins', 'Jenkins', (['"""@#$"""'], {}), "('@#$')\n", (39... |
import requests
import json
with open("api.key") as f:
API_KEY = f.read().strip()
"""
This is for security online, so the API key is not publicized.
"""
f.close()
url='https://webdrink.csh.rit.edu/api/index.php'
def test():
"""
This is not usually called, other than for testing the API.
... | [
"requests.post",
"requests.get"
] | [((409, 439), 'requests.get', 'requests.get', (['url'], {'params': 'head'}), '(url, params=head)\n', (421, 439), False, 'import requests\n'), ((735, 765), 'requests.get', 'requests.get', (['url'], {'params': 'head'}), '(url, params=head)\n', (747, 765), False, 'import requests\n'), ((1000, 1030), 'requests.get', 'reque... |
from unittest import TestCase
import numpy as np
import dianna
import dianna.visualization
from dianna.methods import LIME
from tests.test_onnx_runner import generate_data
from tests.utils import ModelRunner
from tests.utils import run_model
class LimeOnImages(TestCase):
def test_lime_function(self):
np.... | [
"tests.test_onnx_runner.generate_data",
"numpy.allclose",
"dianna.explain_text",
"numpy.random.random",
"dianna.methods.LIME",
"tests.utils.ModelRunner",
"numpy.random.seed",
"dianna.explain_image",
"numpy.load"
] | [((1889, 1949), 'tests.utils.ModelRunner', 'ModelRunner', (['model_path', 'word_vector_file'], {'max_filter_size': '(5)'}), '(model_path, word_vector_file, max_filter_size=5)\n', (1900, 1949), False, 'from tests.utils import ModelRunner\n'), ((2487, 2534), 'numpy.allclose', 'np.allclose', (['scores', 'expected_scores']... |
import re
import pyUnicodeSteganography.zerowidth as zerowidth
import pyUnicodeSteganography.lookalikes as lookalikes
import pyUnicodeSteganography.snow as snow
import pyUnicodeSteganography.emoji as emoji
from pyUnicodeSteganography.zerowidth import zwc_4
def encode(unencoded_string, msg, method="zw", binary=False, ... | [
"pyUnicodeSteganography.zerowidth.encode",
"pyUnicodeSteganography.zerowidth.decode",
"pyUnicodeSteganography.lookalikes.encode",
"pyUnicodeSteganography.lookalikes.decode",
"pyUnicodeSteganography.emoji.encode",
"pyUnicodeSteganography.emoji.decode",
"pyUnicodeSteganography.snow.encode",
"pyUnicodeSt... | [((579, 643), 'pyUnicodeSteganography.zerowidth.encode', 'zerowidth.encode', (['msg'], {'character_set': 'replacements', 'binary': 'binary'}), '(msg, character_set=replacements, binary=binary)\n', (595, 643), True, 'import pyUnicodeSteganography.zerowidth as zerowidth\n'), ((2034, 2099), 'pyUnicodeSteganography.zerowid... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 21 16:52:10 2017
@author: margauxmouchene
"""
import numpy as np
import pytest
from numpy.testing import assert_almost_equal
from landlab import RasterModelGrid
from landlab.components import (
FlowAccumulator,
FlowDirectorSteepest,
Tr... | [
"landlab.components.FlowAccumulator",
"landlab.RasterModelGrid",
"landlab.components.TransportLengthHillslopeDiffuser",
"numpy.array",
"numpy.testing.assert_almost_equal",
"pytest.raises",
"landlab.components.FlowDirectorSteepest"
] | [((408, 433), 'landlab.RasterModelGrid', 'RasterModelGrid', (['(10, 10)'], {}), '((10, 10))\n', (423, 433), False, 'from landlab import RasterModelGrid\n'), ((535, 575), 'landlab.components.FlowAccumulator', 'FlowAccumulator', (['mg'], {'flow_director': '"""MFD"""'}), "(mg, flow_director='MFD')\n", (550, 575), False, '... |
# import app
from flask import Flask, render_template, make_response, send_file
from flask_cors import CORS
# import custom helpers
from maplib import generate_embed
import loyaltylib as ll
app = Flask(__name__)
CORS(app)
# import declared routes
import frontenddata
@app.route('/ll')
def llfn():
ll.create_loya... | [
"flask.render_template",
"flask_cors.CORS",
"flask.Flask",
"loyaltylib.create_loyalty_account",
"maplib.generate_embed",
"loyaltylib.retrieve_loyalty_account"
] | [((198, 213), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (203, 213), False, 'from flask import Flask, render_template, make_response, send_file\n'), ((214, 223), 'flask_cors.CORS', 'CORS', (['app'], {}), '(app)\n', (218, 223), False, 'from flask_cors import CORS\n'), ((306, 333), 'loyaltylib.create_loy... |
import torch
import torch.nn.functional as F
try:
import matplotlib.pyplot as plt
except ImportError:
pass
def factor_getter(n, base):
base = base * 0.8 ** (n // 6)
i = n % 6
if i < 3:
f = [0, 0, 0]
f[i] = base
else:
base /= 2
f = [base, base, base]
f[i ... | [
"matplotlib.pyplot.plot",
"matplotlib.pyplot.axis",
"torch.nn.functional.interpolate",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show"
] | [((2598, 2617), 'matplotlib.pyplot.title', 'plt.title', (['im.shape'], {}), '(im.shape)\n', (2607, 2617), True, 'import matplotlib.pyplot as plt\n'), ((2622, 2637), 'matplotlib.pyplot.axis', 'plt.axis', (['"""off"""'], {}), "('off')\n", (2630, 2637), True, 'import matplotlib.pyplot as plt\n'), ((2642, 2652), 'matplotli... |
from flax.geometry import Blob, Point, Rectangle, Size, Span
def test_blob_create():
rect = Rectangle(origin=Point(0, 0), size=Size(5, 5))
blob = Blob.from_rectangle(rect)
assert blob.area == rect.area
assert blob.height == rect.height
def test_blob_math_disjoint():
# These rectangles look like... | [
"flax.geometry.Size",
"flax.geometry.Span",
"flax.geometry.Point",
"flax.geometry.Blob.from_rectangle",
"pprint.pprint"
] | [((156, 181), 'flax.geometry.Blob.from_rectangle', 'Blob.from_rectangle', (['rect'], {}), '(rect)\n', (175, 181), False, 'from flax.geometry import Blob, Point, Rectangle, Size, Span\n'), ((525, 551), 'flax.geometry.Blob.from_rectangle', 'Blob.from_rectangle', (['rect1'], {}), '(rect1)\n', (544, 551), False, 'from flax... |
import os
dir = ['trainA', 'trainB', 'testA', 'testB']
for d in dir:
img_names = os.listdir(d)
f = open('list_' + d + '.txt', "w")
for img in img_names:
f.write('./' + img + '\n')
# print(img_names) | [
"os.listdir"
] | [((87, 100), 'os.listdir', 'os.listdir', (['d'], {}), '(d)\n', (97, 100), False, 'import os\n')] |
#!/usr/bin/env python3
import logging
import numpy as np
import time
import torch
import cv2
logger = logging.getLogger(__name__)
def retry_load_images(image_paths, retry=10, backend="pytorch"):
"""
This function is to load images with support of retrying for failed load.
Args:
image_paths (li... | [
"logging.getLogger",
"time.sleep",
"numpy.stack",
"cv2.imread",
"torch.linspace"
] | [((105, 132), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (122, 132), False, 'import logging\n'), ((595, 617), 'cv2.imread', 'cv2.imread', (['image_path'], {}), '(image_path)\n', (605, 617), False, 'import cv2\n'), ((896, 911), 'time.sleep', 'time.sleep', (['(1.0)'], {}), '(1.0)\n', (9... |
import config
from malleus.api.service.protos.bench_service_pb2 import BenchRequest
#from malleus.api.service.protos.bench_service_pb2 import BenchRequest.Datasource
from malleus.api.domain.timer import Timer
import grpc
from malleus.api.service.protos.bench_service_pb2 import BenchRequest
import malleus.api.service.p... | [
"malleus.api.service.protos.bench_service_pb2_grpc.BenchServiceStub",
"grpc.insecure_channel",
"malleus.api.domain.timer.Timer",
"malleus.api.service.protos.bench_service_pb2.BenchRequest"
] | [((446, 488), 'grpc.insecure_channel', 'grpc.insecure_channel', (['config.host[region]'], {}), '(config.host[region])\n', (467, 488), False, 'import grpc\n'), ((509, 557), 'malleus.api.service.protos.bench_service_pb2_grpc.BenchServiceStub', 'bench_service_pb2_grpc.BenchServiceStub', (['channel'], {}), '(channel)\n', (... |
from resolwe.flow.models import Data
from resolwe.test import tag_process
from resolwe_bio.utils.filter import filter_vcf_variable
from resolwe_bio.utils.test import BioProcessTestCase
class CheMutWorkflowTestCase(BioProcessTestCase):
@tag_process("workflow-chemut")
def test_chemut_workflow(self):
wi... | [
"resolwe.flow.models.Data.objects.last",
"resolwe.flow.models.Data.objects.all",
"resolwe.test.tag_process"
] | [((243, 273), 'resolwe.test.tag_process', 'tag_process', (['"""workflow-chemut"""'], {}), "('workflow-chemut')\n", (254, 273), False, 'from resolwe.test import tag_process\n'), ((1703, 1721), 'resolwe.flow.models.Data.objects.all', 'Data.objects.all', ([], {}), '()\n', (1719, 1721), False, 'from resolwe.flow.models imp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import docker
import socket
docker_client = docker.from_env()
myself = docker_client.containers.get(socket.gethostname())
myself.pause() | [
"docker.from_env",
"socket.gethostname"
] | [((92, 109), 'docker.from_env', 'docker.from_env', ([], {}), '()\n', (107, 109), False, 'import docker\n'), ((149, 169), 'socket.gethostname', 'socket.gethostname', ([], {}), '()\n', (167, 169), False, 'import socket\n')] |
# An example for how to lock specific folders using the lockRegExp param
import studiolibrary
if __name__ == "__main__":
# Use the studiolibrary.app context for creating a QApplication instance
with studiolibrary.app():
# Lock all folders that contain the words "icon" & "Pixar" in the path
... | [
"studiolibrary.app",
"studiolibrary.main"
] | [((211, 230), 'studiolibrary.app', 'studiolibrary.app', ([], {}), '()\n', (228, 230), False, 'import studiolibrary\n'), ((355, 426), 'studiolibrary.main', 'studiolibrary.main', ([], {'name': '"""Example3"""', 'path': '"""data"""', 'lockRegExp': 'lockRegExp'}), "(name='Example3', path='data', lockRegExp=lockRegExp)\n", ... |
# GUI Development using Tkinter
import tkinter as tk
app = tk.Tk()
app.geometry('340x310')
app.title("Calculator")
entry = tk.Entry(app,text='0',font=('arial',20,'normal'))
entry.place(x=20,y=15)
def number(n):
if n=="C":
entry.delete(0,'end')
elif n=="ans":
k2 = entry.get()
entry.delet... | [
"tkinter.Tk",
"tkinter.Entry"
] | [((63, 70), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (68, 70), True, 'import tkinter as tk\n'), ((134, 187), 'tkinter.Entry', 'tk.Entry', (['app'], {'text': '"""0"""', 'font': "('arial', 20, 'normal')"}), "(app, text='0', font=('arial', 20, 'normal'))\n", (142, 187), True, 'import tkinter as tk\n')] |
# Generated by Django 2.2.4 on 2019-08-21 20:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0055_pycron'),
]
operations = [
migrations.AlterField(
model_name='pycron',
name='model_name',
f... | [
"django.db.models.CharField",
"django.db.models.IntegerField"
] | [((325, 379), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(40)', 'verbose_name': '"""Modelo"""'}), "(max_length=40, verbose_name='Modelo')\n", (341, 379), False, 'from django.db import migrations, models\n'), ((506, 572), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'default'... |
#!/usr/bin/env python
import argparse
import logging
from tornado import gen, ioloop
from kiel.clients import GroupedConsumer
log = logging.getLogger()
parser = argparse.ArgumentParser(
description="Example grouped consumer that prints out messages it gets."
)
parser.add_argument(
"brokers", type=lambda ... | [
"logging.getLogger",
"tornado.ioloop.IOLoop.instance",
"argparse.ArgumentParser",
"kiel.clients.GroupedConsumer"
] | [((137, 156), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (154, 156), False, 'import logging\n'), ((168, 270), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Example grouped consumer that prints out messages it gets."""'}), "(description=\n 'Example grouped consumer th... |
import pandas as pd
from caf import source_config
from utils import write_csv_file
def _get_year(p):
"""Get year from string having the DD/MM/YEAR format."""
date_tokens = p['dtref'].split('/')
if len(date_tokens) == 3:
date_year = date_tokens[-1]
else:
date_year = None
return dat... | [
"utils.write_csv_file",
"pandas.read_csv"
] | [((1537, 1590), 'pandas.read_csv', 'pd.read_csv', (['raw_file'], {'sep': '""";"""', 'encoding': '"""ISO-8859-1"""'}), "(raw_file, sep=';', encoding='ISO-8859-1')\n", (1548, 1590), True, 'import pandas as pd\n'), ((2039, 2088), 'utils.write_csv_file', 'write_csv_file', (['raw_data'], {'output_file': 'output_file'}), '(r... |
'''
Run constraint solver to complete spec.
'''
import json
import logging
import os
import subprocess
import tempfile
from typing import Dict, List, Tuple, Optional
import clyngor
from draco.spec import Query, Task
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
DRACO_LP = ['define.lp... | [
"logging.basicConfig",
"logging.getLogger",
"json.loads",
"subprocess.Popen",
"os.path.join",
"os.path.dirname",
"clyngor.Answers",
"tempfile.NamedTemporaryFile"
] | [((220, 259), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (239, 259), False, 'import logging\n'), ((269, 296), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (286, 296), False, 'import logging\n'), ((1347, 1448), 'subprocess.Pop... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'diptera_track.ui'
#
# Created by: PyQt5 UI code generator 5.9.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
Mai... | [
"PyQt5.QtWidgets.QSpinBox",
"BoundingBoxWidget.BBoxWidget",
"PyQt5.QtWidgets.QApplication",
"PyQt5.QtWidgets.QVBoxLayout",
"ScaleModelWidget.ScaleModelWidget",
"PyQt5.QtWidgets.QTableWidget",
"PyQt5.QtWidgets.QComboBox",
"ImageSegmentWidget.ImageSegmentWidget",
"PyQt5.QtWidgets.QLabel",
"PyQt5.QtW... | [((52911, 52943), 'PyQt5.QtWidgets.QApplication', 'QtWidgets.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (52933, 52943), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((52961, 52984), 'PyQt5.QtWidgets.QMainWindow', 'QtWidgets.QMainWindow', ([], {}), '()\n', (52982, 52984), False, 'from PyQt5 import QtC... |
"""Shelving Filter Cascade with Adjustable Transition Slope and Bandwidth
<NAME>, <NAME>, <NAME>
In: Proc. of 148th AES Convention, Virtual Vienna, May 2020, Paper 10339
http://www.aes.org/e-lib/browse.cfm?elib=20756
"""
import numpy as np
from scipy.signal import tf2sos, freqs
from matplotlib import rcParams
def ha... | [
"numpy.prod",
"numpy.log10",
"numpy.sqrt",
"numpy.linalg.multi_dot",
"numpy.array",
"scipy.signal.freqs",
"numpy.arange",
"numpy.divmod",
"numpy.exp",
"numpy.concatenate",
"numpy.abs",
"numpy.ceil",
"scipy.signal.tf2sos",
"numpy.ones",
"numpy.squeeze",
"numpy.sign",
"numpy.log2",
"... | [((676, 686), 'numpy.sign', 'np.sign', (['G'], {}), '(G)\n', (683, 686), True, 'import numpy as np\n'), ((8566, 8591), 'numpy.zeros', 'np.zeros', (['(num_biquad, 6)'], {}), '((num_biquad, 6))\n', (8574, 8591), True, 'import numpy as np\n'), ((9018, 9043), 'numpy.zeros', 'np.zeros', (['(num_biquad, 6)'], {}), '((num_biq... |
import os.path as osp
from .reader.video_reader import VideoReader
class ReaderFactory():
video_exts = [".mp4", ".avi", ".mov", ".MOV", ".mkv"]
def create(target_input, target_fps):
if osp.isfile(target_input):
ext = osp.splitext(target_input)[1]
if ext in ReaderFactory.video_... | [
"os.path.isfile",
"os.path.splitext"
] | [((204, 228), 'os.path.isfile', 'osp.isfile', (['target_input'], {}), '(target_input)\n', (214, 228), True, 'import os.path as osp\n'), ((248, 274), 'os.path.splitext', 'osp.splitext', (['target_input'], {}), '(target_input)\n', (260, 274), True, 'import os.path as osp\n')] |
# Code modified from original by @jvfe (BSD2)
# Copyright (c) 2020, jvfe
# https://github.com/jvfe/wdt_contribs/tree/master/complex_portal/src
import math
import re
from collections import defaultdict
from ftplib import FTP
from functools import lru_cache, reduce
from time import gmtime, strftime
import pandas as pd
f... | [
"wikidataintegrator.wdi_core.WDItemEngine.execute_sparql_query",
"wikidataintegrator.wdi_core.WDTime",
"ftplib.FTP",
"wikidata2df.wikidata2df",
"pandas.read_csv",
"pandas.merge",
"wikidataintegrator.wdi_core.WDItemID",
"collections.defaultdict",
"pandas.read_table",
"wikidataintegrator.wdi_core.WD... | [((10803, 10826), 'functools.lru_cache', 'lru_cache', ([], {'maxsize': 'None'}), '(maxsize=None)\n', (10812, 10826), False, 'from functools import lru_cache, reduce\n'), ((515, 528), 'json.load', 'json.load', (['fp'], {}), '(fp)\n', (524, 528), False, 'import json\n'), ((1174, 1226), 'pandas.read_table', 'pd.read_table... |
import scipy.special as sc
from tests.src.utils import split_list, __print
# .11 Serial Test
def serial_test(key, n, m=3, b_print=True):
def compute(s,m):
if m == 0:
return 0
if m == 1: head = ''
else : head = s[0:(m-1)]
s = s + head
v = [0]*2**m
... | [
"scipy.special.gammaincc",
"tests.src.utils.split_list"
] | [((968, 1006), 'scipy.special.gammaincc', 'sc.gammaincc', (['(2 ** (m - 2))', '(d_psi2 / 2)'], {}), '(2 ** (m - 2), d_psi2 / 2)\n', (980, 1006), True, 'import scipy.special as sc\n'), ((1010, 1049), 'scipy.special.gammaincc', 'sc.gammaincc', (['(2 ** (m - 3))', '(d2_psi2 / 2)'], {}), '(2 ** (m - 3), d2_psi2 / 2)\n', (1... |
# Copyright 2018 Amazon.com, Inc. or its affiliates.
# 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.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file ac... | [
"boto3.client",
"datetime.datetime.utcnow",
"json.dumps",
"base64.b64decode",
"time.sleep"
] | [((1227, 1274), 'base64.b64decode', 'base64.b64decode', (["response['UserData']['Value']"], {}), "(response['UserData']['Value'])\n", (1243, 1274), False, 'import base64\n'), ((3758, 3775), 'datetime.datetime.utcnow', 'datetime.utcnow', ([], {}), '()\n', (3773, 3775), False, 'from datetime import datetime\n'), ((3003, ... |
from traceback import print_exc
from uuid import uuid4
from flask import Flask, request, send_from_directory
from function_plot import *
app = Flask(__name__)
max_simultaneous_requests = 8
simultaneous_requests = 0
@app.route('/generate/')
def generate():
global simultaneous_requests
simultaneous_requests +... | [
"flask.request.args.get",
"flask.send_from_directory",
"flask.Flask",
"uuid.uuid4",
"traceback.print_exc"
] | [((144, 159), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (149, 159), False, 'from flask import Flask, request, send_from_directory\n'), ((989, 1066), 'flask.send_from_directory', 'send_from_directory', (['path', 'filename'], {'mimetype': '"""video/mp4"""', 'as_attachment': '(True)'}), "(path, filename,... |
import inspect
import sys
import numpy as np
import attrdict
from mtwaffle import graphs
from mtwaffle import mt
class Site(attrdict.AttrDict):
index_map = {
'xx': [0, 0],
'xy': [0, 1],
'yx': [1, 0],
'yy': [1, 1]
}
EXCLUDED_CALLABLES = ('between_freqs', )
def __in... | [
"mtwaffle.graphs.plot_impedance_tensors",
"mtwaffle.mt.callables.items",
"mtwaffle.graphs.plot_mohr_imp",
"numpy.asarray",
"mtwaffle.graphs.plot_ptensell",
"inspect.signature",
"mtwaffle.graphs.plot_mohr_ptensor",
"mtwaffle.graphs.plot_ptensell_filled",
"mtwaffle.graphs.plot_res_phase"
] | [((450, 467), 'numpy.asarray', 'np.asarray', (['freqs'], {}), '(freqs)\n', (460, 467), True, 'import numpy as np\n'), ((486, 500), 'numpy.asarray', 'np.asarray', (['zs'], {}), '(zs)\n', (496, 500), True, 'import numpy as np\n'), ((1758, 1778), 'mtwaffle.mt.callables.items', 'mt.callables.items', ([], {}), '()\n', (1776... |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | [
"google.cloud.spanner_dbapi.connect",
"unittest.mock.create_autospec",
"unittest.mock.patch",
"unittest.mock.Mock"
] | [((1012, 1056), 'unittest.mock.patch', 'mock.patch', (['"""google.cloud.spanner_v1.Client"""'], {}), "('google.cloud.spanner_v1.Client')\n", (1022, 1056), False, 'from unittest import mock\n'), ((970, 1008), 'unittest.mock.Mock', 'mock.Mock', ([], {'spec': '_CredentialsWithScopes'}), '(spec=_CredentialsWithScopes)\n', ... |
from hearthbreaker.cards.base import SpellCard
from hearthbreaker.constants import CHARACTER_CLASS, CARD_RARITY
from hearthbreaker.tags.base import BuffUntil, Buff
from hearthbreaker.tags.event import TurnStarted
from hearthbreaker.tags.status import Stealth, Taunt, Frozen
import hearthbreaker.targeting
class TheCoin... | [
"hearthbreaker.tags.status.Taunt",
"hearthbreaker.tags.event.TurnStarted",
"hearthbreaker.tags.status.Stealth",
"hearthbreaker.tags.status.Frozen"
] | [((1262, 1270), 'hearthbreaker.tags.status.Frozen', 'Frozen', ([], {}), '()\n', (1268, 1270), False, 'from hearthbreaker.tags.status import Stealth, Taunt, Frozen\n'), ((1636, 1645), 'hearthbreaker.tags.status.Stealth', 'Stealth', ([], {}), '()\n', (1643, 1645), False, 'from hearthbreaker.tags.status import Stealth, Ta... |
# Copyright 2021 Dakewe Biotech Corporation. 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... | [
"torchvision.transforms.ToTensor",
"torch.from_numpy",
"numpy.asarray",
"cv2.cvtColor"
] | [((1328, 1366), 'cv2.cvtColor', 'cv2.cvtColor', (['image', 'cv2.COLOR_BGR2RGB'], {}), '(image, cv2.COLOR_BGR2RGB)\n', (1340, 1366), False, 'import cv2\n'), ((1098, 1136), 'cv2.cvtColor', 'cv2.cvtColor', (['image', 'cv2.COLOR_BGR2RGB'], {}), '(image, cv2.COLOR_BGR2RGB)\n', (1110, 1136), False, 'import cv2\n'), ((1783, 1... |
import core
import model
import settings
def get_communitylist():
res = []
for community in model.Community.select():
res.append(community.title)
return res
if __name__ == "__main__":
regionlist = settings.REGIONLIST # only pinyin support
model.database_init()
core.GetHouseByRegionl... | [
"core.GetHouseByRegionlist",
"core.GetCommunityByRegionlist",
"model.database_init",
"core.GetSellByCommunitylist",
"model.Community.select",
"core.GetRentByRegionlist"
] | [((102, 126), 'model.Community.select', 'model.Community.select', ([], {}), '()\n', (124, 126), False, 'import model\n'), ((272, 293), 'model.database_init', 'model.database_init', ([], {}), '()\n', (291, 293), False, 'import model\n'), ((298, 335), 'core.GetHouseByRegionlist', 'core.GetHouseByRegionlist', (['regionlis... |
from linked_list.linked_listf import LinkedList
def ll_merge(list_A, list_B):
curr_B = list_B.head
curr_A = list_A.head
temp_C = None
while curr_A._next and curr_B:
curr_B = list_B.head
temp_A = curr_A._next
temp_B = curr_B._next
# if curr_B._next._next:
# te... | [
"linked_list.linked_listf.LinkedList"
] | [((573, 585), 'linked_list.linked_listf.LinkedList', 'LinkedList', ([], {}), '()\n', (583, 585), False, 'from linked_list.linked_listf import LinkedList\n'), ((699, 711), 'linked_list.linked_listf.LinkedList', 'LinkedList', ([], {}), '()\n', (709, 711), False, 'from linked_list.linked_listf import LinkedList\n')] |
import time
class Timer(object):
def __init__(self):
self._start = 0
self._end = 0
def __enter__(self):
self._start = time.time()
return self
def __exit__(self, exc_type, exc_val, exc_tb):
self._end = time.time()
@property
def duration(self):
if s... | [
"time.time"
] | [((153, 164), 'time.time', 'time.time', ([], {}), '()\n', (162, 164), False, 'import time\n'), ((257, 268), 'time.time', 'time.time', ([], {}), '()\n', (266, 268), False, 'import time\n'), ((354, 365), 'time.time', 'time.time', ([], {}), '()\n', (363, 365), False, 'import time\n')] |
#!/usr/bin/env python
# vim: expandtab:tabstop=4:shiftwidth=4
"""
This is a script that can be used to tag EBS volumes in OpenShift v3.
This script assume that your AWS credentials are setup in ~/.aws/credentials like this:
[default]
aws_access_key_id = xxxx
aws_secret_access_key = xxxx
Or that environmen... | [
"logging.getLogger",
"openshift_tools.cloud.aws.ebs_util.EbsUtil",
"logging.StreamHandler",
"argparse.ArgumentParser",
"logging.Formatter",
"logging.handlers.RotatingFileHandler",
"openshift_tools.cloud.aws.ebs_snapshotter.EbsSnapshotter",
"sys.exit"
] | [((715, 734), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (732, 734), False, 'import logging\n'), ((781, 848), 'logging.Formatter', 'logging.Formatter', (['"""%(asctime)s %(levelname)s %(name)s %(message)s"""'], {}), "('%(asctime)s %(levelname)s %(name)s %(message)s')\n", (798, 848), False, 'import logg... |
import _jpype
import jpype
import common
from jpype.types import *
class JChar2TestCase(common.JPypeTestCase):
def setUp(self):
common.JPypeTestCase.setUp(self)
def testCharRange(self):
self.assertEqual(ord(str(jpype.JChar(65))), 65)
self.assertEqual(ord(str(jpype.JChar(512))), 512)
... | [
"_jpype.fault",
"jpype.JObject",
"common.JPypeTestCase.setUp",
"jpype.JArray",
"jpype.JChar",
"jpype.java.lang.Character",
"jpype.JClass"
] | [((142, 174), 'common.JPypeTestCase.setUp', 'common.JPypeTestCase.setUp', (['self'], {}), '(self)\n', (168, 174), False, 'import common\n'), ((393, 421), '_jpype.fault', '_jpype.fault', (['"""PyJPChar_new"""'], {}), "('PyJPChar_new')\n", (405, 421), False, 'import _jpype\n'), ((512, 549), '_jpype.fault', '_jpype.fault'... |
"""
Random utilities this app needs
"""
import os
import re
from buzz import Corpus as BuzzCorpus
from buzz import Collection
from django.conf import settings
from explore.models import Corpus
from .models import OCRUpdate, PDF
# from django.core.exceptions import ObjectDoesNotExist
# when doing OCR, re.findall wi... | [
"os.makedirs",
"os.path.join",
"buzz.Corpus",
"explore.models.Corpus.objects.get",
"os.path.basename",
"re.findall"
] | [((1771, 1817), 'os.path.join', 'os.path.join', (['"""static"""', '"""corpora"""', 'slug', '"""txt"""'], {}), "('static', 'corpora', slug, 'txt')\n", (1783, 1817), False, 'import os\n'), ((1822, 1854), 'os.makedirs', 'os.makedirs', (['base'], {'exist_ok': '(True)'}), '(base, exist_ok=True)\n', (1833, 1854), False, 'imp... |
import subprocess
import time
import sys
import signal
from testutils import assert_raises
is_unix = not sys.platform.startswith("win")
if is_unix:
def echo(text):
return ["echo", text]
def sleep(secs):
return ["sleep", str(secs)]
else:
def echo(text):
return ["cmd", "/C", f"echo {... | [
"testutils.assert_raises",
"sys.platform.startswith",
"time.sleep"
] | [((505, 520), 'time.sleep', 'time.sleep', (['(0.1)'], {}), '(0.1)\n', (515, 520), False, 'import time\n'), ((107, 137), 'sys.platform.startswith', 'sys.platform.startswith', (['"""win"""'], {}), "('win')\n", (130, 137), False, 'import sys\n'), ((660, 700), 'testutils.assert_raises', 'assert_raises', (['subprocess.Timeo... |
import fmtrack
import os
import matplotlib.colors as colors
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import pickle
import pyvista
from sklearn.gaussian_process import GaussianProcessRegressor
from sklearn.gaussian_process.kernels import (RBF, Matern, RationalQuadratic,
... | [
"numpy.argsort",
"pyvista.Arrow",
"sklearn.gaussian_process.GaussianProcessRegressor",
"numpy.mean",
"pyvista.PolyData",
"numpy.sort",
"numpy.asarray",
"matplotlib.pyplot.style.use",
"sklearn.neighbors.KernelDensity",
"numpy.max",
"numpy.exp",
"numpy.linspace",
"numpy.vstack",
"numpy.min",... | [((1131, 1218), 'numpy.loadtxt', 'np.loadtxt', (["(root_directory + '/Gel_cell_coords/' + file_prefix_1 + '_cell_mesh.txt')"], {}), "(root_directory + '/Gel_cell_coords/' + file_prefix_1 +\n '_cell_mesh.txt')\n", (1141, 1218), True, 'import numpy as np\n'), ((1230, 1320), 'numpy.loadtxt', 'np.loadtxt', (["(root_dire... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from lxml import etree as ElementTree
from odoo.http import Controller, route, request
class Board(Controller):
@route('/board/add_to_dashboard', type='json', auth='user')
def add_to_dashboard(self, action_id... | [
"lxml.etree.tostring",
"odoo.http.request.env.ref",
"lxml.etree.fromstring",
"odoo.http.route"
] | [((221, 279), 'odoo.http.route', 'route', (['"""/board/add_to_dashboard"""'], {'type': '"""json"""', 'auth': '"""user"""'}), "('/board/add_to_dashboard', type='json', auth='user')\n", (226, 279), False, 'from odoo.http import Controller, route, request\n'), ((445, 495), 'odoo.http.request.env.ref', 'request.env.ref', (... |
import defectio
client = defectio.Client()
@client.event
async def on_ready():
print("We have logged in.")
@client.event
async def on_message(message: defectio.Message):
if message.author == client.user:
return
if message.content.startswith("$hello"):
await message.channel.send("Hello!... | [
"defectio.Client"
] | [((26, 43), 'defectio.Client', 'defectio.Client', ([], {}), '()\n', (41, 43), False, 'import defectio\n')] |