code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
"""Add token details column to user Revision ID: <KEY> Revises: 2<PASSWORD> Create Date: 2020-05-03 18:27:05.322276 """ import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision = "<KEY>" down_revision = "25a64d119303" branch_labels = () depends_on = None def upgrade() -> Non...
[ "alembic.op.drop_column", "sqlalchemy.JSON" ]
[((431, 467), 'alembic.op.drop_column', 'op.drop_column', (['"""user"""', '"""token_data"""'], {}), "('user', 'token_data')\n", (445, 467), False, 'from alembic import op\n'), ((373, 382), 'sqlalchemy.JSON', 'sa.JSON', ([], {}), '()\n', (380, 382), True, 'import sqlalchemy as sa\n')]
""" File: quadratic_solver.py ----------------------- This program should implement a console program that asks 3 inputs (a, b, and c) from users to compute the roots of equation ax^2 + bx + c = 0 Output format should match what is shown in the sample run in the Assignment 2 Handout. """ import math def main(): ""...
[ "math.sqrt" ]
[((596, 619), 'math.sqrt', 'math.sqrt', (['discriminant'], {}), '(discriminant)\n', (605, 619), False, 'import math\n'), ((640, 663), 'math.sqrt', 'math.sqrt', (['discriminant'], {}), '(discriminant)\n', (649, 663), False, 'import math\n')]
from __future__ import annotations from . import randoms import astor import graphviz as gv import os import ast import logging from typing import Dict, List, Tuple, Set, Optional, Any BASIC_TYPES = (ast.Num, ast.Str, ast.FormattedValue, ast.JoinedStr, ast.Bytes, ast.NameConstant, ast.Ellipsis, ast.Cons...
[ "ast.arguments", "logging.debug", "astor.to_source", "ast.Dict", "ast.Del", "ast.Try", "ast.Load", "os.path.normpath", "ast.Expr", "ast.Pass", "ast.Index", "ast.Yield", "ast.Module", "ast.Store", "ast.And", "graphviz.Digraph", "ast.Assign", "ast.Return", "ast.Call" ]
[((5756, 5807), 'graphviz.Digraph', 'gv.Digraph', ([], {'name': "('cluster_' + self.name)", 'format': 'fmt'}), "(name='cluster_' + self.name, format=fmt)\n", (5766, 5807), True, 'import graphviz as gv\n'), ((6437, 6463), 'os.path.normpath', 'os.path.normpath', (['filepath'], {}), '(filepath)\n', (6453, 6463), False, 'i...
import tensorflow as tf import numpy as np ds = tf.contrib.distributions def decode(z, observable_space_dims): with tf.variable_scope('Decoder', [z]): logits = tf.layers.dense(z, 200, activation=tf.nn.tanh) logits = tf.layers.dense(logits, np.prod(observable_space_dims)) p_x_given_z = ds.Ber...
[ "tensorflow.layers.dense", "tensorflow.variable_scope", "numpy.prod" ]
[((123, 156), 'tensorflow.variable_scope', 'tf.variable_scope', (['"""Decoder"""', '[z]'], {}), "('Decoder', [z])\n", (140, 156), True, 'import tensorflow as tf\n'), ((175, 221), 'tensorflow.layers.dense', 'tf.layers.dense', (['z', '(200)'], {'activation': 'tf.nn.tanh'}), '(z, 200, activation=tf.nn.tanh)\n', (190, 221)...
import gym from gym import spaces import cv2 import pygame import copy import numpy as np from overcooked_ai_py.mdp.overcooked_env import OvercookedEnv as OriginalEnv from overcooked_ai_py.mdp.overcooked_mdp import OvercookedGridworld from overcooked_ai_py.visualization.state_visualizer import StateVisualizer from ov...
[ "pygame.surfarray.array3d", "cv2.resize", "gym.spaces.Discrete", "numpy.array", "overcooked_ai_py.mdp.overcooked_env.OvercookedEnv.from_mdp", "cv2.cvtColor", "copy.deepcopy", "numpy.rot90", "overcooked_ai_py.visualization.state_visualizer.StateVisualizer.default_hud_data", "overcooked_ai_py.visual...
[((844, 890), 'overcooked_ai_py.mdp.overcooked_mdp.OvercookedGridworld.from_layout_name', 'OvercookedGridworld.from_layout_name', (['scenario'], {}), '(scenario)\n', (880, 890), False, 'from overcooked_ai_py.mdp.overcooked_mdp import OvercookedGridworld\n'), ((917, 971), 'overcooked_ai_py.mdp.overcooked_env.OvercookedE...
import hashlib import inspect import json from datetime import datetime, timezone from typing import List, Any, Optional, Dict import pydantic from asff.constants import ( DEFAULT_SEVERITY, DEFAULT_SCHEMA_VERSION, DEFAULT_PRODUCT_ARN_FMT, DEFAULT_REGION, DEFAULT_GENERATOR_ID, DEFAULT_PRODUCT_N...
[ "json.loads", "inspect.getmembers", "asff.exceptions.ValidationError", "hashlib.new", "datetime.datetime.now", "asff.constants.DEFAULT_PRODUCT_ARN_FMT.format", "asff.generated.Resource" ]
[((3198, 3219), 'hashlib.new', 'hashlib.new', (['"""sha256"""'], {}), "('sha256')\n", (3209, 3219), False, 'import hashlib\n'), ((6466, 6581), 'asff.constants.DEFAULT_PRODUCT_ARN_FMT.format', 'DEFAULT_PRODUCT_ARN_FMT.format', ([], {'region': 'region', 'aws_account_id': 'aws_account_id', 'product_name': 'DEFAULT_PRODUCT...
#!/usr/bin/env python3 # encoding: utf-8 # public domain import random """ spec: [11:37 PM] nick: can you write a python function that just generates a really long string containing all numbers and +-*/? int type: signed 64 bit """ def arithmetic_gen(operand_count): operands = [] rand_num = lambda: str(random.ra...
[ "random.choice", "random.randrange" ]
[((311, 346), 'random.randrange', 'random.randrange', (['(-2 ** 64)', '(2 ** 63)'], {}), '(-2 ** 64, 2 ** 63)\n', (327, 346), False, 'import random\n'), ((424, 445), 'random.choice', 'random.choice', (['"""+-*/"""'], {}), "('+-*/')\n", (437, 445), False, 'import random\n')]
from fbrp import life_cycle from fbrp import registrar import argparse @registrar.register_command("down") class down_cmd: @classmethod def define_argparse(cls, parser: argparse.ArgumentParser): parser.add_argument("proc", action="append", nargs="*") @staticmethod def exec(args: argparse.Name...
[ "fbrp.life_cycle.system_state", "fbrp.life_cycle.set_ask", "fbrp.registrar.register_command" ]
[((74, 108), 'fbrp.registrar.register_command', 'registrar.register_command', (['"""down"""'], {}), "('down')\n", (100, 108), False, 'from fbrp import registrar\n'), ((553, 603), 'fbrp.life_cycle.set_ask', 'life_cycle.set_ask', (['proc_name', 'life_cycle.Ask.DOWN'], {}), '(proc_name, life_cycle.Ask.DOWN)\n', (571, 603)...
# Generated by Django 3.0.5 on 2020-06-01 22:25 import baby_backend.apps.customers.models from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ mi...
[ "django.db.models.OneToOneField", "django.db.models.DateField", "django.db.models.TextField", "django.db.models.ForeignKey", "django.db.models.DateTimeField", "django.db.models.BooleanField", "django.db.models.SlugField", "django.db.models.AutoField", "django.db.models.BigIntegerField", "django.db...
[((318, 375), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (349, 375), False, 'from django.db import migrations, models\n'), ((508, 601), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)...
from decimal import Decimal from PyInquirer import prompt from termcolor import colored from thirdweb_web3.exceptions import TimeExhausted from .get import get def burn(currency_module): """ This function is used to burn some tokens from your account. """ # Get the amount of tokens to burn burn...
[ "termcolor.colored", "PyInquirer.prompt", "decimal.Decimal" ]
[((328, 569), 'PyInquirer.prompt', 'prompt', (["[{'type': 'input', 'name': 'amount', 'message':\n 'Enter the amount of tokens to burn', 'default': '1'}, {'type':\n 'confirm', 'name': 'confirmation', 'message':\n 'Do you want to burn the selected tokens?', 'default': False}]"], {}), "([{'type': 'input', 'name'...
# Copyright 2019 The FastEstimator 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 appl...
[ "lazy_loader.attach" ]
[((786, 1130), 'lazy_loader.attach', 'lazy.attach', (['__name__'], {'submodules': "{'breast_cancer', 'cifair10', 'cifair100', 'cifar10', 'cifar100', 'cub200',\n 'food101', 'horse2zebra', 'imdb_review', 'mendeley', 'mitmovie_ner',\n 'mnist', 'montgomery', 'mscoco', 'nih_chestxray', 'omniglot',\n 'penn_treebank'...
from typing import List, Dict import logging import json import debug_logger import socket_connections def get_connections( setting: Dict, binding: bool, logger: logging.Logger ) -> List: conn_list = [] for conn in setting: conn_list.append( socket_connections.Connection( ...
[ "json.load", "debug_logger.init_logger", "socket_connections.Connection" ]
[((544, 603), 'debug_logger.init_logger', 'debug_logger.init_logger', (['"""my_logger"""', '"""debug"""', '"""debug.log"""'], {}), "('my_logger', 'debug', 'debug.log')\n", (568, 603), False, 'import debug_logger\n'), ((663, 675), 'json.load', 'json.load', (['f'], {}), '(f)\n', (672, 675), False, 'import json\n'), ((278...
# Generated by Django 2.2.1 on 2019-05-13 10:27 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies: list[tuple[str, str]] = [] operations = [ migrations.CreateModel( name='Email', fields=[ ( ...
[ "django.db.models.DateTimeField", "django.db.models.EmailField", "django.db.models.AutoField" ]
[((360, 453), '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", (376, 453), False, 'from django.db import migrations, models\...
#!/usr/bin/python3 __author__ = 'kilroy' # (c) 2014, WasHere Consulting, Inc. # Written for Infinite Skills # this requires Python 3 to function properly import os, sys, re, argparse # This is a class designed to store the results from the parsed file until we're # ready to print them out class modsecRec: #...
[ "os.path.exists", "argparse.ArgumentParser", "os.remove" ]
[((1607, 1632), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1630, 1632), False, 'import os, sys, re, argparse\n'), ((2016, 2045), 'os.path.exists', 'os.path.exists', (['inputFileName'], {}), '(inputFileName)\n', (2030, 2045), False, 'import os, sys, re, argparse\n'), ((2137, 2167), 'os.path...
from django.conf.urls import url from events import views urlpatterns = [ url('', views.search, name='events'), ]
[ "django.conf.urls.url" ]
[((76, 112), 'django.conf.urls.url', 'url', (['""""""', 'views.search'], {'name': '"""events"""'}), "('', views.search, name='events')\n", (79, 112), False, 'from django.conf.urls import url\n')]
import pytest from pg13 import pgmock_dbapi2, sqparse2 def test_connection(): with pgmock_dbapi2.connect() as a, a.cursor() as acur: acur.execute('create table t1 (a int)') acur.execute('insert into t1 values (1)') acur.execute('insert into t1 values (3)') # test second connction into same DB with p...
[ "pytest.raises", "pg13.pgmock_dbapi2.connect" ]
[((86, 109), 'pg13.pgmock_dbapi2.connect', 'pgmock_dbapi2.connect', ([], {}), '()\n', (107, 109), False, 'from pg13 import pgmock_dbapi2, sqparse2\n'), ((319, 349), 'pg13.pgmock_dbapi2.connect', 'pgmock_dbapi2.connect', (['a.db_id'], {}), '(a.db_id)\n', (340, 349), False, 'from pg13 import pgmock_dbapi2, sqparse2\n'), ...
# Generated by Django 3.0 on 2020-05-29 15:32 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('customer_success', '0012_auto_20200528_1414'), ] operations = [ migrations.AddField( model_name='action', name='recur_...
[ "django.db.models.CharField", "django.db.models.BooleanField", "django.db.models.IntegerField" ]
[((356, 537), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'choices': "[('days', 'Day(s)')]", 'help_text': '"""The type of time period to use for recurrance"""', 'max_length': '(50)', 'null': '(True)', 'verbose_name': '"""time period"""'}), "(blank=True, choices=[('days', 'Day(s)')], help_...
from __future__ import annotations from base64 import b64decode, b64encode from logging import Logger, getLogger from typing import Any, Callable, Iterable import attrs from .. import events from ..abc import EventBroker, Serializer, Subscription from ..events import Event from ..exceptions import DeserializationErr...
[ "logging.getLogger", "attrs.asdict", "base64.b64encode", "base64.b64decode", "attrs.define", "attrs.field" ]
[((326, 361), 'attrs.define', 'attrs.define', ([], {'eq': '(False)', 'frozen': '(True)'}), '(eq=False, frozen=True)\n', (338, 361), False, 'import attrs\n'), ((629, 651), 'attrs.define', 'attrs.define', ([], {'eq': '(False)'}), '(eq=False)\n', (641, 651), False, 'import attrs\n'), ((710, 733), 'attrs.field', 'attrs.fie...
import pandas as pd from mamba import description, context, it, before from expects import expect, equal from blsqpy.descriptor import Descriptor import blsqpy.extract as extract from pandas.testing import assert_frame_equal with description('extract') as self: with it('extract data elements from config'): ...
[ "blsqpy.descriptor.Descriptor.load", "pandas.read_csv", "blsqpy.extract.to_data_elements", "expects.expect", "blsqpy.extract.rotate_de_coc_as_columns", "mamba.it", "mamba.description", "expects.equal" ]
[((232, 254), 'mamba.description', 'description', (['"""extract"""'], {}), "('extract')\n", (243, 254), False, 'from mamba import description, context, it, before\n'), ((274, 313), 'mamba.it', 'it', (['"""extract data elements from config"""'], {}), "('extract data elements from config')\n", (276, 313), False, 'from ma...
from fastapi import FastAPI app = FastAPI() TAREFAS = [ { "id": "1", "titulo": "fazer compras", "descrição": "comprar leite e ovos", "estado": "não finalizado", }, { "id": "2", "titulo": "levar o cachorro para tosar", "descrição": "está muito peludo"...
[ "fastapi.FastAPI" ]
[((35, 44), 'fastapi.FastAPI', 'FastAPI', ([], {}), '()\n', (42, 44), False, 'from fastapi import FastAPI\n')]
print('Gathering psychic powers...') import re import numpy as np from gensim.models.keyedvectors import KeyedVectors word_vectors = KeyedVectors.load_word2vec_format('GoogleNews-vectors-negative300.bin.gz', binary=True, limit=200000) # word_vectors.save('wvsubset') # word_vectors = KeyedVectors.load("wvsubset...
[ "re.split", "nltk.pos_tag", "gensim.models.keyedvectors.KeyedVectors.load_word2vec_format", "nltk.stem.WordNetLemmatizer", "numpy.argsort", "numpy.array", "numpy.dot", "nltk.tokenize.RegexpTokenizer", "numpy.load", "numpy.save" ]
[((139, 244), 'gensim.models.keyedvectors.KeyedVectors.load_word2vec_format', 'KeyedVectors.load_word2vec_format', (['"""GoogleNews-vectors-negative300.bin.gz"""'], {'binary': '(True)', 'limit': '(200000)'}), "('GoogleNews-vectors-negative300.bin.gz',\n binary=True, limit=200000)\n", (172, 244), False, 'from gensim....
# coding: utf-8 """Tests for the elpy.autopep8 module""" import unittest import os from elpy import auto_pep8 from elpy.tests.support import BackendTestCase class Autopep8TestCase(BackendTestCase): def setUp(self): if not auto_pep8.autopep8: raise unittest.SkipTest def test_fix_code(s...
[ "os.getcwd" ]
[((415, 426), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (424, 426), False, 'import os\n')]
from disco.bot import Plugin, Config from disco.api.http import APIException class RewardsPluginConfig(Config): master_guild_id = 0 @Plugin.with_config(RewardsPluginConfig) class RewardsPlugin(Plugin): @Plugin.command("rolereward", "<role_id:snowflake> <giveaway_name:str...>", group="giveaway", level=100)...
[ "disco.bot.Plugin.command", "disco.bot.Plugin.with_config" ]
[((142, 181), 'disco.bot.Plugin.with_config', 'Plugin.with_config', (['RewardsPluginConfig'], {}), '(RewardsPluginConfig)\n', (160, 181), False, 'from disco.bot import Plugin, Config\n'), ((217, 324), 'disco.bot.Plugin.command', 'Plugin.command', (['"""rolereward"""', '"""<role_id:snowflake> <giveaway_name:str...>"""']...
import sys from loguru import logger from .log import DevelopFormatter, JsonSink from .settings import settings logger.remove() if settings.env == "development": develop_fmt = DevelopFormatter(settings.component_name) logger.add(sys.stdout, format=develop_fmt) else: json_sink = JsonSink(settings.componen...
[ "loguru.logger.add", "loguru.logger.remove" ]
[((115, 130), 'loguru.logger.remove', 'logger.remove', ([], {}), '()\n', (128, 130), False, 'from loguru import logger\n'), ((229, 271), 'loguru.logger.add', 'logger.add', (['sys.stdout'], {'format': 'develop_fmt'}), '(sys.stdout, format=develop_fmt)\n', (239, 271), False, 'from loguru import logger\n'), ((332, 353), '...
#!/usr/bin/python # # Python 2.7 server that adds "no-cache" # import SimpleHTTPServer class NonCachingRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): def end_headers(self): self.send_my_headers() SimpleHTTPServer.SimpleHTTPRequestHandler.end_headers(self) def send_my_headers(self): self.se...
[ "SimpleHTTPServer.test", "SimpleHTTPServer.SimpleHTTPRequestHandler.end_headers" ]
[((496, 556), 'SimpleHTTPServer.test', 'SimpleHTTPServer.test', ([], {'HandlerClass': 'NonCachingRequestHandler'}), '(HandlerClass=NonCachingRequestHandler)\n', (517, 556), False, 'import SimpleHTTPServer\n'), ((219, 278), 'SimpleHTTPServer.SimpleHTTPRequestHandler.end_headers', 'SimpleHTTPServer.SimpleHTTPRequestHandl...
# noinspection PyUnresolvedReferences from pythoncom import com_error from datetime import date from datetime import datetime from .. util.text import vengeance_message from .. util.iter import force_two_dimen from .. util.iter import is_iterable from .. util.iter import is_vengeance_class from .. excel_com.excel_a...
[ "datetime.datetime" ]
[((3554, 3586), 'datetime.datetime', 'datetime', (['v.year', 'v.month', 'v.day'], {}), '(v.year, v.month, v.day)\n', (3562, 3586), False, 'from datetime import datetime\n')]
from math import sin, pi import random import numpy as np from scipy.stats import norm def black_box_projectile(theta, v0=10, g=9.81): assert theta >= 0 assert theta <= 90 return (v0 ** 2) * sin(2 * pi * theta / 180) / g def random_shooting(n=1, min_a=0, max_a=90): assert min_a <= max_a return [r...
[ "numpy.clip", "numpy.mean", "random.uniform", "scipy.stats.norm.rvs", "scipy.stats.norm.fit", "numpy.array", "numpy.argsort", "numpy.std", "math.sin", "numpy.round" ]
[((419, 436), 'numpy.array', 'np.array', (['actions'], {}), '(actions)\n', (427, 436), True, 'import numpy as np\n'), ((319, 347), 'random.uniform', 'random.uniform', (['min_a', 'max_a'], {}), '(min_a, max_a)\n', (333, 347), False, 'import random\n'), ((2290, 2310), 'scipy.stats.norm.fit', 'norm.fit', (['elite_acts'], ...
""" <EMAIL> """ import os import filecmp import time GP_options_dict = { 'run_pearson' : 'BENCHMARK_1_GP_pearson', 'run_net_pearson' : 'BENCHMARK_3_GP_net_pearson', 'run_bootstrap_pearson' : 'BENCHMARK_2_GP_bootstrap_pearson', ...
[ "os.listdir", "filecmp.cmp", "os.path.join", "os.system", "time.time" ]
[((981, 998), 'os.listdir', 'os.listdir', (['v_dir'], {}), '(v_dir)\n', (991, 998), False, 'import os\n'), ((1023, 1046), 'os.listdir', 'os.listdir', (['results_dir'], {}), '(results_dir)\n', (1033, 1046), False, 'import os\n'), ((1800, 1811), 'time.time', 'time.time', ([], {}), '()\n', (1809, 1811), False, 'import tim...
#!/usr/bin/env python # Needed to set seed for random generators for making reproducible experiments from numpy.random import seed seed(1) from tensorflow import set_random_seed set_random_seed(1) import numpy as np import tifffile as tiff import os import random import shutil from PIL import Image from ..utils impor...
[ "numpy.mean", "numpy.all", "os.listdir", "tifffile.imread", "random.shuffle", "os.makedirs", "shutil.move", "PIL.Image.open", "numpy.shape", "numpy.size", "random.seed", "numpy.array", "numpy.zeros", "numpy.random.seed", "shutil.rmtree", "numpy.pad", "tensorflow.set_random_seed", "...
[((132, 139), 'numpy.random.seed', 'seed', (['(1)'], {}), '(1)\n', (136, 139), False, 'from numpy.random import seed\n'), ((179, 197), 'tensorflow.set_random_seed', 'set_random_seed', (['(1)'], {}), '(1)\n', (194, 197), False, 'from tensorflow import set_random_seed\n'), ((1500, 1554), 'numpy.zeros', 'np.zeros', (['(im...
"""Neural Gas example using the Iris dataset.""" import prototorch as pt import pytorch_lightning as pl import torch if __name__ == "__main__": # Prepare and pre-process the dataset from sklearn.datasets import load_iris from sklearn.preprocessing import StandardScaler x_train, y_train = load_iris(ret...
[ "sklearn.datasets.load_iris", "prototorch.datasets.NumpyDataset", "sklearn.preprocessing.StandardScaler", "prototorch.models.NeuralGas", "pytorch_lightning.Trainer", "torch.utils.data.DataLoader", "prototorch.models.VisNG2D" ]
[((307, 333), 'sklearn.datasets.load_iris', 'load_iris', ([], {'return_X_y': '(True)'}), '(return_X_y=True)\n', (316, 333), False, 'from sklearn.datasets import load_iris\n'), ((380, 396), 'sklearn.preprocessing.StandardScaler', 'StandardScaler', ([], {}), '()\n', (394, 396), False, 'from sklearn.preprocessing import S...
import os import json import numpy as np from SoccerNet.Downloader import getListGames from config.classes import EVENT_DICTIONARY_V2, INVERSE_EVENT_DICTIONARY_V2 def label2vector(folder_path, num_classes=17, framerate=2): label_path = folder_path + "/Labels-v2.json" # Load labels labels = json.load(open...
[ "os.makedirs", "numpy.where", "SoccerNet.Downloader.getListGames", "numpy.zeros", "json.dump" ]
[((388, 424), 'numpy.zeros', 'np.zeros', (['(vector_size, num_classes)'], {}), '((vector_size, num_classes))\n', (396, 424), True, 'import numpy as np\n'), ((443, 479), 'numpy.zeros', 'np.zeros', (['(vector_size, num_classes)'], {}), '((vector_size, num_classes))\n', (451, 479), True, 'import numpy as np\n'), ((1386, 1...
import os import sys from app.backend import tools import warnings sys.path.append(os.path.join(os.getcwd(), 'cytomod', 'otherTools')) warnings.filterwarnings('ignore') warnings.simplefilter('ignore') def make_cyto_data(parameters): cy_data_name = tools.read_excel(os.path.join(parameters.path_files, 'data_files_a...
[ "warnings.simplefilter", "os.path.join", "warnings.filterwarnings", "os.getcwd" ]
[((135, 168), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (158, 168), False, 'import warnings\n'), ((169, 200), 'warnings.simplefilter', 'warnings.simplefilter', (['"""ignore"""'], {}), "('ignore')\n", (190, 200), False, 'import warnings\n'), ((96, 107), 'os.getcwd', 'o...
#!/usr/bin/env python #-*- coding: utf-8 -*- import rospy from flexbe_core import EventState, Logger from sonia_common.srv import ImuTareSrv class imu_tare(EventState): ''' State to tare the IMU <= continue Activation successful <= failed ...
[ "flexbe_core.Logger.log", "rospy.ServiceProxy", "rospy.wait_for_service" ]
[((499, 543), 'rospy.wait_for_service', 'rospy.wait_for_service', (['"""/provider_imu/tare"""'], {}), "('/provider_imu/tare')\n", (521, 543), False, 'import rospy\n'), ((564, 616), 'rospy.ServiceProxy', 'rospy.ServiceProxy', (['"""/provider_imu/tare"""', 'ImuTareSrv'], {}), "('/provider_imu/tare', ImuTareSrv)\n", (582,...
import pygame as pg from pygame.locals import KEYUP, K_ESCAPE, QUIT class GameEngine: def __init__(self, size = (640, 480), fps = 1): pg.init() self.size, self.fps = size, fps self.screen = pg.display.set_mode(self.size) self.running = False def mainLoop(self): self.running = True while(self.runnin...
[ "pygame.init", "pygame.event.get", "pygame.display.set_mode", "pygame.display.flip", "pygame.time.Clock" ]
[((138, 147), 'pygame.init', 'pg.init', ([], {}), '()\n', (145, 147), True, 'import pygame as pg\n'), ((198, 228), 'pygame.display.set_mode', 'pg.display.set_mode', (['self.size'], {}), '(self.size)\n', (217, 228), True, 'import pygame as pg\n'), ((478, 492), 'pygame.event.get', 'pg.event.get', ([], {}), '()\n', (490, ...
import sys import re import os import fnmatch from os import walk as py_walk def walk(top, callback, args): for root, dirs, files in py_walk(top): callback(args, root, files) def find_data_files(srcdir, destdir, *wildcards, **kw): """ get a list of all files under the srcdir matching wildcards, ...
[ "os.path.join", "os.path.isdir", "fnmatch.fnmatch", "os.path.basename", "os.walk" ]
[((138, 150), 'os.walk', 'py_walk', (['top'], {}), '(top)\n', (145, 150), True, 'from os import walk as py_walk\n'), ((613, 638), 'os.path.join', 'os.path.join', (['dirname', 'wc'], {}), '(dirname, wc)\n', (625, 638), False, 'import os\n'), ((1331, 1350), 'os.path.basename', 'os.path.basename', (['f'], {}), '(f)\n', (1...
__author__ = 'jules' from deepThought.scheduler.scheduler import Scheduler from deepThought.scheduler.RBRS import RBRS from deepThought.scheduler.genetic.ListGA import ListGA from deepThought.scheduler.genetic.ArcGA import ArcGA from deepThought.util import Logger from deepThought.scheduler.MfssRb import MfssRB """ Th...
[ "deepThought.scheduler.RBRS.RBRS", "deepThought.scheduler.genetic.ListGA.ListGA", "deepThought.simulator.simulator.simulate_schedule", "deepThought.util.Logger.info", "deepThought.scheduler.MfssRb.MfssRB", "deepThought.scheduler.genetic.ArcGA.ArcGA" ]
[((1184, 1238), 'deepThought.util.Logger.info', 'Logger.info', (['"""Generating initial Population with RBRS"""'], {}), "('Generating initial Population with RBRS')\n", (1195, 1238), False, 'from deepThought.util import Logger\n'), ((1325, 1377), 'deepThought.util.Logger.info', 'Logger.info', (['"""Applying ListGA to i...
from typing import Any, Optional, Union import torch from numpy import ndarray from pytorch_lightning import LightningModule from torch import Tensor, nn, optim from torch.nn.functional import cross_entropy from torchmetrics.functional import accuracy class LinearNN(LightningModule): def __init__(self) -> None: ...
[ "torch.nn.ReLU", "torch.nn.Flatten", "torch.nn.Linear", "torch.nn.functional.cross_entropy", "torch.no_grad" ]
[((370, 382), 'torch.nn.Flatten', 'nn.Flatten', ([], {}), '()\n', (380, 382), False, 'from torch import Tensor, nn, optim\n'), ((903, 925), 'torch.nn.functional.cross_entropy', 'cross_entropy', (['pred', 'y'], {}), '(pred, y)\n', (916, 925), False, 'from torch.nn.functional import cross_entropy\n'), ((1230, 1252), 'tor...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of Karesansui Core. # # Copyright (C) 2009-2012 HDE, Inc. # # 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 restric...
[ "karesansui.lib.collectd.utils.plugin_selector_to_dict", "os.path.exists", "karesansui.lib.utils.preprint_r", "karesansui.lib.parser.collectd.collectdParser", "karesansui.lib.utils.uniq_sort", "karesansui.lib.utils.available_virt_mechs", "karesansui.lib.utils.available_virt_uris", "karesansui.lib.conf...
[((1958, 1993), 'os.path.exists', 'os.path.exists', (['COLLECTD_PLUGIN_DIR'], {}), '(COLLECTD_PLUGIN_DIR)\n', (1972, 1993), False, 'import os\n'), ((2972, 3004), 'karesansui.lib.conf.read_conf', 'read_conf', (['modules', 'webobj', 'host'], {}), '(modules, webobj, host)\n', (2981, 3004), False, 'from karesansui.lib.conf...
""" The toolaudit application """ from .kitlist import KitList import logging from . import readers import os import os.path import sys class ToolauditApp(object): """Class for toolaudit functions""" def __init__(self): """ Initialize the toolaudit class Parameters ----------...
[ "logging.getLogger", "os.path.exists", "logging.StreamHandler", "os.chdir", "os.path.dirname", "sys.exit", "os.path.abspath" ]
[((448, 475), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (465, 475), False, 'import logging\n'), ((494, 517), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (515, 517), False, 'import logging\n'), ((765, 794), 'os.path.abspath', 'os.path.abspath', (['kitlist_file'...
import unittest class Stack: def __init__(self): self.values = [] self.is_empty = True self.size = 0 def push(self, value): self.values.append(value) self.size += 1 self.is_empty = False def pop(self): if not self.is_empty: self.size -=...
[ "unittest.main" ]
[((2916, 2931), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2929, 2931), False, 'import unittest\n')]
#!/usr/bin/python from doppelserver.models import load_session, StaticSample import urllib, time import doppelserver.utils as utils from lxml import etree if __name__ == "__main__": s = load_session() while True: f = urllib.urlopen("http://tac.mit.edu/E14/data.asp") xml = etree.XML(f.read()) ...
[ "doppelserver.utils.lookup_sensor", "time.sleep", "doppelserver.models.load_session", "doppelserver.models.StaticSample", "urllib.urlopen" ]
[((192, 206), 'doppelserver.models.load_session', 'load_session', ([], {}), '()\n', (204, 206), False, 'from doppelserver.models import load_session, StaticSample\n'), ((235, 284), 'urllib.urlopen', 'urllib.urlopen', (['"""http://tac.mit.edu/E14/data.asp"""'], {}), "('http://tac.mit.edu/E14/data.asp')\n", (249, 284), F...
from django.urls import path from . import views app_name = 'home' urlpatterns = [ path('', views.index, name = 'index'), path('all', views.all, name= 'all'), path('login', views.my_login, name= 'login'), path('logout', views.my_logout, name= 'logout'), path('signup', views.my_signup, name = 'signup...
[ "django.urls.path" ]
[((87, 122), 'django.urls.path', 'path', (['""""""', 'views.index'], {'name': '"""index"""'}), "('', views.index, name='index')\n", (91, 122), False, 'from django.urls import path\n'), ((130, 164), 'django.urls.path', 'path', (['"""all"""', 'views.all'], {'name': '"""all"""'}), "('all', views.all, name='all')\n", (134,...
import csv import numpy as np def cargar_datos(nombre_archivo): datos_entrenamiento = [] nombres_entrenamiento = [] with open(nombre_archivo, newline='') as csvfile: for fila in csv.reader(csvfile): datos_entrenamiento.append(list(map(lambda x: float(x), fila[:-1]))) nombre...
[ "numpy.array", "csv.reader" ]
[((200, 219), 'csv.reader', 'csv.reader', (['csvfile'], {}), '(csvfile)\n', (210, 219), False, 'import csv\n'), ((372, 401), 'numpy.array', 'np.array', (['datos_entrenamiento'], {}), '(datos_entrenamiento)\n', (380, 401), True, 'import numpy as np\n'), ((403, 434), 'numpy.array', 'np.array', (['nombres_entrenamiento'],...
#!/usr/bin/env python3 # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
[ "pyudev.Context", "subprocess.run", "pyudev.Monitor.from_netlink" ]
[((762, 867), 'subprocess.run', 'subprocess.run', (['(f"{os.environ[\'HOME\']}/.local/lib/input-device-handler/xinput.sh",)'], {'check': '(True)'}), '((\n f"{os.environ[\'HOME\']}/.local/lib/input-device-handler/xinput.sh",),\n check=True)\n', (776, 867), False, 'import subprocess\n'), ((910, 926), 'pyudev.Contex...
#!/usr/bin/env python3 from collections import defaultdict from unicodedata import normalize # (ending, parse)->int(count) counts = defaultdict(int) # (ending)->set(parse) parses = defaultdict(set) # (ending)->set(rule) rules = defaultdict(set) with open("ending_tree.txt") as stream: for line in stream: ...
[ "collections.defaultdict", "unicodedata.normalize" ]
[((134, 150), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (145, 150), False, 'from collections import defaultdict\n'), ((184, 200), 'collections.defaultdict', 'defaultdict', (['set'], {}), '(set)\n', (195, 200), False, 'from collections import defaultdict\n'), ((232, 248), 'collections.defaultdi...
""" Multiple inheritance sample 1 from docs. Note: not more than one review per book looks like a wrong example. """ from django.db import models class Model(models.Model): class Meta: app_label = 'a2' abstract = True class Article(Model): article_id = models.AutoField(primary_key=True) ...
[ "django.db.models.AutoField", "django.db.models.CharField" ]
[((283, 317), 'django.db.models.AutoField', 'models.AutoField', ([], {'primary_key': '(True)'}), '(primary_key=True)\n', (299, 317), False, 'from django.db import models\n'), ((333, 364), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(10)'}), '(max_length=10)\n', (349, 364), False, 'from django...
from PreProcessListener import PreProcessListener import re from enum import Enum from typing import TypeVar, Generic, List from ANTLRv4Parser import ANTLRv4Parser from ProcessListenerBase import ProcessListenerBase, Stack from ElseTemplateGenerator import ElsePlaceholder class ProcessListener(ProcessListenerBase): ...
[ "re.split", "ProcessListenerBase.Stack", "re.compile", "ElseTemplateGenerator.ElsePlaceholder", "re.sub" ]
[((374, 459), 're.compile', 're.compile', (['"""^\\\\s*(?:public|private|protected|fragment)?([A-Za-z0-9_]+)\\\\s*:.*$"""'], {}), "('^\\\\s*(?:public|private|protected|fragment)?([A-Za-z0-9_]+)\\\\s*:.*$'\n )\n", (384, 459), False, 'import re\n'), ((477, 507), 're.compile', 're.compile', (['"""^([,;|:]\\\\s*).*$"""'...
# # Test DAF support for ACARS data # # SOFTWARE HISTORY # # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 01/19/16 4795 mapeters Initial Creation. # 04/11/16 5548 tgurney ...
[ "awips.dataaccess.DataAccessLayer.newDataRequest" ]
[((709, 742), 'awips.dataaccess.DataAccessLayer.newDataRequest', 'DAL.newDataRequest', (['self.datatype'], {}), '(self.datatype)\n', (727, 742), True, 'from awips.dataaccess import DataAccessLayer as DAL\n'), ((835, 868), 'awips.dataaccess.DataAccessLayer.newDataRequest', 'DAL.newDataRequest', (['self.datatype'], {}), ...
# -*- coding: utf-8 -*- """ Created on Fri Jun 21 20:27:01 2020 @author: <NAME> """ '''This program aims to calculate which algorithm is the most efficient in the sorting function''' from random import randrange import timeit #Sorting Function def Bubble_Sort (vector,vector_size): aux = 0 for ...
[ "timeit.default_timer", "random.randrange" ]
[((3891, 3913), 'timeit.default_timer', 'timeit.default_timer', ([], {}), '()\n', (3911, 3913), False, 'import timeit\n'), ((3967, 3989), 'timeit.default_timer', 'timeit.default_timer', ([], {}), '()\n', (3987, 3989), False, 'import timeit\n'), ((4102, 4124), 'timeit.default_timer', 'timeit.default_timer', ([], {}), '(...
# coding:utf-8 from django.db import models # isbn13:9787111013853 class Comment(models.Model): """ 评论模型 """ isbn13 = models.CharField(max_length=200,default=None) author = models.CharField(max_length=200,null=True,blank=True,default=None) time = models.CharField(max_length=200,null=True,blan...
[ "django.db.models.TextField", "django.db.models.CharField", "django.db.models.IntegerField" ]
[((137, 183), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(200)', 'default': 'None'}), '(max_length=200, default=None)\n', (153, 183), False, 'from django.db import models\n'), ((196, 265), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(200)', 'null': '(True)', 'blank...
''' Examples using Sense HAT animations: circle, triangle, line, and square functions. By <NAME>, 5/15/2017 ''' from sense_hat import SenseHat import time import numpy as np import time import ect from random import randint import sys sense = SenseHat() w = [150, 150, 150] b = [0, 0, 255] e = [0, 0, 0] # create...
[ "sense_hat.SenseHat", "ect.circle", "ect.square", "numpy.array", "ect.triangle", "ect.clear", "ect.cell", "random.randint" ]
[((248, 258), 'sense_hat.SenseHat', 'SenseHat', ([], {}), '()\n', (256, 258), False, 'from sense_hat import SenseHat\n'), ((342, 552), 'numpy.array', 'np.array', (['[e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e,\n e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e,\n ...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import os import sys import torch from torchvision.utils import save_image from options.train_options import TrainOptions import data from util.iter_counter import IterationCounter from util.util import print_current_errors from util.util import ...
[ "trainers.pix2pix_trainer.Pix2PixTrainer", "options.train_options.TrainOptions", "os.path.join", "util.util.mkdir", "pdb.set_trace", "data.create_dataloader", "torchvision.utils.save_image", "util.util.print_current_errors" ]
[((545, 572), 'data.create_dataloader', 'data.create_dataloader', (['opt'], {}), '(opt)\n', (567, 572), False, 'import data\n'), ((759, 817), 'trainers.pix2pix_trainer.Pix2PixTrainer', 'Pix2PixTrainer', (['opt'], {'resume_epoch': 'iter_counter.first_epoch'}), '(opt, resume_epoch=iter_counter.first_epoch)\n', (773, 817)...
"""Tasks for tests.""" from celery import shared_task from flask_celery import single_instance @shared_task(bind=True) @single_instance def add(self, x, y): """Celery task: add numbers.""" return x + y @shared_task(bind=True) @single_instance(include_args=True, lock_timeout=20) def mul(self, x, y): ""...
[ "celery.shared_task", "flask_celery.single_instance" ]
[((100, 122), 'celery.shared_task', 'shared_task', ([], {'bind': '(True)'}), '(bind=True)\n', (111, 122), False, 'from celery import shared_task\n'), ((217, 239), 'celery.shared_task', 'shared_task', ([], {'bind': '(True)'}), '(bind=True)\n', (228, 239), False, 'from celery import shared_task\n'), ((241, 292), 'flask_c...
from setuptools import setup, find_packages import os def get_version(): basedir = os.path.dirname(__file__) with open(os.path.join(basedir, 'alternativefacts/version.py')) as f: variables = {} exec(f.read(), variables) return variables.get('VERSION') raise RuntimeError('No version ...
[ "os.path.dirname", "setuptools.find_packages", "os.path.join" ]
[((88, 113), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (103, 113), False, 'import os\n'), ((576, 591), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (589, 591), False, 'from setuptools import setup, find_packages\n'), ((128, 180), 'os.path.join', 'os.path.join', (['based...
# -*- coding: utf-8 -*- """ Created on Sun Nov 5 17:05:49 2017 @author: thuzhang """ import numpy as np import pandas as pd File='DataBase/DataBaseNECA.csv' OriginData=pd.read_table(File,sep=",") for i in range(0,int(len(OriginData)/24)): _DailyData=OriginData["SYSLoad"][24*i:24*i+24] _DryData=OriginData["Dr...
[ "numpy.where", "numpy.mean", "pandas.read_table", "numpy.max" ]
[((171, 199), 'pandas.read_table', 'pd.read_table', (['File'], {'sep': '""","""'}), "(File, sep=',')\n", (184, 199), True, 'import pandas as pd\n'), ((409, 427), 'numpy.max', 'np.max', (['_DailyData'], {}), '(_DailyData)\n', (415, 427), True, 'import numpy as np\n'), ((507, 524), 'numpy.mean', 'np.mean', (['_DryData'],...
from os import makedirs from os.path import exists, join from fedot.core.composer.gp_composer.gp_composer import GPComposerBuilder, GPComposerRequirements from fedot.core.data.data import InputData from fedot.core.data.data_split import train_test_data_setup from fedot.core.optimisers.gp_comp.gp_optimiser import GPGra...
[ "fedot.core.optimisers.gp_comp.gp_optimiser.GPGraphOptimiserParameters", "fedot.core.data.data.InputData.from_csv", "os.path.exists", "fedot.core.composer.gp_composer.gp_composer.GPComposerBuilder", "os.makedirs", "fedot.core.pipelines.node.SecondaryNode", "fedot.core.data.data_split.train_test_data_set...
[((1129, 1149), 'fedot.core.pipelines.node.PrimaryNode', 'PrimaryNode', (['"""logit"""'], {}), "('logit')\n", (1140, 1149), False, 'from fedot.core.pipelines.node import PrimaryNode, SecondaryNode\n'), ((1173, 1195), 'fedot.core.pipelines.node.PrimaryNode', 'PrimaryNode', (['"""xgboost"""'], {}), "('xgboost')\n", (1184...
""" This module provides a summarize_book function. It takes a url as input, and attempts to generates a summary for the text. """ # imports from transformers import pipeline import re import requests def summarize_book(url): # get the text with requests txt_url = url # for now, work wit...
[ "transformers.pipeline", "requests.get", "re.compile" ]
[((580, 601), 'requests.get', 'requests.get', (['txt_url'], {}), '(txt_url)\n', (592, 601), False, 'import requests\n'), ((799, 872), 're.compile', 're.compile', (['"""[*]{3}\\\\sSTART\\\\sOF.+PROJECT\\\\sGUTENBERG\\\\sEBOOK.+\\\\s[*]{3}"""'], {}), "('[*]{3}\\\\sSTART\\\\sOF.+PROJECT\\\\sGUTENBERG\\\\sEBOOK.+\\\\s[*]{3...
__author__ = "<NAME>" __email__ = "<EMAIL>" import pymel.core as pm import mgear.rigbits.sdk_io as sdk_io import mgear.core.pickWalk as pickWalk SDK_ANIMCURVES_TYPE = ("animCurveUA", "animCurveUL", "animCurveUU") # reload(sdk_io) # ================================================= # # MATH # =======================...
[ "mgear.rigbits.sdk_io.getConnectedSDKs", "pymel.core.attributeQuery", "mgear.rigbits.sdk_io.getMultiDriverSDKs", "pymel.core.transformLimits", "mgear.rigbits.sdk_io.getPynodes", "pymel.core.setDrivenKeyframe", "pymel.core.ls", "mgear.core.pickWalk.getMirror", "pymel.core.hasAttr", "pymel.core.list...
[((1629, 1650), 'pymel.core.select', 'pm.select', ([], {'clear': '(True)'}), '(clear=True)\n', (1638, 1650), True, 'import pymel.core as pm\n'), ((5391, 5448), 'pymel.core.listConnections', 'pm.listConnections', (['node.worldMatrix[0]'], {'destination': '(True)'}), '(node.worldMatrix[0], destination=True)\n', (5409, 54...
# Copyright (c) 2014-2018, iocage # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted providing that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and th...
[ "hashlib.sha256", "os.listdir", "zipfile.ZipFile", "datetime.datetime.utcnow", "subprocess.check_call", "subprocess.Popen", "os.chdir", "fnmatch.filter", "os.remove" ]
[((6391, 6412), 'os.listdir', 'os.listdir', (['image_dir'], {}), '(image_dir)\n', (6401, 6412), False, 'import os\n'), ((6431, 6470), 'fnmatch.filter', 'fnmatch.filter', (['exports', 'f"""{jail}*.zip"""'], {}), "(exports, f'{jail}*.zip')\n", (6445, 6470), False, 'import fnmatch\n'), ((7293, 7327), 'zipfile.ZipFile', 'z...
import os from os.path import expanduser LOCAL_PATH = os.path.join(expanduser("~"), '.local', 'share', 'lap')
[ "os.path.expanduser" ]
[((67, 82), 'os.path.expanduser', 'expanduser', (['"""~"""'], {}), "('~')\n", (77, 82), False, 'from os.path import expanduser\n')]
import numpy as np from scipy import signal, ndimage from hexrd import convolution def fast_snip1d(y, w=4, numiter=2): """ """ bkg = np.zeros_like(y) zfull = np.log(np.log(np.sqrt(y + 1.) + 1.) + 1.) for k, z in enumerate(zfull): b = z for i in range(numiter): for p in...
[ "numpy.sqrt", "numpy.minimum", "scipy.signal.fft", "numpy.log", "hexrd.convolution.convolve", "scipy.ndimage.convolve", "numpy.indices", "numpy.exp", "numpy.zeros", "numpy.isnan", "numpy.hypot", "numpy.all", "numpy.zeros_like" ]
[((148, 164), 'numpy.zeros_like', 'np.zeros_like', (['y'], {}), '(y)\n', (161, 164), True, 'import numpy as np\n'), ((887, 907), 'numpy.zeros_like', 'np.zeros_like', (['zfull'], {}), '(zfull)\n', (900, 907), True, 'import numpy as np\n'), ((1533, 1546), 'numpy.isnan', 'np.isnan', (['bkg'], {}), '(bkg)\n', (1541, 1546),...
from Spread.stddevct import StdDevCT from Operations.differencepower import DifferencePower from Spread.generalizedvariance import GeneralizedVariance class StandardDeviation (GeneralizedVariance): def __init__ (self, length, min_value, max_value, arithmetic_mean): GeneralizedVariance.__init__ (self, length, min_v...
[ "Spread.generalizedvariance.GeneralizedVariance.__init__" ]
[((271, 383), 'Spread.generalizedvariance.GeneralizedVariance.__init__', 'GeneralizedVariance.__init__', (['self', 'length', 'min_value', 'max_value', 'StdDevCT', 'DifferencePower', 'arithmetic_mean'], {}), '(self, length, min_value, max_value, StdDevCT,\n DifferencePower, arithmetic_mean)\n', (299, 383), False, 'fr...
import pandas as pd import numpy as np import seaborn as sb import base64 from io import BytesIO from flask import send_file from flask import request from napa import player_information as pi import matplotlib matplotlib.use('Agg') # required to solve multithreading issues with matplotlib within flask import matplotli...
[ "pandas.read_sql_query", "matplotlib.pyplot.savefig", "seaborn.despine", "pandas.DataFrame", "matplotlib.use", "napa.player_information.create_rand_team", "napa.player_information.create_two_rand_teams", "seaborn.set_context", "io.BytesIO", "numpy.floor", "napa.player_information.team_data", "...
[((211, 232), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (225, 232), False, 'import matplotlib\n'), ((369, 405), 'seaborn.set_context', 'sb.set_context', (['"""talk"""'], {'font_scale': '(1)'}), "('talk', font_scale=1)\n", (383, 405), True, 'import seaborn as sb\n'), ((408, 438), 'matplotlib....
from pathlib import Path import pytest import shutil from uuid import uuid4 from resubname import cli FIXTURES_PATH = Path(__file__).parent / "fixtures" def sorted_glob(p: Path, pattern="*"): """ return sorted filenames for matched files. """ names = [x.name for x in p.glob(pattern)] names.sort...
[ "shutil.copytree", "uuid.uuid4", "pytest.raises", "pathlib.Path" ]
[((442, 476), 'shutil.copytree', 'shutil.copytree', (['src', 'fixture_path'], {}), '(src, fixture_path)\n', (457, 476), False, 'import shutil\n'), ((121, 135), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (125, 135), False, 'from pathlib import Path\n'), ((1327, 1351), 'pytest.raises', 'pytest.raises', (...
import numpy as np from torch.utils.data import Dataset import sys import torch from ppo_and_friends.utils.mpi_utils import rank_print from mpi4py import MPI comm = MPI.COMM_WORLD rank = comm.Get_rank() num_procs = comm.Get_size() class EpisodeInfo(object): def __init__(self, starting_...
[ "numpy.clip", "torch.transpose", "numpy.array", "torch.tensor", "numpy.zeros", "numpy.empty", "numpy.concatenate", "ppo_and_friends.utils.mpi_utils.rank_print" ]
[((5083, 5094), 'numpy.empty', 'np.empty', (['(0)'], {}), '(0)\n', (5091, 5094), True, 'import numpy as np\n'), ((5134, 5145), 'numpy.empty', 'np.empty', (['(0)'], {}), '(0)\n', (5142, 5145), True, 'import numpy as np\n'), ((5185, 5196), 'numpy.empty', 'np.empty', (['(0)'], {}), '(0)\n', (5193, 5196), True, 'import num...
""" Only allow 1 swear per 24 hours """ import asyncio import discord import re from datetime import datetime, timedelta from discord.ext import commands from common import * THIN_ICE_ROLES = { "dannybd-test": 812918168913182720, "gamescord": 812942511085322271, "rttftc": 812925753594871808, } class Dai...
[ "discord.ext.commands.Cog.listener", "datetime.datetime.now", "datetime.timedelta" ]
[((402, 437), 'discord.ext.commands.Cog.listener', 'commands.Cog.listener', (['"""on_message"""'], {}), "('on_message')\n", (423, 437), False, 'from discord.ext import commands\n'), ((990, 1004), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (1002, 1004), False, 'from datetime import datetime, timedelta\n'...
from bingads.v12.internal.bulk.mappings import _SimpleBulkMapping from bingads.v12.internal.bulk.string_table import _StringTable from bingads.service_client import _CAMPAIGN_OBJECT_FACTORY_V12 from .common import _BulkAdExtensionBase from .common import _BulkAdGroupAdExtensionAssociation from .common import _BulkCamp...
[ "bingads.service_client._CAMPAIGN_OBJECT_FACTORY_V12.create" ]
[((476, 532), 'bingads.service_client._CAMPAIGN_OBJECT_FACTORY_V12.create', '_CAMPAIGN_OBJECT_FACTORY_V12.create', (['"""ReviewAdExtension"""'], {}), "('ReviewAdExtension')\n", (511, 532), False, 'from bingads.service_client import _CAMPAIGN_OBJECT_FACTORY_V12\n'), ((2922, 2978), 'bingads.service_client._CAMPAIGN_OBJEC...
import math from PIL import ImageOps import areas_finder from point import Point from sketch import Sketch from utils import RGB from triangle import Triangle ####################################################################### class BaseSeeder(object): #######################################################...
[ "sketch.Sketch", "math.sqrt", "point.Point", "triangle.Triangle", "areas_finder.get_areas", "PIL.ImageOps.posterize" ]
[((475, 534), 'point.Point', 'Point', (['self.source_image.size[0]', 'self.source_image.size[1]'], {}), '(self.source_image.size[0], self.source_image.size[1])\n', (480, 534), False, 'from point import Point\n'), ((1573, 1633), 'triangle.Triangle', 'Triangle', (['[min_x, min_y, min_x, max_y, max_x, max_y]', 'c', '(255)...
from dataclasses import dataclass, asdict from typing import ( Any, Dict, List, Optional, Set, Tuple, Union, ) from rotkehlchen.typing import ChecksumEthAddress SerializeAsDictKeys = Union[List[str], Tuple[str, ...], Set[str]] @dataclass(init=True, repr=True, eq=False, unsafe_hash=False...
[ "dataclasses.dataclass", "dataclasses.asdict" ]
[((261, 334), 'dataclasses.dataclass', 'dataclass', ([], {'init': '(True)', 'repr': '(True)', 'eq': '(False)', 'unsafe_hash': '(False)', 'frozen': '(True)'}), '(init=True, repr=True, eq=False, unsafe_hash=False, frozen=True)\n', (270, 334), False, 'from dataclasses import dataclass, asdict\n'), ((1879, 1891), 'dataclas...
# -*- coding: utf-8; py-indent-offset: 2 -*- """ This module provides tools for examining a set of vectors and find the geometry that best fits from a set of built in shapes. """ from __future__ import absolute_import, division, print_function from scitbx.matrix import col from collections import OrderedDict try: fr...
[ "collections.OrderedDict", "scitbx.matrix.col", "math.sqrt", "six.moves.zip" ]
[((9492, 9902), 'collections.OrderedDict', 'OrderedDict', (["[('tetrahedral', _is_tetrahedron), ('trigonal_planar', _is_trigonal_plane),\n ('square_planar', _is_square_plane), ('square_pyramidal',\n _is_square_pyramid), ('octahedral', _is_octahedron), (\n 'trigonal_pyramidal', _is_trigonal_pyramid), ('trigonal...
from geoalchemy2 import Geometry from search_api.extensions import db from search_api.utilities.charge_id import encode_charge_id from sqlalchemy.dialects.postgresql import JSONB from llc_schema_dto import llc_schema from search_api import config class LocalLandCharge(db.Model): __tablename__ = 'local_land_charge...
[ "llc_schema_dto.llc_schema.convert", "search_api.extensions.db.Column", "search_api.extensions.db.ForeignKey", "search_api.extensions.db.relationship", "geoalchemy2.Geometry", "search_api.utilities.charge_id.encode_charge_id" ]
[((332, 374), 'search_api.extensions.db.Column', 'db.Column', (['db.BigInteger'], {'primary_key': '(True)'}), '(db.BigInteger, primary_key=True)\n', (341, 374), False, 'from search_api.extensions import db\n'), ((390, 494), 'search_api.extensions.db.relationship', 'db.relationship', (['"""GeometryFeature"""'], {'back_p...
from radixlib.actions import TransferTokens from typing import Dict, Any import unittest class TestTransferTokensAction(unittest.TestCase): """ Unit tests for the TransferTokens action of mutable tokens """ ActionDict: Dict[str, Any] = { "from_account": { "address": "tdx1qspqqecwh3tgsgz92l...
[ "radixlib.actions.TransferTokens.from_dict" ]
[((907, 948), 'radixlib.actions.TransferTokens.from_dict', 'TransferTokens.from_dict', (['self.ActionDict'], {}), '(self.ActionDict)\n', (931, 948), False, 'from radixlib.actions import TransferTokens\n'), ((1591, 1632), 'radixlib.actions.TransferTokens.from_dict', 'TransferTokens.from_dict', (['self.ActionDict'], {}),...
""" author: <NAME> """ import numpy as np import time import copy from numba import njit from numba.typed import List from gglasso.solver.ggl_helper import phiplus, prox_od_1norm, prox_2norm, prox_rank_norm from gglasso.helper.ext_admm_helper import check_G def ext_ADMM_MGL(S, lambda1, lambda2, reg , Omega_0, G,\...
[ "numpy.sqrt", "numpy.ones", "numpy.maximum", "gglasso.solver.ggl_helper.phiplus", "numba.typed.List", "gglasso.helper.ext_admm_helper.check_G", "gglasso.solver.ggl_helper.prox_od_1norm", "gglasso.solver.ggl_helper.prox_rank_norm", "numpy.linalg.eigvalsh", "numpy.zeros", "numpy.isnan", "numpy.l...
[((5244, 5266), 'numpy.zeros', 'np.zeros', (['K'], {'dtype': 'int'}), '(K, dtype=int)\n', (5252, 5266), True, 'import numpy as np\n'), ((5281, 5293), 'numpy.arange', 'np.arange', (['K'], {}), '(K)\n', (5290, 5293), True, 'import numpy as np\n'), ((5700, 5713), 'gglasso.helper.ext_admm_helper.check_G', 'check_G', (['G',...
import os from setuptools import find_packages, setup __version__ = "1.9.0" with open(os.path.join( os.path.abspath(os.path.dirname(__file__)), "README.md") ) as f: README = f.read() repo_url = "https://github.com/Detrous/darksky" setup( version=__version__, name="darksky_weather", packages...
[ "os.path.dirname", "setuptools.find_packages" ]
[((321, 336), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (334, 336), False, 'from setuptools import find_packages, setup\n'), ((128, 153), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (143, 153), False, 'import os\n')]
from collections import namedtuple import cv2 import matplotlib.pylab as plt import numpy as np import pandas as pd import random from os.path import join from prettyparse import Usage from torch.utils.data.dataset import Dataset as TorchDataset from autodo.dataset import Dataset k = np.array([[2304.5479, 0, 1686.23...
[ "matplotlib.pylab.imread", "collections.namedtuple", "random.shuffle", "pandas.read_csv", "os.path.join", "random.seed", "numpy.array", "numpy.zeros", "numpy.concatenate", "autodo.dataset.Dataset.from_folder", "prettyparse.Usage", "cv2.resize" ]
[((288, 385), 'numpy.array', 'np.array', (['[[2304.5479, 0, 1686.2379], [0, 2305.8757, 1354.9849], [0, 0, 1]]'], {'dtype': 'np.float32'}), '([[2304.5479, 0, 1686.2379], [0, 2305.8757, 1354.9849], [0, 0, 1]],\n dtype=np.float32)\n', (296, 385), True, 'import numpy as np\n'), ((462, 500), 'collections.namedtuple', 'na...
# -*- coding: utf-8 -*- """ threaded_ping_server.py ~~~~~~~~~~~~~~~~~~~~~~~ TCP server based on threads simulating ping output. """ __author__ = '<NAME>' __copyright__ = 'Copyright (C) 2018, Nokia' __email__ = '<EMAIL>' import logging import select import socket import sys import threading import time from contextli...
[ "logging.basicConfig", "select.select", "socket.socket", "time.sleep", "threading.Event", "contextlib.closing", "threading.Thread" ]
[((2707, 2756), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (2720, 2756), False, 'import socket\n'), ((2989, 3006), 'threading.Event', 'threading.Event', ([], {}), '()\n', (3004, 3006), False, 'import threading\n'), ((3027, 3123), 'threadin...
"""Setup.""" from os import path from setuptools import find_packages from setuptools import setup HERE = path.abspath(path.dirname(__file__)) with open(path.join(HERE, 'requirements.txt')) as f: requirements = [] for line in f: requirements.append(line.strip()) setup( name='taxifare', version='0.1',...
[ "os.path.dirname", "setuptools.find_packages", "os.path.join" ]
[((120, 142), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (132, 142), False, 'from os import path\n'), ((155, 190), 'os.path.join', 'path.join', (['HERE', '"""requirements.txt"""'], {}), "(HERE, 'requirements.txt')\n", (164, 190), False, 'from os import path\n'), ((334, 379), 'setuptools.find...
""" Provides anadroid version information. """ # This file is auto-generated! Do not edit! # Use `python -m incremental.update anadroid` to change this file. from incremental import Version __version__ = Version("anadroid", 0, 5, 26) __all__ = ["__version__"]
[ "incremental.Version" ]
[((207, 236), 'incremental.Version', 'Version', (['"""anadroid"""', '(0)', '(5)', '(26)'], {}), "('anadroid', 0, 5, 26)\n", (214, 236), False, 'from incremental import Version\n')]
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2012-2021 SoftBank Robotics. All rights reserved. # Use of this source code is governed by a BSD-style license (see the COPYING file). """ Display info about a toolchain package """ from __future__ import absolute_import from __future__ import unicode_litera...
[ "qisys.ui.info" ]
[((843, 881), 'qisys.ui.info', 'ui.info', (['package.name', 'package.version'], {}), '(package.name, package.version)\n', (850, 881), False, 'from qisys import ui\n'), ((886, 916), 'qisys.ui.info', 'ui.info', (['"""path:"""', 'package.path'], {}), "('path:', package.path)\n", (893, 916), False, 'from qisys import ui\n'...
from datetime import datetime from typing import List, Dict, Union import pytest from dataclasses import field from krake.data.config import HooksConfiguration from krake.data.core import Metadata, ListMetadata from krake.data.kubernetes import ClusterList from marshmallow import ValidationError from krake.data.serial...
[ "krake.data.core.ListMetadata", "datetime.datetime", "krake.data.serializable.is_generic_subtype", "krake.data.serializable.is_qualified_generic", "tests.factories.core.MetadataFactory", "tests.factories.openstack.ProjectFactory", "marshmallow.ValidationError", "tests.factories.kubernetes.ApplicationF...
[((13981, 14522), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""label_value"""', "[{'key': 'value'}, {'key1': 'value'}, {'key': 'value1'}, {'key-one':\n 'value'}, {'key': 'value-one'}, {'key-1': 'value'}, {'key': 'value-1'},\n {'k': 'value'}, {'key': 'v'}, {'kk': 'value'}, {'key': 'vv'}, {'k.k':\n ...
# type: ignore # ^ that's necessary to prevent a false linting error of some kind import asyncio import urllib.parse from time import perf_counter import typer from mcsniperpy.util.logs_manager import Color as color from mcsniperpy.util.logs_manager import Logger as log async def check(url: str, iterations:...
[ "asyncio.open_connection", "time.perf_counter", "asyncio.sleep" ]
[((656, 670), 'time.perf_counter', 'perf_counter', ([], {}), '()\n', (668, 670), False, 'from time import perf_counter\n'), ((766, 780), 'time.perf_counter', 'perf_counter', ([], {}), '()\n', (778, 780), False, 'from time import perf_counter\n'), ((446, 499), 'asyncio.open_connection', 'asyncio.open_connection', (['uri...
import argparse from datetime import datetime import sys import os from rlpytorch import * if __name__ == '__main__': parser = argparse.ArgumentParser() collector = StatsCollector() game = load_module(os.environ["game"]).Loader() runner = SingleProcessRun() args_providers = [game, runner] ...
[ "argparse.ArgumentParser" ]
[((134, 159), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (157, 159), False, 'import argparse\n')]
from typing import TypeVar class Config(): SimplexMax: int = 8 Epsilon: float = 1e-5 Max: float = 1e37 PositiveMin: float = 1e-37 NegativeMin: float = -Max Pi: float = 3.14159265 HalfPi: float = Pi / 2.0 DoublePi: float = Pi * 2.0 ReciprocalOfPi: float = 0.3183098861 GeometryEp...
[ "typing.TypeVar" ]
[((943, 967), 'typing.TypeVar', 'TypeVar', (['"""T"""', 'float', 'int'], {}), "('T', float, int)\n", (950, 967), False, 'from typing import TypeVar\n')]
import numpy as np import torch import torch.nn.functional as F from maskrcnn_benchmark.modeling.utils import cat from maskrcnn_benchmark.structures.bounding_box import BoxList from siammot.utils import registry from .feature_extractor import EMMFeatureExtractor, EMMPredictor from .track_loss import EMMLossCom...
[ "torch.ger", "siammot.utils.registry.SIAMESE_TRACKER.register", "numpy.sqrt", "torch.max", "torch.stack", "torch.hann_window", "torch.exp", "torch.nn.functional.sigmoid", "maskrcnn_benchmark.structures.bounding_box.BoxList", "numpy.floor", "torch.arange", "torch.meshgrid", "torch.nn.function...
[((371, 411), 'siammot.utils.registry.SIAMESE_TRACKER.register', 'registry.SIAMESE_TRACKER.register', (['"""EMM"""'], {}), "('EMM')\n", (404, 411), False, 'from siammot.utils import registry\n'), ((4603, 4631), 'torch.nn.functional.softmax', 'F.softmax', (['cls_logits'], {'dim': '(1)'}), '(cls_logits, dim=1)\n', (4612,...
import unittest import datetime as dt from AShareData.config import get_db_interface, set_global_config from AShareData.date_utils import date_type2datetime class MyTestCase(unittest.TestCase): def setUp(self) -> None: set_global_config('config.json') self.db_interface = get_db_interface() d...
[ "datetime.datetime", "AShareData.config.set_global_config", "AShareData.config.get_db_interface", "AShareData.date_utils.date_type2datetime", "unittest.main" ]
[((1400, 1415), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1413, 1415), False, 'import unittest\n'), ((234, 266), 'AShareData.config.set_global_config', 'set_global_config', (['"""config.json"""'], {}), "('config.json')\n", (251, 266), False, 'from AShareData.config import get_db_interface, set_global_config\...
# -*- coding: utf-8 -*- import re from django.contrib.sites.models import Site from django.core.exceptions import ValidationError from django.core.validators import URLValidator from django.db import models from django.urls import resolve, reverse from sortedm2m.fields import SortedManyToManyField def validate_url(...
[ "re.search", "django.core.validators.URLValidator", "django.db.models.IntegerField", "django.db.models.ForeignKey", "django.core.exceptions.ValidationError", "django.db.models.BooleanField", "django.urls.reverse", "django.urls.resolve", "django.db.models.CharField", "sortedm2m.fields.SortedManyToM...
[((341, 355), 'django.core.validators.URLValidator', 'URLValidator', ([], {}), '()\n', (353, 355), False, 'from django.core.validators import URLValidator\n'), ((740, 853), 'django.core.exceptions.ValidationError', 'ValidationError', (['(\'Hodnota by mala byť externá URL, absolútna cesta\' +\n \' alebo urlname začín...
# -*- coding: utf-8 -*- import scrapy import re from images.items import ImagesItem class VeerSpider(scrapy.Spider): name = 'veer' allowed_domains = ['*'] def start_requests(self): keyword = self.settings['KEYWORD'] pages = self.settings['PAGE'] cookies = self.settings['VEER_COOK...
[ "re.findall", "scrapy.Request", "images.items.ImagesItem" ]
[((649, 661), 'images.items.ImagesItem', 'ImagesItem', ([], {}), '()\n', (659, 661), False, 'from images.items import ImagesItem\n'), ((686, 734), 're.findall', 're.findall', (['"""src="(http.*?.jpg)\\""""', 'response.text'], {}), '(\'src="(http.*?.jpg)"\', response.text)\n', (696, 734), False, 'import re\n'), ((538, 6...
import pytest import pika from mettle.settings import get_settings from mettle.publisher import publish_event @pytest.mark.xfail(reason="Need RabbitMQ fixture") def test_long_routing_key(): settings = get_settings() conn = pika.BlockingConnection(pika.URLParameters(settings.rabbit_url)) chan = conn.chann...
[ "pytest.mark.xfail", "pika.URLParameters", "mettle.settings.get_settings", "pytest.raises" ]
[((114, 163), 'pytest.mark.xfail', 'pytest.mark.xfail', ([], {'reason': '"""Need RabbitMQ fixture"""'}), "(reason='Need RabbitMQ fixture')\n", (131, 163), False, 'import pytest\n'), ((208, 222), 'mettle.settings.get_settings', 'get_settings', ([], {}), '()\n', (220, 222), False, 'from mettle.settings import get_setting...
from datetime import timedelta from jcasts.episodes.emails import send_new_episodes_email from jcasts.episodes.factories import EpisodeFactory from jcasts.podcasts.factories import SubscriptionFactory class TestSendNewEpisodesEmail: def test_send_if_no_episodes(self, user, mailoutbox): """If no recommend...
[ "jcasts.podcasts.factories.SubscriptionFactory", "jcasts.episodes.factories.EpisodeFactory", "datetime.timedelta" ]
[((571, 602), 'jcasts.episodes.factories.EpisodeFactory', 'EpisodeFactory', ([], {'podcast': 'podcast'}), '(podcast=podcast)\n', (585, 602), False, 'from jcasts.episodes.factories import EpisodeFactory\n'), ((382, 399), 'datetime.timedelta', 'timedelta', ([], {'days': '(7)'}), '(days=7)\n', (391, 399), False, 'from dat...
import numpy as np import scipy.signal from tqdm import tqdm possible_motion_estimation_methods = ['decentralized_registration', ] def init_kwargs_dict(method, method_kwargs): # handle kwargs by method if method == 'decentralized_registration': method_kwargs_ = dict(pairwise_displacement_method='con...
[ "numpy.abs", "numpy.tile", "numpy.allclose", "numpy.ceil", "numpy.histogramdd", "numpy.ones", "numpy.convolve", "tqdm.tqdm", "numpy.linalg.norm", "numpy.argmax", "numpy.max", "numpy.exp", "numpy.diag", "numpy.zeros", "numpy.concatenate", "numpy.min", "numpy.arange" ]
[((7004, 7039), 'numpy.arange', 'np.arange', (['(0)', '(num_sample + bin)', 'bin'], {}), '(0, num_sample + bin, bin)\n', (7013, 7039), True, 'import numpy as np\n'), ((7351, 7389), 'numpy.arange', 'np.arange', (['min_', '(max_ + bin_um)', 'bin_um'], {}), '(min_, max_ + bin_um, bin_um)\n', (7360, 7389), True, 'import nu...
import django_filters from django.contrib.auth.models import User, Group from rest_framework import viewsets, mixins from rest_framework.response import Response from rest_framework.authentication import TokenAuthentication from rest_framework import filters from api.pagination import LargeResultsSetPagination from api...
[ "api.models.Quiz.objects.all" ]
[((645, 663), 'api.models.Quiz.objects.all', 'Quiz.objects.all', ([], {}), '()\n', (661, 663), False, 'from api.models import Quiz\n')]
# author: WatchDogOblivion # description: TODO # WatchDogs SMTP Script import traceback from watchdogs.base.models import AllArgs, Common from watchdogs.mail.parsers import SMTPArgs from watchdogs.mail.services import SMTPService class SMTPScript(Common): def __init__(self, sMTPService=SMTPService()): #type: ...
[ "watchdogs.mail.parsers.SMTPArgs", "traceback.format_exc", "watchdogs.mail.services.SMTPService" ]
[((293, 306), 'watchdogs.mail.services.SMTPService', 'SMTPService', ([], {}), '()\n', (304, 306), False, 'from watchdogs.mail.services import SMTPService\n'), ((831, 853), 'traceback.format_exc', 'traceback.format_exc', ([], {}), '()\n', (851, 853), False, 'import traceback\n'), ((937, 959), 'traceback.format_exc', 'tr...
# -*- coding: utf-8 -*- """Headlines_Bayes.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1YzcugeVLWofKlwfN2uC-Mk_EY3jYX_pk """ import pandas as pd import numpy as np from sklearn.feature_extraction.text import CountVectorizer from sklearn.na...
[ "pandas.read_csv", "sklearn.feature_extraction.text.CountVectorizer", "sklearn.metrics.classification_report", "pandas.crosstab", "sklearn.naive_bayes.GaussianNB", "sklearn.metrics.accuracy_score" ]
[((356, 407), 'pandas.read_csv', 'pd.read_csv', (['"""Headlines.csv"""'], {'encoding': '"""ISO-8859-1"""'}), "('Headlines.csv', encoding='ISO-8859-1')\n", (367, 407), True, 'import pandas as pd\n'), ((1072, 1107), 'sklearn.feature_extraction.text.CountVectorizer', 'CountVectorizer', ([], {'ngram_range': '(1, 1)'}), '(n...
import csv import io import os import uuid from datetime import datetime, timezone from Levenshtein import distance from requests import Session from requests.auth import HTTPBasicAuth # or HTTPDigestAuth, or OAuth1, etc. from zeep import Client from zeep.transports import Transport from dotenv import loa...
[ "models.portfolioclasses.PSQLGroupStudent", "os.path.exists", "requests.auth.HTTPBasicAuth", "requests.Session", "os.getenv", "csv.writer", "dotenv.load_dotenv", "Levenshtein.distance", "os.path.dirname", "models.portfolioclasses.PSQLFaculty", "models.portfolioclasses.PSQLStudent", "models.por...
[((601, 628), 'os.path.exists', 'os.path.exists', (['dotenv_path'], {}), '(dotenv_path)\n', (615, 628), False, 'import os\n'), ((4844, 4871), 'os.path.exists', 'os.path.exists', (['dotenv_path'], {}), '(dotenv_path)\n', (4858, 4871), False, 'import os\n'), ((8534, 8547), 'io.StringIO', 'io.StringIO', ([], {}), '()\n', ...
# python_turtle.py # Some examples of graphics drawing using Python Turtle graphics. # https://www.pforprograms.com/2020/09/turtle-python-tutorials.html?m=1 import turtle def display_screen(bg_color = "black"): wn = turtle.Screen() wn.bgcolor(bg_color) def ninja_twist(): display_screen() ninja = turt...
[ "turtle.Screen", "turtle.Turtle" ]
[((222, 237), 'turtle.Screen', 'turtle.Screen', ([], {}), '()\n', (235, 237), False, 'import turtle\n'), ((316, 331), 'turtle.Turtle', 'turtle.Turtle', ([], {}), '()\n', (329, 331), False, 'import turtle\n')]
from unittest import TestCase import torch from src.transformer.operations import softmax class Test(TestCase): def test_softmax(self): data = torch.ones(size=[16, 8, 4]) expected_output = torch.full_like(data, fill_value=0.25, dtype=torch.float32) output = softmax(data, dim=-1) ...
[ "torch.testing.assert_allclose", "src.transformer.operations.softmax", "torch.full_like", "torch.ones" ]
[((159, 186), 'torch.ones', 'torch.ones', ([], {'size': '[16, 8, 4]'}), '(size=[16, 8, 4])\n', (169, 186), False, 'import torch\n'), ((213, 272), 'torch.full_like', 'torch.full_like', (['data'], {'fill_value': '(0.25)', 'dtype': 'torch.float32'}), '(data, fill_value=0.25, dtype=torch.float32)\n', (228, 272), False, 'im...
from PIL import Image import os PATH = r'D:\picture\2018092902' SAVE_PATH = r'D:\save_picture' image_fold = os.listdir(PATH) # for image_dir in image_fold: # images = os.listdir(os.path.join(PATH, image_dir)) # for image in images: # img = Image.open(os.path.join(PATH, image_dir, image)) # w,...
[ "os.listdir", "PIL.Image.open" ]
[((110, 126), 'os.listdir', 'os.listdir', (['PATH'], {}), '(PATH)\n', (120, 126), False, 'import os\n'), ((423, 456), 'PIL.Image.open', 'Image.open', (['"""20180929_155901.jpg"""'], {}), "('20180929_155901.jpg')\n", (433, 456), False, 'from PIL import Image\n')]
import gensim import numpy as np import pandas as pd import psycopg2 import re import os import warnings; warnings.filterwarnings('ignore') """Review2Vec (R2V) is the second type of model we designed for Groa. We trained Gensim's Doc2Vec word embedding model on documents containing all the reviews a user has written ...
[ "gensim.models.Doc2Vec.load", "warnings.filterwarnings", "os.getenv" ]
[((107, 140), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (130, 140), False, 'import warnings\n'), ((2693, 2731), 'gensim.models.Doc2Vec.load', 'gensim.models.Doc2Vec.load', (['model_path'], {}), '(model_path)\n', (2719, 2731), False, 'import gensim\n'), ((2075, 2099), ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Oct 7 21:32:49 2020 @author: alfredocu """ # Bibliotecas. import numpy as np import numpy.random as rnd import matplotlib.pyplot as plt # Algoritmos. from sklearn.linear_model import LinearRegression from sklearn.preprocessing import PolynomialFeature...
[ "sklearn.preprocessing.PolynomialFeatures", "numpy.random.rand", "matplotlib.pyplot.ylabel", "sklearn.model_selection.train_test_split", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "sklearn.preprocessing.StandardScaler", "numpy.linspace", "numpy.random.seed", "matplotlib.pyplot.axis", ...
[((474, 492), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (488, 492), True, 'import numpy as np\n'), ((713, 735), 'sklearn.model_selection.train_test_split', 'train_test_split', (['x', 'y'], {}), '(x, y)\n', (729, 735), False, 'from sklearn.model_selection import train_test_split\n'), ((1239, 1269)...
# -*- coding: utf-8 -*- """ RPC ~~~ :author: <NAME> <<EMAIL>> :copyright: (c) <NAME>, 2014 :license: This software makes use of the MIT Open Source License. A copy of this license is included as ``LICENSE.md`` in the root of the project. """ # stdlib import abc import copy # cant...
[ "canteen.core.runtime.Runtime.execute_hooks", "protorpc.messages.MessageField", "canteen.util.struct.WritableObjectProxy", "protorpc.wsgi.util.first_found", "canteen.core.Library", "protorpc.remote.method", "canteen.logic.http.url", "json.dumps", "traceback.print_exc", "protorpc.wsgi.service.servi...
[((640, 677), 'canteen.core.Library', 'core.Library', (['"""protorpc"""'], {'strict': '(True)'}), "('protorpc', strict=True)\n", (652, 677), False, 'from canteen import core\n'), ((3413, 3989), 'canteen.util.struct.WritableObjectProxy', 'datastructures.WritableObjectProxy', ([], {}), "(**{'Key': Key, 'Echo': Echo, 'Mes...