code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# Copyright 2019 Xilinx Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"numpy.minimum",
"numpy.sum",
"numpy.maximum",
"numpy.argmax",
"numpy.zeros",
"numpy.argsort",
"numpy.sort",
"numpy.cumsum",
"numpy.mean",
"numpy.arange",
"numpy.array",
"numpy.where",
"dataset.dataset_common.EDD_LABELS.items",
"numpy.max",
"numpy.finfo",
"numpy.concatenate"
] | [((1699, 1732), 'dataset.dataset_common.EDD_LABELS.items', 'dataset_common.EDD_LABELS.items', ([], {}), '()\n', (1730, 1732), False, 'from dataset import dataset_common\n'), ((2096, 2108), 'numpy.mean', 'np.mean', (['aps'], {}), '(aps)\n', (2103, 2108), True, 'import numpy as np\n'), ((2208, 2232), 'numpy.arange', 'np.... |
"""
DS-OOP-Review has two modules that I am using to learn this week
"""
import setuptools
import unittest
REQUIRED = [
"numpy",
"pandas"
]
with open("README.md", "r") as fh:
LONG_DESCRIPTION = fh.read()
setuptools.setup(
name="DS-OOP-Review",
version = "0.1.2",
author = "Zebfred",
... | [
"setuptools.find_packages"
] | [((508, 534), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (532, 534), False, 'import setuptools\n')] |
from hashlib import sha256
from urllib.parse import urlparse, urlunparse
# Based on (and should return the same results as):
# https://dev.azure.com/msresearch/Serverless-Efficiency/_git/azure-webjobs-sdk?path=/src/Microsoft.Azure.WebJobs.Host/FunctionDataCache/ConsistentHash.cs
class ConsistentHash:
def __init_... | [
"hashlib.sha256",
"urllib.parse.urlunparse",
"urllib.parse.urlparse"
] | [((2156, 2177), 'urllib.parse.urlunparse', 'urlunparse', (['uri_parts'], {}), '(uri_parts)\n', (2166, 2177), False, 'from urllib.parse import urlparse, urlunparse\n'), ((2070, 2083), 'urllib.parse.urlparse', 'urlparse', (['key'], {}), '(key)\n', (2078, 2083), False, 'from urllib.parse import urlparse, urlunparse\n'), (... |
""" Cisco_IOS_XR_tty_vty_cfg
This module contains a collection of YANG definitions
for Cisco IOS\-XR tty\-vty package configuration.
This module contains definitions
for the following management objects\:
vty\: VTY Pools configuration
Copyright (c) 2013\-2016 by Cisco Systems, Inc.
All rights reserved.
"""
imp... | [
"ydk.errors.YPYModelError",
"ydk.types.YList"
] | [((1345, 1352), 'ydk.types.YList', 'YList', ([], {}), '()\n', (1350, 1352), False, 'from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict\n'), ((3270, 3317), 'ydk.errors.YPYModelError', 'YPYModelError', (['"""Key property pool_name is None"""'], {}), "('Key property pool_name is None')\n", (32... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Examples for the NURBS-Python Package
Released under MIT License
Developed by <NAME> (c) 2018
"""
import os
from geomdl import exchange
from geomdl import multi
from geomdl.visualization import VisPlotly as vis
# Fix file path
os.chdir(os.path.dirname(os... | [
"geomdl.exchange.export_obj",
"geomdl.multi.SurfaceContainer",
"os.path.realpath",
"geomdl.visualization.VisPlotly.VisConfig",
"geomdl.exchange.import_smesh",
"geomdl.visualization.VisPlotly.VisSurface"
] | [((396, 425), 'geomdl.exchange.import_smesh', 'exchange.import_smesh', (['"""data"""'], {}), "('data')\n", (417, 425), False, 'from geomdl import exchange\n'), ((489, 517), 'geomdl.multi.SurfaceContainer', 'multi.SurfaceContainer', (['data'], {}), '(data)\n', (511, 517), False, 'from geomdl import multi\n'), ((615, 657... |
import logging
from hedera.supported_languages import SUPPORTED_LANGUAGES
from lattices.models import LatticeNode, LemmaNode
from .models import add_form, lookup_form
logger = logging.getLogger(__name__)
RESOLVED_NA = "na"
RESOLVED_NO_LEMMA = "no-lemma"
RESOLVED_UNRESOLVED = "unresolved"
RESOLVED_NO_AMBIGUITY = "... | [
"lattices.models.LemmaNode.objects.create",
"lattices.models.LatticeNode.objects.create",
"logging.getLogger",
"lattices.models.LemmaNode.objects.filter"
] | [((180, 207), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (197, 207), False, 'import logging\n'), ((2144, 2198), 'lattices.models.LemmaNode.objects.filter', 'LemmaNode.objects.filter', ([], {'context': 'context', 'lemma': 'label'}), '(context=context, lemma=label)\n', (2168, 2198), Fal... |
from collections import deque
import subprocess
import traceback
import sys
from threading import Thread
try:
from queue import Queue, Empty
except ImportError:
from Queue import Queue, Empty # python 2.x
from nanome._internal._process import _ProcessEntry
from nanome.util import Logs, IntEnum, auto
POSIX = ... | [
"threading.Thread",
"subprocess.Popen",
"nanome.util.auto",
"Queue.Queue",
"nanome.util.Logs.debug",
"traceback.format_exc",
"nanome._internal._process._ProcessEntry",
"collections.deque",
"nanome.util.Logs.error"
] | [((430, 436), 'nanome.util.auto', 'auto', ([], {}), '()\n', (434, 436), False, 'from nanome.util import Logs, IntEnum, auto\n'), ((464, 470), 'nanome.util.auto', 'auto', ([], {}), '()\n', (468, 470), False, 'from nanome.util import Logs, IntEnum, auto\n'), ((490, 496), 'nanome.util.auto', 'auto', ([], {}), '()\n', (494... |
from dash.dependencies import Input, Output
from server import app
@app.callback(Output('stacked_bar', 'clickData'),
[Input('remove_clickData', 'n_clicks')])
def reset_click_data_callback(n_clicks):
return None
@app.callback(Output('remove_clickData', 'style'),
[Input('stacked_bar', 'c... | [
"dash.dependencies.Input",
"dash.dependencies.Output"
] | [((82, 116), 'dash.dependencies.Output', 'Output', (['"""stacked_bar"""', '"""clickData"""'], {}), "('stacked_bar', 'clickData')\n", (88, 116), False, 'from dash.dependencies import Input, Output\n'), ((245, 280), 'dash.dependencies.Output', 'Output', (['"""remove_clickData"""', '"""style"""'], {}), "('remove_clickData... |
"""
This module recognizes shapes in pictures
"""
import numpy as np
import sys
np.set_printoptions(threshold=sys.maxsize)
import matplotlib.image as img
import matplotlib.pyplot as plt
# sample user interaction idea
# img = library.image('pic1.png')
# img_contour = img.draw_contours()
class Picture:
"""
Runs... | [
"matplotlib.image.imread",
"numpy.set_printoptions",
"matplotlib.pyplot.show",
"numpy.abs",
"matplotlib.pyplot.imshow",
"numpy.zeros",
"numpy.array_equal"
] | [((80, 122), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'threshold': 'sys.maxsize'}), '(threshold=sys.maxsize)\n', (99, 122), True, 'import numpy as np\n'), ((9988, 9998), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (9996, 9998), True, 'import matplotlib.pyplot as plt\n'), ((2870, 2891), 'matplo... |
import torch
from itertools import accumulate
from fairseq.data import (
data_utils,
FairseqDataset,
Dictionary,
IdDataset,
NestedDictionaryDataset,
NumelDataset,
NumSamplesDataset,
)
from functools import lru_cache
import numpy as np
from seqp.hdf5 import Hdf5RecordReader
from typing import... | [
"fairseq.data.data_utils.collate_tokens",
"fairseq.data.NumelDataset",
"torch.stack",
"seqp.hdf5.Hdf5RecordReader",
"itertools.accumulate",
"fairseq.data.NumSamplesDataset",
"numpy.array",
"fairseq.data.IdDataset",
"functools.lru_cache"
] | [((1335, 1355), 'functools.lru_cache', 'lru_cache', ([], {'maxsize': '(8)'}), '(maxsize=8)\n', (1344, 1355), False, 'from functools import lru_cache\n'), ((868, 896), 'seqp.hdf5.Hdf5RecordReader', 'Hdf5RecordReader', (['data_files'], {}), '(data_files)\n', (884, 896), False, 'from seqp.hdf5 import Hdf5RecordReader\n'),... |
#
# Copyright (C) 2016 VSCT
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | [
"tempfile.NamedTemporaryFile",
"piptools.utils.key_from_ireq",
"tempfile.TemporaryDirectory",
"os.unlink",
"optparse.Option",
"piptools.utils.assert_compatible_pip_version",
"pip.download.PipSession",
"tempfile.mkdtemp",
"piptools.scripts.compile.PipCommand",
"pip.download.unpack_url",
"pip.req.... | [((1688, 1719), 'piptools.utils.assert_compatible_pip_version', 'assert_compatible_pip_version', ([], {}), '()\n', (1717, 1719), False, 'from piptools.utils import assert_compatible_pip_version, key_from_ireq\n'), ((7950, 7962), 'piptools.scripts.compile.PipCommand', 'PipCommand', ([], {}), '()\n', (7960, 7962), False,... |
from conans import ConanFile, tools, CMake
from conans.errors import ConanInvalidConfiguration, ConanException
import os
class Sol2Conan(ConanFile):
name = "sol2"
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://github.com/ThePhD/sol2"
description = "C++17 Lua bindings"
t... | [
"conans.tools.get",
"os.rename",
"conans.tools.Version",
"conans.CMake",
"conans.tools.check_min_cppstd",
"os.path.join"
] | [((583, 636), 'conans.tools.get', 'tools.get', ([], {}), "(**self.conan_data['sources'][self.version])\n", (592, 636), False, 'from conans import ConanFile, tools, CMake\n'), ((700, 748), 'os.rename', 'os.rename', (['extracted_dir', 'self._source_subfolder'], {}), '(extracted_dir, self._source_subfolder)\n', (709, 748)... |
import tkinter as tk
from tkinter import ttk
WORDS = (
'123456789',
'0ABCDEFGH',
'IJKLMNOPQ',
'RSTUVWXYZ',
'/=,?.*&#$',
'123456789',
'0ABCDEFGH',
'IJKLMNOPQ',
'RSTUVWXYZ'
)
class Checker(ttk.LabelFrame):
def __init__(self, container, word):
super().__init__(container... | [
"tkinter.Button",
"tkinter.ttk.Label",
"tkinter.Entry",
"tkinter.StringVar"
] | [((369, 426), 'tkinter.Button', 'tk.Button', (['self'], {'text': '"""Play Recording"""', 'command': 'self.play'}), "(self, text='Play Recording', command=self.play)\n", (378, 426), True, 'import tkinter as tk\n'), ((572, 595), 'tkinter.StringVar', 'tk.StringVar', (['container'], {}), '(container)\n', (584, 595), True, ... |
import pickle
import os
import pathlib
class Account:
acc_no = 0
name = ''
deposit = 0
type = ''
def create_account(self):
self.acc_no = int(input("Enter the account no : "))
self.name = input("Enter the account holder name : ")
self.type = input("Ente the type of account ... | [
"os.remove",
"pickle.dump",
"os.rename",
"pathlib.Path",
"pickle.load"
] | [((1790, 1819), 'pathlib.Path', 'pathlib.Path', (['"""accounts.data"""'], {}), "('accounts.data')\n", (1802, 1819), False, 'import pathlib\n'), ((2140, 2169), 'pathlib.Path', 'pathlib.Path', (['"""accounts.data"""'], {}), "('accounts.data')\n", (2152, 2169), False, 'import pathlib\n'), ((2647, 2676), 'pathlib.Path', 'p... |
from tqdm.auto import tqdm
import click
import numpy as np
from transformers import GPT2LMHeadModel, GPT2TokenizerFast
from sklearn.metrics.pairwise import cosine_similarity
import torch
import math
import json
def load_vectors(path, max_n=200_000):
with open(path) as f:
ids = {}
dim = int(f.readl... | [
"numpy.stack",
"sklearn.metrics.pairwise.cosine_similarity",
"torch.zeros_like",
"transformers.GPT2TokenizerFast.from_pretrained",
"transformers.GPT2LMHeadModel.from_pretrained",
"click.option",
"numpy.zeros",
"click.command",
"torch.save",
"tqdm.auto.tqdm",
"numpy.argsort",
"torch.normal",
... | [((1882, 1897), 'click.command', 'click.command', ([], {}), '()\n', (1895, 1897), False, 'import click\n'), ((1899, 1988), 'click.option', 'click.option', (['"""--german_tokenizer"""'], {'help': '"""Name or path of trained German tokenizer."""'}), "('--german_tokenizer', help=\n 'Name or path of trained German token... |
from django.shortcuts import render
def signIn(request):
return render(request, 'MyApp/signIn.html')
def signUp(request):
return render(request, 'MyApp/signUp.html') | [
"django.shortcuts.render"
] | [((69, 105), 'django.shortcuts.render', 'render', (['request', '"""MyApp/signIn.html"""'], {}), "(request, 'MyApp/signIn.html')\n", (75, 105), False, 'from django.shortcuts import render\n'), ((138, 174), 'django.shortcuts.render', 'render', (['request', '"""MyApp/signUp.html"""'], {}), "(request, 'MyApp/signUp.html')\... |
#!/usr/bin/env python3
from itertools import product
from pathlib import Path
import numpy as np
import pygame
import os
# основные используемые цвета
background_color = (100, 100, 100)
layout_color = (120, 120, 120)
lighter_color = (150, 150, 150)
text_color = (200, 200, 200)
colors = {
# игровое поле и шрифт
... | [
"pygame.event.get",
"numpy.empty",
"pygame.Rect",
"numpy.arange",
"pygame.font.Font",
"pygame.mouse.get_pos",
"os.path.abspath",
"pygame.display.set_mode",
"numpy.random.choice",
"pygame.display.set_caption",
"pygame.quit",
"pygame.Surface",
"numpy.ceil",
"pygame.draw.rect",
"pygame.init... | [((764, 786), 'numpy.array', 'np.array', (['[[True] * 5]'], {}), '([[True] * 5])\n', (772, 786), True, 'import numpy as np\n'), ((792, 814), 'numpy.array', 'np.array', (['[[True] * 4]'], {}), '([[True] * 4])\n', (800, 814), True, 'import numpy as np\n'), ((820, 842), 'numpy.array', 'np.array', (['[[True] * 3]'], {}), '... |
from flask import Flask, render_template, flash, request, redirect, url_for
from flask_bootstrap import Bootstrap
from flask_login import UserMixin, LoginManager, login_required, login_user, logout_user, current_user
import time
app = Flask(__name__)
bootstrap = Bootstrap(app)
app.config['SECRET_KEY'] = 'hello RobbiJi... | [
"toDB.prodInStock",
"flask.flash",
"toDB.getFundChangDetail",
"flask.request.form.get",
"form.expensive_trade_fields",
"flask.url_for",
"form.loginForm",
"toDB.getProdSale",
"flask_login.current_user.get_id",
"form.add_prod_fields",
"flask_bootstrap.Bootstrap",
"toDB.expenTrade",
"toDB.getPr... | [((236, 251), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (241, 251), False, 'from flask import Flask, render_template, flash, request, redirect, url_for\n'), ((264, 278), 'flask_bootstrap.Bootstrap', 'Bootstrap', (['app'], {}), '(app)\n', (273, 278), False, 'from flask_bootstrap import Bootstrap\n'), (... |
# Usage
# python example.py 01
import numpy as np
import sys
import tequila as tq
import qiskit
import pickle
filename = 'xyz/CH3CL_CL_' + sys.argv[1] + '.xyz'
active_orbitals = {"A":[21,22]}
basis = 'sto-3g'
molecule = tq.chemistry.Molecule(geometry=filename,
backend='psi4',
... | [
"tequila.minimize",
"tequila.chemistry.Molecule",
"tequila.ExpectationValue"
] | [((221, 379), 'tequila.chemistry.Molecule', 'tq.chemistry.Molecule', ([], {'geometry': 'filename', 'backend': '"""psi4"""', 'charge': '(-1)', 'basis_set': 'basis', 'active_orbitals': 'active_orbitals', 'transformation': '"""bravyi_kitaev"""'}), "(geometry=filename, backend='psi4', charge=-1,\n basis_set=basis, activ... |
# -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2014 <NAME>
Exemplo de leitura e processamento de um arquivo CSV no Python. Neste exemplo
um arquivo obtido no analisador de espéctro é lido, convertido e plotado.
"""
# Importa bibliotecas necessárias.
from numpy import *
import matplotlib.pyplot as plt... | [
"matplotlib.pyplot.axvline",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xlabel"
] | [((971, 1003), 'matplotlib.pyplot.plot', 'plt.plot', (['famp[:, 0]', 'famp[:, 1]'], {}), '(famp[:, 0], famp[:, 1])\n', (979, 1003), True, 'import matplotlib.pyplot as plt\n'), ((1031, 1041), 'matplotlib.pyplot.grid', 'plt.grid', ([], {}), '()\n', (1039, 1041), True, 'import matplotlib.pyplot as plt\n'), ((1243, 1263), ... |
import os.path
from PIL import Image
import pytest
from twisted.web.resource import Resource
from undercrawler.utils import using_splash
from .utils import text_resource, html, paths_set, find_item, inlineCallbacks
from .mockserver import MockServer
from .conftest import make_crawler
class SinglePage(text_resource(... | [
"undercrawler.utils.using_splash",
"pytest.mark.skip",
"PIL.Image.open"
] | [((8929, 8988), 'pytest.mark.skip', 'pytest.mark.skip', (['"""This is not really a test at the moment"""'], {}), "('This is not really a test at the moment')\n", (8945, 8988), False, 'import pytest\n'), ((3550, 3580), 'undercrawler.utils.using_splash', 'using_splash', (['crawler.settings'], {}), '(crawler.settings)\n',... |
import sys
import os
from script.tools import Recorder
from model.runner import Trainer
from attrdict import AttrDict
import traceback
import tqdm
import pandas as pd
save_dir_root = '../save'
runs_dir_root = '../runs'
cross_weights = {0: 0.014705882352941176,
1: 0.014705882352941176,
... | [
"pandas.DataFrame",
"os.mkdir",
"model.runner.Trainer",
"os.path.exists",
"script.tools.Recorder",
"traceback.format_exc",
"attrdict.AttrDict",
"os.path.join"
] | [((6549, 6563), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (6561, 6563), True, 'import pandas as pd\n'), ((6592, 6606), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (6604, 6606), True, 'import pandas as pd\n'), ((12300, 12319), 'attrdict.AttrDict', 'AttrDict', (['task_attr'], {}), '(task_attr)\n', (... |
import json
def main():
data = []
occupations = set()
genres = set()
countries = set()
with open('./filmarks.jsonlines', mode='r') as f:
for line in f.readlines():
obj = json.loads(line)
for o in obj['production_members'].keys():
occupations.add(o)
... | [
"json.dump",
"json.loads"
] | [((1041, 1079), 'json.dump', 'json.dump', (['data', 'f'], {'ensure_ascii': '(False)'}), '(data, f, ensure_ascii=False)\n', (1050, 1079), False, 'import json\n'), ((212, 228), 'json.loads', 'json.loads', (['line'], {}), '(line)\n', (222, 228), False, 'import json\n')] |
import requests
import json
import math
import logging
from dotenv import dotenv_values
config = dotenv_values(".env")
GITHUB_API_URL = "https://api.github.com"
ORG_ENDPOINT = GITHUB_API_URL + "/orgs/" + config["ORGANIZATION_NAME"]
ORG_REPOS_ENDPOINT = ORG_ENDPOINT + "/repos?per_page=100&page={current_page}"
REPO_END... | [
"json.loads",
"math.ceil",
"logging.warning",
"logging.info",
"requests.get",
"dotenv.dotenv_values"
] | [((98, 119), 'dotenv.dotenv_values', 'dotenv_values', (['""".env"""'], {}), "('.env')\n", (111, 119), False, 'from dotenv import dotenv_values\n'), ((761, 791), 'json.loads', 'json.loads', (["config['EXCLUDED']"], {}), "(config['EXCLUDED'])\n", (771, 791), False, 'import json\n'), ((981, 1006), 'json.loads', 'json.load... |
# DO NOT EDIT THIS FILE. This file will be overwritten when re-running go-raml.
from sanic import Blueprint
from sanic.views import HTTPMethodView
from sanic.response import text
from . import deliveries_api
deliveries_if = Blueprint('deliveries_if')
class deliveriesView(HTTPMethodView):
async def get(self, r... | [
"sanic.Blueprint"
] | [((227, 253), 'sanic.Blueprint', 'Blueprint', (['"""deliveries_if"""'], {}), "('deliveries_if')\n", (236, 253), False, 'from sanic import Blueprint\n')] |
#--------------------------------------------------------------
# This is a demo file intended to show the use of the SNIC algorithm
# Please compile the C files of snic.h and snic.c using:
# "python snic.c" on the command prompt prior to using this file.
#
# To see the demo use: "python SNICdemo.py" on the command pro... | [
"cffi.FFI",
"timeit.default_timer",
"numpy.asarray",
"numpy.zeros",
"PIL.Image.open",
"numpy.array",
"PIL.Image.fromarray",
"_snic.lib.SNIC_main"
] | [((854, 873), 'PIL.Image.open', 'Image.open', (['imgname'], {}), '(imgname)\n', (864, 873), False, 'from PIL import Image\n'), ((906, 921), 'numpy.asarray', 'np.asarray', (['img'], {}), '(img)\n', (916, 921), True, 'import numpy as np\n'), ((1302, 1334), 'numpy.zeros', 'np.zeros', (['(h, w)'], {'dtype': 'np.int32'}), '... |
#!/usr/bin/python
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you... | [
"os.remove",
"resource_management.core.resources.Execute",
"resource_management.libraries.functions.format.format",
"resource_management.libraries.functions.dynamic_variable_interpretation.copy_tarballs_to_hdfs",
"os.path.isfile",
"resource_management.libraries.functions.check_process_status.check_process... | [((2117, 2154), 'resource_management.libraries.functions.format.format', 'format', (['"""{spark_history_server_stop}"""'], {}), "('{spark_history_server_stop}')\n", (2123, 2154), False, 'from resource_management.libraries.functions.format import format\n'), ((2159, 2251), 'resource_management.core.resources.Execute', '... |
from plot_helper import plot_data
from general_helper import NNcompute_nb_errors, generate_disc_set, analyse_model
from NN_classes import NNSequential, NNRelu, NNTanh, NNLinear
from torch import set_grad_enabled
set_grad_enabled(False)
def main() :
"""
Main Function: to compute performance of Two Models with diff... | [
"general_helper.analyse_model",
"NN_classes.NNRelu",
"general_helper.generate_disc_set",
"torch.set_grad_enabled",
"plot_helper.plot_data",
"NN_classes.NNTanh",
"NN_classes.NNLinear"
] | [((213, 236), 'torch.set_grad_enabled', 'set_grad_enabled', (['(False)'], {}), '(False)\n', (229, 236), False, 'from torch import set_grad_enabled\n'), ((1000, 1110), 'general_helper.generate_disc_set', 'generate_disc_set', (['train_size'], {'one_hot_encoding': 'with_one_hot_encoding', 'label_1_in_center': 'label_1_in_... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
import numpy as np
import pytorch_lightning as pl
import lightly
num_workers = 8
max_epochs = 800
knn_k = 200
knn_t = 0.1
classes = 10
batch_size = 512
seed=1
pl.seed_everything(seed)
# use a GPU if available
gpus = 1 if torch.cud... | [
"lightly.data.SimCLRCollateFunction",
"torch.nn.AdaptiveAvgPool2d",
"pytorch_lightning.Trainer",
"pytorch_lightning.seed_everything",
"torch.utils.data.DataLoader",
"torch.mm",
"torch.cat",
"torch.nn.Module",
"torchvision.datasets.CIFAR10",
"torch.optim.lr_scheduler.CosineAnnealingLR",
"torch.cu... | [((248, 272), 'pytorch_lightning.seed_everything', 'pl.seed_everything', (['seed'], {}), '(seed)\n', (266, 272), True, 'import pytorch_lightning as pl\n'), ((413, 481), 'lightly.data.SimCLRCollateFunction', 'lightly.data.SimCLRCollateFunction', ([], {'input_size': '(32)', 'gaussian_blur': '(0.0)'}), '(input_size=32, ga... |
from environments.utils.random_planar_graph.DisjointSet import *
from environments.utils.random_planar_graph import triangulation
def generate_node(width, height, randstream):
return (randstream.randint(0, width-1), randstream.randint(0, height-1))
def distance2(node0, node1):
dx = node1[0] - node0[0]
dy = node1[1... | [
"environments.utils.random_planar_graph.triangulation.triangulate"
] | [((1327, 1381), 'environments.utils.random_planar_graph.triangulation.triangulate', 'triangulation.triangulate', (['nodes', 'randstream', 'tri_mode'], {}), '(nodes, randstream, tri_mode)\n', (1352, 1381), False, 'from environments.utils.random_planar_graph import triangulation\n')] |
import woof
def test_woof_not_configured(custom_backend_class):
woof.notify('hey')
assert custom_backend_class.messages == []
def test_woof_configured(custom_backend_class, environ_set):
environ_set('WOOF_CUSTOM_PARAM1', 'param1_value')
environ_set('WOOF_CUSTOM_PARAM2', 'param2_value')
woof.noti... | [
"woof.notify"
] | [((70, 88), 'woof.notify', 'woof.notify', (['"""hey"""'], {}), "('hey')\n", (81, 88), False, 'import woof\n'), ((311, 329), 'woof.notify', 'woof.notify', (['"""hey"""'], {}), "('hey')\n", (322, 329), False, 'import woof\n')] |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | [
"django.core.urlresolvers.reverse_lazy"
] | [((945, 994), 'django.core.urlresolvers.reverse_lazy', 'reverse_lazy', (['"""horizon:project:connections:index"""'], {}), "('horizon:project:connections:index')\n", (957, 994), False, 'from django.core.urlresolvers import reverse_lazy\n')] |
from bigchaindb_driver import BigchainDB
from bigchaindb_driver.crypto import generate_keypair
import json
bdb_root_url = '172.16.58.3:9984'
bdb = BigchainDB(bdb_root_url)
def get_articles(search_term):
user = generate_keypair()
return bdb.assets.get(search=search_term)
if __name__ == "__main__":
pr... | [
"bigchaindb_driver.crypto.generate_keypair",
"bigchaindb_driver.BigchainDB"
] | [((149, 173), 'bigchaindb_driver.BigchainDB', 'BigchainDB', (['bdb_root_url'], {}), '(bdb_root_url)\n', (159, 173), False, 'from bigchaindb_driver import BigchainDB\n'), ((217, 235), 'bigchaindb_driver.crypto.generate_keypair', 'generate_keypair', ([], {}), '()\n', (233, 235), False, 'from bigchaindb_driver.crypto impo... |
"""
@brief test log(time=16s)
"""
import unittest
import numpy
from pandas import DataFrame
from pyquickhelper.pycode import ExtTestCase
from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split
from sklearn.naive_bayes import BernoulliNB
from skl2onnx import convert_skl... | [
"unittest.main",
"pandas.DataFrame",
"mlprodict.tools.asv_options_helper.get_opset_number_from_onnx",
"numpy.abs",
"sklearn.model_selection.train_test_split",
"mlprodict.tools.asv_options_helper.get_ir_version_from_onnx",
"sklearn.datasets.make_classification",
"skl2onnx.common.data_types.FloatTensorT... | [((3510, 3525), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3523, 3525), False, 'import unittest\n'), ((783, 893), 'sklearn.datasets.make_classification', 'make_classification', ([], {'n_classes': 'n_classes', 'n_features': '(100)', 'n_samples': '(1000)', 'random_state': '(42)', 'n_informative': '(7)'}), '(n_c... |
import sys
import util
import os
from chainer import cuda, Variable
from lfads import LFADS_full, LFADS
import chainer.functions as F
import numpy as np
import six
import h5py
def main(args):
# load model
if 'full' in args.model:
model = LFADS_full.load(args.model)
else:
model = LFADS.load... | [
"chainer.Variable",
"h5py.File",
"argparse.ArgumentParser",
"chainer.cuda.get_device",
"lfads.LFADS.load",
"chainer.cuda.to_cpu",
"lfads.LFADS_full.load"
] | [((1865, 1944), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Prior sampling for novel data generation"""'}), "(description='Prior sampling for novel data generation')\n", (1888, 1944), False, 'import argparse\n'), ((256, 283), 'lfads.LFADS_full.load', 'LFADS_full.load', (['args.model']... |
from django.db import models
from app.models.core.transaction import Transaction
class TransactionDetails(models.Model):
"""Each transaction details responsible for managing ONLY ONE type of product"""
payment_id = models.IntegerField() # index (pk) key linked to transaction table
transaction = models.Fo... | [
"django.db.models.ForeignKey",
"django.db.models.IntegerField",
"django.db.models.DateTimeField",
"django.db.models.DecimalField"
] | [((225, 246), 'django.db.models.IntegerField', 'models.IntegerField', ([], {}), '()\n', (244, 246), False, 'from django.db import models\n'), ((311, 400), 'django.db.models.ForeignKey', 'models.ForeignKey', (['Transaction'], {'on_delete': 'models.CASCADE', 'related_name': '"""transaction"""'}), "(Transaction, on_delete... |
from __future__ import absolute_import
from builtins import object
from django.test import TestCase, override_settings
from readthedocs.core.utils.extend import (SettingsOverrideObject,
get_override_class)
# Top level to ensure module name is correct
class FooBase(object):
... | [
"readthedocs.core.utils.extend.get_override_class",
"django.test.override_settings"
] | [((679, 721), 'django.test.override_settings', 'override_settings', ([], {'FOO_OVERRIDE_CLASS': 'None'}), '(FOO_OVERRIDE_CLASS=None)\n', (696, 721), False, 'from django.test import TestCase, override_settings\n'), ((1214, 1272), 'django.test.override_settings', 'override_settings', ([], {'FOO_OVERRIDE_CLASS': 'EXTEND_O... |
from django import template
from django.forms.fields import CheckboxInput
register = template.Library()
@register.filter(name='is_checkbox')
def is_checkbox(value):
return isinstance(value, CheckboxInput)
| [
"django.template.Library"
] | [((89, 107), 'django.template.Library', 'template.Library', ([], {}), '()\n', (105, 107), False, 'from django import template\n')] |
from brownie import Contract
from yearn.utils import safe_views
from yearn.multicall2 import fetch_multicall
STRATEGY_VIEWS_SCALED = [
"maxDebtPerHarvest",
"minDebtPerHarvest",
"totalDebt",
"totalGain",
"totalLoss",
"estimatedTotalAssets",
"lentTotalAssets",
"balanceOfPool",
"balan... | [
"brownie.Contract",
"yearn.multicall2.fetch_multicall",
"yearn.utils.safe_views"
] | [((416, 434), 'brownie.Contract', 'Contract', (['strategy'], {}), '(strategy)\n', (424, 434), False, 'from brownie import Contract\n'), ((525, 554), 'yearn.utils.safe_views', 'safe_views', (['self.strategy.abi'], {}), '(self.strategy.abi)\n', (535, 554), False, 'from yearn.utils import safe_views\n'), ((981, 1113), 'ye... |
"""Usage: linca.py [--ipe] [--scale=<s>] [--straightness=<s>]
linca.py --help
Draws a linear cartogram.
Options:
--ipe Write IPE file.
-s --scale=<s> Scale all coordinates by a constant factor. [Default: 1]
--straightness=<s> Focus on direction rather than length. [Default: 10]
-... | [
"math.sqrt",
"docopt.docopt",
"scipy.sparse.csr_matrix",
"miniipe.Document",
"miniipe.polyline",
"scipy.sparse.linalg.spsolve"
] | [((2404, 2467), 'scipy.sparse.csr_matrix', 'sparse_matrix', (['(vals, (rows, cols))'], {'shape': '(num_rows, num_cols)'}), '((vals, (rows, cols)), shape=(num_rows, num_cols))\n', (2417, 2467), True, 'from scipy.sparse import csr_matrix as sparse_matrix\n'), ((2679, 2701), 'scipy.sparse.linalg.spsolve', 'sparse_solve', ... |
# -*- coding: iso-8859-1 -*-
# Maintainer: joaander
from hoomd import *
from hoomd import deprecated
import hoomd;
context.initialize()
import unittest
import os
import tempfile
# unit tests for deprecated.dump.xml
class dmp_xml_tests (unittest.TestCase):
def setUp(self):
print
if hoomd.comm.get_r... | [
"unittest.main",
"hoomd.deprecated.init.create_random",
"os.remove",
"tempfile.mkstemp",
"hoomd.deprecated.dump.xml",
"hoomd.comm.get_rank"
] | [((2986, 3023), 'unittest.main', 'unittest.main', ([], {'argv': "['test.py', '-v']"}), "(argv=['test.py', '-v'])\n", (2999, 3023), False, 'import unittest\n'), ((492, 540), 'hoomd.deprecated.init.create_random', 'deprecated.init.create_random', ([], {'N': '(100)', 'phi_p': '(0.05)'}), '(N=100, phi_p=0.05)\n', (521, 540... |
#!/usr/bin/env python2
import RPi.GPIO as GPIO
import time
import sys
def note_to_freq(note,a=440.0):
notes = { 'a':9,
'b':11,
'c':0,
'd':2,
'e':4,
'f':5,
'g':7,
}
c = a * (2**(1/12.0))**(-57) # c0
f = notes[note[0]]
if "is" in note:
f += 1
n = int(note[3:])
elif "es" in note:
f -= 1
n = ... | [
"RPi.GPIO.setmode",
"RPi.GPIO.setup",
"time.time",
"time.sleep",
"sys.argv.index",
"RPi.GPIO.output",
"RPi.GPIO.setwarnings"
] | [((416, 439), 'RPi.GPIO.setwarnings', 'GPIO.setwarnings', (['(False)'], {}), '(False)\n', (432, 439), True, 'import RPi.GPIO as GPIO\n'), ((441, 463), 'RPi.GPIO.setmode', 'GPIO.setmode', (['GPIO.BCM'], {}), '(GPIO.BCM)\n', (453, 463), True, 'import RPi.GPIO as GPIO\n'), ((465, 489), 'RPi.GPIO.setup', 'GPIO.setup', (['(... |
from django.conf.urls import url
from django.conf.urls import include
from django.contrib import admin
from django.contrib.sitemaps.views import sitemap
from django.urls import path
from blog.sitemap import HomePageSiteMap
from blog.sitemap import PostSiteMap
from blog.sitemap import StaticSiteMap
app_name = "core"
... | [
"django.conf.urls.include",
"django.urls.path"
] | [((443, 474), 'django.urls.path', 'path', (['"""admin/"""', 'admin.site.urls'], {}), "('admin/', admin.site.urls)\n", (447, 474), False, 'from django.urls import path\n'), ((534, 640), 'django.urls.path', 'path', (['"""sitemap.xml"""', 'sitemap', "{'sitemaps': sitemaps}"], {'name': '"""django.contrib.sitemaps.views.sit... |
import random
num = random.random()
print('{:.2f}'.format(num))
| [
"random.random"
] | [((20, 35), 'random.random', 'random.random', ([], {}), '()\n', (33, 35), False, 'import random\n')] |
# Faça um programa em python que abra e reproduza um arquivo de áudio mp3.
import pygame
pygame.init()
pygame.mixer_music.load("chef021.mp3")
pygame.mixer_music.play()
pygame.event.wait()
| [
"pygame.event.wait",
"pygame.mixer_music.play",
"pygame.mixer_music.load",
"pygame.init"
] | [((91, 104), 'pygame.init', 'pygame.init', ([], {}), '()\n', (102, 104), False, 'import pygame\n'), ((105, 143), 'pygame.mixer_music.load', 'pygame.mixer_music.load', (['"""chef021.mp3"""'], {}), "('chef021.mp3')\n", (128, 143), False, 'import pygame\n'), ((144, 169), 'pygame.mixer_music.play', 'pygame.mixer_music.play... |
from django.contrib import admin
from . import models
class OrganizationAdmin(admin.ModelAdmin):
model = models.Organization
prepopulated_fields = {'slug': ('name',)}
class OrderProductInline(admin.TabularInline):
model = models.OrderProduct
class OrderAdmin(admin.ModelAdmin):
model = models.Order... | [
"django.contrib.admin.site.register"
] | [((359, 404), 'django.contrib.admin.site.register', 'admin.site.register', (['models.Order', 'OrderAdmin'], {}), '(models.Order, OrderAdmin)\n', (378, 404), False, 'from django.contrib import admin\n'), ((405, 464), 'django.contrib.admin.site.register', 'admin.site.register', (['models.Organization', 'OrganizationAdmin... |
import autotrader
autotrader.send_order("SP-FUTURE", "BUY", 2933,197) | [
"autotrader.send_order"
] | [((19, 71), 'autotrader.send_order', 'autotrader.send_order', (['"""SP-FUTURE"""', '"""BUY"""', '(2933)', '(197)'], {}), "('SP-FUTURE', 'BUY', 2933, 197)\n", (40, 71), False, 'import autotrader\n')] |
import re, os, sys
from functools import reduce
from itertools import combinations as comb, permutations as perm, combinations_with_replacement as combr
from operator import itemgetter
from pprint import pprint
from math import *
from collections import defaultdict
import networkx as nx
import numpy as np
def dprint(d... | [
"functools.reduce"
] | [((568, 600), 'functools.reduce', 'reduce', (['(lambda a, b: a * b)', 'l', '(1)'], {}), '(lambda a, b: a * b, l, 1)\n', (574, 600), False, 'from functools import reduce\n'), ((1001, 1073), 'functools.reduce', 'reduce', (['(lambda a, b: a * 5 + b)', '(cpoints[CM[c]] for c in stack[::-1])', '(0)'], {}), '(lambda a, b: a ... |
import os
import csv
import itertools
import sys
import ntpath
correction = 0.2
data_csv = R".\data\driving_log.csv"
data_out = R".\data\filenames_angles.csv"
def preprocess():
filename_angles = []
# change later
with open(data_csv) as csvfile:
reader = csv.reader(csvfile)
for line in rea... | [
"csv.reader",
"ntpath.basename"
] | [((277, 296), 'csv.reader', 'csv.reader', (['csvfile'], {}), '(csvfile)\n', (287, 296), False, 'import csv\n'), ((540, 564), 'ntpath.basename', 'ntpath.basename', (['line[0]'], {}), '(line[0])\n', (555, 564), False, 'import ntpath\n'), ((593, 617), 'ntpath.basename', 'ntpath.basename', (['line[1]'], {}), '(line[1])\n',... |
import os
import gin
from histo_lib import WSI, RandomTiler
@gin.configurable
def extract_random_tiles(
wsi_filename,
tile_size,
n_tiles,
level=0,
seed=7,
check_tissue=True,
prefix="",
suffix=".png",
max_iter=1e4,
):
"""
Extract random tiles from the WSI and save them to ... | [
"os.path.isdir",
"os.path.exists",
"histo_lib.RandomTiler",
"histo_lib.WSI"
] | [((1547, 1574), 'os.path.isdir', 'os.path.isdir', (['wsi_filename'], {}), '(wsi_filename)\n', (1560, 1574), False, 'import os\n'), ((1700, 1717), 'histo_lib.WSI', 'WSI', (['wsi_filename'], {}), '(wsi_filename)\n', (1703, 1717), False, 'from histo_lib import WSI, RandomTiler\n'), ((1731, 1819), 'histo_lib.RandomTiler', ... |
import os
import sys
def is_frozen():
return getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS')
def get_script_path():
return os.path.realpath(sys.argv[0])
def is_nt():
return os.name.startswith("nt")
def is_posix():
return os.name.startswith("posix")
| [
"os.path.realpath",
"os.name.startswith"
] | [((146, 175), 'os.path.realpath', 'os.path.realpath', (['sys.argv[0]'], {}), '(sys.argv[0])\n', (162, 175), False, 'import os\n'), ((202, 226), 'os.name.startswith', 'os.name.startswith', (['"""nt"""'], {}), "('nt')\n", (220, 226), False, 'import os\n'), ((256, 283), 'os.name.startswith', 'os.name.startswith', (['"""po... |
"""
https://leetcode.com/problems/maximum-binary-tree/
https://leetcode.com/submissions/detail/117135480/
"""
from common.tree_node import TreeNode
from common.print_tree_node import printTreeNode
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# ... | [
"unittest.main",
"common.tree_node.TreeNode"
] | [((2192, 2207), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2205, 2207), False, 'import unittest\n'), ((1787, 1798), 'common.tree_node.TreeNode', 'TreeNode', (['(6)'], {}), '(6)\n', (1795, 1798), False, 'from common.tree_node import TreeNode\n'), ((1828, 1839), 'common.tree_node.TreeNode', 'TreeNode', (['(3)']... |
"""
A collection of classes extending the functionality of Python's builtins.
author: <NAME>
email: <EMAIL>
This is `export file` while one can dictate what will be exposed with toolbox
"""
from crocodile import core
from crocodile.core import datetime, dt, os, sys, string, random, np, copy, dill
from crocodile imp... | [
"importlib.reload",
"argparse.ArgumentParser",
"inspect.ismodule"
] | [((2376, 2439), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Crocodile toolbox parser"""'}), "(description='Crocodile toolbox parser')\n", (2399, 2439), False, 'import argparse\n'), ((1902, 1923), 'inspect.ismodule', 'inspect.ismodule', (['val'], {}), '(val)\n', (1918, 1923), False, 'i... |
"""
``Example``::
``csprng_trivium``
load, req = pyrtl.Input(1, 'load'), pyrtl.Input(1, 'req')
ready, rand = pyrtl.Output(1, 'ready'), pyrtl.Output(128, 'rand')
ready_out, rand_out = prngs.csprng_trivium(128, load, req)
ready <<= ready_out
rand <<= rand_out
sim_trace = pyrtl.SimulationTrac... | [
"random.SystemRandom",
"math.ceil",
"pyrtl.Register",
"pyrtl.WireVector",
"pyrtl.PyrtlError",
"pyrtl.concat",
"pyrtl.rtllib.adders.kogge_stone",
"pyrtl.as_wires",
"math.log",
"pyrtl.Const",
"pyrtl.rtllib.libutils._shifted_reg_next"
] | [((3672, 3723), 'pyrtl.Register', 'pyrtl.Register', (['(127 if bitwidth < 127 else bitwidth)'], {}), '(127 if bitwidth < 127 else bitwidth)\n', (3686, 3723), False, 'import pyrtl\n'), ((5507, 5532), 'pyrtl.as_wires', 'pyrtl.as_wires', (['seed', '(128)'], {}), '(seed, 128)\n', (5521, 5532), False, 'import pyrtl\n'), ((5... |
#main.py | <NAME> | 2021 / 2022
from flask import Flask, g, render_template, request, session, url_for, redirect
import time
import datetime
import threading
import csv
import os
import logging
import RPi.GPIO as GPIO
logging.basicConfig(filename="log.log", format='%(asctime)s - %(levelname)s - %(message)s', level=l... | [
"csv.reader",
"flask.request.form.get",
"time.strftime",
"flask.request.environ.get",
"flask.url_for",
"RPi.GPIO.output",
"csv.DictWriter",
"RPi.GPIO.cleanup",
"RPi.GPIO.setup",
"flask.render_template",
"time.localtime",
"threading.Thread",
"RPi.GPIO.setmode",
"datetime.datetime.today",
... | [((221, 338), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': '"""log.log"""', 'format': '"""%(asctime)s - %(levelname)s - %(message)s"""', 'level': 'logging.DEBUG'}), "(filename='log.log', format=\n '%(asctime)s - %(levelname)s - %(message)s', level=logging.DEBUG)\n", (240, 338), False, 'import logg... |
"""
This file is part of nucypher.
nucypher is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
nucypher is distributed in the hope that it wil... | [
"nucypher.blockchain.eth.agents.NucypherTokenAgent",
"nucypher.blockchain.eth.deployers.UserEscrowDeployer",
"twisted.internet.reactor.callFromThread",
"nucypher.blockchain.eth.deployers.MinerEscrowDeployer",
"datetime.datetime.utcnow",
"nucypher.blockchain.eth.deployers.NucypherTokenDeployer",
"nucyphe... | [((3206, 3226), 'nucypher.blockchain.eth.agents.NucypherTokenAgent', 'NucypherTokenAgent', ([], {}), '()\n', (3224, 3226), False, 'from nucypher.blockchain.eth.agents import NucypherTokenAgent, MinerAgent, PolicyAgent\n'), ((4880, 4944), 'nucypher.blockchain.eth.chains.Blockchain.connect', 'Blockchain.connect', ([], {'... |
# -*- coding: utf-8 -*-
"""Unit tests for account endpoints"""
import pytest
from src.rev_ai.apiclient import RevAiAPIClient
from src.rev_ai.models.asynchronous import Account
try:
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
URL = urljoin(RevAiAPIClient.base_url, 'accoun... | [
"urlparse.urljoin",
"src.rev_ai.apiclient.RevAiAPIClient",
"src.rev_ai.models.asynchronous.Account",
"pytest.mark.usefixtures"
] | [((280, 323), 'urlparse.urljoin', 'urljoin', (['RevAiAPIClient.base_url', '"""account"""'], {}), "(RevAiAPIClient.base_url, 'account')\n", (287, 323), False, 'from urlparse import urljoin\n'), ((327, 388), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""mock_session"""', '"""make_mock_response"""'], {}), "(... |
from dataclasses import dataclass
from geocube.pb import operations_pb2
from geocube import entities
@dataclass(frozen=True)
class ConsolidationParams:
dformat: entities.DataFormat
exponent: float
compression: entities.Compression
overviews_min_size: int
resampling_alg... | [
"dataclasses.dataclass",
"geocube.entities.DataFormat.from_pb"
] | [((105, 127), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (114, 127), False, 'from dataclasses import dataclass\n'), ((459, 498), 'geocube.entities.DataFormat.from_pb', 'entities.DataFormat.from_pb', (['pb.dformat'], {}), '(pb.dformat)\n', (486, 498), False, 'from geocube import... |
import numpy as np
from mushroom.algorithms.agent import Agent
from mushroom.approximators import Regressor
from mushroom.approximators.parametric import LinearApproximator
class SAC(Agent):
"""
Stochastic Actor critic in the episodic setting as presented in:
"Model-Free Reinforcement Learning with Conti... | [
"numpy.zeros",
"mushroom.approximators.Regressor"
] | [((1497, 1570), 'mushroom.approximators.Regressor', 'Regressor', (['LinearApproximator'], {'input_shape': 'input_shape', 'output_shape': '(1,)'}), '(LinearApproximator, input_shape=input_shape, output_shape=(1,))\n', (1506, 1570), False, 'from mushroom.approximators import Regressor\n'), ((1620, 1650), 'numpy.zeros', '... |
# Generated by Django 2.0.12 on 2019-10-29 11:36
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('taobao', '0004_banner'),
]
operations = [
migrations.AlterField(
model_name='banner',
name='pid',
field... | [
"django.db.models.CharField"
] | [((321, 374), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)', 'verbose_name': '"""活动id"""'}), "(max_length=100, verbose_name='活动id')\n", (337, 374), False, 'from django.db import migrations, models\n')] |
from Binary.Scripts.utils import *
import scipy.optimize as opt
from scipy import stats
from sklearn.linear_model import LinearRegression
import numpy as np
np.random.seed(1234)
#
#
def obj_fun(theta, x, y_):
pre_dis = np.dot(x, theta)
loss = np.sum((pre_dis - y_) ** 2)
return loss
class xa... | [
"numpy.zeros_like",
"numpy.random.seed",
"numpy.sum",
"numpy.copy",
"numpy.abs",
"scipy.stats.norm",
"numpy.zeros",
"numpy.ones",
"sklearn.linear_model.LinearRegression",
"numpy.shape",
"numpy.random.randint",
"numpy.linalg.norm",
"numpy.random.random",
"numpy.array",
"numpy.random.choic... | [((157, 177), 'numpy.random.seed', 'np.random.seed', (['(1234)'], {}), '(1234)\n', (171, 177), True, 'import numpy as np\n'), ((233, 249), 'numpy.dot', 'np.dot', (['x', 'theta'], {}), '(x, theta)\n', (239, 249), True, 'import numpy as np\n'), ((261, 288), 'numpy.sum', 'np.sum', (['((pre_dis - y_) ** 2)'], {}), '((pre_d... |
import sys
import os
import random
import re
from subprocess import Popen, PIPE
from smac.tae.execute_ta_run import StatusType, ExecuteTARun
from smac.stats.stats import Stats
from smac.utils.constants import MAXINT
from tempfile import NamedTemporaryFile
__author__ = "<NAME>"
__license__ = "3-clause BSD"
float_reg... | [
"re.search"
] | [((1565, 1597), 're.search', 're.search', (['"""UNSATISFIABLE"""', 'data'], {}), "('UNSATISFIABLE', data)\n", (1574, 1597), False, 'import re\n'), ((1655, 1685), 're.search', 're.search', (['"""SATISFIABLE"""', 'data'], {}), "('SATISFIABLE', data)\n", (1664, 1685), False, 'import re\n'), ((1743, 1775), 're.search', 're... |
from django.shortcuts import render
from django.http import JsonResponse
def get_hierachy_paths(request):
hierachy_paths = [
["/m/0dgw9r", "/m/09l8g", "/m/09x0r", "/m/05zppz"],
["/t/dd00123", "/m/07bm98", "/m/01b7fy"],
["/t/dd00098", "/m/028v0c"],
["/m/0dgw9r", "/m/09l8g", "/m/09x0... | [
"django.shortcuts.render",
"django.http.JsonResponse"
] | [((955, 1045), 'django.http.JsonResponse', 'JsonResponse', (["{'hierachy_paths': hierachy_paths, 'id_to_name': id_to_name}"], {'safe': '(False)'}), "({'hierachy_paths': hierachy_paths, 'id_to_name': id_to_name},\n safe=False)\n", (967, 1045), False, 'from django.http import JsonResponse\n'), ((2349, 2415), 'django.s... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scikitplot.metrics import plot_confusion_matrix, plot_roc
class Plotting():
def plot_losses(self, training_losses, validation_losses):
plt.figure()
epochs = range(len(training_losses))
line1 = plt.plot(epochs, trai... | [
"matplotlib.pyplot.title",
"pandas.DataFrame",
"matplotlib.pyplot.show",
"numpy.ceil",
"matplotlib.pyplot.plot",
"scikitplot.metrics.plot_roc",
"matplotlib.pyplot.legend",
"numpy.transpose",
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"scikitplot.metrics.plot_confus... | [((225, 237), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (235, 237), True, 'import matplotlib.pyplot as plt\n'), ((299, 355), 'matplotlib.pyplot.plot', 'plt.plot', (['epochs', 'training_losses'], {'label': '"""Training Loss"""'}), "(epochs, training_losses, label='Training Loss')\n", (307, 355), True, ... |
import datetime
import json
import os
import boto3
import pandas as pd
import io
bucket_name = os.environ['bucket_name']
dynamo_table = os.environ['dynamodb_table']
# Connect to S3
s3 = boto3.resource(
service_name='s3',
region_name='us-east-1')
# Connect to DynamoDB
resource = boto3.resource('dynamodb', re... | [
"pandas.DataFrame",
"boto3.client",
"json.dumps",
"boto3.resource",
"datetime.datetime.now"
] | [((189, 247), 'boto3.resource', 'boto3.resource', ([], {'service_name': '"""s3"""', 'region_name': '"""us-east-1"""'}), "(service_name='s3', region_name='us-east-1')\n", (203, 247), False, 'import boto3\n'), ((291, 342), 'boto3.resource', 'boto3.resource', (['"""dynamodb"""'], {'region_name': '"""us-east-1"""'}), "('dy... |
import matplotlib.pyplot as plt
from matplotlib.image import BboxImage
from matplotlib.transforms import Bbox
import seaborn as sns
def save_bar_graph(x, y, file_name):
plt.clf()
sns.set_style("whitegrid")
ax = sns.barplot(x=x, y=y)
for item in ax.get_xticklabels():
item.set_rotation(15)
p... | [
"seaborn.set_style",
"matplotlib.transforms.Bbox",
"matplotlib.pyplot.clf",
"seaborn.barplot",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig"
] | [((175, 184), 'matplotlib.pyplot.clf', 'plt.clf', ([], {}), '()\n', (182, 184), True, 'import matplotlib.pyplot as plt\n'), ((189, 215), 'seaborn.set_style', 'sns.set_style', (['"""whitegrid"""'], {}), "('whitegrid')\n", (202, 215), True, 'import seaborn as sns\n'), ((225, 246), 'seaborn.barplot', 'sns.barplot', ([], {... |
import meshio
import numpy as np
from src.htc_calculator.reference_face import ReferenceFace
from src.htc_calculator.activated_reference_face import ActivatedReferenceFace
from src.htc_calculator.construction import Material, Layer, ComponentConstruction
from src.htc_calculator.meshing.mesh_setup import MeshSetup
... | [
"src.htc_calculator.reference_face.ReferenceFace",
"src.htc_calculator.construction.Layer",
"src.htc_calculator.meshing.mesh_setup.MeshSetup",
"numpy.array",
"src.htc_calculator.construction.Material",
"src.htc_calculator.construction.ComponentConstruction",
"src.htc_calculator.activated_reference_face.... | [((410, 464), 'numpy.array', 'np.array', (['[[0, 0, 0], [5, 0, 0], [5, 5, 0], [0, 5, 0]]'], {}), '([[0, 0, 0], [5, 0, 0], [5, 5, 0], [0, 5, 0]])\n', (418, 464), True, 'import numpy as np\n'), ((545, 640), 'src.htc_calculator.construction.Material', 'Material', ([], {'name': '"""concrete"""', 'density': '(2600)', 'speci... |
import numpy as np
from PuzzleLib.Backend import gpuarray
from PuzzleLib.Backend.gpuarray import memoryPool as memPool
from PuzzleLib.Backend.Kernels import Pad
from PuzzleLib.Modules.Module import ModuleError, Module
from PuzzleLib.Modules.Pad2D import PadMode
class Pad1D(Module):
def __init__(self, pad, mode="co... | [
"PuzzleLib.Modules.Pad2D.PadMode",
"PuzzleLib.Backend.Kernels.Pad.reflectpad1dBackward",
"numpy.random.randn",
"numpy.allclose",
"PuzzleLib.Backend.gpuarray.empty",
"numpy.isclose",
"PuzzleLib.Backend.gpuarray.dtypesSupported",
"PuzzleLib.Backend.Kernels.Pad.reflectpad1d",
"PuzzleLib.Modules.Module.... | [((2767, 2841), 'numpy.allclose', 'np.allclose', (['hostOutData[:, :, lpad:hostOutData.shape[2] - rpad]', 'hostData'], {}), '(hostOutData[:, :, lpad:hostOutData.shape[2] - rpad], hostData)\n', (2778, 2841), True, 'import numpy as np\n'), ((2851, 2917), 'numpy.isclose', 'np.isclose', (['hostOutData[0, 0, hostOutData.sha... |
# -*- coding: utf-8 -*-
# Copyright (C) 2015-2016 <NAME> and contributors
# <see AUTHORS.txt file>
#
# This library is part of the Neotext project:
# http://www.neotext.net/
# The code for this server library is released under the MIT License:
# http://www.opensource.org/licenses/mit-license
from django.http import H... | [
"json.dump",
"django.http.HttpResponse",
"hashlib.sha1",
"django.core.validators.URLValidator",
"neotext.lib.neotext_quote_context.quote.Quote",
"django.template.Context",
"json.dumps",
"django.shortcuts.get_object_or_404",
"neotext.lib.neotext_quote_context.document.Document",
"tinys3.Connection"... | [((1566, 1651), 'django.http.HttpResponse', 'HttpResponse', (['"""Hello, world. You\'re at the neotext webservice homepage."""'], {}), '("Hello, world. You\'re at the neotext webservice homepage."\n )\n', (1578, 1651), False, 'from django.http import HttpResponse\n'), ((1866, 1897), 'django.template.... |
# bets/context_processors.py
from bets.forms import PlaceBetsForm
from django.core.urlresolvers import reverse
from bets import views
def place_bets_form_context_processor(request):
return {
'place_bets_form': PlaceBetsForm(),
'place_bets_form_url': reverse('bets:place_bets_form_process', kwargs={'next_url': requ... | [
"bets.forms.PlaceBetsForm",
"django.core.urlresolvers.reverse"
] | [((214, 229), 'bets.forms.PlaceBetsForm', 'PlaceBetsForm', ([], {}), '()\n', (227, 229), False, 'from bets.forms import PlaceBetsForm\n'), ((256, 330), 'django.core.urlresolvers.reverse', 'reverse', (['"""bets:place_bets_form_process"""'], {'kwargs': "{'next_url': request.path}"}), "('bets:place_bets_form_process', kwa... |
import requests
import time
from zounds.soundfile import AudioMetaData
class FreeSoundSearch(object):
"""
Produces an iterable of :class:`zounds.soundfile.AudioMetaData` instances
for every result from a https://freesound.org search
Args:
api_key (str): Your freesound.org API key (get one her... | [
"zounds.soundfile.AudioMetaData",
"time.sleep",
"requests.get",
"requests.Request"
] | [((1897, 2003), 'requests.Request', 'requests.Request', ([], {'method': '"""GET"""', 'url': "data['previews']['preview-hq-ogg']", 'params': "{'token': self.api_key}"}), "(method='GET', url=data['previews']['preview-hq-ogg'],\n params={'token': self.api_key})\n", (1913, 2003), False, 'import requests\n'), ((2156, 234... |
import sys
import os
import numpy as np
import tensorflow as tf
import math
import random
from tensorflow import keras
'''
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
'''
import matplotlib.pyplot as plt
class FittedQAgent():
'''
abstract class for the Tor... | [
"numpy.save",
"tensorflow.keras.models.load_model",
"matplotlib.pyplot.plot",
"tensorflow.train.Saver",
"numpy.argmax",
"tensorflow.global_variables_initializer",
"tensorflow.keras.backend.clear_session",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.InputLayer",
"matplotlib.pyplot.fig... | [((2357, 2385), 'numpy.random.shuffle', 'np.random.shuffle', (['randomize'], {}), '(randomize)\n', (2374, 2385), True, 'import numpy as np\n'), ((6431, 6463), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(16.0, 12.0)'}), '(figsize=(16.0, 12.0))\n', (6441, 6463), True, 'import matplotlib.pyplot as plt\n')... |
################################################################################
# Copyright (c) 2021 ContinualAI. #
# Copyrights licensed under the MIT License. #
# See the accompanying LICENSE file for terms. ... | [
"avalanche.evaluation.metric_utils.get_metric_name",
"time.perf_counter",
"avalanche.evaluation.metrics.mean.Mean",
"avalanche.evaluation.metric_results.MetricValue"
] | [((2634, 2653), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (2651, 2653), False, 'import time\n'), ((4355, 4386), 'avalanche.evaluation.metric_utils.get_metric_name', 'get_metric_name', (['self', 'strategy'], {}), '(self, strategy)\n', (4370, 4386), False, 'from avalanche.evaluation.metric_utils import ... |
# -*- coding: utf-8 -*-
# !/usr/bin/python
# @Time : 2021-03-20
# @Author : 409162075
# @FileName: free_fofa.py
# version: 1.0.0
import requests
from lxml import etree
import base64
import re
import time
import base_auto
import config_auto
import datetime
import os
from urllib.parse import quote
... | [
"os.listdir",
"os.path.join",
"base_auto.logo",
"base_auto.checkSession",
"time.sleep",
"base_auto.init",
"re.findall",
"datetime.timedelta",
"requests.get",
"datetime.datetime.now",
"lxml.etree.HTML"
] | [((4634, 4650), 'base_auto.logo', 'base_auto.logo', ([], {}), '()\n', (4648, 4650), False, 'import base_auto\n'), ((4656, 4680), 'base_auto.checkSession', 'base_auto.checkSession', ([], {}), '()\n', (4678, 4680), False, 'import base_auto\n'), ((4686, 4702), 'base_auto.init', 'base_auto.init', ([], {}), '()\n', (4700, 4... |
import bottle
import model
SKRIVNOST='Danesejelepdan'
DATOTEKA_S_STANJEM = 'stanje.json'
DATOTEKA_z_BESEDAMI = 'besede.txt'
vislice = model.Vislice(DATOTEKA_S_STANJEM, DATOTEKA_z_BESEDAMI)
vislice.nalozi_igre_iz_datoteke()
@bottle.get("/")
def osnovna_stran():
return bottle.template('index.tpl')
@bottle.post("/... | [
"bottle.request.get_cookie",
"bottle.redirect",
"bottle.response.set_cookie",
"bottle.request.forms.getunicode",
"bottle.static_file",
"bottle.get",
"bottle.run",
"model.Vislice",
"bottle.template",
"bottle.post"
] | [((135, 189), 'model.Vislice', 'model.Vislice', (['DATOTEKA_S_STANJEM', 'DATOTEKA_z_BESEDAMI'], {}), '(DATOTEKA_S_STANJEM, DATOTEKA_z_BESEDAMI)\n', (148, 189), False, 'import model\n'), ((227, 242), 'bottle.get', 'bottle.get', (['"""/"""'], {}), "('/')\n", (237, 242), False, 'import bottle\n'), ((306, 332), 'bottle.pos... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | [
"json.loads",
"json.dumps",
"superset.db.Session",
"sqlalchemy.ext.declarative.declarative_base",
"alembic.op.get_bind",
"sqlalchemy.Column",
"sqlalchemy.String"
] | [((1140, 1158), 'sqlalchemy.ext.declarative.declarative_base', 'declarative_base', ([], {}), '()\n', (1156, 1158), False, 'from sqlalchemy.ext.declarative import declarative_base\n'), ((1218, 1257), 'sqlalchemy.Column', 'sa.Column', (['sa.Integer'], {'primary_key': '(True)'}), '(sa.Integer, primary_key=True)\n', (1227,... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
from ansible.module_utils.basic import AnsibleModule
__metaclass__ = type
DOCUMENTATION = r'''
---
module: public_cloud_block_storage
short_description: Manage OVH API for public cloud volume.
description:... | [
"ansible.module_utils.basic.AnsibleModule",
"ansible_collections.synthesio.ovh.plugins.module_utils.ovh.ovh_argument_spec",
"ansible_collections.synthesio.ovh.plugins.module_utils.ovh.ovh_api_connect"
] | [((2007, 2026), 'ansible_collections.synthesio.ovh.plugins.module_utils.ovh.ovh_argument_spec', 'ovh_argument_spec', ([], {}), '()\n', (2024, 2026), False, 'from ansible_collections.synthesio.ovh.plugins.module_utils.ovh import ovh_api_connect, ovh_argument_spec\n'), ((2542, 2608), 'ansible.module_utils.basic.AnsibleMo... |
# prepare for Python 3
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import subprocess
import sys
import os
import re
try:
import benchexec.util as util
import benchexec.result as result
from benchexec.tools.template import BaseTool
except ImportError:
... | [
"symbiotic.benchexec.util.find_executable"
] | [((1036, 1064), 'symbiotic.benchexec.util.find_executable', 'util.find_executable', (['"""ikos"""'], {}), "('ikos')\n", (1056, 1064), True, 'import symbiotic.benchexec.util as util\n')] |
import FreeCAD, Part, Drawing, math, Mesh, importDXF
DOC = FreeCAD.activeDocument()
DOC_NAME = "part_support_laser_cutting"
def clear_doc():
# Clear the active document deleting all the objects
for obj in DOC.Objects:
DOC.removeObject(obj.Name)
def setview():
# Rearrange View
FreeCAD.Gui.S... | [
"Mesh.export",
"FreeCAD.getDocument",
"FreeCAD.newDocument",
"importDXF.export",
"math.sin",
"FreeCAD.Gui.SendMsgToActiveView",
"FreeCAD.setActiveDocument",
"math.cos",
"FreeCAD.Gui.activeDocument",
"FreeCAD.activeDocument",
"Part.show",
"Part.makeCylinder"
] | [((60, 84), 'FreeCAD.activeDocument', 'FreeCAD.activeDocument', ([], {}), '()\n', (82, 84), False, 'import FreeCAD, Part, Drawing, math, Mesh, importDXF\n'), ((766, 818), 'Part.makeCylinder', 'Part.makeCylinder', (['(cote_maximal / 2)', 'hauteur_maximal'], {}), '(cote_maximal / 2, hauteur_maximal)\n', (783, 818), False... |
import unittest
from riftlib import const
from riftlib.chart import Chart
from riftlib.datetime import Datetime
from riftlib.geopos import GeoPos
class ChartTests(unittest.TestCase):
def setUp(self):
self.date = Datetime('2015/03/13', '17:00', '+00:00')
self.pos = GeoPos('38n32', '8w54')
de... | [
"riftlib.datetime.Datetime",
"riftlib.chart.Chart",
"riftlib.geopos.GeoPos"
] | [((228, 269), 'riftlib.datetime.Datetime', 'Datetime', (['"""2015/03/13"""', '"""17:00"""', '"""+00:00"""'], {}), "('2015/03/13', '17:00', '+00:00')\n", (236, 269), False, 'from riftlib.datetime import Datetime\n'), ((289, 312), 'riftlib.geopos.GeoPos', 'GeoPos', (['"""38n32"""', '"""8w54"""'], {}), "('38n32', '8w54')\... |
from django.http import HttpResponse
from .dev_info import bonafides
def index(request):
from django.contrib.auth.models import User
from main.models import Bonafide, Student
from django.http import HttpResponse
import datetime
for idd, username, reason, other, year, branch1, branch2, gender, prin... | [
"django.http.HttpResponse",
"django.contrib.auth.models.User.objects.get",
"datetime.datetime.strptime",
"main.models.Student.objects.get",
"main.models.Bonafide.objects.create"
] | [((928, 948), 'django.http.HttpResponse', 'HttpResponse', (['"""Done"""'], {}), "('Done')\n", (940, 948), False, 'from django.http import HttpResponse\n'), ((422, 457), 'django.contrib.auth.models.User.objects.get', 'User.objects.get', ([], {'username': 'username'}), '(username=username)\n', (438, 457), False, 'from dj... |
#!/usr/bin/env python3
import argparse
import os
import logging
import csv
import bioapps as bio
def readData(filename):
''' Helper function to read files
Args:
filename : Name of file to read
Returns
stripped lines from the file
'''
if os.path.exists(filename):
try:
with op... | [
"bioapps.BamutilPerBaseCoverage",
"logging.error",
"bioapps.RgMergeSort",
"argparse.ArgumentParser",
"logging.basicConfig",
"csv.DictReader",
"bioapps.PlatypusGerm",
"os.path.exists",
"bioapps.ConcatVcf",
"bioapps.SamtoolsFlagstat",
"bioapps.IndexBam",
"bioapps.PicardMarkDuplicates"
] | [((267, 291), 'os.path.exists', 'os.path.exists', (['filename'], {}), '(filename)\n', (281, 291), False, 'import os\n'), ((3445, 3596), 'bioapps.RgMergeSort', 'bio.RgMergeSort', (["sample['ID']", "sample['dir']"], {'inputs': 'RGalnBams', 'outputs': '([alnSampleContigBamFile, alnSampleBamLog] + alnSampleContigBams)', 'm... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Implement diferent methods to build a binomial tree
@author: ucaiado
Created on 06/20/2016
"""
# import libraries
from collections import defaultdict
'''
Begin help functions
'''
class DIFFERENT_SOURCES_ERROR(Exception):
'''
DIFFERENT_SOURCES_ERROR is raised ... | [
"collections.defaultdict"
] | [((3954, 3971), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (3965, 3971), False, 'from collections import defaultdict\n'), ((3995, 4012), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (4006, 4012), False, 'from collections import defaultdict\n'), ((7007, 7024), 'collect... |
import pyblish.api
class ExtractMayaShare(pyblish.api.InstancePlugin):
"""Extract as Maya Ascii"""
label = "Extract MayaShare (ma)"
order = pyblish.api.ExtractorOrder
hosts = ["maya"]
families = ["reveries.mayashare"]
def process(self, instance):
from maya import cmds
from a... | [
"avalon.maya.maintained_selection",
"maya.cmds.file",
"reveries.utils.stage_dir",
"maya.cmds.select"
] | [((396, 413), 'reveries.utils.stage_dir', 'utils.stage_dir', ([], {}), '()\n', (411, 413), False, 'from reveries import utils\n'), ((798, 825), 'avalon.maya.maintained_selection', 'maya.maintained_selection', ([], {}), '()\n', (823, 825), False, 'from avalon import maya\n'), ((1008, 1044), 'maya.cmds.select', 'cmds.sel... |
"""empty message
Revision ID: 5d5340d8c969
Revises:
Create Date: 2021-06-17 11:12:46.834659
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "5d5340d8c969"
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto gener... | [
"alembic.op.drop_table",
"sqlalchemy.DateTime",
"sqlalchemy.PrimaryKeyConstraint",
"sqlalchemy.Text",
"sqlalchemy.Boolean",
"sqlalchemy.UniqueConstraint",
"sqlalchemy.ForeignKeyConstraint",
"sqlalchemy.String",
"sqlalchemy.Integer"
] | [((5892, 5913), 'alembic.op.drop_table', 'op.drop_table', (['"""tags"""'], {}), "('tags')\n", (5905, 5913), False, 'from alembic import op\n'), ((5918, 5942), 'alembic.op.drop_table', 'op.drop_table', (['"""comment"""'], {}), "('comment')\n", (5931, 5942), False, 'from alembic import op\n'), ((5947, 5968), 'alembic.op.... |
from django.urls import path
from .views import (
tasks_list_view)
app_name = 'tasks'
urlpatterns = [
path('', tasks_list_view, name='tasks_list_view')
] | [
"django.urls.path"
] | [((111, 160), 'django.urls.path', 'path', (['""""""', 'tasks_list_view'], {'name': '"""tasks_list_view"""'}), "('', tasks_list_view, name='tasks_list_view')\n", (115, 160), False, 'from django.urls import path\n')] |
import os
import sys
import logging
def root():
"""Returns beluga installation path."""
return os.path.dirname(__file__)
def init_logging(logging_level, display_level, logfile):
"""Initializes the logging system"""
# Define custom formatter class that formats messages based on level
# Ref: http:... | [
"logging.Formatter.format",
"logging.FileHandler",
"os.path.dirname",
"logging.StreamHandler",
"logging.Formatter",
"logging.PercentStyle",
"logging.getLogger"
] | [((105, 130), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (120, 130), False, 'import os\n'), ((1325, 1344), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (1342, 1344), False, 'import logging\n'), ((1431, 1459), 'logging.FileHandler', 'logging.FileHandler', (['logfile'], {}), ... |
from behave import *
import subprocess
@given('we launch eap proxy')
def step_impl(context):
cmd = 'python2 scripts/eap_proxy.py'
pipes = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
std_out, std_err = pipes.communicate()
context.std_out = std_out
context.std_er... | [
"subprocess.Popen"
] | [((147, 233), 'subprocess.Popen', 'subprocess.Popen', (['cmd'], {'stdout': 'subprocess.PIPE', 'stderr': 'subprocess.PIPE', 'shell': '(True)'}), '(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell\n =True)\n', (163, 233), False, 'import subprocess\n')] |
from __future__ import print_function
import unittest
import numpy as np
from openmdao.api import Problem, IndepVarComp, Group
from openmdao.utils.assert_utils import assert_rel_error, assert_check_partials
from CADRE.battery_dymos import BatterySOCComp
class TestBatteryDymos(unittest.TestCase):
@classmethod
... | [
"openmdao.api.IndepVarComp",
"numpy.set_printoptions",
"CADRE.battery_dymos.BatterySOCComp",
"openmdao.api.Group",
"numpy.ones",
"openmdao.utils.assert_utils.assert_check_partials",
"numpy.random.rand",
"numpy.all"
] | [((1013, 1031), 'numpy.random.rand', 'np.random.rand', (['nn'], {}), '(nn)\n', (1027, 1031), True, 'import numpy as np\n'), ((1182, 1217), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'linewidth': '(1024)'}), '(linewidth=1024)\n', (1201, 1217), True, 'import numpy as np\n'), ((1275, 1301), 'openmdao.utils.ass... |
import wx
import wx.grid as gridlib
import wx.lib.agw.floatspin as FS
import os
import re
import sys
import SeriesModel
import Utils
class Options(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent)
#--------------------------------------------------------------------------
box = wx.StaticB... | [
"wx.Panel.__init__",
"wx.BoxSizer",
"wx.FlexGridSizer",
"wx.StaticText",
"wx.Frame.__init__",
"wx.App",
"wx.StaticBoxSizer"
] | [((1608, 1621), 'wx.App', 'wx.App', (['(False)'], {}), '(False)\n', (1614, 1621), False, 'import wx\n'), ((191, 222), 'wx.Panel.__init__', 'wx.Panel.__init__', (['self', 'parent'], {}), '(self, parent)\n', (208, 222), False, 'import wx\n'), ((367, 402), 'wx.StaticBoxSizer', 'wx.StaticBoxSizer', (['box', 'wx.VERTICAL'],... |
# This file is used for generating csv file that is used in training 3D face swap model.
# Written by <NAME>
# 2017.12.25
import os
import sys
#sourcefile = "Desktop/DNA/images/0055.png"
#pathname = "Desktop/DNA/liangjian_test_select/"
sourcefile = sys.argv[1]
pathname = sys.argv[2]
csvname = sys.argv[3]
... | [
"os.listdir"
] | [((360, 380), 'os.listdir', 'os.listdir', (['pathname'], {}), '(pathname)\n', (370, 380), False, 'import os\n')] |
from configparser import ConfigParser
def get_config():
config = ConfigParser()
config.read("config.ini")
return config['claimrank'] | [
"configparser.ConfigParser"
] | [((70, 84), 'configparser.ConfigParser', 'ConfigParser', ([], {}), '()\n', (82, 84), False, 'from configparser import ConfigParser\n')] |
import os
import sys
import unittest
sys.path.append(os.path.join(os.path.dirname(__file__), "../emmer"))
from conversation_table import ConversationTable
class StubConversation(object):
pass
class TestConversationTable(unittest.TestCase):
def test_add_get(self):
table = ConversationTable()
... | [
"unittest.main",
"os.path.dirname",
"conversation_table.ConversationTable"
] | [((2167, 2182), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2180, 2182), False, 'import unittest\n'), ((66, 91), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (81, 91), False, 'import os\n'), ((293, 312), 'conversation_table.ConversationTable', 'ConversationTable', ([], {}), '()\n',... |
from django.contrib import admin
from user import models
admin.site.register(models.User)
| [
"django.contrib.admin.site.register"
] | [((59, 91), 'django.contrib.admin.site.register', 'admin.site.register', (['models.User'], {}), '(models.User)\n', (78, 91), False, 'from django.contrib import admin\n')] |
""" This module computes alignment solutions between all "a priori" solutions
for a dataset and GAIA.
"""
import pytest
import numpy as np
from drizzlepac.haputils import testutils
from ..resources import BaseACS, BaseWFC3
def compare_apriori(dataset):
"""This test will perform fits between ALL a priori s... | [
"pytest.mark.parametrize",
"numpy.allclose",
"numpy.sqrt",
"drizzlepac.haputils.testutils.compare_wcs_alignment"
] | [((925, 965), 'drizzlepac.haputils.testutils.compare_wcs_alignment', 'testutils.compare_wcs_alignment', (['dataset'], {}), '(dataset)\n', (956, 965), False, 'from drizzlepac.haputils import testutils\n'), ((1506, 1584), 'numpy.sqrt', 'np.sqrt', (["(pipeline_results['offset_x'] ** 2 + pipeline_results['offset_y'] ** 2)"... |
# Original by https://github.com/RozeFound, modified by Madis0
from pathlib import Path, PurePosixPath
import pkg_resources as dist
try: dist.require(['tomli']) # python -m pip install tomli
except dist.DistributionNotFound as Error:
exit(Error.report() + '\nThe following dependency is missing: {}"'.form... | [
"zipfile.ZipFile",
"pkg_resources.require",
"tomli.load",
"json.dumps",
"pathlib.PurePosixPath",
"pathlib.Path",
"os.path.expanduser"
] | [((146, 169), 'pkg_resources.require', 'dist.require', (["['tomli']"], {}), "(['tomli'])\n", (158, 169), True, 'import pkg_resources as dist\n'), ((3137, 3160), 'os.path.expanduser', 'os.path.expanduser', (['"""~"""'], {}), "('~')\n", (3155, 3160), False, 'import os\n'), ((3332, 3359), 'pathlib.PurePosixPath', 'PurePos... |
"""
Filter kernels (Szeliski 3.2)
"""
import numpy as np
KERNEL_BILINEAR = 1.0/16 * np.array(((1, 2, 1),
(2, 4, 2),
(1, 2, 1)))
KERNEL_GAUSSIAN = 1.0/256 * np.array(((1, 4, 6, 4, 1),
(4, 16, 24, 16, 4),
... | [
"numpy.arange",
"numpy.array",
"numpy.exp"
] | [((86, 129), 'numpy.array', 'np.array', (['((1, 2, 1), (2, 4, 2), (1, 2, 1))'], {}), '(((1, 2, 1), (2, 4, 2), (1, 2, 1)))\n', (94, 129), True, 'import numpy as np\n'), ((231, 340), 'numpy.array', 'np.array', (['((1, 4, 6, 4, 1), (4, 16, 24, 16, 4), (6, 24, 36, 24, 6), (4, 16, 24, 16, 4\n ), (1, 4, 6, 4, 1))'], {}), ... |
# Generated by Django 3.1.2 on 2020-10-25 18:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('awwards', '0002_location_project_tags'),
]
operations = [
migrations.AddField(
model_name='profile',
name='contact',... | [
"django.db.models.IntegerField"
] | [((339, 369), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'default': '(0)'}), '(default=0)\n', (358, 369), False, 'from django.db import migrations, models\n')] |
import autograd.numpy as np
from autograd import grad
from sklearn.base import BaseEstimator
from scipy.optimize import minimize
def huber(x,h):
"""
Huber loss
"""
assert 0 < h and h < 1
condlist = [x < -h, np.abs(x) <= h, x > h]
choicelist = [0.0, (h+x)**2/(4*h), x]
return np.select(co... | [
"autograd.numpy.sum",
"scipy.optimize.minimize",
"autograd.numpy.dot",
"autograd.numpy.logical_and",
"autograd.numpy.select",
"autograd.numpy.array",
"autograd.grad",
"autograd.numpy.ones",
"autograd.numpy.dtype",
"autograd.numpy.zeros",
"autograd.numpy.abs",
"autograd.numpy.all"
] | [((308, 339), 'autograd.numpy.select', 'np.select', (['condlist', 'choicelist'], {}), '(condlist, choicelist)\n', (317, 339), True, 'import autograd.numpy as np\n'), ((2253, 2288), 'autograd.numpy.dot', 'np.dot', (['smoothed_pair_diffs', 'self.w'], {}), '(smoothed_pair_diffs, self.w)\n', (2259, 2288), True, 'import aut... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 5 13:26:12 2019
@author: doctor
"""
import pandas as pd
import sqlalchemy as sql
import os
import sys
sys.path.append(os.getcwd())
con_st = 'mysql://root:-+@127.0.0.1/test'
sql_engine = sql.create_engine(con_st)
df = pd.read_csv('osos.csv')
df =... | [
"elasticsearch.Elasticsearch",
"pandas.read_csv",
"os.getcwd",
"source.airflow.dags.spyder.custom_es.Query",
"espandas.Espandas",
"pandas.read_sql_query",
"sqlalchemy.create_engine",
"source.airflow.dags.spyder.custom_es.Main"
] | [((259, 284), 'sqlalchemy.create_engine', 'sql.create_engine', (['con_st'], {}), '(con_st)\n', (276, 284), True, 'import sqlalchemy as sql\n'), ((292, 315), 'pandas.read_csv', 'pd.read_csv', (['"""osos.csv"""'], {}), "('osos.csv')\n", (303, 315), True, 'import pandas as pd\n'), ((626, 658), 'pandas.read_sql_query', 'pd... |