code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
''' ASAC (Active Sensing using Actor-Critic Model) (12/18/2018) Prediction Function only with Selected Samples ''' #%% Necessary packages import tensorflow as tf #%% Prediction Function ''' Inputs: - trainX, train Y (training set) - testX: testing features - trainG: mask vector for selected training samples ...
[ "tensorflow.contrib.layers.fully_connected", "tensorflow.nn.dynamic_rnn", "tensorflow.reset_default_graph", "tensorflow.global_variables_initializer", "tensorflow.reshape", "tensorflow.Session", "tensorflow.contrib.rnn.BasicLSTMCell", "tensorflow.placeholder", "tensorflow.train.AdamOptimizer" ]
[((541, 565), 'tensorflow.reset_default_graph', 'tf.reset_default_graph', ([], {}), '()\n', (563, 565), True, 'import tensorflow as tf\n'), ((1183, 1239), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32', '[None, seq_length, data_dim]'], {}), '(tf.float32, [None, seq_length, data_dim])\n', (1197, 1239), True,...
import numpy as np import pickle as pkl import scipy.sparse as sp no_of_graphs = int(input(" no. pf graphs ")) start = int(input(" starting point of graphs ")) #total_type_edges = int(input(" type of edges \n")) total_type_edges = 4 data_folder = "./data/custom/" for graph_num in range(start,no_of_graphs): ...
[ "scipy.sparse.csr_matrix", "numpy.zeros" ]
[((498, 517), 'numpy.zeros', 'np.zeros', (['num_nodes'], {}), '(num_nodes)\n', (506, 517), True, 'import numpy as np\n'), ((531, 550), 'numpy.zeros', 'np.zeros', (['num_nodes'], {}), '(num_nodes)\n', (539, 550), True, 'import numpy as np\n'), ((1312, 1328), 'scipy.sparse.csr_matrix', 'sp.csr_matrix', (['X'], {}), '(X)\...
import discord from discord.ext import commands import ast class Dev(commands.Cog): def __init__(self, client): self.client = client self.config = client.config def insert_returns(self, body): # insert return stmt if the last expression is a expression statement if isinstance(...
[ "discord.ext.commands.command", "ast.Return", "discord.Embed", "ast.fix_missing_locations", "discord.Color.blue", "discord.Game", "ast.parse", "discord.ext.commands.is_owner" ]
[((815, 834), 'discord.ext.commands.is_owner', 'commands.is_owner', ([], {}), '()\n', (832, 834), False, 'from discord.ext import commands\n'), ((840, 869), 'discord.ext.commands.command', 'commands.command', ([], {'hidden': '(True)'}), '(hidden=True)\n', (856, 869), False, 'from discord.ext import commands\n'), ((1751...
# Generated by Django 2.2.1 on 2020-06-28 15:55 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('documents', '0001_initial'), ] operations = [ migrations.AlterModelOptions( name='subcategory',...
[ "django.db.models.ForeignKey", "django.db.models.CharField", "django.db.migrations.AlterModelOptions", "django.db.models.SlugField" ]
[((259, 361), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""subcategory"""', 'options': "{'verbose_name_plural': 'Danh Mục Nhỏ'}"}), "(name='subcategory', options={\n 'verbose_name_plural': 'Danh Mục Nhỏ'})\n", (287, 361), False, 'from django.db import migrations, models...
import datetime print(datetime.time(1, 2, 3, 4)) print(datetime.time(25, 2, 3, 4))
[ "datetime.time" ]
[((22, 47), 'datetime.time', 'datetime.time', (['(1)', '(2)', '(3)', '(4)'], {}), '(1, 2, 3, 4)\n', (35, 47), False, 'import datetime\n'), ((55, 81), 'datetime.time', 'datetime.time', (['(25)', '(2)', '(3)', '(4)'], {}), '(25, 2, 3, 4)\n', (68, 81), False, 'import datetime\n')]
import argparse import configparser import logging import os import shutil import signal import subprocess import sys import threading import time from os import path from pathlib import Path from socket import * from typing import Dict from objs import Frame from objs.ack import Ack from objs.frame_builder import Fra...
[ "threading.Thread", "objs.packet.Packet.unpack", "os.mkdir", "argparse.ArgumentParser", "logging.warning", "os.path.isdir", "os.path.exists", "time.sleep", "objs.frame_builder.FrameBuilder", "logging.info", "pathlib.Path", "objs.ack.Ack", "time.time", "objs.metadata.Metadata.unpack", "sh...
[((406, 433), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (431, 433), False, 'import configparser\n'), ((688, 721), 'pathlib.Path', 'Path', (["config['CLIENT']['LogPath']"], {}), "(config['CLIENT']['LogPath'])\n", (692, 721), False, 'from pathlib import Path\n'), ((1294, 1324), 'logging....
from typing import List from aoc.classes import AoCResult, AoCReturn def main(puzzle_input: List[str]): floor = 0 basement = False for line in puzzle_input: for i, char in enumerate(line): if char == "(": floor += 1 elif char == ")": floor -...
[ "aoc.classes.AoCReturn", "aoc.classes.AoCResult" ]
[((480, 511), 'aoc.classes.AoCResult', 'AoCResult', (['floor', '"""Final floor"""'], {}), "(floor, 'Final floor')\n", (489, 511), False, 'from aoc.classes import AoCResult, AoCReturn\n'), ((523, 554), 'aoc.classes.AoCReturn', 'AoCReturn', (['(result_1, result_2)'], {}), '((result_1, result_2))\n', (532, 554), False, 'f...
import copy import logging from micropsi_core.runtime import logger class StatusLogger(object): INACTIVE = "inactive" ACTIVE = "active" SUCCESS = "success" FAILURE = "failure" def __init__(self, name): """ Logger that accepts non-string data """ self.name = name self._l...
[ "copy.deepcopy", "micropsi_core.runtime.logger.register_logger", "logging.getLogger" ]
[((328, 351), 'logging.getLogger', 'logging.getLogger', (['name'], {}), '(name)\n', (345, 351), False, 'import logging\n'), ((360, 403), 'micropsi_core.runtime.logger.register_logger', 'logger.register_logger', (['name', 'logging.DEBUG'], {}), '(name, logging.DEBUG)\n', (382, 403), False, 'from micropsi_core.runtime im...
import json import sys def return_json_obj(): with open('saves/content.json', 'r', encoding='utf-8') as file: return json.loads(file.read()) def write_json_obj(json_obj): with open('saves/content.json', 'w', encoding='utf-8') as file: json.dump(json_obj, file, indent=4) def receive_data(re...
[ "json.dump", "sys.stdin.buffer.readlines" ]
[((373, 401), 'sys.stdin.buffer.readlines', 'sys.stdin.buffer.readlines', ([], {}), '()\n', (399, 401), False, 'import sys\n'), ((263, 298), 'json.dump', 'json.dump', (['json_obj', 'file'], {'indent': '(4)'}), '(json_obj, file, indent=4)\n', (272, 298), False, 'import json\n')]
#@author:<NAME> #HLRobotics-Automation import git import cv2 import subprocess import sys def update(): try: print("HLEngine:updating MATTBot 2020......") git_dir = "../../../MATTBot/" g = git.cmd.Git(git_dir) g.pull() return("HLEngine:MATTbot updated, reboot MATT to ...
[ "git.cmd.Git" ]
[((225, 245), 'git.cmd.Git', 'git.cmd.Git', (['git_dir'], {}), '(git_dir)\n', (236, 245), False, 'import git\n')]
import numpy as np # Variables controlling flow of the program mode_globals = 2 save_history_globals = True load_recording_globals = False # Variables used for physical simulation dt_main_simulation_globals = 0.020 speedup_globals = 1.0 # MPC dt_mpc_simulation_globals = 0.20 mpc_horizon_globals = 20 # Parameters o...
[ "numpy.sin", "numpy.random.normal", "numpy.cos" ]
[((1563, 1578), 'numpy.cos', 'np.cos', (['s.angle'], {}), '(s.angle)\n', (1569, 1578), True, 'import numpy as np\n'), ((1588, 1603), 'numpy.sin', 'np.sin', (['s.angle'], {}), '(s.angle)\n', (1594, 1603), True, 'import numpy as np\n'), ((2289, 2307), 'numpy.random.normal', 'np.random.normal', ([], {}), '()\n', (2305, 23...
import torch import random import numpy as np from pathlib import Path from typing import Any, List, Tuple, Dict, Optional, Callable from torch.utils.data import DataLoader from torch.utils.data.sampler import SubsetRandomSampler from image_classification.utils import import_class, import_object import wandb import l...
[ "torch.utils.data.sampler.SubsetRandomSampler", "numpy.random.seed", "torch.utils.data.DataLoader", "torch.manual_seed", "pathlib.Path", "random.seed", "torch.cuda.is_available", "image_classification.utils.import_class", "image_classification.utils.import_object", "logging.getLogger" ]
[((333, 360), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (350, 360), False, 'import logging\n'), ((756, 788), 'pathlib.Path', 'Path', (['self.config.checkpoint_dir'], {}), '(self.config.checkpoint_dir)\n', (760, 788), False, 'from pathlib import Path\n'), ((945, 962), 'random.seed', '...
# -*- coding: utf-8 -*- import urllib2 import json import xml.etree.ElementTree as et from os import listdir from os.path import isfile, join import time from pprint import pprint from xmljson import badgerfish as bf import re import sys import import_xml_to_ckan_util as importlib story_fields = ['identifier', 'title...
[ "xml.etree.ElementTree.parse", "xmljson.badgerfish.data", "json.dumps", "time.time", "import_xml_to_ckan_util.init", "import_xml_to_ckan_util.org_exists", "os.path.join", "os.listdir" ]
[((1413, 1425), 'xmljson.badgerfish.data', 'bf.data', (['xml'], {}), '(xml)\n', (1420, 1425), True, 'from xmljson import badgerfish as bf\n'), ((2825, 2836), 'time.time', 'time.time', ([], {}), '()\n', (2834, 2836), False, 'import time\n'), ((2883, 2899), 'import_xml_to_ckan_util.init', 'importlib.init', ([], {}), '()\...
from pandas import DataFrame, read_hdf import numpy as np import os import matplotlib.pyplot as plt # parameters directories = ["/data/u_rgast_software/PycharmProjects/BrainNetworks/BasalGanglia/stn_gpe_healthy_opt2/PopulationDrops"] fid = "PopulationDrop" params = ['eta_e', 'eta_p', 'eta_a', 'delta_e', 'delta_p', 'de...
[ "matplotlib.pyplot.show", "pandas.read_hdf", "matplotlib.pyplot.subplots", "numpy.round", "os.listdir" ]
[((875, 889), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (887, 889), True, 'import matplotlib.pyplot as plt\n'), ((957, 1007), 'numpy.round', 'np.round', (["winner['results'].iloc[0][1]"], {'decimals': '(1)'}), "(winner['results'].iloc[0][1], decimals=1)\n", (965, 1007), True, 'import numpy as np\n...
import random import numpy as np import pytest from pandas import DataFrame from tests.utils import assert_dataframes_equals from weaverbird.backends.pandas_executor.steps.rank import execute_rank from weaverbird.pipeline.steps import RankStep @pytest.fixture def sample_df(): return DataFrame( {'COUNTRY...
[ "pandas.DataFrame", "weaverbird.backends.pandas_executor.steps.rank.execute_rank", "random.choice", "tests.utils.assert_dataframes_equals", "numpy.random.random", "weaverbird.pipeline.steps.RankStep" ]
[((292, 388), 'pandas.DataFrame', 'DataFrame', (["{'COUNTRY': ['France'] * 3 + ['USA'] * 4, 'VALUE': [10, 20, 30, 10, 40, 30, 50]\n }"], {}), "({'COUNTRY': ['France'] * 3 + ['USA'] * 4, 'VALUE': [10, 20, 30, \n 10, 40, 30, 50]})\n", (301, 388), False, 'from pandas import DataFrame\n'), ((448, 519), 'weaverbird.pi...
import numpy as np import matplotlib.pyplot as plt from sklearn import decomposition from matplotlib import pylab from matplotlib.patches import Rectangle from pylab import cm from prettytable import PrettyTable class DataPlotting: # singleton instance = None def __init__(self, calibration_dat...
[ "matplotlib.pylab.subplot", "matplotlib.patches.Rectangle", "matplotlib.pyplot.gca", "matplotlib.pyplot.scatter", "matplotlib.pyplot.legend", "matplotlib.pyplot.setp", "matplotlib.pyplot.axis", "matplotlib.pyplot.text", "matplotlib.pyplot.figure", "numpy.where", "numpy.array", "prettytable.Pre...
[((1104, 1113), 'matplotlib.pyplot.gca', 'plt.gca', ([], {}), '()\n', (1111, 1113), True, 'import matplotlib.pyplot as plt\n'), ((1226, 1260), 'matplotlib.pyplot.setp', 'plt.setp', (['plot_ref'], {'frame_on': '(False)'}), '(plot_ref, frame_on=False)\n', (1234, 1260), True, 'import matplotlib.pyplot as plt\n'), ((1272, ...
from twitter.user import User from twitter.downloader import Downloader user = User('elonmusk') user.getID() user.collectPhotos() Downloader().download(user)
[ "twitter.downloader.Downloader", "twitter.user.User" ]
[((80, 96), 'twitter.user.User', 'User', (['"""elonmusk"""'], {}), "('elonmusk')\n", (84, 96), False, 'from twitter.user import User\n'), ((134, 146), 'twitter.downloader.Downloader', 'Downloader', ([], {}), '()\n', (144, 146), False, 'from twitter.downloader import Downloader\n')]
__all__ = ["settings"] import os from logging.config import dictConfig from pathlib import Path from typing import Any, Dict, Tuple, Union import yaml from pydantic import BaseSettings, Extra, Field, FilePath from pydantic.env_settings import SettingsSourceCallable from .helpers import ConfigFileSettingsSource, MySQ...
[ "pathlib.Path", "pydantic.Field", "yaml.safe_load", "logging.config.dictConfig", "os.getenv" ]
[((363, 404), 'os.getenv', 'os.getenv', (['"""KARMAN_ENV_PREFIX"""', '"""KARMAN_"""'], {}), "('KARMAN_ENV_PREFIX', 'KARMAN_')\n", (372, 404), False, 'import os\n'), ((425, 463), 'os.getenv', 'os.getenv', (['f"""{ENV_PREFIX}ENV_ENCODING"""'], {}), "(f'{ENV_PREFIX}ENV_ENCODING')\n", (434, 463), False, 'import os\n'), ((4...
#!/usr/bin/env python import numpy as np import cPickle as pk import tensorflow as tf from keras import backend as K from time import time from variables import DTYPE, EPSILON from utils import convert_type, discount, LinearVF, gauss_log_prob, numel, dot_not_flat from mpi4py import MPI comm = MPI.COMM_WORLD rank = co...
[ "numpy.sum", "cPickle.load", "numpy.arange", "keras.backend.stop_gradient", "numpy.exp", "keras.backend.placeholder", "numpy.zeros_like", "numpy.copy", "numpy.random.randn", "keras.backend.reshape", "numpy.append", "utils.discount", "keras.backend.gradients", "keras.backend.batch_get_value...
[((543, 553), 'numpy.copy', 'np.copy', (['a'], {}), '(a)\n', (550, 553), True, 'import numpy as np\n'), ((1383, 1393), 'utils.LinearVF', 'LinearVF', ([], {}), '()\n', (1391, 1393), False, 'from utils import convert_type, discount, LinearVF, gauss_log_prob, numel, dot_not_flat\n'), ((1674, 1713), 'keras.backend.variable...
import re from django.shortcuts import render, redirect from django.views import View from QQLoginTool.QQtool import OAuthQQ from django.conf import settings from django_redis import get_redis_connection from carts.utils import merge_cart_cookie_to_redis from meiduo_mall.utils.response_code import RETCODE from django ...
[ "django.http.HttpResponseServerError", "users.models.User.objects.get", "django.http.HttpResponse", "django.shortcuts.redirect", "django.http.HttpResponseForbidden", "django.http.JsonResponse", "re.match", "carts.utils.merge_cart_cookie_to_redis", "users.models.User.objects.create_user", "django.s...
[((587, 614), 'logging.getLogger', 'logging.getLogger', (['"""django"""'], {}), "('django')\n", (604, 614), False, 'import logging\n'), ((792, 929), 'QQLoginTool.QQtool.OAuthQQ', 'OAuthQQ', ([], {'client_id': 'settings.QQ_CLIENT_ID', 'client_secret': 'settings.QQ_CLIENT_SECRET', 'redirect_uri': 'settings.QQ_REDIRECT_UR...
import pytest import web3 from web3 import Web3 from computable.helpers.transaction import call def test_deploy(voting): assert len(voting.account) == 42 assert len(voting.address) == 42 assert voting.account != voting.address def test_is_candidate(voting): hash = Web3.sha3(text='nope') assert cal...
[ "web3.Web3.sha3" ]
[((283, 305), 'web3.Web3.sha3', 'Web3.sha3', ([], {'text': '"""nope"""'}), "(text='nope')\n", (292, 305), False, 'from web3 import Web3\n'), ((401, 428), 'web3.Web3.sha3', 'Web3.sha3', ([], {'text': '"""stillnope"""'}), "(text='stillnope')\n", (410, 428), False, 'from web3 import Web3\n')]
#!/usr/bin/python # The contents of this file are in the public domain. See LICENSE_FOR_EXAMPLE_PROGRAMS.txt # # This example program shows how you can use dlib to make an object # detector for things like object, pedestrians, and any other semi-rigid # object. In particular, we go though the steps to train the ki...
[ "os.path.abspath", "matplotlib.pyplot.show", "os.path.dirname", "matplotlib.pyplot.figure", "numpy.array", "dlib.shape_predictor_training_options", "numpy.int32", "cv2.rectangle", "os.path.join", "os.chdir", "skimage.io.imread" ]
[((1480, 1506), 'os.path.abspath', 'os.path.abspath', (['os.curdir'], {}), '(os.curdir)\n', (1495, 1506), False, 'import os\n'), ((2154, 2193), 'dlib.shape_predictor_training_options', 'dlib.shape_predictor_training_options', ([], {}), '()\n', (2191, 2193), False, 'import dlib\n'), ((3046, 3072), 'os.path.abspath', 'os...
""" For a string, say abcde, a very effective function is treating this as number of prime number base p. Let's elaborate this statement. For a number, say 578, we can represent this number in base 10 number system as 5*10^2+7*10^1+8*10^0 Similarly, we can treat abcde in prime P base as a*P^4 + b*P^3 + c*P^2 + d*P^1...
[ "lists.LinkedList.LinkedList" ]
[((2431, 2443), 'lists.LinkedList.LinkedList', 'LinkedList', ([], {}), '()\n', (2441, 2443), False, 'from lists.LinkedList import LinkedList\n'), ((4729, 4741), 'lists.LinkedList.LinkedList', 'LinkedList', ([], {}), '()\n', (4739, 4741), False, 'from lists.LinkedList import LinkedList\n')]
import torch from torch import nn class AlexNet(nn.Module): def __init__(self): super(AlexNet, self).__init__() self.features = nn.Sequential( nn.Conv2d(3, 96, 11, stride=4, padding=2), nn.ReLU(), nn.LocalResponseNorm(5, k=2), nn.Conv2d(96, 256, 5,...
[ "torch.flatten", "torch.nn.Dropout", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.LocalResponseNorm", "torch.nn.Linear", "torch.rand", "torch.nn.MaxPool2d", "torch.tensor" ]
[((1195, 1228), 'torch.tensor', 'torch.tensor', (['(0)'], {'dtype': 'torch.long'}), '(0, dtype=torch.long)\n', (1207, 1228), False, 'import torch\n'), ((1482, 1510), 'torch.rand', 'torch.rand', (['(1, 3, 224, 224)'], {}), '((1, 3, 224, 224))\n', (1492, 1510), False, 'import torch\n'), ((1056, 1075), 'torch.flatten', 't...
# __BEGIN_LICENSE__ # Copyright (c) 2015, United States Government, as represented by the # Administrator of the National Aeronautics and Space Administration. # All rights reserved. # # The xGDS platform is licensed under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance...
[ "datetime.datetime.now", "json.loads" ]
[((1867, 1898), 'datetime.datetime.now', 'datetime.datetime.now', (['pytz.utc'], {}), '(pytz.utc)\n', (1888, 1898), False, 'import datetime\n'), ((1932, 1963), 'datetime.datetime.now', 'datetime.datetime.now', (['pytz.utc'], {}), '(pytz.utc)\n', (1953, 1963), False, 'import datetime\n'), ((1999, 2030), 'datetime.dateti...
"""Initial Migration Revision ID: 306679134a57 Revises: 62e534197a9f Create Date: 2020-11-04 13:19:37.932571 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '306679134a57' down_revision = '62e534197a9f' branch_labels = None depends_on = None def upgrade(): ...
[ "sqlalchemy.VARCHAR" ]
[((454, 476), 'sqlalchemy.VARCHAR', 'sa.VARCHAR', ([], {'length': '(255)'}), '(length=255)\n', (464, 476), True, 'import sqlalchemy as sa\n'), ((698, 720), 'sqlalchemy.VARCHAR', 'sa.VARCHAR', ([], {'length': '(255)'}), '(length=255)\n', (708, 720), True, 'import sqlalchemy as sa\n')]
import boto3 import botocore import json import re import click import os from haws.main import logger from os import path from haws.main import runtime from rich.prompt import Prompt from haws.services.runtime_helper import get_runtime_settings from pathlib import Path from haws.exceptions.authentication import Invali...
[ "haws.exceptions.authentication.GeneralAuthError", "haws.services.runtime_helper.get_runtime_settings", "boto3.client", "rich.prompt.Prompt.ask", "haws.main.logger.exception", "os.path.exists", "haws.main.logger.info", "haws.exceptions.authentication.NoRuntimeSettings", "haws.main.logger.error", "...
[((464, 514), 'rich.prompt.Prompt.ask', 'Prompt.ask', (['"""[blue bold]Your AWS ID: [/blue bold]"""'], {}), "('[blue bold]Your AWS ID: [/blue bold]')\n", (474, 514), False, 'from rich.prompt import Prompt\n'), ((594, 660), 'rich.prompt.Prompt.ask', 'Prompt.ask', (['"""[blue bold]Your AWS Key: [/blue bold]"""'], {'passw...
# -*- coding: utf-8 -*- """ Created on Tue Oct 13 17:15:16 2020 @author: JAVIER """ import numpy as np import pandas as pd import pickle from .. import bci_architectures as athena from . import bci_penalty_plugin as bci_penalty from .. import load_brain_data as lb from Fancy_aggregations import penalties as pn from...
[ "Fancy_aggregations.binary_parser.parse", "pandas.DataFrame", "pickle.dump", "numpy.minimum", "numpy.abs", "numpy.log", "numpy.argmax", "pandas.read_csv", "numpy.zeros", "numpy.transpose", "sklearn.model_selection.KFold", "numpy.equal", "scipy.optimize.least_squares", "numpy.mean", "nump...
[((1445, 1482), 'numpy.log', 'np.log', (['(y * output + (1 - y) * output)'], {}), '(y * output + (1 - y) * output)\n', (1451, 1482), True, 'import numpy as np\n'), ((2555, 2575), 'numpy.swapaxes', 'np.swapaxes', (['X', '(0)', '(1)'], {}), '(X, 0, 1)\n', (2566, 2575), True, 'import numpy as np\n'), ((2727, 2761), 'numpy...
import unittest from unittest.mock import patch import programytest.storage.engines as Engines from programy.storage.stores.nosql.mongo.config import MongoStorageConfiguration from programy.storage.stores.nosql.mongo.engine import MongoStorageEngine from programy.storage.stores.nosql.mongo.store.oobs import MongoOOBSto...
[ "unittest.skipIf", "programy.storage.stores.nosql.mongo.config.MongoStorageConfiguration", "unittest.mock.patch", "programy.storage.stores.nosql.mongo.engine.MongoStorageEngine", "programy.storage.stores.nosql.mongo.store.oobs.MongoOOBStore" ]
[((451, 514), 'unittest.skipIf', 'unittest.skipIf', (['(Engines.mongo is False)', 'Engines.mongo_disabled'], {}), '(Engines.mongo is False, Engines.mongo_disabled)\n', (466, 514), False, 'import unittest\n'), ((770, 833), 'unittest.skipIf', 'unittest.skipIf', (['(Engines.mongo is False)', 'Engines.mongo_disabled'], {})...
# Generated by Django 3.1.5 on 2021-01-12 14:38 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('accounts', '0004_auto_20210112_1657'), ] operations = [ migrations.RemoveField( model_name='account', name='isVerified', ...
[ "django.db.migrations.RemoveField" ]
[((228, 291), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""account"""', 'name': '"""isVerified"""'}), "(model_name='account', name='isVerified')\n", (250, 291), False, 'from django.db import migrations\n')]
import matplotlib.image as mpimg import numpy as np import pickle from test_feature_exrtact import * from lesson_functions import * color_space = 'YCrCb' orient = 9 pix_per_cell = 8 cell_per_block = 2 hog_channel = 'ALL' spatial_size = (32, 32) hist_bins = 32 spatial_feat = True hist_feat = True h...
[ "numpy.random.randint", "numpy.array", "numpy.vstack" ]
[((2090, 2115), 'numpy.random.randint', 'np.random.randint', (['(0)', '(100)'], {}), '(0, 100)\n', (2107, 2115), True, 'import numpy as np\n'), ((461, 481), 'numpy.array', 'np.array', (['car_images'], {}), '(car_images)\n', (469, 481), True, 'import numpy as np\n'), ((510, 533), 'numpy.array', 'np.array', (['noncar_ima...
import pytest import random try: from metrics import precision, recall, reciprocal_rank, ndcg, fscore, average_precision except: from jinahub.evaluators.rank.metrics import precision, recall, reciprocal_rank, ndcg, fscore, average_precision @pytest.mark.parametrize( 'eval_at, expected', [(None, 0.4),...
[ "jinahub.evaluators.rank.metrics.fscore", "jinahub.evaluators.rank.metrics.recall", "pytest.mark.repeat", "random.shuffle", "jinahub.evaluators.rank.metrics.average_precision", "jinahub.evaluators.rank.metrics.ndcg", "jinahub.evaluators.rank.metrics.reciprocal_rank", "pytest.raises", "jinahub.evalua...
[((253, 369), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""eval_at, expected"""', '[(None, 0.4), (0, 0.0), (2, 1.0), (4, 0.5), (5, 0.4), (100, 0.4)]'], {}), "('eval_at, expected', [(None, 0.4), (0, 0.0), (2, \n 1.0), (4, 0.5), (5, 0.4), (100, 0.4)])\n", (276, 369), False, 'import pytest\n'), ((758, 88...
''' A file for testing the python apt module''' # import sys import apt PACKAGE_NAME = "chromium-browser" CACHE = apt.cache.Cache() # CACHE.update() if PACKAGE_NAME in CACHE: PACKAGE = CACHE[PACKAGE_NAME] print((PACKAGE.versions[0].description)) else: print(("Package %s not found" % PACKAGE_NAME))
[ "apt.cache.Cache" ]
[((117, 134), 'apt.cache.Cache', 'apt.cache.Cache', ([], {}), '()\n', (132, 134), False, 'import apt\n')]
""" Models for the help system. The database-tied help system is only half of Evennia's help functionality, the other one being the auto-generated command help that is created on the fly from each command's `__doc__` string. The persistent database system defined here is intended for all other forms of help that do no...
[ "django.db.models.TextField", "django.db.models.ManyToManyField", "evennia.help.manager.HelpEntryManager", "evennia.typeclasses.models.AliasHandler", "evennia.locks.lockhandler.LockHandler", "django.db.models.CharField", "django.db.models.BooleanField", "evennia.typeclasses.models.TagHandler", "djan...
[((1608, 1701), 'django.db.models.CharField', 'models.CharField', (['"""help key"""'], {'max_length': '(255)', 'unique': '(True)', 'help_text': '"""key to search for"""'}), "('help key', max_length=255, unique=True, help_text=\n 'key to search for')\n", (1624, 1701), False, 'from django.db import models\n'), ((1754,...
from netnir.helpers.scaffold.command import CommandScaffold from netnir.helpers.common.args import ( netconf_config, netconf_filter, netconf_source, netconf_target, netconf_capabilities, config, ) class NetConf(CommandScaffold): """netconf commands""" @staticmethod def parser(pars...
[ "netnir.helpers.common.args.netconf_source", "netnir.helpers.common.args.netconf_filter", "netnir.helpers.common.args.config", "netnir.helpers.common.args.netconf_config", "netnir.plugins.netconf.netconf_capabilities", "netnir.helpers.common.args.netconf_target", "netnir.helpers.scaffold.command.Command...
[((333, 363), 'netnir.helpers.scaffold.command.CommandScaffold.parser', 'CommandScaffold.parser', (['parser'], {}), '(parser)\n', (355, 363), False, 'from netnir.helpers.scaffold.command import CommandScaffold\n'), ((372, 394), 'netnir.helpers.common.args.netconf_config', 'netconf_config', (['parser'], {}), '(parser)\n...
from colassigner import ColAccessor, get_att_value def test_type_retention(): class TestCols(ColAccessor): fing = int class SubCol(ColAccessor): a = int b = float class SubSubCol(ColAccessor): x = str y = str class...
[ "colassigner.get_att_value" ]
[((377, 415), 'colassigner.get_att_value', 'get_att_value', (['TestCols', 'TestCols.fing'], {}), '(TestCols, TestCols.fing)\n', (390, 415), False, 'from colassigner import ColAccessor, get_att_value\n'), ((434, 483), 'colassigner.get_att_value', 'get_att_value', (['TestCols.SubCol', 'TestCols.SubCol.b'], {}), '(TestCol...
import sys, json args = json.loads(sys.argv[1].replace('\\"', '"')) if len(sys.argv) > 1 else {} from pyspark.sql import SparkSession # add additional imports here if needed spark = SparkSession.builder.getOrCreate() # # add your code here # the **kwargs passed to run_on_spark() are in args # spark.stop()
[ "pyspark.sql.SparkSession.builder.getOrCreate" ]
[((184, 218), 'pyspark.sql.SparkSession.builder.getOrCreate', 'SparkSession.builder.getOrCreate', ([], {}), '()\n', (216, 218), False, 'from pyspark.sql import SparkSession\n')]
import logging import tensorflow as tf logger = logging.getLogger(__name__) class HyperTune(tf.keras.callbacks.Callback): """Callback for HyperTune on AI Platform.""" def __init__(self, metric, tag=None, logdir=None, **kwargs): super().__init__(**kwargs) self._metric = metric self._t...
[ "tensorflow.summary.create_file_writer", "tensorflow.summary.scalar", "logging.getLogger" ]
[((50, 77), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (67, 77), False, 'import logging\n'), ((447, 490), 'tensorflow.summary.create_file_writer', 'tf.summary.create_file_writer', (['self._logdir'], {}), '(self._logdir)\n', (476, 490), True, 'import tensorflow as tf\n'), ((640, 700), ...
from django.dispatch import receiver from django.db.models.signals import post_save from django.db.models import Model, OneToOneField, ManyToManyField, Manager, \ CASCADE from django.contrib.auth.models import User from capstoneproject.models.models.content_rating import ContentRating from capstoneproject.models.mo...
[ "django.db.models.OneToOneField", "django.db.models.ManyToManyField", "django.dispatch.receiver", "capstoneproject.models.querysets.user_storage_queryset.UserStorageQuerySet.as_manager" ]
[((677, 715), 'django.db.models.OneToOneField', 'OneToOneField', (['User'], {'on_delete': 'CASCADE'}), '(User, on_delete=CASCADE)\n', (690, 715), False, 'from django.db.models import Model, OneToOneField, ManyToManyField, Manager, CASCADE\n'), ((733, 799), 'django.db.models.ManyToManyField', 'ManyToManyField', (['Categ...
import requests import json import sys import configparser import datetime from datetime import date from influxdb import InfluxDBClient import argparse config = configparser.ConfigParser() config.read("config.ini") parser=argparse.ArgumentParser( description='''Script to login to E-REDES distribución of the span...
[ "json.dump", "argparse.ArgumentParser", "json.loads", "influxdb.InfluxDBClient", "datetime.date.today", "datetime.datetime.strptime", "datetime.timedelta", "requests.post", "configparser.ConfigParser", "datetime.date.replace" ]
[((163, 190), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (188, 190), False, 'import configparser\n'), ((225, 403), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Script to login to E-REDES distribución of the spanish energy company and download consumptio...
import abc import torch from scipy.integrate import solve_ivp from .misc import _handle_unused_kwargs class ScipyWrapperODESolver(metaclass=abc.ABCMeta): def __init__(self, func, y0, rtol, atol, solver="LSODA", **unused_kwargs): unused_kwargs.pop("norm", None) unused_kwargs.pop("grid_points", None...
[ "torch.no_grad", "torch.tensor" ]
[((1483, 1498), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (1496, 1498), False, 'import torch\n'), ((1368, 1383), 'torch.tensor', 'torch.tensor', (['t'], {}), '(t)\n', (1380, 1383), False, 'import torch\n'), ((1164, 1183), 'torch.tensor', 'torch.tensor', (['sol.y'], {}), '(sol.y)\n', (1176, 1183), False, 'impo...
#!/usr/bin/env python # BlackJack IRC Bot - Developed by acidvegas in Python (https://acid.vegas/blackjack) # blackjack.py import os import sys sys.dont_write_bytecode = True os.chdir(sys.path[0] or '.') sys.path += ('core',) import debug debug.info() if not debug.check_version(3): debug.error_exit('BlackJack requ...
[ "irc.BlackJack.connect", "debug.info", "debug.check_privileges", "debug.check_version", "debug.error_exit", "os.chdir" ]
[((177, 205), 'os.chdir', 'os.chdir', (["(sys.path[0] or '.')"], {}), "(sys.path[0] or '.')\n", (185, 205), False, 'import os\n'), ((243, 255), 'debug.info', 'debug.info', ([], {}), '()\n', (253, 255), False, 'import debug\n'), ((436, 459), 'irc.BlackJack.connect', 'irc.BlackJack.connect', ([], {}), '()\n', (457, 459),...
import sys import unittest from modulegraph2 import _utilities as utilities class TestPrivateUtilities(unittest.TestCase): def check_results_equal(self, func, input_values): for value, expected in input_values: with self.subTest(value): self.assertEqual(func(*value), expected)...
[ "modulegraph2._utilities.FakePackage", "modulegraph2._utilities.saved_sys_path", "sys.path.insert" ]
[((1939, 1978), 'modulegraph2._utilities.FakePackage', 'utilities.FakePackage', (["['some', 'path']"], {}), "(['some', 'path'])\n", (1960, 1978), True, 'from modulegraph2 import _utilities as utilities\n'), ((1551, 1577), 'modulegraph2._utilities.saved_sys_path', 'utilities.saved_sys_path', ([], {}), '()\n', (1575, 157...
import os import math import re from collections import Counter def read_classification_from_file(filename): """ Return { <filename> : <classification> } dict """ with open(filename, "rt") as f: classification = {} for line in f: key, value = line.split() classification[key] = value return classifica...
[ "collections.Counter", "os.listdir", "math.fabs", "re.compile" ]
[((409, 424), 'os.listdir', 'os.listdir', (['dir'], {}), '(dir)\n', (419, 424), False, 'import os\n'), ((631, 640), 'collections.Counter', 'Counter', ([], {}), '()\n', (638, 640), False, 'from collections import Counter\n'), ((655, 664), 'collections.Counter', 'Counter', ([], {}), '()\n', (662, 664), False, 'from colle...
import logging import math import pygame from pygame.joystick import Joystick class Extreme3dPro: # sample usage # controller = Extreme3dPro() # while True: # controller.update() # print("pitch:{pitch} roll:{roll} yaw:{yaw}".format(pitch=controller.pitch, # ...
[ "pygame.joystick.init", "pygame.event.pump", "pygame.init", "math.copysign", "pygame.joystick.Joystick" ]
[((677, 690), 'pygame.init', 'pygame.init', ([], {}), '()\n', (688, 690), False, 'import pygame\n'), ((699, 721), 'pygame.joystick.init', 'pygame.joystick.init', ([], {}), '()\n', (719, 721), False, 'import pygame\n'), ((748, 769), 'pygame.joystick.Joystick', 'Joystick', (['joystick_id'], {}), '(joystick_id)\n', (756, ...
import collections from dataset import GraphEditDistanceDataset, FixedGraphEditDistanceDataset from graphembeddingnetwork import GraphEmbeddingNet, GraphEncoder, GraphAggregator from graphmatchingnetwork import GraphMatchingNet import copy import torch import random GraphData = collections.namedtuple('GraphData', [ ...
[ "graphembeddingnetwork.GraphEmbeddingNet", "copy.deepcopy", "dataset.FixedGraphEditDistanceDataset", "graphembeddingnetwork.GraphEncoder", "graphembeddingnetwork.GraphAggregator", "dataset.GraphEditDistanceDataset", "collections.namedtuple", "torch.reshape", "graphmatchingnetwork.GraphMatchingNet", ...
[((280, 402), 'collections.namedtuple', 'collections.namedtuple', (['"""GraphData"""', "['from_idx', 'to_idx', 'node_features', 'edge_features', 'graph_idx',\n 'n_graphs']"], {}), "('GraphData', ['from_idx', 'to_idx', 'node_features',\n 'edge_features', 'graph_idx', 'n_graphs'])\n", (302, 402), False, 'import col...
#!/usr/bin/env python """ Oracle running queries """ # select username,process,server,program,osuser,schemaname from v$session; # http://stackoverflow.com/questions/199508/how-do-i-show-running-processes-in-oracle-db import sys import lib_common import lib_oracle import lib_credentials from sources_types.oracle impo...
[ "sources_types.oracle.db.MakeUri", "lib_credentials.GetCredentials", "sources_types.oracle.query.MakeUri", "sys.exc_info", "lib_common.MakeProp", "lib_oracle.CallbackQuery", "lib_oracle.OracleEnv" ]
[((1893, 1915), 'lib_oracle.OracleEnv', 'lib_oracle.OracleEnv', ([], {}), '()\n', (1913, 1915), False, 'import lib_oracle\n'), ((2060, 2110), 'lib_credentials.GetCredentials', 'lib_credentials.GetCredentials', (['"""Oracle"""', 'database'], {}), "('Oracle', database)\n", (2090, 2110), False, 'import lib_credentials\n')...
""" dlc2kinematics © <NAME> https://github.com/AdaptiveMotorControlLab/dlc2kinematics/ """ import pandas as pd import numpy as np import matplotlib.pyplot as plt from matplotlib import gridspec from mpl_toolkits.mplot3d import Axes3D from sklearn.decomposition import PCA from dlc2kinematics.utils import auxiliaryfunct...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.show", "mpl_toolkits.mplot3d.Axes3D", "pandas.read_hdf", "matplotlib.pyplot.ylim", "matplotlib.pyplot.legend", "numpy.cumsum", "matplotlib.pyplot.figure", "matplotlib.pyplot.cla", "sklearn.decomposition.PCA", "dlc2kinematics.utils.auxiliaryfunctions....
[((1270, 1297), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""Frame numbers"""'], {}), "('Frame numbers')\n", (1280, 1297), True, 'import matplotlib.pyplot as plt\n'), ((1302, 1329), 'matplotlib.pyplot.ylabel', 'plt.ylabel', (['"""velocity (AU)"""'], {}), "('velocity (AU)')\n", (1312, 1329), True, 'import matplotlib....
############################################################################# # Copyright (c) 2018 <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...
[ "os.environ.get", "click.prompt" ]
[((2169, 2209), 'os.environ.get', 'os.environ.get', (['"""PYCI_INTERACTIVE"""', '(True)'], {}), "('PYCI_INTERACTIVE', True)\n", (2183, 2209), False, 'import os\n'), ((1097, 1156), 'click.prompt', 'click.prompt', (['"""Enter Github access token:"""'], {'hide_input': '(True)'}), "('Enter Github access token:', hide_input...
import os from typing import Any, Dict, Optional, Union from argparse import Namespace try: from pytorch_lightning.loggers.base import ( LightningLoggerBase, rank_zero_experiment, ) from pytorch_lightning.utilities import rank_zero_only except ImportError: raise RuntimeError( 'T...
[ "aim.sdk.repo.Repo.default_repo_path", "aim.sdk.utils.get_aim_repo_name", "aim.sdk.utils.clean_repo_path", "omegaconf.OmegaConf.is_config", "aim.sdk.run.Run", "omegaconf.OmegaConf.to_container" ]
[((2977, 3004), 'omegaconf.OmegaConf.is_config', 'OmegaConf.is_config', (['params'], {}), '(params)\n', (2996, 3004), False, 'from omegaconf import OmegaConf\n'), ((4541, 4573), 'aim.sdk.utils.clean_repo_path', 'clean_repo_path', (['self._repo_path'], {}), '(self._repo_path)\n', (4556, 4573), False, 'from aim.sdk.utils...
import numpy as np from scipy import stats data = np.array([1,2,3,4]) ans = np.median(data) print(ans)
[ "numpy.median", "numpy.array" ]
[((51, 73), 'numpy.array', 'np.array', (['[1, 2, 3, 4]'], {}), '([1, 2, 3, 4])\n', (59, 73), True, 'import numpy as np\n'), ((77, 92), 'numpy.median', 'np.median', (['data'], {}), '(data)\n', (86, 92), True, 'import numpy as np\n')]
import unittest from minos.common import ( DatabaseLock, Lock, ) from minos.common.testing import ( MockedDatabaseClient, ) class TestDatabaseLock(unittest.IsolatedAsyncioTestCase): def test_base(self): self.assertTrue(issubclass(DatabaseLock, Lock)) async def test_client(self): ...
[ "unittest.main", "minos.common.DatabaseLock", "minos.common.testing.MockedDatabaseClient" ]
[((965, 980), 'unittest.main', 'unittest.main', ([], {}), '()\n', (978, 980), False, 'import unittest\n'), ((329, 351), 'minos.common.testing.MockedDatabaseClient', 'MockedDatabaseClient', ([], {}), '()\n', (349, 351), False, 'from minos.common.testing import MockedDatabaseClient\n'), ((367, 394), 'minos.common.Databas...
import shutil import os def delete_wallets_and_pools(): """ Delete all files out of the .indy/pool and .indy/wallet directories """ print("\nCheck if the wallet and pool for this test already exist and delete them...\n") user_home = os.path.expanduser('~') + os.sep work_dir = user_home + ".indy_cl...
[ "shutil.rmtree", "os.path.expanduser" ]
[((251, 274), 'os.path.expanduser', 'os.path.expanduser', (['"""~"""'], {}), "('~')\n", (269, 274), False, 'import os\n'), ((344, 378), 'shutil.rmtree', 'shutil.rmtree', (["(work_dir + '/pool/')"], {}), "(work_dir + '/pool/')\n", (357, 378), False, 'import shutil\n'), ((444, 480), 'shutil.rmtree', 'shutil.rmtree', (["(...
#!/usr/bin/env python # test_processors.py # # Copyright (C) 2020-2021 <NAME> # All rights reserved. # # This software may be modified and distributed under the terms of the # BSD license. See the LICENSE file for details. from os.path import getsize import numpy as np import pytest from PIL import Image fro...
[ "pipescaler.processors.ThresholdProcessor", "pipescaler.processors.XbrzProcessor", "pipescaler.processors.ESRGANProcessor", "pipescaler.processors.AppleScriptExternalProcessor", "pipescaler.processors.SolidColorProcessor", "pytest.mark.parametrize", "pipescaler.processors.CropProcessor", "shared.xfail...
[((958, 974), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (972, 974), False, 'import pytest\n'), ((1113, 1129), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (1127, 1129), False, 'import pytest\n'), ((1261, 1277), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (1275, 1277), False, 'import pytes...
import sys import ring from ring.coder import ( Registry, Coder, JsonCoder, coderize, registry as default_registry) import pytest def test_coder_registry(): registry = Registry() error_coder = None, None registry.register('_error', error_coder) assert registry.get('_error') == (None, None) ...
[ "ring.dict", "memcache.Client", "ring.memcache", "tests._test_module_py37.DataClass", "pytest.raises", "ring.coder.registry.get", "ring.coder.Registry", "ring.coder.coderize", "pytest.mark.parametrize", "datetime.datetime.now" ]
[((2547, 2596), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""raw_coder"""', '[JsonCoder]'], {}), "('raw_coder', [JsonCoder])\n", (2570, 2596), False, 'import pytest\n'), ((180, 190), 'ring.coder.Registry', 'Registry', ([], {}), '()\n', (188, 190), False, 'from ring.coder import Registry, Coder, JsonCoder...
from rgrammar import RandomGrammar def main(): rules = { '<start>' : ['<template>'], '<template>' : ['<det> <noun> <verb> <adj>', '<det> <adj> <noun>'], '<det>' : ['A', 'The', 'This', 'That'], '<verb>' : ['is', 'was'], '<noun>' : ['house...
[ "rgrammar.RandomGrammar" ]
[((454, 474), 'rgrammar.RandomGrammar', 'RandomGrammar', (['rules'], {}), '(rules)\n', (467, 474), False, 'from rgrammar import RandomGrammar\n')]
import jsonpickle from datetime import datetime from sqlalchemy import (Column, Integer, String, DateTime, UniqueConstraint, ForeignKey, Date, Numeric, Boolean, CheckConstraint) from sqlalchemy.orm import relationship, backref from flask_sqlalchemy import Model from app.extensions import db fr...
[ "jsonpickle.encode", "app.extensions.db.session.add", "sqlalchemy.ForeignKey", "sqlalchemy.orm.relationship", "sqlalchemy.Numeric", "sqlalchemy.CheckConstraint", "sqlalchemy.UniqueConstraint", "sqlalchemy.orm.backref", "sqlalchemy.Column", "datetime.datetime.utcnow", "sqlalchemy.String", "app....
[((405, 438), 'sqlalchemy.Column', 'Column', (['Integer'], {'primary_key': '(True)'}), '(Integer, primary_key=True)\n', (411, 438), False, 'from sqlalchemy import Column, Integer, String, DateTime, UniqueConstraint, ForeignKey, Date, Numeric, Boolean, CheckConstraint\n'), ((965, 1006), 'sqlalchemy.Column', 'Column', ([...
# Generated by Django 3.1.4 on 2020-12-31 21:27 from django.db import migrations, models def mark_giver_notification_as_sent_for_all_previous_orders(apps, schema_editor): apps.get_model('orders.Order').objects.filter(giver__isnull=False) \ .update(notification_to_giver_is_sent=True) class Migration(mig...
[ "django.db.migrations.RunPython", "django.db.models.BooleanField" ]
[((610, 687), 'django.db.migrations.RunPython', 'migrations.RunPython', (['mark_giver_notification_as_sent_for_all_previous_orders'], {}), '(mark_giver_notification_as_sent_for_all_previous_orders)\n', (630, 687), False, 'from django.db import migrations, models\n'), ((555, 589), 'django.db.models.BooleanField', 'model...
# -*- coding: utf-8 -*- """ Tests for ml2p.hyperparameters. """ import pytest from ml2p.hyperparameters import HyperParameterEncodingError, decode, encode class TestEncode: def test_int(self): assert encode({"a": 1}) == {"a": "1"} def test_float(self): assert encode({"a": 1.2}) == {"a": "1...
[ "pytest.raises", "ml2p.hyperparameters.encode", "ml2p.hyperparameters.decode" ]
[((217, 233), 'ml2p.hyperparameters.encode', 'encode', (["{'a': 1}"], {}), "({'a': 1})\n", (223, 233), False, 'from ml2p.hyperparameters import HyperParameterEncodingError, decode, encode\n'), ((290, 308), 'ml2p.hyperparameters.encode', 'encode', (["{'a': 1.2}"], {}), "({'a': 1.2})\n", (296, 308), False, 'from ml2p.hyp...
"""Save markdowns to the disks from the web""" import hashlib import yaml import subprocess from pathlib import Path from helpers.providers import UrlOpener from helpers.db_handler import DB from helpers.logger import Logger from helpers.cleaner import Cleaner from helpers.aws_helper import AWS from helpers.config_hand...
[ "subprocess.run", "helpers.providers.UrlOpener.open", "os.path.basename", "yaml.dump", "helpers.config_handler.ConfigHandler.get_mk_pages", "helpers.db_handler.DB.get_markdowns_menu", "helpers.db_handler.DB.insert_only_new_content", "pathlib.Path", "helpers.db_handler.DB.is_there_any_new_update", ...
[((390, 414), 'helpers.logger.Logger.initial', 'Logger.initial', (['__name__'], {}), '(__name__)\n', (404, 414), False, 'from helpers.logger import Logger\n'), ((999, 1035), 'os.path.join', 'join', (['website_path', '"""docs"""', 'category'], {}), "(website_path, 'docs', category)\n", (1003, 1035), False, 'from os.path...
# Copyright (c) 2020. Sophos Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
[ "uuid.uuid4", "json.loads", "boto3.client", "time.sleep", "hashlib.sha256", "requests.get", "requests.post", "urllib.parse.unquote_plus" ]
[((1464, 1553), 'requests.post', 'requests.post', (['"""https://api.labs.sophos.com/oauth2/token"""'], {'data': 'data', 'headers': 'headers'}), "('https://api.labs.sophos.com/oauth2/token', data=data,\n headers=headers)\n", (1477, 1553), False, 'import requests\n'), ((1991, 2039), 'requests.post', 'requests.post', (...
from __future__ import (absolute_import, division, print_function, unicode_literals) from astroid import MANAGER, Class, CallFunc from .models import transform_model_class from .testing import transform_test_response from .factories import transform_factory_return def register(linter): M...
[ "astroid.MANAGER.register_transform" ]
[((319, 375), 'astroid.MANAGER.register_transform', 'MANAGER.register_transform', (['Class', 'transform_model_class'], {}), '(Class, transform_model_class)\n', (345, 375), False, 'from astroid import MANAGER, Class, CallFunc\n'), ((380, 438), 'astroid.MANAGER.register_transform', 'MANAGER.register_transform', (['Class'...
import os, logging, imp from datetime import date, datetime, time from dateutil.relativedelta import relativedelta from flufl.enum import IntEnum GLOBAL_START_DATE = datetime(2007, 1, 1) class Granularity(IntEnum): NONE = 0 YEAR = 10 HALF_YEAR = 13 QUARTER = 15 MONTH = 20 WEEK = 30 DAY ...
[ "datetime.date", "dateutil.relativedelta.relativedelta", "datetime.datetime", "datetime.datetime.strptime", "datetime.time", "datetime.datetime.now" ]
[((169, 189), 'datetime.datetime', 'datetime', (['(2007)', '(1)', '(1)'], {}), '(2007, 1, 1)\n', (177, 189), False, 'from datetime import date, datetime, time\n'), ((1522, 1536), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (1534, 1536), False, 'from datetime import date, datetime, time\n'), ((2008, 2029)...
#!/usr/bin/env python # # A noddy example to exercise most of the features in the "eb" module. # Demonstrates how I recommend filling in the parameter vector - this # way internal rearrangements of the vector as the model evolves won't # break all of your scripts. # import numpy import eb import matplotlib.pyplot as p...
[ "matplotlib.pyplot.subplot", "numpy.absolute", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "eb.phicont", "matplotlib.pyplot.ylim", "numpy.empty", "numpy.median", "numpy.compress", "numpy.zeros", "numpy.empty_like", "numpy.linspace", "eb.getvder", "eb.model" ]
[((379, 419), 'numpy.zeros', 'numpy.zeros', (['eb.NPAR'], {'dtype': 'numpy.double'}), '(eb.NPAR, dtype=numpy.double)\n', (390, 419), False, 'import numpy\n'), ((3170, 3204), 'eb.getvder', 'eb.getvder', (['parm', '(-61.070553)', 'ktot'], {}), '(parm, -61.070553, ktot)\n', (3180, 3204), False, 'import eb\n'), ((3405, 342...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __copyright__ = """ This code is licensed under the MIT license. Copyright University Innsbruck, Institute for General, Inorganic, and Theoretical Chemistry, Podewitz Group See LICENSE for details """ from os import path from setuptools import setup, find_packages import ...
[ "os.path.realpath", "os.path.join", "sys.exit" ]
[((704, 719), 'sys.exit', 'sys.exit', (['error'], {}), '(error)\n', (712, 719), False, 'import sys\n'), ((741, 764), 'os.path.realpath', 'path.realpath', (['__file__'], {}), '(__file__)\n', (754, 764), False, 'from os import path\n'), ((777, 806), 'os.path.join', 'path.join', (['here', '"""README.rst"""'], {}), "(here,...
#!/usr/bin/python3 import subprocess import json import sys from kubernetes import client, config # whitelists against images that are problematic to pull/scan GLOBAL_IMAGE_WHITELIST = [ 'jaegertracing/all-in-one:1.16', # error in image scan: scan failed: failed to apply layers: unknown OS - no shell, no ls - pos...
[ "json.loads", "subprocess.check_output", "json.dumps", "kubernetes.client.CoreV1Api", "kubernetes.config.load_kube_config", "sys.exit" ]
[((3315, 3340), 'kubernetes.config.load_kube_config', 'config.load_kube_config', ([], {}), '()\n', (3338, 3340), False, 'from kubernetes import client, config\n'), ((5600, 5611), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (5608, 5611), False, 'import sys\n'), ((3405, 3423), 'kubernetes.client.CoreV1Api', 'client.C...
# Generated by Django 2.2.1 on 2019-06-01 00:33 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('organization', '0007_auto_20190529_0137'), ] operations = [ migrations.AddField( model_name='co...
[ "django.db.models.CharField", "django.db.models.ForeignKey" ]
[((372, 440), 'django.db.models.CharField', 'models.CharField', ([], {'default': '"""知名高校"""', 'max_length': '(10)', 'verbose_name': '"""机构标签"""'}), "(default='知名高校', max_length=10, verbose_name='机构标签')\n", (388, 440), False, 'from django.db import migrations, models\n'), ((563, 701), 'django.db.models.ForeignKey', 'mo...
import unittest from unittest import mock import cherry class ApiTest(unittest.TestCase): def setUp(self): self.model = 'foo' self.text = 'random string' @mock.patch('cherry.api.Classify') def test_classify_api(self, mock_classify): cherry.classify(model=self.model, text=self.tex...
[ "cherry.search", "cherry.performance", "cherry.classify", "cherry.display", "cherry.train", "unittest.mock.patch" ]
[((183, 216), 'unittest.mock.patch', 'mock.patch', (['"""cherry.api.Classify"""'], {}), "('cherry.api.Classify')\n", (193, 216), False, 'from unittest import mock\n'), ((409, 441), 'unittest.mock.patch', 'mock.patch', (['"""cherry.api.Trainer"""'], {}), "('cherry.api.Trainer')\n", (419, 441), False, 'from unittest impo...
#if 0 # ----------------------------------------------------------------------- # $Id: mp3info.py,v 1.12 2003/07/10 13:05:05 the_krow Exp $ # ----------------------------------------------------------------------- # $Log: mp3info.py,v $ # Revision 1.12 2003/07/10 13:05:05 the_krow # o id3v2 tabled added to eyed3 # o ...
[ "mmpython.registertype", "struct.unpack", "string.find", "struct.pack", "mmpython.mediainfo.MusicInfo.__init__", "re.compile" ]
[((18648, 18723), 'mmpython.registertype', 'mmpython.registertype', (['"""audio/mp3"""', "('mp3',)", 'mediainfo.TYPE_MUSIC', 'MP3Info'], {}), "('audio/mp3', ('mp3',), mediainfo.TYPE_MUSIC, MP3Info)\n", (18669, 18723), False, 'import mmpython\n'), ((13363, 13390), 'struct.unpack', 'struct.unpack', (['""">i"""', 'header'...
from fastapi import FastAPI from pymongo import MongoClient import uvicorn from bson.objectid import ObjectId from typing import List, Optional import psycopg2 from game_class import Game app = FastAPI() # Connection a la base Postgre distante try: connection = psycopg2.connect(user = "mlrzrpdtctsdmu", ...
[ "psycopg2.connect", "game_class.Game", "uvicorn.run", "fastapi.FastAPI" ]
[((195, 204), 'fastapi.FastAPI', 'FastAPI', ([], {}), '()\n', (202, 204), False, 'from fastapi import FastAPI\n'), ((270, 440), 'psycopg2.connect', 'psycopg2.connect', ([], {'user': '"""mlrzrpdtctsdmu"""', 'password': '"""<PASSWORD>"""', 'host': '"""ec2-34-253-148-186.eu-west-1.compute.amazonaws.com"""', 'port': '"""54...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jun 15 23:00:51 2020 @author: zf """ # import pycocotools.coco as coco from pycocotools.coco import COCO import os import shutil from tqdm import tqdm import skimage.io as io import matplotlib.pyplot as plt import cv2 from PIL import Image, ImageDraw im...
[ "os.mkdir", "DataFunction.write_rotate_xml", "numpy.sin", "sys.path.append", "numpy.zeros_like", "os.path.exists", "numpy.transpose", "numpy.int", "cv2.destroyAllWindows", "tqdm.tqdm", "Rotatexml2DotaTxT.eval_rotatexml", "cv2.waitKey", "numpy.float", "numpy.cos", "numpy.dot", "numpy.vs...
[((348, 382), 'sys.path.append', 'sys.path.append', (['"""/home/zf/0tools"""'], {}), "('/home/zf/0tools')\n", (363, 382), False, 'import sys\n'), ((2090, 2104), 'cv2.waitKey', 'cv2.waitKey', (['(0)'], {}), '(0)\n', (2101, 2104), False, 'import cv2\n'), ((2109, 2132), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([...
# Copyright 2021 EMQ Technologies Co., Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
[ "logging.info", "traceback.format_exc" ]
[((1294, 1328), 'logging.info', 'logging.info', (['"""start running sink"""'], {}), "('start running sink')\n", (1306, 1328), False, 'import logging\n'), ((2151, 2173), 'traceback.format_exc', 'traceback.format_exc', ([], {}), '()\n', (2171, 2173), False, 'import traceback\n'), ((1802, 1824), 'traceback.format_exc', 't...
from jumpscale import j app = j.tools.prefab._getBaseAppClass() class PrefabZStor(app): NAME = 'zstor' def build(self): if not self.prefab.runtimmes.golang.isInstalled(): self.logger.info('install golang') self.prefab.runtimmes.golang.install(reset=False, old=False) ...
[ "jumpscale.j.tools.prefab._getBaseAppClass", "jumpscale.j.sal.fs.joinPaths" ]
[((32, 65), 'jumpscale.j.tools.prefab._getBaseAppClass', 'j.tools.prefab._getBaseAppClass', ([], {}), '()\n', (63, 65), False, 'from jumpscale import j\n'), ((631, 682), 'jumpscale.j.sal.fs.joinPaths', 'j.sal.fs.joinPaths', (['dest', '"""daemon/client/py-client"""'], {}), "(dest, 'daemon/client/py-client')\n", (649, 68...
""" This script demonstrates how to read the protocol from an ABF file. This could be used to only analyze ABF files in a folder with a certain protocol. """ import pyabf abfFilePath = R"X:/Data/C57/TGOT on PVT/2020-07-28 10nM TGOT on PVT/20831011.abf" abf = pyabf.ABF(abfFilePath, loadData=False) print(abf.protocol)
[ "pyabf.ABF" ]
[((260, 298), 'pyabf.ABF', 'pyabf.ABF', (['abfFilePath'], {'loadData': '(False)'}), '(abfFilePath, loadData=False)\n', (269, 298), False, 'import pyabf\n')]
#! /usr/bin/python import math from astropy import units as u ''' Exposure time calculator for a list of target stars, desired measurement quality, and optical system specifications. Currently a proof of concept derived from ESPRESSO performance on fixed stellar types. ''' mags = [0,1,2,3,4,5,6,7,8,9,10,11,12] teles...
[ "math.sqrt" ]
[((1448, 1568), 'math.sqrt', 'math.sqrt', (['((photons * gain) ** 2 + 4 * (photons / SNR) ** 2 * ((2 * 2.2 * gain *\n read_noise) ** 2 + dark_noise ** 2))'], {}), '((photons * gain) ** 2 + 4 * (photons / SNR) ** 2 * ((2 * 2.2 *\n gain * read_noise) ** 2 + dark_noise ** 2))\n', (1457, 1568), False, 'import math\n'...
import os import tempfile import shutil import urllib import zipfile import pandas as pd import urllib.request import json import text_data # Temporary folder for data we need during execution of this notebook (we'll clean up # at the end, we promise) temp_dir = os.path.join(tempfile.gettempdir(), 'mind') os.makedirs...
[ "json.dump", "zipfile.ZipFile", "os.makedirs", "json.loads", "os.path.basename", "os.path.getsize", "tempfile.gettempdir", "urllib.request.urlretrieve", "os.path.isfile", "text_data.TextItem", "pandas.read_table", "shutil.rmtree", "os.path.join", "os.listdir" ]
[((309, 345), 'os.makedirs', 'os.makedirs', (['temp_dir'], {'exist_ok': '(True)'}), '(temp_dir, exist_ok=True)\n', (320, 345), False, 'import os\n'), ((2398, 2418), 'os.listdir', 'os.listdir', (['temp_dir'], {}), '(temp_dir)\n', (2408, 2418), False, 'import os\n'), ((2806, 2840), 'os.path.join', 'os.path.join', (['temp...
"""List current photoshop all documents.""" # Import local modules import photoshop.api as ps app = ps.Application() doc = app.documents[0] print(doc.name) for doc in app.documents: print(doc.name)
[ "photoshop.api.Application" ]
[((103, 119), 'photoshop.api.Application', 'ps.Application', ([], {}), '()\n', (117, 119), True, 'import photoshop.api as ps\n')]
import pytest from py_wlc.economics import Cost, Discount, GdpDeflator TOLERANCE = 0.0001 @pytest.fixture(scope="module") def discount(): return Discount(2010) @pytest.fixture(scope="module") def deflator(): return GdpDeflator(2010, {2010: 0.03}, True) class TestClassMethods: def test_validate_type_...
[ "py_wlc.economics.Cost.validate_type", "pytest.fixture", "pytest.raises", "py_wlc.economics.GdpDeflator", "py_wlc.economics.Discount", "py_wlc.economics.Cost" ]
[((95, 125), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (109, 125), False, 'import pytest\n'), ((170, 200), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (184, 200), False, 'import pytest\n'), ((153, 167), 'py_wlc.economics.Dis...
# -*- coding: utf-8 -*- """This script launches xrtQook.""" __author__ = "<NAME>, <NAME>" __date__ = "27 Oct 2017" import sys import os sys.path.append(os.path.join('..', '..')) import xrt.gui.xrtQook as xQ if __name__ == '__main__': if any('spyder' in name.lower() for name in os.environ): pass # spyder...
[ "os.path.join", "xrt.gui.xrtQook.XrtQook", "xrt.gui.xrtQook.qt.QApplication" ]
[((153, 177), 'os.path.join', 'os.path.join', (['""".."""', '""".."""'], {}), "('..', '..')\n", (165, 177), False, 'import os\n'), ((769, 793), 'xrt.gui.xrtQook.qt.QApplication', 'xQ.qt.QApplication', (['args'], {}), '(args)\n', (787, 793), True, 'import xrt.gui.xrtQook as xQ\n'), ((804, 816), 'xrt.gui.xrtQook.XrtQook'...
"""empty message Revision ID: 5b5ae2885b42 Revises: <PASSWORD> Create Date: 2021-08-23 20:46:26.371041 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '5b5ae2885b42' down_revision = '<PASSWORD>' branch_labels = None depends_on = None def upgrade(): # ### ...
[ "alembic.op.drop_column", "sqlalchemy.Boolean" ]
[((906, 940), 'alembic.op.drop_column', 'op.drop_column', (['"""user"""', '"""business"""'], {}), "('user', 'business')\n", (920, 940), False, 'from alembic import op\n'), ((945, 979), 'alembic.op.drop_column', 'op.drop_column', (['"""user"""', '"""personal"""'], {}), "('user', 'personal')\n", (959, 979), False, 'from ...
# Importing external packages: import pandas as pd import requests import collections import json import ast import itertools class VelkozzAPI(object): """A python object representing a connection to the Velkozz Web API. """ def __init__(self, **kwargs): # Core Web API Configuration: TOD...
[ "pandas.DataFrame", "pandas.DataFrame.from_dict", "requests.get", "ast.literal_eval", "requests.post", "itertools.chain" ]
[((2890, 2975), 'requests.get', 'requests.get', (['reddit_top_posts_endpoint'], {'headers': 'self.auth_header', 'params': 'params'}), '(reddit_top_posts_endpoint, headers=self.auth_header, params=params\n )\n', (2902, 2975), False, 'import requests\n'), ((5968, 6044), 'requests.get', 'requests.get', (['indeed_jobs_e...
#!/usr/bin/env python # coding: utf-8 import sys sys.path.append('../../') import os import numpy as np import torch import scipy as sc import dill from core.dynamics import RoboticDynamics from koopman_core.util import run_experiment, evaluate_ol_pred from koopman_core.dynamics import BilinearLiftedDynamics from koopm...
[ "koopman_core.learning.KoopDnn", "ray.tune.uniform", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "numpy.arange", "koopman_core.util.evaluate_ol_pred", "os.path.join", "sys.path.append", "os.path.abspath", "koopman_core.dynamics.BilinearLiftedDynamics", "koopman_core.learning.KoopmanNe...
[((49, 74), 'sys.path.append', 'sys.path.append', (['"""../../"""'], {}), "('../../')\n", (64, 74), False, 'import sys\n'), ((1229, 1300), 'numpy.array', 'np.array', (['[[0, 0, 1, 0], [0, 0, 0, 1], [0, 0, lambd, 0], [0, 0, 0, mu]]'], {}), '([[0, 0, 1, 0], [0, 0, 0, 1], [0, 0, lambd, 0], [0, 0, 0, mu]])\n', (1237, 1300)...
import os from open_relation.dataset.label_hier import LabelHier from open_relation.dataset.label_hier import LabelNode from open_relation.dataset.dataset_config import DatasetConfig class PreNet(LabelHier): def _construct_hier(self): # root node # 0 is background next_label_ind = 1 ...
[ "open_relation.dataset.label_hier.LabelHier.__init__", "open_relation.dataset.label_hier.LabelNode", "os.path.join", "open_relation.dataset.dataset_config.DatasetConfig" ]
[((4863, 4883), 'open_relation.dataset.dataset_config.DatasetConfig', 'DatasetConfig', (['"""vrd"""'], {}), "('vrd')\n", (4876, 4883), False, 'from open_relation.dataset.dataset_config import DatasetConfig\n'), ((4897, 4962), 'os.path.join', 'os.path.join', (['dataset_config.dataset_root', '"""predicate_labels.txt"""']...
import sys import pandas as pd import re import numpy as np from sqlalchemy import create_engine from nltk.tokenize import word_tokenize from nltk.corpus import stopwords from nltk.stem import WordNetLemmatizer from nltk.stem.porter import PorterStemmer from sklearn.pipeline import Pipeline from sklearn.feature_extract...
[ "pandas.DataFrame", "sklearn.model_selection.GridSearchCV", "sklearn.feature_extraction.text.CountVectorizer", "nltk.stem.WordNetLemmatizer", "sklearn.model_selection.train_test_split", "joblib.dump", "sklearn.metrics.classification_report", "sklearn.ensemble.GradientBoostingClassifier", "pandas.rea...
[((1068, 1115), 'sqlalchemy.create_engine', 'create_engine', (["('sqlite:///' + database_filepath)"], {}), "('sqlite:///' + database_filepath)\n", (1081, 1115), False, 'from sqlalchemy import create_engine\n'), ((1123, 1172), 'pandas.read_sql_table', 'pd.read_sql_table', (['"""categorized_messages"""', 'engine'], {}), ...
#!/usr/bin/env python """ Examples of using Tekton for a network of 4 routers connected via OSPF """ import tempfile from tekton.connected import ConnectedSyn from tekton.gns3 import GNS3Topo from tekton.graph import NetworkGraph __author__ = "<NAME>" __email__ = "<EMAIL>" def ospf_net(): graph = NetworkGraph(...
[ "tekton.gns3.GNS3Topo", "tempfile.mkdtemp", "tekton.connected.ConnectedSyn", "tekton.graph.NetworkGraph" ]
[((307, 321), 'tekton.graph.NetworkGraph', 'NetworkGraph', ([], {}), '()\n', (319, 321), False, 'from tekton.graph import NetworkGraph\n'), ((1574, 1604), 'tekton.connected.ConnectedSyn', 'ConnectedSyn', (['graph'], {'full': '(True)'}), '(graph, full=True)\n', (1586, 1604), False, 'from tekton.connected import Connecte...
import graphene from graphene_sqlalchemy import SQLAlchemyConnectionField from todo.api.types import Task class Query(graphene.ObjectType): hello = graphene.String(description="A typical hello world") tasks = SQLAlchemyConnectionField(Task) def resolve_hello(self, info): return "World"
[ "graphene.String", "graphene_sqlalchemy.SQLAlchemyConnectionField" ]
[((155, 207), 'graphene.String', 'graphene.String', ([], {'description': '"""A typical hello world"""'}), "(description='A typical hello world')\n", (170, 207), False, 'import graphene\n'), ((220, 251), 'graphene_sqlalchemy.SQLAlchemyConnectionField', 'SQLAlchemyConnectionField', (['Task'], {}), '(Task)\n', (245, 251),...
import os import argparse from shutil import copyfile if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument('--indirs', nargs='+') parser.add_argument('--outdir', type=str, default='') args = parser.parse_args() os.makedirs(args.outdir, exist_ok=True) for indir in ...
[ "os.makedirs", "argparse.ArgumentParser", "shutil.copyfile", "os.path.join", "os.listdir" ]
[((96, 121), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (119, 121), False, 'import argparse\n'), ((263, 302), 'os.makedirs', 'os.makedirs', (['args.outdir'], {'exist_ok': '(True)'}), '(args.outdir, exist_ok=True)\n', (274, 302), False, 'import os\n'), ((434, 451), 'os.listdir', 'os.listdir'...
# * This code is provided solely for the personal and private use of students # * taking the CSC401 course at the University of Toronto. Copying for purposes # * other than this use is expressly prohibited. All forms of distribution of # * this code, including but not limited to public repositories on GitHub, # * ...
[ "sklearn.ensemble.RandomForestClassifier", "sklearn.naive_bayes.GaussianNB", "sklearn.ensemble.AdaBoostClassifier", "numpy.random.seed", "argparse.ArgumentParser", "sklearn.linear_model.SGDClassifier", "numpy.argmax", "numpy.load", "sklearn.model_selection.train_test_split", "os.path.dirname", "...
[((1143, 1162), 'numpy.random.seed', 'np.random.seed', (['(401)'], {}), '(401)\n', (1157, 1162), True, 'import numpy as np\n'), ((2351, 2366), 'sklearn.linear_model.SGDClassifier', 'SGDClassifier', ([], {}), '()\n', (2364, 2366), False, 'from sklearn.linear_model import SGDClassifier\n'), ((2464, 2476), 'sklearn.naive_...
import configparser # READ ETL FILE/DATABASE LOCATION AND CREDENTIALS. config = configparser.ConfigParser() config.read('dwh.cfg') ARN = config.get('IAM_ROLE', 'ARN') LOG_DATA = config.get('S3', 'LOG_DATA') LOG_JSONPATH = config.get('S3', 'LOG_JSONPATH') SONG_DATA = config.get('S3', 'SONG_DATA') # DROP TABLES sta...
[ "configparser.ConfigParser" ]
[((82, 109), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (107, 109), False, 'import configparser\n')]
import os import sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..', 'NiftyPETd', 'NIMPA', 'niftypet'))) import niftypet.nimpa sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..', 'NiftyPETd', 'NIPET', 'niftypet'))) import niftypet.nip...
[ "os.path.dirname" ]
[((69, 94), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (84, 94), False, 'import os\n'), ((220, 245), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (235, 245), False, 'import os\n')]
import tensorflow as tf from tensorflow.keras.layers import Embedding, LSTM, Dense, Attention from params import NUM_WORDS, EMBEDDING_DIM, LATENT_DIM, MAX_LEN_TARGET class Encoder(tf.keras.Model): def __init__(self): super(Encoder, self).__init__() self.embedding = Embedding(NUM_WORD...
[ "tensorflow.range", "tensorflow.keras.layers.Dense", "tensorflow.argmax", "tensorflow.convert_to_tensor", "tensorflow.reshape", "tensorflow.concat", "tensorflow.keras.layers.LSTM", "tensorflow.TensorArray", "tensorflow.keras.layers.Embedding", "tensorflow.GradientTape", "tensorflow.keras.layers....
[((302, 337), 'tensorflow.keras.layers.Embedding', 'Embedding', (['NUM_WORDS', 'EMBEDDING_DIM'], {}), '(NUM_WORDS, EMBEDDING_DIM)\n', (311, 337), False, 'from tensorflow.keras.layers import Embedding, LSTM, Dense, Attention\n'), ((358, 416), 'tensorflow.keras.layers.LSTM', 'LSTM', (['LATENT_DIM'], {'return_sequences': ...
import sys import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split import utils from methods import methods from visualization import plots FILENAME = 'datasets/ILThermo_Tm.csv' MODEL = 'mlp_regressor' DIRNAME = 'my_test' descs = sys.argv[1:] if le...
[ "matplotlib.pyplot.title", "numpy.empty", "sklearn.model_selection.train_test_split", "utils.molecular_descriptors", "matplotlib.pyplot.figure", "numpy.arange", "pandas.DataFrame", "utils.normalization", "numpy.copy", "numpy.linspace", "matplotlib.pyplot.show", "matplotlib.pyplot.ylim", "mat...
[((398, 423), 'utils.read_data', 'utils.read_data', (['FILENAME'], {}), '(FILENAME)\n', (413, 423), False, 'import utils\n'), ((431, 469), 'utils.molecular_descriptors', 'utils.molecular_descriptors', (['df', 'descs'], {}), '(df, descs)\n', (458, 469), False, 'import utils\n'), ((474, 499), 'numpy.empty', 'np.empty', (...
# Generated by Django 3.0.4 on 2020-04-02 10:15 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('products', '0003_product_price'), ] operations = [ migrations.CreateModel( name='Category', ...
[ "django.db.migrations.RenameField", "django.db.models.ForeignKey", "django.db.models.CharField", "django.db.models.BooleanField", "django.db.models.AutoField", "django.db.models.DateTimeField" ]
[((898, 991), 'django.db.migrations.RenameField', 'migrations.RenameField', ([], {'model_name': '"""product"""', 'old_name': '"""is_active"""', 'new_name': '"""available"""'}), "(model_name='product', old_name='is_active', new_name\n ='available')\n", (920, 991), False, 'from django.db import migrations, models\n'),...
#!/usr/bin/env python # coding: utf-8 import argparse import sys #GOAL: Scrape craigslist apartments and create an apartment table def main(): import requests from requests.exceptions import RequestException from warnings import warn from bs4 import BeautifulSoup import numpy as np import pan...
[ "pandas.DataFrame", "json.loads", "sqlite3.connect", "requests.get", "bs4.BeautifulSoup", "datetime.datetime.now", "os.chdir" ]
[((9768, 9786), 'pandas.DataFrame', 'pd.DataFrame', (['rows'], {}), '(rows)\n', (9780, 9786), True, 'import pandas as pd\n'), ((10644, 10658), 'os.chdir', 'os.chdir', (['""".."""'], {}), "('..')\n", (10652, 10658), False, 'import os\n'), ((10663, 10679), 'os.chdir', 'os.chdir', (['"""data"""'], {}), "('data')\n", (1067...
import logging from typing import Dict, Any, List import requests class GitLabAPI: def __init__(self, api_token): self.api_token = api_token def get_urls_for_mrs_paged_for_project( self, project_id: str, start: str, end: str, page: int ) -> List[str]: """ This function is...
[ "logging.warn", "logging.error", "requests.get" ]
[((924, 984), 'requests.get', 'requests.get', (['url'], {'headers': "{'Private-Token': self.api_token}"}), "(url, headers={'Private-Token': self.api_token})\n", (936, 984), False, 'import requests\n'), ((2368, 2428), 'requests.get', 'requests.get', (['url'], {'headers': "{'Private-Token': self.api_token}"}), "(url, hea...
from vec import Vec from mat import Mat import hw3 vin = Vec({0, 1, 2},{0: 1, 1: 2, 2:0}) vout = Vec({0, 1, 2},{0: 1, 1: 5, 2:6}) M1 = Mat(({0, 1, 2}, {0, 1, 2}), {(0, 0): -1, (0, 1): 1, (0, 2): 2, (1, 0): 1, (1, 1): 2, (1, 2): 3, (2, 0): 2, (2, 1): 2, (2, 2): 1}) lcmvm = hw3.lin_comb_mat_vec_mult(M1, vin) print(lcm...
[ "hw3.lin_comb_vec_mat_mult", "mat.Mat", "hw3.lin_comb_mat_vec_mult", "vec.Vec", "hw3.dot_product_mat_vec_mult", "hw3.dot_product_vec_mat_mult" ]
[((59, 99), 'vec.Vec', 'Vec', (['{0, 1, 2}', '{(0): 1, (1): 2, (2): 0}'], {}), '({0, 1, 2}, {(0): 1, (1): 2, (2): 0})\n', (62, 99), False, 'from vec import Vec\n'), ((99, 139), 'vec.Vec', 'Vec', (['{0, 1, 2}', '{(0): 1, (1): 5, (2): 6}'], {}), '({0, 1, 2}, {(0): 1, (1): 5, (2): 6})\n', (102, 139), False, 'from vec impo...
import os list_dir = os.listdir("/Users/ntdat/Tài liệu/Năm 4/Kỳ 2/Các hệ thống đa phương tiện/Data_Camera_SanTennis_Labeled/Labels/") train_txt = open("/Users/ntdat/Tài liệu/Năm 4/Kỳ 2/Các hệ thống đa phương tiện/Data_Camera_SanTennis_Labeled/train.txt", "w") valid_txt = open("/Users/ntdat...
[ "os.listdir" ]
[((22, 158), 'os.listdir', 'os.listdir', (['"""/Users/ntdat/Tài liệu/Năm 4/Kỳ 2/Các hệ thống đa phương tiện/Data_Camera_SanTennis_Labeled/Labels/"""'], {}), "(\n '/Users/ntdat/Tài liệu/Năm 4/Kỳ 2/Các hệ thống đa phương tiện/Data_Camera_SanTennis_Labeled/Labels/'\n )\n", (32, 158), Fals...
try: import uvloop uvloop.install() del uvloop except ImportError: pass __version__ = '0.1.0' PRODUCT = "Aiopika Python Client Library" from .parameter import * from .exceptions import * from .credentials import * from .connection import * from .channel import *
[ "uvloop.install" ]
[((27, 43), 'uvloop.install', 'uvloop.install', ([], {}), '()\n', (41, 43), False, 'import uvloop\n')]
""" ############################################################################### Controller: Overall controller class ############################################################################### """ import pickle as _pickle import copy as _copy import time import random import string import OpenPNM from OpenPNM....
[ "copy.deepcopy", "OpenPNM.Utilities.IO.MAT.save", "copy.copy", "time.strftime", "random.choice", "OpenPNM.Utilities.IO.VTK.save", "OpenPNM.Base.logging.getLogger", "datetime.datetime.now" ]
[((349, 368), 'OpenPNM.Base.logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (366, 368), False, 'from OpenPNM.Base import logging\n'), ((9567, 9582), 'copy.copy', '_copy.copy', (['obj'], {}), '(obj)\n', (9577, 9582), True, 'import copy as _copy\n'), ((9610, 9634), 'copy.copy', '_copy.copy', (['obj.__dict__'],...
# coding: utf-8 ### # @file access.py # @author <NAME> <<EMAIL>> # # @section LICENSE # # Copyright © 2018-2019 <NAME>. # # 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 r...
[ "os.geteuid", "pathlib.Path", "stat.S_ISDIR", "os.getegid" ]
[((2079, 2097), 'pathlib.Path', 'pathlib.Path', (['path'], {}), '(path)\n', (2091, 2097), False, 'import pathlib\n'), ((2187, 2199), 'os.geteuid', 'os.geteuid', ([], {}), '()\n', (2197, 2199), False, 'import os\n'), ((2211, 2223), 'os.getegid', 'os.getegid', ([], {}), '()\n', (2221, 2223), False, 'import os\n'), ((2370...