code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
import time from browserist import Browser from config.item_page import ITEM_PAGE from config.model import CheckOutPage, Item def add_to_cart(browser: Browser, amount: int, item: Item): browser.open.url(item.url) for _ in range(amount - 1): # The item count always starts at 1. browser.click.button(...
[ "time.sleep" ]
[((374, 389), 'time.sleep', 'time.sleep', (['(0.1)'], {}), '(0.1)\n', (384, 389), False, 'import time\n'), ((553, 566), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (563, 566), False, 'import time\n')]
from random import randint, choice from math import sin, cos, radians, exp, sqrt, fabs import pygame from pygame.sprite import Sprite # from pygame.math import vec2d from utils import SIM_COLORS, SCALE, SIGN from utils import euclidean_distance, vec2d, Rotate2D import numpy as np class Agent(Sprite): """ A agent...
[ "utils.SIGN", "math.exp", "pygame.draw.line", "utils.vec2d", "math.radians", "utils.euclidean_distance", "numpy.array", "pygame.sprite.Sprite.__init__" ]
[((2015, 2036), 'pygame.sprite.Sprite.__init__', 'Sprite.__init__', (['self'], {}), '(self)\n', (2030, 2036), False, 'from pygame.sprite import Sprite\n'), ((2487, 2507), 'utils.vec2d', 'vec2d', (['init_position'], {}), '(init_position)\n', (2492, 2507), False, 'from utils import euclidean_distance, vec2d, Rotate2D\n')...
import wiringpi import time import sys servo_pin = 18 motor1_pin = 23 motor2_pin = 24 SPI_CH = 0 READ_CH = 0 param = sys.argv set_smell = param[1] already_dgree = int(param[2]) set_dgree = int(param[3]) wiringpi.wiringPiSetupGpio() wiringpi.pinMode( motor1_pin, 1 ) wiringpi.pinMode( motor2_pin, 1 ) wiringpi.pinMode...
[ "wiringpi.pinMode", "wiringpi.pwmSetClock", "wiringpi.digitalWrite", "wiringpi.pwmSetMode", "time.sleep", "wiringpi.pwmWrite", "wiringpi.wiringPiSPIDataRW", "wiringpi.pwmSetRange", "wiringpi.wiringPiSPISetup", "wiringpi.wiringPiSetupGpio" ]
[((207, 235), 'wiringpi.wiringPiSetupGpio', 'wiringpi.wiringPiSetupGpio', ([], {}), '()\n', (233, 235), False, 'import wiringpi\n'), ((236, 267), 'wiringpi.pinMode', 'wiringpi.pinMode', (['motor1_pin', '(1)'], {}), '(motor1_pin, 1)\n', (252, 267), False, 'import wiringpi\n'), ((270, 301), 'wiringpi.pinMode', 'wiringpi....
# # 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, software # ...
[ "heat.common.i18n._", "heat.engine.constraints.CustomConstraint", "heat.engine.constraints.AllowedValues", "heat.engine.support.SupportStatus" ]
[((1103, 1141), 'heat.engine.support.SupportStatus', 'support.SupportStatus', ([], {'version': '"""6.0.0"""'}), "(version='6.0.0')\n", (1124, 1141), False, 'from heat.engine import support\n'), ((1386, 1422), 'heat.common.i18n._', '_', (['"""The name for the address scope."""'], {}), "('The name for the address scope.'...
import logging import tempfile from types import SimpleNamespace from pathlib import Path from typing import Any, Dict, Optional, Generator, Iterable, List, Tuple import sqlalchemy as sqla from sqlalchemy.orm import Session, sessionmaker import pytest from tweepy.models import User from chainblocker import Blocklis...
[ "tempfile.TemporaryDirectory", "chainblocker.BlocklistDBBase.metadata.create_all", "pytest.raises", "pathlib.Path", "sqlalchemy.orm.sessionmaker", "types.SimpleNamespace", "logging.getLogger" ]
[((416, 435), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (433, 435), False, 'import logging\n'), ((1749, 1887), 'types.SimpleNamespace', 'SimpleNamespace', ([], {'id': 'self.user_id', 'screen_name': 'self.screen_name', 'followers_count': 'self.followers_count', 'friends_count': 'self.friends_count'}), ...
from __future__ import print_function, absolute_import import time import torch from .utils.meters import AverageMeter import torch.nn.functional as F import numpy as np class Trainer(object): def __init__(self, model, model_inv): super(Trainer, self).__init__() self.device = torch.device('cuda' i...
[ "torch.cuda.is_available", "time.time" ]
[((703, 714), 'time.time', 'time.time', ([], {}), '()\n', (712, 714), False, 'import time\n'), ((1867, 1878), 'time.time', 'time.time', ([], {}), '()\n', (1876, 1878), False, 'import time\n'), ((322, 347), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (345, 347), False, 'import torch\n'), ((90...
__all__ = [ 'PredictionSummaryComponent', 'ImportancesComponent', 'FeatureDescriptionsComponent', 'FeatureInputComponent', 'PdpComponent', ] from math import ceil import numpy as np import pandas as pd import dash from dash import html, dcc, Input, Output, State, dash_table from dash.exceptions im...
[ "dash_bootstrap_components.RadioButton", "dash_bootstrap_components.Label", "dash.Output", "dash_bootstrap_components.Input", "dash_bootstrap_components.Select", "dash_bootstrap_components.Tooltip", "math.ceil", "dash.html.Div", "dash_bootstrap_components.Col", "dash_bootstrap_components.FormText"...
[((39603, 39626), 'math.ceil', 'ceil', (['(n_inputs / n_cols)'], {}), '(n_inputs / n_cols)\n', (39607, 39626), False, 'from math import ceil\n'), ((4323, 4373), 'dash.Output', 'Output', (["('modelprediction-' + self.name)", '"""children"""'], {}), "('modelprediction-' + self.name, 'children')\n", (4329, 4373), False, '...
# Line nofity import requests class LineMain: def lineNotifyMessage(self, token, msg): headers = { "Authorization": "Bearer " + token, "Content-Type" : "application/x-www-form-urlencoded" } payload = {'message': msg } r = requests.post("https...
[ "requests.post" ]
[((300, 391), 'requests.post', 'requests.post', (['"""https://notify-api.line.me/api/notify"""'], {'headers': 'headers', 'params': 'payload'}), "('https://notify-api.line.me/api/notify', headers=headers,\n params=payload)\n", (313, 391), False, 'import requests\n')]
from pathlib import Path PROJECT_ROOT = Path(__file__).parent.parent DATA_PATH = PROJECT_ROOT / "intro_to_pytorch/data"
[ "pathlib.Path" ]
[((41, 55), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (45, 55), False, 'from pathlib import Path\n')]
import hmac import hashlib import json import requests BASE_URL = 'https://api.mailgun.net/v3' class Mailgun(object): ACCESS_LEVELS = ['readonly', 'members', 'everyone'] def __init__(self, domain, private_key, public_key): self.private_key = private_key self.public_key = public_key ...
[ "requests.post", "requests.get", "json.dumps" ]
[((614, 674), 'requests.post', 'requests.post', (['(url + path)'], {'auth': 'auth', 'data': 'data', 'files': 'files'}), '(url + path, auth=auth, data=data, files=files)\n', (627, 674), False, 'import requests\n'), ((929, 979), 'requests.get', 'requests.get', (['(url + path)'], {'auth': 'auth', 'params': 'params'}), '(u...
from django.test import SimpleTestCase from pattern_library.utils import get_template_ancestors class TestGetTemplateAncestors(SimpleTestCase): def test_page(self): self.assertEqual( get_template_ancestors('patterns/pages/test_page/test_page.html'), [ 'patterns/pag...
[ "pattern_library.utils.get_template_ancestors" ]
[((210, 275), 'pattern_library.utils.get_template_ancestors', 'get_template_ancestors', (['"""patterns/pages/test_page/test_page.html"""'], {}), "('patterns/pages/test_page/test_page.html')\n", (232, 275), False, 'from pattern_library.utils import get_template_ancestors\n'), ((524, 589), 'pattern_library.utils.get_temp...
''' Builds a networkx graph from the coexistance data and attributes calculated by input.py ''' import sys import math import json import re import pandas as pd import networkx as nx from tqdm import tqdm def prob_calc(): print('Calculating probability normalised weights...') # calculate expected probability and ...
[ "pandas.read_csv", "pandas.merge", "networkx.Graph", "networkx.write_gexf", "networkx.from_pandas_dataframe" ]
[((460, 574), 'pandas.read_csv', 'pd.read_csv', (['"""data/coexistences.csv"""'], {'index_col': '(0)', 'dtype': "{'attribute1': str, 'attribute2': str, 'totals': int}"}), "('data/coexistences.csv', index_col=0, dtype={'attribute1': str,\n 'attribute2': str, 'totals': int})\n", (471, 574), True, 'import pandas as pd\...
"""Script that merges configurations for debug or simplification.""" from __future__ import print_function import argparse import yaml from opennmt.config import load_config def main(): parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument("config", nargs=...
[ "opennmt.config.load_config", "yaml.dump", "argparse.ArgumentParser" ]
[((202, 281), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), '(formatter_class=argparse.ArgumentDefaultsHelpFormatter)\n', (225, 281), False, 'import argparse\n'), ((394, 418), 'opennmt.config.load_config', 'load_config', (['args.config'], {}),...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
[ "tensorflow.python.ops.confusion_matrix.confusion_matrix" ]
[((1135, 1265), 'tensorflow.python.ops.confusion_matrix.confusion_matrix', 'cm.confusion_matrix', ([], {'labels': 'labels', 'predictions': 'predictions', 'num_classes': 'num_classes', 'dtype': 'dtype', 'name': 'name', 'weights': 'weights'}), '(labels=labels, predictions=predictions, num_classes=\n num_classes, dtype...
""" Module with tests for debug """ #----------------------------------------------------------------------------- # Copyright (c) 2013, the IPython Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #---------...
[ "StringIO.StringIO" ]
[((1172, 1182), 'StringIO.StringIO', 'StringIO', ([], {}), '()\n', (1180, 1182), False, 'from StringIO import StringIO\n')]
__author__ = "Altertech Group, https://www.altertech.com/" __copyright__ = "Copyright (C) 2012-2018 Altertech Group" __license__ = "Apache License 2.0" __version__ = "1.1.1" __description__ = "BME280 temperature/humidity/pressure sensors (I2C/SMBus)" __api__ = 5 __required__ = ['aao_get', 'value'] __mods_required__ = ...
[ "importlib.import_module", "eva.uc.driverapi.log_traceback", "time.time", "time.sleep", "eva.uc.driverapi.get_timeout", "ctypes.c_short" ]
[((6219, 6247), 'time.sleep', 'time.sleep', (['(wait_time / 1000)'], {}), '(wait_time / 1000)\n', (6229, 6247), False, 'import time\n'), ((8177, 8222), 'ctypes.c_short', 'c_short', (['((data[index + 1] << 8) + data[index])'], {}), '((data[index + 1] << 8) + data[index])\n', (8184, 8222), False, 'from ctypes import c_sh...
#!/usr/bin/python """ linuxrouter.py: Example network with Linux IP router This example converts a Node into a router using IP forwarding already built into Linux. The example topology creates a router and three IP subnets: - 192.168.1.0/24 (r0-eth1, IP: 192.168.1.1) - 172.16.0.0/12 (r0-eth2, IP: 172.16.0.1...
[ "mininet.log.info", "mininet.log.setLogLevel", "mininet.net.Mininet", "mininet.cli.CLI" ]
[((2445, 2463), 'mininet.net.Mininet', 'Mininet', ([], {'topo': 'topo'}), '(topo=topo)\n', (2452, 2463), False, 'from mininet.net import Mininet\n'), ((2487, 2525), 'mininet.log.info', 'info', (['"""*** Routing Table on Router:\n"""'], {}), "('*** Routing Table on Router:\\n')\n", (2491, 2525), False, 'from mininet.log...
import base64 from io import BytesIO import PIL def any_image_to_base64(any_image, format=None): """Convert an image to base64-encoded string :param any_image: a PIL.Image.Image instance, file-like object or path to an image file :type any_image: PIL.Image.Image/file/str :para...
[ "io.BytesIO" ]
[((833, 842), 'io.BytesIO', 'BytesIO', ([], {}), '()\n', (840, 842), False, 'from io import BytesIO\n')]
import click import requests def validate_token(ctx, param, value): if value is None: raise click.BadParameter('Pass a GitHub OAuth token with "%s" or set the environment variable %s' % ('" / "'.join(param.opts), param.envvar)) return value def validate_repository(ct...
[ "click.BadParameter", "click.argument", "click.option", "click.echo", "click.command", "click.ClickException", "requests.get", "requests.post", "click.style" ]
[((961, 976), 'click.command', 'click.command', ([], {}), '()\n', (974, 976), False, 'import click\n'), ((978, 1066), 'click.option', 'click.option', (['"""-t"""', '"""--token"""'], {'envvar': '"""GITHUB_OAUTH_TOKEN"""', 'callback': 'validate_token'}), "('-t', '--token', envvar='GITHUB_OAUTH_TOKEN', callback=\n vali...
import utility import math # The actual usable screen size is (in pixel): # WIDTH = 320 # HEIGHT = 222 # The number of line and columns visible at the same time in the interpreter is (based on 'M'): # MAX_LINE = 16 # Python font size = small # MAX_COLUMN = 42 # Python font size = small # MAX_LINE = 12 # Python fon...
[ "utility.printMenu", "math.sqrt" ]
[((806, 840), 'utility.printMenu', 'utility.printMenu', (['"""Statics"""', 'menu'], {}), "('Statics', menu)\n", (823, 840), False, 'import utility\n'), ((420, 455), 'math.sqrt', 'math.sqrt', (['(x ** 2 + y ** 2 + z ** 2)'], {}), '(x ** 2 + y ** 2 + z ** 2)\n', (429, 455), False, 'import math\n')]
# Copyright 2021 Sony Corporation. # Copyright 2021 Sony Group Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
[ "nnabla.functions.max_pooling", "nnabla.functions.concatenate", "nnabla.parametric_functions.deconvolution", "models.networks.initializers.bilinear_depthwise_initializer", "numpy.transpose", "nnabla.functions.relu", "numpy.random.RandomState", "nnabla.logger.logger.debug", "nnabla.functions.reshape"...
[((1166, 1192), 'numpy.random.RandomState', 'np.random.RandomState', (['(214)'], {}), '(214)\n', (1187, 1192), True, 'import numpy as np\n'), ((1483, 1665), 'nnabla.parametric_functions.deconvolution', 'PF.deconvolution', (['x', 'out_map', 'kernel'], {'pad': 'pad', 'stride': 'stride', 'dilation': 'dilation', 'w_init': ...
import click import spacy from tika import parser import re import math import string import sys import nltk from nltk.corpus import stopwords nltk.download('stopwords') import os def preprocess(doc): """ Used to preprocess the parsed resumes """ doc = doc.replace("\n", " ") doc = doc.replace(...
[ "os.getcwd", "click.option", "click.command", "math.acos", "re.findall", "tika.parser.from_file", "nltk.corpus.stopwords.words", "nltk.download", "math.degrees", "os.listdir" ]
[((143, 169), 'nltk.download', 'nltk.download', (['"""stopwords"""'], {}), "('stopwords')\n", (156, 169), False, 'import nltk\n'), ((5016, 5031), 'click.command', 'click.command', ([], {}), '()\n', (5029, 5031), False, 'import click\n'), ((5282, 5386), 'click.option', 'click.option', (['"""--out-file"""', '"""-o"""'], ...
""" This module implements plotting functions useful to report analysis results. Author: <NAME>, <NAME>, 2017 """ import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as mpatches import pandas as pd from nilearn.glm.first_level import check_design_matrix from nilearn.glm.contrasts import expr...
[ "matplotlib.pyplot.subplot", "matplotlib.pyplot.savefig", "numpy.abs", "matplotlib.pyplot.get_cmap", "numpy.sum", "matplotlib.pyplot.close", "nilearn.glm.first_level.check_design_matrix", "matplotlib.pyplot.subplots", "matplotlib.pyplot.colorbar", "nilearn.glm.contrasts.expression_to_contrast_vect...
[((1283, 1317), 'nilearn.glm.first_level.check_design_matrix', 'check_design_matrix', (['design_matrix'], {}), '(design_matrix)\n', (1302, 1317), False, 'from nilearn.glm.first_level import check_design_matrix\n'), ((2132, 2150), 'matplotlib.pyplot.tight_layout', 'plt.tight_layout', ([], {}), '()\n', (2148, 2150), True...
"""Date and time functions Refactored from Cufflinks' 'date_tools.py' module. Credits to @jorgesantos. """ import datetime as dt def get_date_from_today(delta, strfmt='%Y%m%d'): """ Returns a string that represents a date n numbers of days from today. Parameters ---------- delta : int ...
[ "datetime.datetime.strptime", "datetime.timedelta", "datetime.date.today" ]
[((797, 838), 'datetime.datetime.strptime', 'dt.datetime.strptime', (['string_date', 'strfmt'], {}), '(string_date, strfmt)\n', (817, 838), True, 'import datetime as dt\n'), ((440, 455), 'datetime.date.today', 'dt.date.today', ([], {}), '()\n', (453, 455), True, 'import datetime as dt\n'), ((458, 477), 'datetime.timede...
import pandas as pd import numpy as np import pickle import json from sklearn.metrics import mean_squared_error, mean_absolute_error from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelEncoder from keras.models import Model from keras.optimizers import RMSprop, Adam from keras....
[ "pandas.read_csv", "keras.preprocessing.sequence.pad_sequences", "sklearn.model_selection.train_test_split", "numpy.zeros", "sklearn.preprocessing.LabelEncoder", "keras.preprocessing.text.Tokenizer", "gensim.models.KeyedVectors.load_word2vec_format", "deepmm.models.DeepMultimodalModel", "numpy.sqrt"...
[((687, 710), 'pandas.read_csv', 'pd.read_csv', (['"""data.csv"""'], {}), "('data.csv')\n", (698, 710), True, 'import pandas as pd\n'), ((748, 803), 'gensim.models.KeyedVectors.load_word2vec_format', 'KeyedVectors.load_word2vec_format', (['"""embeddings_w2v.txt"""'], {}), "('embeddings_w2v.txt')\n", (781, 803), False, ...
"""Tests for scandir.scandir().""" from __future__ import unicode_literals import os import shutil import sys import time import unittest try: import scandir has_scandir = True except ImportError: has_scandir = False FILE_ATTRIBUTE_DIRECTORY = 16 TEST_PATH = os.path.abspath(os.path.join(os.path.dirname...
[ "os.mkdir", "os.remove", "scandir.walk", "os.makedirs", "os.path.basename", "os.path.dirname", "os.path.exists", "sys.getfilesystemencoding", "time.sleep", "os.path.normpath", "shutil.rmtree", "os.symlink", "os.path.join" ]
[((1000, 1019), 'os.mkdir', 'os.mkdir', (['TEST_PATH'], {}), '(TEST_PATH)\n', (1008, 1019), False, 'import os\n'), ((305, 330), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (320, 330), False, 'import os\n'), ((584, 615), 'os.symlink', 'os.symlink', (['__file__', 'link_name'], {}), '(__file_...
#!/usr/bin/python # -*- coding: utf-8 -*- import os import subprocess import sys import time import csv from itertools import combinations_with_replacement import timeit import torch import gc sys.path.append('/pytorch-cifar-master/') # mode = 'one' mode = 'two' # one_exec = 'cuda' # co_exec = 'cuda' co_exec = 'nn'...
[ "sys.path.append", "subprocess.Popen", "csv.reader", "csv.writer", "subprocess.Popen.poll", "time.sleep", "itertools.combinations_with_replacement", "time.time" ]
[((194, 235), 'sys.path.append', 'sys.path.append', (['"""/pytorch-cifar-master/"""'], {}), "('/pytorch-cifar-master/')\n", (209, 235), False, 'import sys\n'), ((4077, 4090), 'csv.reader', 'csv.reader', (['f'], {}), '(f)\n', (4087, 4090), False, 'import csv\n'), ((4697, 4737), 'itertools.combinations_with_replacement',...
from rest_framework.pagination import PageNumberPagination from rest_framework.response import Response class CustomPagination(PageNumberPagination): def get_paginated_response(self, data): return Response(data)
[ "rest_framework.response.Response" ]
[((217, 231), 'rest_framework.response.Response', 'Response', (['data'], {}), '(data)\n', (225, 231), False, 'from rest_framework.response import Response\n')]
from typing import Tuple from uuid import uuid4 from opwen_email_server import azure_constants as constants from opwen_email_server import config from opwen_email_server import events from opwen_email_server.services.auth import AzureAuth from opwen_email_server.services.queue import AzureQueue from opwen_email_server...
[ "uuid.uuid4", "opwen_email_server.services.auth.AzureAuth", "opwen_email_server.services.queue.AzureQueue", "opwen_email_server.services.storage.AzureTextStorage" ]
[((423, 540), 'opwen_email_server.services.storage.AzureTextStorage', 'AzureTextStorage', ([], {'account': 'config.BLOBS_ACCOUNT', 'key': 'config.BLOBS_KEY', 'container': 'constants.CONTAINER_SENDGRID_MIME'}), '(account=config.BLOBS_ACCOUNT, key=config.BLOBS_KEY,\n container=constants.CONTAINER_SENDGRID_MIME)\n', (4...
# Copyright (c) 2020 DDN. All rights reserved. # Use of this source code is governed by a MIT-style # license that can be found in the LICENSE file. import threading from django.db import transaction from chroma_core.services import ChromaService, ServiceThread from chroma_core.services.plugin_runner.resource_manager...
[ "chroma_core.services.ServiceThread", "chroma_core.services.plugin_runner.agent_daemon_interface.AgentDaemonRpcInterface", "chroma_core.services.plugin_runner.resource_manager.ResourceManager", "chroma_core.services.plugin_runner.agent_daemon.AgentPluginHandler", "chroma_core.services.plugin_runner.scan_dae...
[((1759, 1776), 'threading.Event', 'threading.Event', ([], {}), '()\n', (1774, 1776), False, 'import threading\n'), ((1802, 1819), 'threading.Event', 'threading.Event', ([], {}), '()\n', (1817, 1819), False, 'import threading\n'), ((2256, 2300), 'chroma_core.lib.storage_plugin.manager.storage_plugin_manager.get_errored...
import matplotlib.pyplot as plt import numpy as np from mode_shape import make_dir from scipy.interpolate import spline num = 300 fre = 2 scale = 1 x = np.arange(0,101) mode1 = np.sin(x*2*np.pi/100) mode2 = np.sin(x*np.pi/100) xnew = np.linspace(x.min(),x.max(),300) #4 0.01 result_path = 'data/1+2_scale_%0.1f_...
[ "matplotlib.pyplot.xlim", "matplotlib.pyplot.plot", "scipy.interpolate.spline", "mode_shape.make_dir", "matplotlib.pyplot.ylim", "matplotlib.pyplot.close", "matplotlib.pyplot.axis", "matplotlib.pyplot.figure", "numpy.sin", "numpy.arange", "matplotlib.pyplot.savefig" ]
[((159, 176), 'numpy.arange', 'np.arange', (['(0)', '(101)'], {}), '(0, 101)\n', (168, 176), True, 'import numpy as np\n'), ((184, 211), 'numpy.sin', 'np.sin', (['(x * 2 * np.pi / 100)'], {}), '(x * 2 * np.pi / 100)\n', (190, 211), True, 'import numpy as np\n'), ((214, 237), 'numpy.sin', 'np.sin', (['(x * np.pi / 100)'...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import tensorflow as tf from math import pi class proposal_q(): def __init__(self, config, scope_name='proposal'): self.config = config with tf.variable_scope(scope_name...
[ "tensorflow.reduce_sum", "tensorflow.nn.relu", "tensorflow.sqrt", "tensorflow.summary.scalar", "numpy.log", "tensorflow.stop_gradient", "tensorflow.reshape", "tensorflow.reduce_mean", "tensorflow.variable_scope", "numpy.zeros", "tensorflow.placeholder", "tensorflow.matmul", "tensorflow.exp",...
[((1769, 1794), 'tensorflow.reduce_sum', 'tf.reduce_sum', (['lq'], {'axis': '(1)'}), '(lq, axis=1)\n', (1782, 1794), True, 'import tensorflow as tf\n'), ((2088, 2161), 'tensorflow.placeholder', 'tf.placeholder', ([], {'name': '"""X"""', 'dtype': 'tf.float32', 'shape': '[None, self.config.dim]'}), "(name='X', dtype=tf.f...
# the API to `contrib.bech32m` is an abomination unto man. This API is slightly less bad from typing import Optional, Tuple from hsms.contrib.bech32m import ( bech32_decode as bech32_decode5, bech32_encode as bech32_encode5, convertbits, Encoding, ) def bech32_decode(text, max_length: int = 90) -> O...
[ "hsms.contrib.bech32m.bech32_encode", "hsms.contrib.bech32m.bech32_decode", "hsms.contrib.bech32m.convertbits" ]
[((393, 425), 'hsms.contrib.bech32m.bech32_decode', 'bech32_decode5', (['text', 'max_length'], {}), '(text, max_length)\n', (407, 425), True, 'from hsms.contrib.bech32m import bech32_decode as bech32_decode5, bech32_encode as bech32_encode5, convertbits, Encoding\n'), ((667, 690), 'hsms.contrib.bech32m.convertbits', 'c...
""" RB-related functions of gates and models """ #*************************************************************************************************** # Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS). # Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government reta...
[ "numpy.linalg.eigvals", "pygsti.tools.optools.diamonddist", "numpy.argmax", "pygsti.tools.rbtools.p_to_r", "pygsti.tools.matrixtools.unvec", "numpy.zeros", "numpy.transpose", "numpy.amax", "numpy.sort", "numpy.mean", "numpy.linalg.inv", "numpy.array", "warnings.warn", "pygsti.tools.optools...
[((4189, 4223), 'pygsti.tools.rbtools.p_to_r', '_rbtls.p_to_r', (['p'], {'d': 'd', 'rtype': 'rtype'}), '(p, d=d, rtype=rtype)\n', (4202, 4223), True, 'from pygsti.tools import rbtools as _rbtls\n'), ((9132, 9150), 'numpy.argmax', '_np.argmax', (['absgam'], {}), '(absgam)\n', (9142, 9150), True, 'import numpy as _np\n')...
import csv import datetime import os from django.contrib.gis.geos import Point from django.core.management import BaseCommand, CommandError from django.db import transaction from geopy import Nominatim from countries.models import Country from report.models import Report, Sighting, ReportedViaChoice from users.emails...
[ "users.emails.overdue_reports_reminder", "users.models.User.objects.filter" ]
[((570, 657), 'users.models.User.objects.filter', 'User.objects.filter', ([], {'role__in': '[User.COMMUNITY_LIAISON, User.MODERATOR, User.ADMIN]'}), '(role__in=[User.COMMUNITY_LIAISON, User.MODERATOR, User.\n ADMIN])\n', (589, 657), False, 'from users.models import User\n'), ((817, 862), 'users.emails.overdue_report...
import json import logging import os import pprint import shutil from typing import Any, Callable, Dict, List, Optional, Tuple, Union import deepdiff from tests.test_helpers.type_helpers import PytestConfig logger = logging.getLogger(__name__) IGNORE_PATH_TIMESTAMPS = [ # Ignore timestamps from the ETL pipeline...
[ "json.load", "pprint.pformat", "json.dumps", "os.path.isfile", "deepdiff.DeepDiff", "logging.getLogger" ]
[((219, 246), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (236, 246), False, 'import logging\n'), ((2522, 2612), 'deepdiff.DeepDiff', 'deepdiff.DeepDiff', (['golden', 'output'], {'exclude_regex_paths': 'ignore_paths', 'ignore_order': '(True)'}), '(golden, output, exclude_regex_paths=ig...
from tkinter import * from tkinter import messagebox import Clases_Bracket_Nuevo class ClaseUsuarioNuevo(): def VentanaUsuarioNuevo(v_main,nom_usuario,id_bracket): v=Toplevel() v.geometry("1030x700+%d+0" %((v.winfo_screenwidth() - 1030) / 2)) v.title("Bracket de To...
[ "Clases_Bracket_Nuevo.BotonesGrupos", "tkinter.messagebox.showinfo" ]
[((951, 1016), 'Clases_Bracket_Nuevo.BotonesGrupos', 'Clases_Bracket_Nuevo.BotonesGrupos', (['"""A"""', '(1)', 'frmGruposIzq'], {'text': '""""""'}), "('A', 1, frmGruposIzq, text='')\n", (985, 1016), False, 'import Clases_Bracket_Nuevo\n'), ((1081, 1146), 'Clases_Bracket_Nuevo.BotonesGrupos', 'Clases_Bracket_Nuevo.Boton...
#!/usr/bin/env python import argparse import os import glob import collections import tensorflow as tf import numpy as np from tensorflow.keras import Model # 100k # USER_SHAPE = 943 # ITEM_SHAPE = 1682 # POSTFIX = "-100k" # 25m USER_SHAPE = 162550 # 162541 ITEM_SHAPE = 209180 # 209171 POSTFIX = "-25m" tf.enabl...
[ "argparse.ArgumentParser", "tensorflow.data.TFRecordDataset", "os.path.join", "tensorflow.keras.metrics.Mean", "tensorflow.random.normal", "tensorflow.keras.losses.MSE", "tensorflow.keras.optimizers.SGD", "tensorflow.io.parse_single_example", "tensorflow.config.experimental.set_memory_growth", "te...
[((312, 339), 'tensorflow.enable_eager_execution', 'tf.enable_eager_execution', ([], {}), '()\n', (337, 339), True, 'import tensorflow as tf\n'), ((341, 384), 'tensorflow.debugging.set_log_device_placement', 'tf.debugging.set_log_device_placement', (['(True)'], {}), '(True)\n', (378, 384), True, 'import tensorflow as t...
# -*- coding:utf-8 -*- # Created by LuoJie at 12/12/19 import tensorflow as tf import pandas as pd import os, sys, inspect currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir) sys.path.insert(0,parentdir) from pgn.batcher import beam_test_batc...
[ "pgn.test_helper.greedy_decode", "pgn.model.PGN", "pgn.test_helper.beam_decode", "utils.config_gpu.config_gpu", "tensorflow.train.Checkpoint", "pandas.read_csv", "os.path.dirname", "sys.path.insert", "utils.params.get_params", "pgn.batcher.batcher", "inspect.currentframe", "utils.saveLoader.Vo...
[((224, 251), 'os.path.dirname', 'os.path.dirname', (['currentdir'], {}), '(currentdir)\n', (239, 251), False, 'import os, sys, inspect\n'), ((252, 281), 'sys.path.insert', 'sys.path.insert', (['(0)', 'parentdir'], {}), '(0, parentdir)\n', (267, 281), False, 'import os, sys, inspect\n'), ((854, 866), 'utils.config_gpu....
import argparse import os import sys def printExceptionAndExit(e): print(type(e)) print(str(e)) sys.exit() def extractDataFromFile(header_file, data_file): with open(header_file) as headerFile: headers = headerFile.read().splitlines() with open(data_file) as dataFile: data_file_li...
[ "os.makedirs", "argparse.ArgumentParser", "os.path.exists", "os.path.join", "os.listdir", "sys.exit" ]
[((109, 119), 'sys.exit', 'sys.exit', ([], {}), '()\n', (117, 119), False, 'import sys\n'), ((772, 793), 'os.listdir', 'os.listdir', (['directory'], {}), '(directory)\n', (782, 793), False, 'import os\n'), ((1574, 1602), 'os.makedirs', 'os.makedirs', (['directoryToMake'], {}), '(directoryToMake)\n', (1585, 1602), False...
"""Entity processing job.""" import html import re import spacy from flask import current_app from sqlalchemy import desc from aggrep import db from aggrep.jobs.base import Job from aggrep.models import Entity, EntityProcessQueue new_line = re.compile(r"(/\n)") ws = re.compile(r"\s+") nlp = spacy.load("en_core_web_m...
[ "aggrep.db.session.commit", "html.unescape", "aggrep.models.Entity", "spacy.load", "aggrep.models.EntityProcessQueue.post_id.in_", "sqlalchemy.desc", "aggrep.db.session.add", "flask.current_app.logger.info", "aggrep.db.session.rollback", "re.compile" ]
[((244, 264), 're.compile', 're.compile', (['"""(/\\\\n)"""'], {}), "('(/\\\\n)')\n", (254, 264), False, 'import re\n'), ((270, 288), 're.compile', 're.compile', (['"""\\\\s+"""'], {}), "('\\\\s+')\n", (280, 288), False, 'import re\n'), ((295, 323), 'spacy.load', 'spacy.load', (['"""en_core_web_md"""'], {}), "('en_core...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Apr 12 08:54:32 2021 OK so far: swoosh h2o: 1994-2019 30S to 30N mean, 82 hpa regressors: QBO_CDAS = +5 months lag correlated with h2o: 0.508 Anom_nino3p4 = no lags corr with h2o: -0.167 LR: no CV does R2 of 0.2857 Cross valid...
[ "seaborn.lineplot", "sklearn.model_selection.GridSearchCV", "numpy.abs", "sklearn.model_selection.cross_validate", "sklearn.model_selection.train_test_split", "aux_functions_strat.anomalize_xr", "sklearn.metrics.r2_score", "joblib.dump", "numpy.logspace", "aux_functions_strat.path_glob", "numpy....
[((1556, 1600), 'seaborn.set_theme', 'sns.set_theme', ([], {'style': '"""ticks"""', 'font_scale': '(1.5)'}), "(style='ticks', font_scale=1.5)\n", (1569, 1600), True, 'import seaborn as sns\n'), ((1680, 1701), 'pandas.DataFrame', 'pd.DataFrame', (['df_shap'], {}), '(df_shap)\n', (1692, 1701), True, 'import pandas as pd\...
#!/usr/bin/env python """ Creates lists of molecules on a grid with a +-0.5 pixel random offset. Hazen 12/16 """ import numpy import random import storm_analysis.sa_library.sa_h5py as saH5Py def emittersOnGrid(h5_name, nx, ny, sigma, spacing, zrange, zoffset, seed = 0): if seed is not None: random.se...
[ "argparse.ArgumentParser", "storm_analysis.sa_library.sa_h5py.saveLocalizations", "numpy.zeros", "numpy.ones", "random.random", "random.seed" ]
[((1206, 1246), 'storm_analysis.sa_library.sa_h5py.saveLocalizations', 'saH5Py.saveLocalizations', (['h5_name', 'peaks'], {}), '(h5_name, peaks)\n', (1230, 1246), True, 'import storm_analysis.sa_library.sa_h5py as saH5Py\n'), ((1312, 1398), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""...
import pytest import os from helpers.cluster import ClickHouseCluster from helpers.test_tools import TSV, assert_eq_with_retry ENABLE_DICT_CONFIG = ['configs/enable_dictionaries.xml'] DICTIONARY_FILES = ['configs/dictionaries/cache.xml'] cluster = ClickHouseCluster(__file__) instance = cluster.add_instance('instance'...
[ "helpers.cluster.ClickHouseCluster", "pytest.fixture" ]
[((250, 277), 'helpers.cluster.ClickHouseCluster', 'ClickHouseCluster', (['__file__'], {}), '(__file__)\n', (267, 277), False, 'from helpers.cluster import ClickHouseCluster\n'), ((375, 405), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (389, 405), False, 'import pytest\n')...
""" Condel ======== """ #import distribute_setup #distribute_setup.use_setuptools() from setuptools import setup, find_packages from condel import VERSION, AUTHORS, AUTHORS_EMAIL setup( name = "Condel", version = VERSION, packages = find_packages(), install_requires = [ "bgcore>=0.3.1", ], scripts = [ ...
[ "setuptools.find_packages" ]
[((241, 256), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (254, 256), False, 'from setuptools import setup, find_packages\n')]
# -*- coding: future_fstrings -*- import logging from .. import loader, utils logger = logging.getLogger(__name__) def register(cb): cb(ForwardMod()) class ForwardMod(loader.Module): """Forwards messages""" def __init__(self): self.commands = {"fwdall":self.fwdallcmd} self.config = {} ...
[ "logging.getLogger" ]
[((90, 117), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (107, 117), False, 'import logging\n')]
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('courses', '0002_auto_20140907_0049'), ] operations = [ migrations.AlterField( model_name='section', ...
[ "django.db.models.IntegerField" ]
[((350, 384), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'db_index': '(True)'}), '(db_index=True)\n', (369, 384), False, 'from django.db import models, migrations\n')]
""" desisim.pixsim ============== Tools for DESI pixel level simulations using specter """ from __future__ import absolute_import, division, print_function import sys import os import os.path import random from time import asctime import socket import astropy.units as u import numpy as np import desimodel.io impo...
[ "numpy.empty", "numpy.arange", "numpy.random.normal", "multiprocessing.cpu_count", "desiutil.log.get_logger", "time.asctime", "traceback.print_exc", "astropy.io.fits.getdata", "os.path.exists", "numpy.random.RandomState", "socket.gethostname", "desiutil.iers.freeze_iers", "numpy.random.poiss...
[((457, 469), 'desiutil.log.get_logger', 'get_logger', ([], {}), '()\n', (467, 469), False, 'from desiutil.log import get_logger\n'), ((8037, 8050), 'desiutil.iers.freeze_iers', 'freeze_iers', ([], {}), '()\n', (8048, 8050), False, 'from desiutil.iers import freeze_iers\n'), ((19668, 19699), 'numpy.zeros', 'np.zeros', ...
from calendar import timegm from datetime import datetime, timedelta, tzinfo from socket import inet_ntoa, inet_aton from struct import pack, unpack, calcsize # Used for converting python datetime objects to and from FILETIME structures. _EPOCH_AS_FILETIME = 116444736000000000 _HUNDREDS_OF_NANOS = 10000000 _ZERO = t...
[ "struct.calcsize", "struct.pack", "socket.inet_aton", "datetime.datetime.utcfromtimestamp", "datetime.timedelta" ]
[((319, 331), 'datetime.timedelta', 'timedelta', (['(0)'], {}), '(0)\n', (328, 331), False, 'from datetime import datetime, timedelta, tzinfo\n'), ((872, 885), 'struct.pack', 'pack', (['"""<I"""', 'v'], {}), "('<I', v)\n", (876, 885), False, 'from struct import pack, unpack, calcsize\n'), ((7322, 7350), 'datetime.datet...
# -*- coding: utf-8 -*- # # Copyright (c) 2019~2999 - Cologler <<EMAIL>> # ---------- # # ---------- from utils import get_instrs_from_b2a, get_instrs def test_return_none(): def func(): return None assert get_instrs(func) == get_instrs_from_b2a(func) def test_return_true(): def func(): ...
[ "utils.get_instrs", "utils.get_instrs_from_b2a" ]
[((225, 241), 'utils.get_instrs', 'get_instrs', (['func'], {}), '(func)\n', (235, 241), False, 'from utils import get_instrs_from_b2a, get_instrs\n'), ((245, 270), 'utils.get_instrs_from_b2a', 'get_instrs_from_b2a', (['func'], {}), '(func)\n', (264, 270), False, 'from utils import get_instrs_from_b2a, get_instrs\n'), (...
import re import pandas as pd import numpy as np import ast import pickle import datetime from nltk.corpus import stopwords import pkg_resources # from pkg_resources import resource_string, resource_listdir def memoize(func): memory = {} def memoizer(*args, **kwargs): key = str(args) + str(kwargs) ...
[ "pandas.read_csv", "pkg_resources.resource_filename", "datetime.datetime.now", "numpy.max", "pickle.load", "nltk.corpus.stopwords.words", "ast.literal_eval", "re.sub" ]
[((839, 909), 'pkg_resources.resource_filename', 'pkg_resources.resource_filename', (['"""dbaicd10.resources"""', '"""dba_icd10.csv"""'], {}), "('dbaicd10.resources', 'dba_icd10.csv')\n", (870, 909), False, 'import pkg_resources\n'), ((936, 1007), 'pkg_resources.resource_filename', 'pkg_resources.resource_filename', ([...
# Generated by Django 3.2.10 on 2022-02-18 15:20 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ("nautobot_device_lifecycle_mgmt", "0008_software_image_data_migration"), ] operations = [ migrations.RemoveField( model_name="softwarelc...
[ "django.db.migrations.RemoveField" ]
[((262, 331), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""softwarelcm"""', 'name': '"""download_url"""'}), "(model_name='softwarelcm', name='download_url')\n", (284, 331), False, 'from django.db import migrations\n'), ((376, 452), 'django.db.migrations.RemoveField', 'migrations...
import pyOcean_cpu as ocean # Fortran-style strides a = ocean.tensor([3,4],'F'); a.copy(range(a.nelem)) print(a) print(a.strides) b = a.reshape([2,3,2]) print(b) print(b.storage.obj == a.storage.obj) a.reshape([2,6],True) print(a) # C-style strides a = ocean.tensor([3,4],'C'); a.copy(range(a.nelem)) print(a) print...
[ "pyOcean_cpu.tensor" ]
[((57, 82), 'pyOcean_cpu.tensor', 'ocean.tensor', (['[3, 4]', '"""F"""'], {}), "([3, 4], 'F')\n", (69, 82), True, 'import pyOcean_cpu as ocean\n'), ((258, 283), 'pyOcean_cpu.tensor', 'ocean.tensor', (['[3, 4]', '"""C"""'], {}), "([3, 4], 'C')\n", (270, 283), True, 'import pyOcean_cpu as ocean\n')]
#-*- coding: utf-8 -*- # --------------------------------------------------------------------# # --------------------------------------------------------------------# # ---------- Made by <NAME> @ircam on 11/2015 # ---------- Copyright (c) 2018 CREAM Lab // CNRS / IRCAM / Sorbonne Université # ---------- # ---------- p...
[ "os.mkdir", "os.remove", "numpy.sum", "transform_audio.extract_sentences_tags", "numpy.max", "datetime.timedelta", "soundfile.write", "subprocess.Popen", "soundfile.read", "os.path.basename", "subprocess.check_output", "os.path.realpath", "numpy.asarray", "datetime.datetime", "subprocess...
[((1006, 1034), 'os.path.basename', 'os.path.basename', (['video_file'], {}), '(video_file)\n', (1022, 1034), False, 'import os\n'), ((1212, 1248), 'subprocess.call', 'subprocess.call', (['command'], {'shell': '(True)'}), '(command, shell=True)\n', (1227, 1248), False, 'import subprocess\n'), ((1637, 1665), 'os.path.ba...
from __future__ import annotations from typing import TYPE_CHECKING, Type import re if TYPE_CHECKING: import volga.types as types from typing import get_type_hints import volga.fields as fields import volga.format as format import volga.exceptions as exceptions RE_FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL...
[ "volga.exceptions.ParsingError", "typing.get_type_hints", "volga.format.dispatch", "volga.fields.Str", "re.compile" ]
[((386, 418), 're.compile', 're.compile', (['"""(.*?)(")"""', 'RE_FLAGS'], {}), '(\'(.*?)(")\', RE_FLAGS)\n', (396, 418), False, 'import re\n'), ((471, 540), 're.compile', 're.compile', (['"""(-?(?:0|[1-9]\\\\d*))(\\\\.\\\\d+)?([eE][-+]?\\\\d+)?"""', 'RE_FLAGS'], {}), "('(-?(?:0|[1-9]\\\\d*))(\\\\.\\\\d+)?([eE][-+]?\\\...
""" Cisco_IOS_XR_lib_mpp_oper This module contains a collection of YANG definitions for Cisco IOS\-XR lib\-mpp package operational data. This module contains definitions for the following management objects\: management\-plane\-protection\: Management Plane Protection (MPP) operational data Copyright (c) 2013...
[ "ydk.errors.YPYModelError", "ydk.types.YList" ]
[((5285, 5292), 'ydk.types.YList', 'YList', ([], {}), '()\n', (5290, 5292), False, 'from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict\n'), ((16567, 16574), 'ydk.types.YList', 'YList', ([], {}), '()\n', (16572, 16574), False, 'from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64...
import os import json import pprint import math import re services = None cfn_spec = None tf_resources = [] cfn_types = [] cfn_occurances = [] tf_occurances = [] cfn_exceptions = { 'AWS::CloudFormation::CustomResource': 'N/A', 'AWS::CloudFormation::Macro': 'N/A', 'AWS::CloudFormation::Stack': 'N/A', '...
[ "re.compile" ]
[((1582, 1637), 're.compile', 're.compile', (['"""(AWS\\\\:\\\\:[a-zA-Z0-9]+\\\\:\\\\:[a-zA-Z0-9]+)"""'], {}), "('(AWS\\\\:\\\\:[a-zA-Z0-9]+\\\\:\\\\:[a-zA-Z0-9]+)')\n", (1592, 1637), False, 'import re\n'), ((1670, 1737), 're.compile', 're.compile', (['"""terraformType\\\\\'\\\\:\\\\ \\\\\'(aws(?:\\\\_[a-zA-Z0-9]+)+)\\...
import sys import shutil import subprocess from pathlib import Path from functools import partial import pandas as pd import pysam import astk.utils.func as ul def site_flanking(chrN, site, sam, control_sam=None, window=150, bins=15): def signal_func(chrN, start, end, sam, control_sam): if control_sam...
[ "pandas.DataFrame", "functools.partial", "subprocess.run", "astk.utils.func.parse_cmd_r", "pandas.read_csv", "pysam.AlignmentFile", "pathlib.Path", "shutil.copy", "shutil.copytree", "pandas.concat", "sys.exit" ]
[((599, 653), 'functools.partial', 'partial', (['signal_func'], {'sam': 'sam', 'control_sam': 'control_sam'}), '(signal_func, sam=sam, control_sam=control_sam)\n', (606, 653), False, 'from functools import partial\n'), ((1235, 1256), 'pandas.read_csv', 'pd.read_csv', (['bam_meta'], {}), '(bam_meta)\n', (1246, 1256), Tr...
# Import essential libraries import requests import cv2 import numpy as np import imutils import mediapipe as mp import threading import pygame.mixer from pygame import * import time import os import sys import multiprocessing #Global variables definition landmarks= {'thumb': [1,2,3,4], 'index': [5,6,7,8], 'middle': [...
[ "cv2.cvtColor", "cv2.waitKey", "cv2.imdecode", "numpy.zeros", "time.time", "time.sleep", "numpy.array", "numpy.linalg.norm", "multiprocessing.Queue", "cv2.rectangle", "requests.get", "imutils.resize", "multiprocessing.Process", "cv2.imshow", "os.listdir", "sys.exit" ]
[((739, 750), 'numpy.zeros', 'np.zeros', (['(5)'], {}), '(5)\n', (747, 750), True, 'import numpy as np\n'), ((764, 775), 'numpy.zeros', 'np.zeros', (['(5)'], {}), '(5)\n', (772, 775), True, 'import numpy as np\n'), ((852, 868), 'numpy.zeros', 'np.zeros', (['(5, 2)'], {}), '((5, 2))\n', (860, 868), True, 'import numpy a...
from itertools import chain from time import time from django.urls import reverse from rest_framework import fields, serializers from . import models class LineItemSerializerRegistry: """Registers serializers with their associated models. This is used instead of discovery or a metaclass-based registry as ...
[ "rest_framework.fields.EmailField", "rest_framework.fields.BooleanField", "rest_framework.fields.DictField", "rest_framework.fields.SerializerMethodField", "time.time", "django.urls.reverse", "rest_framework.fields.DecimalField", "itertools.chain" ]
[((3968, 3998), 'rest_framework.fields.SerializerMethodField', 'fields.SerializerMethodField', ([], {}), '()\n', (3996, 3998), False, 'from rest_framework import fields, serializers\n'), ((4010, 4040), 'rest_framework.fields.SerializerMethodField', 'fields.SerializerMethodField', ([], {}), '()\n', (4038, 4040), False, ...
# -*- coding: utf-8 -*- from collections import OrderedDict from shutil import rmtree import xlsxwriter from classy_xlsx.core import XlsxContext from .worksheet import XlsxSheetFabric, OneRegionXlsxSheet, XlsxSheet class XlsxWorkbook(XlsxContext): file_name = '/tmp/workbook.xlsx' def __init__(self, context...
[ "collections.OrderedDict", "shutil.rmtree", "xlsxwriter.Workbook" ]
[((558, 594), 'xlsxwriter.Workbook', 'xlsxwriter.Workbook', (['self._dest_file'], {}), '(self._dest_file)\n', (577, 594), False, 'import xlsxwriter\n'), ((742, 755), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (753, 755), False, 'from collections import OrderedDict\n'), ((2463, 2483), 'shutil.rmtree', '...
from tc2py import * import pysces import re def getPyscesModel(): A = tc_allItems(); N = fromMatrix( tc_getStoichiometry(A), True ); rates0 = fromTC( tc_getRates(A) ); params = fromTC( tc_getParameters(A) ); fixed = fromTC( tc_getFixedVariables(A) ); inits = fromTC( tc_getInitialValues(A) ); ...
[ "pysces.model", "re.compile" ]
[((679, 696), 're.compile', 're.compile', (['"""\\\\^"""'], {}), "('\\\\^')\n", (689, 696), False, 'import re\n'), ((3839, 3856), 're.compile', 're.compile', (['"""\\\\^"""'], {}), "('\\\\^')\n", (3849, 3856), False, 'import re\n'), ((3922, 3981), 'pysces.model', 'pysces.model', (['"""model"""'], {'loader': '"""string"...
import logging from io import StringIO from optparse import make_option from django.core.management.base import BaseCommand import pymarc from core.management.commands import configure_logging from core import solr_index from core.models import Title configure_logging("openoni_purge_titles.config", "openoni_purge_e...
[ "io.StringIO", "core.solr_index.delete_title", "core.models.Title.objects.filter", "core.solr_index.conn", "logging.getLogger", "core.management.commands.configure_logging" ]
[((255, 332), 'core.management.commands.configure_logging', 'configure_logging', (['"""openoni_purge_titles.config"""', '"""openoni_purge_etitles.log"""'], {}), "('openoni_purge_titles.config', 'openoni_purge_etitles.log')\n", (272, 332), False, 'from core.management.commands import configure_logging\n'), ((340, 367), ...
from Instrucciones.TablaSimbolos.Instruccion import Instruccion from Instrucciones.Expresiones.Primitivo import Primitivo from Instrucciones.Expresiones.Enum import Enum from storageManager.jsonMode import * class CreateType(Instruccion): def __init__(self, id, tipo, listaExpre, strGram,linea, columna, strSent): ...
[ "Instrucciones.TablaSimbolos.Instruccion.Instruccion.__init__", "Instrucciones.Expresiones.Enum.Enum" ]
[((327, 393), 'Instrucciones.TablaSimbolos.Instruccion.Instruccion.__init__', 'Instruccion.__init__', (['self', 'tipo', 'linea', 'columna', 'strGram', 'strSent'], {}), '(self, tipo, linea, columna, strGram, strSent)\n', (347, 393), False, 'from Instrucciones.TablaSimbolos.Instruccion import Instruccion\n'), ((545, 593)...
"""Contains specialized classes which don't interact directly with users, don't have many instances, and use human-readable key names.""" from google.appengine.api import logservice # ErrorChecker from google.appengine.api import mail # ErrorChecker from google.appengine.api import search ...
[ "google.appengine.api.search.Index", "id_model.Cohort.get_by_id", "collections.defaultdict", "google.appengine.ext.db.get", "google.appengine.ext.db.put", "google.appengine.ext.db.IntegerProperty", "core.Model.to_dict", "logging.error", "google.appengine.ext.db.StringProperty", "datetime.datetime....
[((5117, 5142), 'util.DictionaryProperty', 'util.DictionaryProperty', ([], {}), '()\n', (5140, 5142), False, 'import util\n'), ((25947, 25968), 'google.appengine.ext.db.DateTimeProperty', 'db.DateTimeProperty', ([], {}), '()\n', (25966, 25968), False, 'from google.appengine.ext import db\n'), ((26404, 26426), 're.compi...
#!/usr/bin/env python3 from __future__ import print_function from __future__ import absolute_import import click from taw.util import * from taw.taw import * # This must be the end of imports # ======================= # bash completion stuff # ======================= click_global_dns_record_types = click.Choice(['...
[ "click.Choice", "click.option", "click.argument", "click.launch" ]
[((305, 394), 'click.Choice', 'click.Choice', (["['A', 'AAAA', 'ALIAS', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT']"], {}), "(['A', 'AAAA', 'ALIAS', 'CNAME', 'MX', 'NS', 'PTR', 'SOA',\n 'SRV', 'TXT'])\n", (317, 394), False, 'import click\n'), ((1549, 1645), 'click.argument', 'click.argument', (['"""zonename"""'...
from django.http import HttpResponse def home_page_view(request): return HttpResponse('Hello, Worlds!!')
[ "django.http.HttpResponse" ]
[((78, 109), 'django.http.HttpResponse', 'HttpResponse', (['"""Hello, Worlds!!"""'], {}), "('Hello, Worlds!!')\n", (90, 109), False, 'from django.http import HttpResponse\n')]
from django.contrib import admin from .models import Hero admin.site.register(Hero)
[ "django.contrib.admin.site.register" ]
[((59, 84), 'django.contrib.admin.site.register', 'admin.site.register', (['Hero'], {}), '(Hero)\n', (78, 84), False, 'from django.contrib import admin\n')]
''' Shows the grid world using pygame. Globecom Tutorial - December 7, 2021 Tutorial 29: Machine Learning for MIMO Systems with Large Arrays <NAME> (NCSU), <NAME> (UFPA) and <NAME>. (NCSU) ''' import time import matplotlib.pyplot as plt from matplotlib import colors import numpy as np import pygame as pg import pyscree...
[ "imageio.mimsave", "numpy.abs", "pygame.display.set_mode", "pyscreenshot.grab", "matplotlib.pyplot.subplots", "time.sleep", "pygame.transform.scale", "matplotlib.pyplot.figure", "pygame.image.load", "pygame.time.Clock", "matplotlib.colors.ListedColormap", "matplotlib.pyplot.savefig" ]
[((983, 1038), 'matplotlib.colors.ListedColormap', 'colors.ListedColormap', (["['gray', 'red', 'green', 'blue']"], {}), "(['gray', 'red', 'green', 'blue'])\n", (1004, 1038), False, 'from matplotlib import colors\n'), ((1093, 1105), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (1103, 1105), True, 'import ...
#!/usr/bin/env python import asyncio import websockets import datetime import random class SocketClient: def __init__(self): self.socket = websockets.connect('ws://localhost:9000') # asyncio.get_event_loop().run_until_complete() async def send(self, message): await self.socket.send(me...
[ "websockets.connect" ]
[((153, 194), 'websockets.connect', 'websockets.connect', (['"""ws://localhost:9000"""'], {}), "('ws://localhost:9000')\n", (171, 194), False, 'import websockets\n')]
import time import pleasehold if __name__ == '__main__': print('before') before = time.time() with pleasehold.hold('starting', 'complete') as holding: time.sleep(2) holding.push('1') holding.push('2') holding.push('3') holding.push('4') time.sleep(2) ...
[ "time.sleep", "pleasehold.hold", "time.time" ]
[((91, 102), 'time.time', 'time.time', ([], {}), '()\n', (100, 102), False, 'import time\n'), ((113, 152), 'pleasehold.hold', 'pleasehold.hold', (['"""starting"""', '"""complete"""'], {}), "('starting', 'complete')\n", (128, 152), False, 'import pleasehold\n'), ((173, 186), 'time.sleep', 'time.sleep', (['(2)'], {}), '(...
# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2016-10-11 18:31 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Teache...
[ "django.db.models.TextField", "django.db.models.URLField", "django.db.models.AutoField" ]
[((368, 461), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (384, 461), False, 'from django.db import migrations, models\...
# -*- coding: utf-8 -*- import random from collections import deque from .actions import JoinAction from .actions import VoteAction from .phases import Signup from .roles import Townie from .roles import Cop from .roles import Mafioso next_phase = {'signup': 'day', 'day': 'night', 'night':...
[ "collections.deque" ]
[((6892, 6906), 'collections.deque', 'deque', (['players'], {}), '(players)\n', (6897, 6906), False, 'from collections import deque\n')]
#!/usr/bin/env python """ Creates a commit that increments the versionCode in the build.gradle file. We usually run this before releasing a new beta version to the store. Does the following things: Step 1: (run without arguments) - Bump versionCode - Make a new commit After this run 'git review' and + the com...
[ "sh.git.add", "os.path.abspath", "sh.cd", "sh.git.commit", "os.path.join", "re.compile" ]
[((511, 546), 'os.path.join', 'os.path.join', (['script_dir', 'os.pardir'], {}), '(script_dir, os.pardir)\n', (523, 546), False, 'import os\n'), ((561, 588), 'os.path.abspath', 'os.path.abspath', (['parent_dir'], {}), '(parent_dir)\n', (576, 588), False, 'import os\n'), ((613, 657), 're.compile', 're.compile', (['VERSI...
from flask import current_app as app from flask import render_template @app.route('/') def home(): """Landing page.""" nav = [ {'name': 'Live', 'url': 'live.html'}, {'name': 'Demo', 'url': 'demo.html'} ] return render_template( 'index.html', title="Stonk Scraper", ...
[ "flask.current_app.route", "flask.render_template" ]
[((73, 87), 'flask.current_app.route', 'app.route', (['"""/"""'], {}), "('/')\n", (82, 87), True, 'from flask import current_app as app\n'), ((472, 522), 'flask.current_app.route', 'app.route', (['"""/live"""'], {'methods': "['GET', 'POST', 'PUT']"}), "('/live', methods=['GET', 'POST', 'PUT'])\n", (481, 522), True, 'fr...
from typing import Optional from fastapi.encoders import jsonable_encoder from .models import Application, ApplicationCreate, ApplicationUpdate def get(*, db_session, app_id: int) -> Optional[Application]: return db_session.query(Application).filter(Application.id == app_id).one_or_none() def get_by_name(*, db...
[ "fastapi.encoders.jsonable_encoder" ]
[((803, 824), 'fastapi.encoders.jsonable_encoder', 'jsonable_encoder', (['app'], {}), '(app)\n', (819, 824), False, 'from fastapi.encoders import jsonable_encoder\n')]
import calendar import numpy as np import pandas as pd import os import shutil import tables import tempfile import unittest from datetime import datetime from phildb.log_handler import LogHandler class LogHandlerTest(unittest.TestCase): def setUp(self): self.tmp_dir = tempfile.mkdtemp() self.log...
[ "pandas.Timestamp", "numpy.isnan", "datetime.datetime", "tempfile.mkdtemp", "shutil.rmtree", "tables.open_file", "os.path.join", "phildb.log_handler.LogHandler" ]
[((285, 303), 'tempfile.mkdtemp', 'tempfile.mkdtemp', ([], {}), '()\n', (301, 303), False, 'import tempfile\n'), ((328, 371), 'os.path.join', 'os.path.join', (['self.tmp_dir', '"""log_file.hdf5"""'], {}), "(self.tmp_dir, 'log_file.hdf5')\n", (340, 371), False, 'import os\n'), ((1638, 1681), 'os.path.join', 'os.path.joi...
from xml.etree.ElementTree import SubElement from elifecrossref import mime_type, resource_url, tags def set_component_list(parent, poa_article, crossref_config): """ Set the component_list from the article object component_list objects """ if not poa_article.component_list: return compon...
[ "elifecrossref.tags.add_inline_tag", "elifecrossref.tags.add_clean_tag", "xml.etree.ElementTree.SubElement", "elifecrossref.resource_url.generate_resource_url", "elifecrossref.mime_type.crossref_mime_type" ]
[((335, 371), 'xml.etree.ElementTree.SubElement', 'SubElement', (['parent', '"""component_list"""'], {}), "(parent, 'component_list')\n", (345, 371), False, 'from xml.etree.ElementTree import SubElement\n'), ((804, 835), 'xml.etree.ElementTree.SubElement', 'SubElement', (['parent', '"""component"""'], {}), "(parent, 'c...
""" """ from django.contrib import admin from challenges.models import Challenge from challenges.models import FilmChallenge class ChallengeAdmin(admin.ModelAdmin): list_display = ["task"] class FilmChallengeAdmin(admin.ModelAdmin): list_display = ["film"] admin.site.register(Challenge, ChallengeAdmin) admin...
[ "django.contrib.admin.site.register" ]
[((268, 314), 'django.contrib.admin.site.register', 'admin.site.register', (['Challenge', 'ChallengeAdmin'], {}), '(Challenge, ChallengeAdmin)\n', (287, 314), False, 'from django.contrib import admin\n'), ((315, 369), 'django.contrib.admin.site.register', 'admin.site.register', (['FilmChallenge', 'FilmChallengeAdmin'],...
# Copyright 2021 <NAME>. 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 applicable law or agree...
[ "pandas.read_csv", "readability_transformers.file_utils.CachedDataset" ]
[((1888, 1946), 'readability_transformers.file_utils.CachedDataset', 'CachedDataset', (['DATASET_ID', 'DATASET_ZIP_URL', 'DATAFILES_META'], {}), '(DATASET_ID, DATASET_ZIP_URL, DATAFILES_META)\n', (1901, 1946), False, 'from readability_transformers.file_utils import CachedDataset\n'), ((2036, 2057), 'pandas.read_csv', '...
from django.urls import path from . import views from django.conf.urls import url from django.contrib.auth.views import LoginView, LogoutView urlpatterns = [ path('',views.profile, name='profile'), path('login/',LoginView.as_view(template_name='accounts/login.html'),name='login'), path('logout/',LogoutView...
[ "django.contrib.auth.views.LogoutView.as_view", "django.contrib.auth.views.LoginView.as_view", "django.urls.path" ]
[((163, 202), 'django.urls.path', 'path', (['""""""', 'views.profile'], {'name': '"""profile"""'}), "('', views.profile, name='profile')\n", (167, 202), False, 'from django.urls import path\n'), ((373, 423), 'django.urls.path', 'path', (['"""register/"""', 'views.register'], {'name': '"""register"""'}), "('register/', ...
__author__ = 'royrusso' import json import logging import jmespath import pytest LOGGER = logging.getLogger(__name__) pytest_plugins = ["docker_compose"] @pytest.mark.es_versions def test_get_cluster_summary(session_scoped_container_getter, fixture): fixture.add_all_clusters(session_scoped_container_getter, cl...
[ "jmespath.search", "logging.getLogger", "json.dumps" ]
[((93, 120), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (110, 120), False, 'import logging\n'), ((2786, 2865), 'jmespath.search', 'jmespath.search', (['"""transient.discovery.zen.minimum_master_nodes"""', "res['data'][0]"], {}), "('transient.discovery.zen.minimum_master_nodes', res['d...
import bincopy import struct # goal is to extend the functionality and update the default creation parameter of a BinFile object. class MemFile(bincopy.BinFile): def __init__(self, filenames=None, overwrite=True, word_size_bits=16, header_encoding='utf-8'): super().__init__(filenames=filenames, overwrite=...
[ "struct.unpack", "struct.pack" ]
[((944, 971), 'struct.pack', 'struct.pack', (['fmt_out', '*data'], {}), '(fmt_out, *data)\n', (955, 971), False, 'import struct\n'), ((3405, 3432), 'struct.pack', 'struct.pack', (['fmt_out', '*data'], {}), '(fmt_out, *data)\n', (3416, 3432), False, 'import struct\n'), ((889, 923), 'struct.unpack', 'struct.unpack', (['f...
import numpy as np import pymc as pm challenger_data = np.genfromtxt( "../../Chapter2_MorePyMC/data/challenger_data.csv", skip_header=1, usecols=[1, 2], missing_values="NA", delimiter=",") # drop the NA values challenger_data = challenger_data[~np.isnan(challenger_data[:, 1])] temperature = challenger_data[...
[ "pymc.MAP", "pymc.Model", "numpy.genfromtxt", "pymc.MCMC", "numpy.isnan", "pymc.Bernoulli", "numpy.exp", "pymc.Normal" ]
[((57, 193), 'numpy.genfromtxt', 'np.genfromtxt', (['"""../../Chapter2_MorePyMC/data/challenger_data.csv"""'], {'skip_header': '(1)', 'usecols': '[1, 2]', 'missing_values': '"""NA"""', 'delimiter': '""","""'}), "('../../Chapter2_MorePyMC/data/challenger_data.csv',\n skip_header=1, usecols=[1, 2], missing_values='NA'...
from cs50 import get_float while True: owed = round(get_float("Change owed: ") * 100) if owed > 0: break coins = [25, 10, 5, 1] change = 0 for c in coins: if owed == 0: break change += owed // c owed = owed % c print(change)
[ "cs50.get_float" ]
[((57, 83), 'cs50.get_float', 'get_float', (['"""Change owed: """'], {}), "('Change owed: ')\n", (66, 83), False, 'from cs50 import get_float\n')]
import datetime from django.test import TestCase from django.urls import include, path, reverse from rest_framework.test import APITestCase from rest_framework.test import APIRequestFactory, URLPatternsTestCase from rest_framework import status from rest_framework.routers import DefaultRouter from log_api.models import...
[ "log_api.models.User.objects.count", "log_api.models.User.objects.get", "rest_framework.routers.DefaultRouter", "django.urls.include" ]
[((487, 502), 'rest_framework.routers.DefaultRouter', 'DefaultRouter', ([], {}), '()\n', (500, 502), False, 'from rest_framework.routers import DefaultRouter\n'), ((581, 601), 'django.urls.include', 'include', (['router.urls'], {}), '(router.urls)\n', (588, 601), False, 'from django.urls import include, path, reverse\n...
########################################################################################### ################ Python script to create a nested JSON object per study ################### ############################## <NAME> 13/12/2021 ################################# # import libraries import pandas as pd import os imp...
[ "pandas.read_csv", "json.dump", "os.chdir" ]
[((502, 534), 'os.chdir', 'os.chdir', (['working_directory_path'], {}), '(working_directory_path)\n', (510, 534), False, 'import os\n'), ((636, 681), 'pandas.read_csv', 'pd.read_csv', (['"""StudyDescription.txt"""'], {'sep': '"""\t"""'}), "('StudyDescription.txt', sep='\\t')\n", (647, 681), True, 'import pandas as pd\n...
import unittest import uuid import datetime from boto.mturk.question import ExternalQuestion from _init_environment import SetHostMTurkConnection, external_url, \ config_environment class Test(unittest.TestCase): def setUp(self): config_environment() def test_create_hit_extern...
[ "unittest.main", "boto.mturk.question.ExternalQuestion", "_init_environment.config_environment", "_init_environment.SetHostMTurkConnection" ]
[((948, 963), 'unittest.main', 'unittest.main', ([], {}), '()\n', (961, 963), False, 'import unittest\n'), ((264, 284), '_init_environment.config_environment', 'config_environment', ([], {}), '()\n', (282, 284), False, 'from _init_environment import SetHostMTurkConnection, external_url, config_environment\n'), ((350, 4...
import os import time from gtts import gTTS import pygame from pygame import USEREVENT from pygame import mixer from pygame._sdl2 import get_num_audio_devices, get_audio_device_name language = input("Language [en, ar... etc]:\n") accent = input("Accent: [com.au, co.uk, com, ca, co.in, ie, co.za, ca, fr, c...
[ "os.remove", "gtts.gTTS", "pygame.mixer.init", "pygame.mixer.music.play", "os.system", "pygame.mixer.music.unload", "pygame.mixer.music.get_busy", "pygame.mixer.music.load" ]
[((389, 405), 'os.system', 'os.system', (['"""cls"""'], {}), "('cls')\n", (398, 405), False, 'import os\n'), ((407, 447), 'os.system', 'os.system', (['"""title Google Text-to-Speech"""'], {}), "('title Google Text-to-Speech')\n", (416, 447), False, 'import os\n'), ((509, 553), 'gtts.gTTS', 'gTTS', ([], {'text': 'mytext...
import unittest from Graph import GFD class Test_GFD(unittest.TestCase): def setUp(self): self.gfd = GFD('person') def test_initial(self): self.assertEqual(1, len(self.gfd.nodes)) self.assertEqual(0, len(self.gfd.edges)) self.assertEqual('person', self.gfd.nodes[0].type) ...
[ "unittest.main", "Graph.GFD" ]
[((2524, 2539), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2537, 2539), False, 'import unittest\n'), ((115, 128), 'Graph.GFD', 'GFD', (['"""person"""'], {}), "('person')\n", (118, 128), False, 'from Graph import GFD\n')]
""" Implements agents for TD3 algorithms """ from typing import Tuple, Dict, List import tensorflow as tf import tensorflow_probability as tfp import numpy as np import gym from tf2rl.common.models import MLPFeatureExtractor from tf2rl.common.base_class import BasePolicy tfd = tfp.distributions class TD3Policy(Ba...
[ "tensorflow.clip_by_value", "tensorflow.random.normal", "tensorflow.keras.layers.Dense", "tensorflow.concat", "tf2rl.common.models.MLPFeatureExtractor", "tensorflow.keras.Sequential" ]
[((1193, 1257), 'tf2rl.common.models.MLPFeatureExtractor', 'MLPFeatureExtractor', (['self.layers', 'self.activation'], {'name': '"""pi_net"""'}), "(self.layers, self.activation, name='pi_net')\n", (1212, 1257), False, 'from tf2rl.common.models import MLPFeatureExtractor\n'), ((1368, 1456), 'tensorflow.keras.layers.Dens...
from collections import deque m, n = map(int, input().split()) graph = [] queue = deque([]) for i in range(n): graph.append(list(map(int, input().split()))) for j in range(m): # 익은 토마토 큐에 저장 if graph[i][j] == 1: queue.append([i, j]) dx = [-1, 1, 0, 0] dy = [0, 0, -1, 1] def bfs(): ...
[ "collections.deque" ]
[((83, 92), 'collections.deque', 'deque', (['[]'], {}), '([])\n', (88, 92), False, 'from collections import deque\n')]
import json import logging import time import numpy as np from sklearn.svm import OneClassSVM from sklearn.metrics import roc_auc_score from sklearn.metrics.pairwise import pairwise_distances from base.base_dataset import BaseADDataset from networks.main import build_network class OCSVM(object): """A class for O...
[ "json.dump", "networks.main.build_network", "sklearn.metrics.pairwise.pairwise_distances", "logging.getLogger", "time.time", "sklearn.metrics.roc_auc_score", "numpy.array", "sklearn.svm.OneClassSVM", "numpy.concatenate" ]
[((552, 585), 'sklearn.svm.OneClassSVM', 'OneClassSVM', ([], {'kernel': 'kernel', 'nu': 'nu'}), '(kernel=kernel, nu=nu)\n', (563, 585), False, 'from sklearn.svm import OneClassSVM\n'), ((1071, 1335), 'networks.main.build_network', 'build_network', (['"""embedding"""', 'dataset'], {'embedding_size': 'embedding_size', 'p...
from os import environ from hashlib import md5 from aiogram.types import (Message, ReplyKeyboardMarkup, KeyboardButton) from objects import globals from objects.globals import dp, config from db_models.AuthUser import AuthUser from keyboards.keyboards import MENU_BUTTONS @dp.message_handler(commands="start...
[ "aiogram.types.ReplyKeyboardMarkup", "aiogram.types.KeyboardButton", "db_models.AuthUser.AuthUser.objects.filter", "os.environ.get", "objects.globals.dp.message_handler" ]
[((286, 322), 'objects.globals.dp.message_handler', 'dp.message_handler', ([], {'commands': '"""start"""'}), "(commands='start')\n", (304, 322), False, 'from objects.globals import dp, config\n'), ((1481, 1540), 'aiogram.types.ReplyKeyboardMarkup', 'ReplyKeyboardMarkup', ([], {'resize_keyboard': '(True)', 'keyboard': '...
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Chat protocols. """ from incremental import Version from twisted.python.deprecate import deprecatedModuleAttribute deprecatedModuleAttribute( Version("Twisted", 16, 2, 0), "There is no replacement for this module.", "twisted.wor...
[ "incremental.Version" ]
[((226, 254), 'incremental.Version', 'Version', (['"""Twisted"""', '(16)', '(2)', '(0)'], {}), "('Twisted', 16, 2, 0)\n", (233, 254), False, 'from incremental import Version\n')]
from cryptography.fernet import Fernet import os def write_key(): """ Generates a key and save it into a file """ key = Fernet.generate_key() with open("key.key", "wb") as key_file: key_file.write(key) def load_key(): """ Loads the key from the current directory named `key.key` ...
[ "cryptography.fernet.Fernet", "cryptography.fernet.Fernet.generate_key", "argparse.ArgumentParser" ]
[((138, 159), 'cryptography.fernet.Fernet.generate_key', 'Fernet.generate_key', ([], {}), '()\n', (157, 159), False, 'from cryptography.fernet import Fernet\n'), ((498, 509), 'cryptography.fernet.Fernet', 'Fernet', (['key'], {}), '(key)\n', (504, 509), False, 'from cryptography.fernet import Fernet\n'), ((908, 919), 'c...
from pypom import Page, Region from selenium.webdriver.common.by import By from selenium.webdriver.common.action_chains import ActionChains class Base(Page): _url = '{base_url}/{locale}' _amo_header = (By.CLASS_NAME, 'Header-title') def __init__(self, selenium, base_url, locale='en-US', **kwargs): ...
[ "pages.desktop.themes.Themes", "selenium.webdriver.common.action_chains.ActionChains", "pages.desktop.login.Login", "pages.desktop.extensions.Extensions", "pages.desktop.search.Search" ]
[((2724, 2764), 'pages.desktop.login.Login', 'Login', (['self.selenium', 'self.page.base_url'], {}), '(self.selenium, self.page.base_url)\n', (2729, 2764), False, 'from pages.desktop.login import Login\n'), ((2923, 2950), 'selenium.webdriver.common.action_chains.ActionChains', 'ActionChains', (['self.selenium'], {}), '...
# Generated by Django 3.2 on 2021-04-23 22:50 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('archives', '0014_alter_contact_message'), ] operations = [ migrations.CreateModel( name='Partner', fields=[ ...
[ "django.db.models.BigAutoField", "django.db.models.CharField", "django.db.models.FileField" ]
[((333, 429), 'django.db.models.BigAutoField', 'models.BigAutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (352, 429), False, 'from django.db import migrations, m...
# Generated by Django 2.1.9 on 2019-10-03 13:27 from django.db import migrations, models import image_cropping.fields class Migration(migrations.Migration): dependencies = [ ("com", "0004_compage_is_interest_group"), ] operations = [ migrations.AddField( model_name="compage...
[ "django.db.models.ImageField" ]
[((858, 1068), 'django.db.models.ImageField', 'models.ImageField', ([], {'blank': '(True)', 'help_text': '"""Bilder som er større enn 770x300 px ser best ut. Du kan beskjære bildet etter opplasting."""', 'null': '(True)', 'upload_to': '"""uploads/news_pictures"""', 'verbose_name': '"""Bilde"""'}), "(blank=True, help_te...
import json import os from cond_stmt import CondStmt from trace import Trace import base64 class Importer: INPUT_NAME = "id_" found_conditions = set() files = None def __init__(self, folder): self.folder = folder self.files = self.get_files() def get_files(self): ...
[ "cond_stmt.CondStmt.fromJson", "os.listdir", "json.loads" ]
[((336, 359), 'os.listdir', 'os.listdir', (['self.folder'], {}), '(self.folder)\n', (346, 359), False, 'import os\n'), ((1810, 1829), 'json.loads', 'json.loads', (['content'], {}), '(content)\n', (1820, 1829), False, 'import json\n'), ((2392, 2429), 'os.listdir', 'os.listdir', (["(self.folder + '/../hangs')"], {}), "(s...