code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import os
import csv
import six
import pandas as pd
import numpy as np
from ..core import STReader, SortOrder, find_conversion
from ..core import csv_headers, col_population, pop_na, col_timestamps, col_node_ids
# TODO: Won't work with a non-population column csv file. Update so that if there is no populations then i... | [
"os.makedirs",
"csv.writer",
"pandas.read_csv",
"numpy.isscalar",
"os.path.dirname",
"os.path.exists",
"csv.Sniffer",
"numpy.array"
] | [((536, 557), 'os.path.dirname', 'os.path.dirname', (['path'], {}), '(path)\n', (551, 557), False, 'import os\n'), ((616, 637), 'os.makedirs', 'os.makedirs', (['path_dir'], {}), '(path_dir)\n', (627, 637), False, 'import os\n'), ((1913, 1974), 'pandas.read_csv', 'pd.read_csv', (['path'], {'sep': 'sep', 'header': '(0 if... |
"""
tests.tests_dratf04
~~~~~~~~~~~~~~~~~~~~~~
Test against `Common test suite`_.
.. _`Common test suite`:: https://github.com/json-schema/JSON-Schema-Test-Suite
"""
from jsonspec.validators import load, ValidationError, CompilationError
from jsonspec.reference.providers import SpecProvider, ProxyPro... | [
"os.path.abspath",
"jsonspec.driver.load",
"pathlib.Path",
"jsonspec.reference.providers.SpecProvider",
"jsonspec.validators.load",
"os.path.join",
"logging.getLogger"
] | [((447, 474), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (464, 474), False, 'import logging\n'), ((498, 523), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (513, 523), False, 'import os\n'), ((564, 599), 'os.path.join', 'os.path.join', (['here', '"""suite""... |
"""MIT License
Copyright (c) 2022 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distrib... | [
"cv2.GaussianBlur",
"cv2.cvtColor",
"numpy.empty",
"numpy.ones",
"cv2.LUT",
"cv2.createCLAHE",
"cv2.decomposeProjectionMatrix",
"cv2.StereoSGBM_create"
] | [((1590, 1632), 'cv2.decomposeProjectionMatrix', 'cv2.decomposeProjectionMatrix', (['leftProjMat'], {}), '(leftProjMat)\n', (1619, 1632), False, 'import cv2\n'), ((1677, 1720), 'cv2.decomposeProjectionMatrix', 'cv2.decomposeProjectionMatrix', (['rightProjMat'], {}), '(rightProjMat)\n', (1706, 1720), False, 'import cv2\... |
import unittest
import os
import yaml
from shutil import copytree, copyfile
from elasticsearch import Elasticsearch
from filebeat import BaseTest
INTEGRATION_TESTS = os.environ.get('INTEGRATION_TESTS', False)
class Test(BaseTest):
def init(self):
self.elasticsearch_url = self.get_elasti... | [
"elasticsearch.Elasticsearch",
"unittest.skipIf",
"os.mkdir",
"os.path.isdir",
"os.environ.get",
"shutil.copyfile",
"shutil.copytree",
"os.getenv"
] | [((178, 220), 'os.environ.get', 'os.environ.get', (['"""INTEGRATION_TESTS"""', '(False)'], {}), "('INTEGRATION_TESTS', False)\n", (192, 220), False, 'import os\n'), ((474, 601), 'unittest.skipIf', 'unittest.skipIf', (['(not INTEGRATION_TESTS)', '"""integration tests are disabled, run with INTEGRATION_TESTS=1 to enable ... |
from keras.models import Sequential
from keras.layers import Dense, Reshape, Flatten, Conv2D
from keras.optimizers import SGD
import random
import matplotlib.pyplot as plt
from dqn.dqn import DQN
from tictactoe_env import TicTacToe
def model_constructor():
model = Sequential()
# hidden layer
model.add(Den... | [
"matplotlib.pyplot.show",
"tictactoe_env.TicTacToe",
"random.randint",
"matplotlib.pyplot.legend",
"keras.layers.Dense",
"dqn.dqn.DQN",
"keras.models.Sequential"
] | [((493, 518), 'dqn.dqn.DQN', 'DQN', (['model_constructor', '(9)'], {}), '(model_constructor, 9)\n', (496, 518), False, 'from dqn.dqn import DQN\n'), ((526, 551), 'dqn.dqn.DQN', 'DQN', (['model_constructor', '(9)'], {}), '(model_constructor, 9)\n', (529, 551), False, 'from dqn.dqn import DQN\n'), ((5928, 5940), 'matplot... |
from django.urls import path
from . import views
urlpatterns = [
path('', views.all_supplies, name='supplies'),
path('add/', views.supply_add, name='supply_add'),
path('edit/<int:supply_id>/', views.supply_edit, name='supply_edit'),
path('delete/<int:supply_id>/\
', views.supply_delete, name='s... | [
"django.urls.path"
] | [((70, 115), 'django.urls.path', 'path', (['""""""', 'views.all_supplies'], {'name': '"""supplies"""'}), "('', views.all_supplies, name='supplies')\n", (74, 115), False, 'from django.urls import path\n'), ((121, 170), 'django.urls.path', 'path', (['"""add/"""', 'views.supply_add'], {'name': '"""supply_add"""'}), "('add... |
import libvirt
import re
def CreateVM(UserID, TemplateID, VMName):
# Step1:从Template中获取虚拟机的配置信息
image = GetImageFromTemplate(TemplateID)
cpu = GETCPUFromTemplate(TemplateID)
memory = GetMemoryFromTemplate(TemplateID)
# Step2:获取可用的的服务器
host_list = GetHosts()
target_host = GetBestHostFromHos... | [
"re.search"
] | [((1997, 2016), 're.search', 're.search', (['reg', 'xml'], {}), '(reg, xml)\n', (2006, 2016), False, 'import re\n')] |
# Copyright 2022 Quantapix 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 applicable l... | [
"torch.ones",
"transformers.utils.logging.get_logger",
"torch.nn.functional.softmax",
"torch.einsum",
"torch.arange",
"torch.matmul"
] | [((1192, 1220), 'transformers.utils.logging.get_logger', 'logging.get_logger', (['__name__'], {}), '(__name__)\n', (1210, 1220), False, 'from transformers.utils import logging\n'), ((1801, 1824), 'torch.ones', 'torch.ones', (['s'], {'device': 'd'}), '(s, device=d)\n', (1811, 1824), False, 'import torch\n'), ((8272, 829... |
import graphene
from graphene.types import Field
from graphene_django.types import DjangoObjectType
from graphene_django.forms.mutation import DjangoModelFormMutation
from .forms import IssueForm, ResearchNoteForm, ResearchNoteWrittenForm
from .models import Issue, ResearchNote
class IssueType(DjangoObjectType):
... | [
"graphene.List",
"graphene.types.Field"
] | [((474, 498), 'graphene.List', 'graphene.List', (['IssueType'], {}), '(IssueType)\n', (487, 498), False, 'import graphene\n'), ((520, 551), 'graphene.List', 'graphene.List', (['ResearchNoteType'], {}), '(ResearchNoteType)\n', (533, 551), False, 'import graphene\n'), ((897, 913), 'graphene.types.Field', 'Field', (['Issu... |
# coding: utf-8
import os
import shutil
import pickle
import librosa
import argparse
import pandas as pd
import numpy as np
from glob import glob
from tqdm import tqdm
from PIL import Image
from facenet_pytorch import MTCNN, InceptionResnetV1
import torch
from transformers import BertTokenizer, BertModel
from torch.ut... | [
"os.mkdir",
"pickle.dump",
"argparse.ArgumentParser",
"pandas.read_csv",
"numpy.mean",
"pickle.load",
"numpy.random.normal",
"shutil.rmtree",
"torch.no_grad",
"librosa.feature.mfcc",
"os.path.join",
"numpy.std",
"os.path.exists",
"transformers.BertModel.from_pretrained",
"librosa.feature... | [((10167, 10192), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (10190, 10192), False, 'import argparse\n'), ((1269, 1299), 'os.path.join', 'os.path.join', (['tmp_dir', '"""Faces"""'], {}), "(tmp_dir, 'Faces')\n", (1281, 1299), False, 'import os\n'), ((1308, 1335), 'os.mkdir', 'os.mkdir', (['f... |
from flask import Flask
from flask_login import LoginManager
from flask_restful import Api
from flask_mail import Mail
from data import global_init, create_session, User
from data.user import AnonymousUser
from config import config
from bot import bot_launch
from threading import Thread
import logging
import ... | [
"data.global_init",
"flask_restful.Api",
"threading.Thread",
"flask.Flask",
"flask_mail.Mail",
"os.environ.get",
"logging.info",
"data.create_session",
"config.config.setup",
"flask_login.LoginManager"
] | [((326, 340), 'config.config.setup', 'config.setup', ([], {}), '()\n', (338, 340), False, 'from config import config\n'), ((342, 355), 'data.global_init', 'global_init', ([], {}), '()\n', (353, 355), False, 'from data import global_init, create_session, User\n'), ((365, 416), 'flask.Flask', 'Flask', (['__name__'], {'st... |
# Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
"official.vision.beta.modeling.decoders.factory.register_decoder_builder",
"official.vision.beta.projects.yolo.modeling.layers.nn_blocks.PathAggregationBlock",
"tensorflow.keras.layers.Input"
] | [((21313, 21361), 'official.vision.beta.modeling.decoders.factory.register_decoder_builder', 'factory.register_decoder_builder', (['"""yolo_decoder"""'], {}), "('yolo_decoder')\n", (21345, 21361), False, 'from official.vision.beta.modeling.decoders import factory\n'), ((20280, 20318), 'tensorflow.keras.layers.Input', '... |
#!/usr/bin/python
# Copyright 2017-present Open Networking Foundation
#
# 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 ap... | [
"os.mkdir",
"django.setup",
"argparse.ArgumentParser",
"os.path.isfile",
"xosconfig.Config",
"yaml.safe_load",
"shutil.rmtree",
"os.path.join",
"sys.path.append",
"os.path.abspath",
"os.path.exists",
"shutil.copyfile",
"xosgenx.generator.XOSProcessor.process",
"xosconfig.Config.init",
"o... | [((9736, 9789), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""XOS Migrations"""'}), "(description='XOS Migrations')\n", (9759, 9789), False, 'import argparse\n'), ((1352, 1371), 'os.path.isabs', 'os.path.isabs', (['dir_'], {}), '(dir_)\n', (1365, 1371), False, 'import os\n'), ((2706, 27... |
#! /usr/bin/env python
"""Generate tables from Rainbow's experimental results."""
import csv
import json
import logging
import os
import re
from typing import Any, List, Optional, Tuple
import click
from sklearn import metrics
from rainbow import datasets, utils
logger = logging.getLogger(__name__)
# constants
... | [
"rainbow.utils.configure_logging",
"re.match",
"click.command",
"click.Path",
"csv.DictWriter",
"os.path.join",
"os.listdir",
"logging.getLogger",
"re.compile"
] | [((278, 305), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (295, 305), False, 'import logging\n'), ((20597, 20612), 'click.command', 'click.command', ([], {}), '()\n', (20610, 20612), False, 'import click\n'), ((15890, 15962), 're.compile', 're.compile', (['"""(?P<task>[a-z]*(?:_\\\\d+)... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 18 18:05:40 2018
Dataset Object
CHECK MAX DISBALANCE OPN REPLICATION FOR MULTICLASS
@author: ereyes
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
class Datase... | [
"numpy.random.shuffle",
"numpy.concatenate",
"numpy.max",
"numpy.where",
"numpy.array",
"numpy.arange",
"numpy.min",
"numpy.unique"
] | [((2965, 3000), 'numpy.arange', 'np.arange', (['self.data_array.shape[0]'], {}), '(self.data_array.shape[0])\n', (2974, 3000), True, 'import numpy as np\n'), ((3003, 3025), 'numpy.random.shuffle', 'np.random.shuffle', (['idx'], {}), '(idx)\n', (3020, 3025), True, 'import numpy as np\n'), ((4385, 4411), 'numpy.unique', ... |
# -*- coding: utf-8 -*-
'''
This module is the core module, creating the tkInter GUI and "placing" the orders.
The order_engine module handles the orders and calculating the PNLs, returning those values here.
Lots to do! Need to clean all of this up, need to employ better code practice.
Will eventually add separate... | [
"tkinter.StringVar",
"order_engine.get_account_value",
"tkinter.Button",
"tkinter.Entry",
"tkinter.Listbox",
"tkinter.messagebox.showinfo",
"tkinter.font.Font",
"trade_exporting.read_all",
"tkinter.Radiobutton",
"time.strftime",
"selenium.webdriver.Chrome",
"order_engine.get_position",
"loca... | [((921, 982), 'locale.setlocale', 'locale.setlocale', (['locale.LC_ALL', '"""English_United States.1252"""'], {}), "(locale.LC_ALL, 'English_United States.1252')\n", (937, 982), False, 'import locale\n'), ((16992, 16999), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (16997, 16999), True, 'import tkinter as tk\n'), ((1387, ... |
#!/usr/bin/env python
# -*- coding: utf-8
# Copyright 2017-2019 The FIAAS Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... | [
"k8s.models.ingress.IngressBackend",
"k8s.models.ingress.HTTPIngressRuleValue",
"hashlib.sha1",
"k8s.models.ingress.IngressTLS",
"k8s.models.ingress.Ingress.delete",
"k8s.models.ingress.IngressRule",
"k8s.models.ingress.Ingress.get_or_create",
"k8s.models.ingress.IngressSpec",
"k8s.models.common.Obj... | [((1075, 1102), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1092, 1102), False, 'import logging\n'), ((2016, 2060), 'fiaas_deploy_daemon.tools.merge_dicts', 'merge_dicts', (['app_spec.labels.ingress', 'labels'], {}), '(app_spec.labels.ingress, labels)\n', (2027, 2060), False, 'from fi... |
import pytest
from app.authentication import get_token_from_headers, get_allowed_tokens_from_config
def test_get_token_from_headers():
yield check_token, {'Authorization': 'Bearer foo-bar'}, 'foo-bar'
yield check_token, {'Authorization': 'Bearer bar-foo'}, 'bar-foo'
yield check_token, {'Authorization': '... | [
"pytest.mark.parametrize",
"app.authentication.get_token_from_headers",
"app.authentication.get_allowed_tokens_from_config"
] | [((695, 847), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""config,tokens"""', "[({'DM_API_AUTH_TOKENS': 'foo:bar'}, ['foo', 'bar']), ({\n 'DM_API_AUTH_TOKENS': 'bar'}, ['bar']), ({}, [])]"], {}), "('config,tokens', [({'DM_API_AUTH_TOKENS': 'foo:bar'\n }, ['foo', 'bar']), ({'DM_API_AUTH_TOKENS': 'ba... |
# -*- coding: utf-8 -*-
"""Tests for the executor_vline."""
# Third party imports
import pytest
from qtpy.QtCore import Qt
from spyder.config.manager import CONF
# Local imports
from spyder_okvim.spyder.config import CONF_SECTION
from spyder_okvim.utils.vim_status import VimState
@pytest.mark.parametrize(
"text,... | [
"pytest.mark.parametrize",
"spyder.config.manager.CONF.set"
] | [((285, 1055), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""text, cmd_list, cursor_pos, sel_pos"""', '[(\'import numpy as np\', [\'V\'], 0, [0, 18]), (\'import numpy as np\', [\'V\',\n \'l\', \'h\'], 0, [0, 18]), (\'import numpy as np\', [\'V\', \'5l\'], 5, [0, 18]),\n (\'import numpy as np\', [\'5... |
from typing import Optional, List
from pydantic import Field, SecretStr, validator
from pystratis.api import Model
from pystratis.core import Outpoint, Recipient
from pystratis.core.types import Address, Money
# noinspection PyUnresolvedReferences
class BuildTransactionRequest(Model):
"""A request model for the s... | [
"pydantic.Field",
"pydantic.validator",
"pystratis.core.types.Money"
] | [((1646, 1670), 'pydantic.Field', 'Field', ([], {'alias': '"""feeAmount"""'}), "(alias='feeAmount')\n", (1651, 1670), False, 'from pydantic import Field, SecretStr, validator\n'), ((1739, 1788), 'pydantic.Field', 'Field', ([], {'default': '(False)', 'alias': '"""segwitChangeAddress"""'}), "(default=False, alias='segwit... |
import networkx as nx
import matplotlib.pyplot as plt
import pylab
import pickle
import numpy as np
import common
def draw_transition_table(transition_table, cluster_centers, meanscreen, tsne ,color, black_edges=None, red_edges=None, title=None):
G = nx.DiGraph()
edge_colors = []
if red_edges is not None... | [
"numpy.argmax",
"matplotlib.pyplot.axes",
"numpy.ones",
"numpy.isnan",
"matplotlib.pyplot.figure",
"networkx.draw_networkx_labels",
"networkx.draw_networkx_edge_labels",
"numpy.round",
"matplotlib.pyplot.draw",
"common.load_hdf5",
"matplotlib.pyplot.show",
"numpy.ones_like",
"matplotlib.pypl... | [((257, 269), 'networkx.DiGraph', 'nx.DiGraph', ([], {}), '()\n', (267, 269), True, 'import networkx as nx\n'), ((1258, 1353), 'networkx.draw_networkx_edge_labels', 'nx.draw_networkx_edge_labels', (['G', 'pos'], {'edge_labels': 'edge_labels', 'label_pos': '(0.65)', 'font_size': '(9)'}), '(G, pos, edge_labels=edge_label... |
import json
import os
import sys
if len(sys.argv) != 2:
sys.exit("invalid args")
def loadTemplate():
with open("template.hpp", "r") as file:
return file.read()
def loadBlocks():
with open("blocks.json", "r") as file:
data = file.read()
return json.loads(data)
def constantNameFromBlockName(name):
return "B... | [
"os.path.join",
"os.makedirs",
"sys.exit",
"json.loads"
] | [((733, 771), 'os.path.join', 'os.path.join', (['sys.argv[1]', '"""generated"""'], {}), "(sys.argv[1], 'generated')\n", (745, 771), False, 'import os\n'), ((772, 813), 'os.makedirs', 'os.makedirs', (['outputDirPath'], {'exist_ok': '(True)'}), '(outputDirPath, exist_ok=True)\n', (783, 813), False, 'import os\n'), ((832,... |
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY ... | [
"megengine.core.tensor.dtype.get_scale",
"megengine.quantization.quantize.quantize_qat",
"megengine.tensor",
"numpy.float32",
"numpy.ones",
"megengine.core.tensor.dtype.get_zero_point",
"megengine.core.tensor.dtype.qint8",
"test.utils.LinearOpr",
"megengine.core.tensor.dtype.quint8",
"megengine.mo... | [((1033, 1050), 'megengine.quantization.quantize.quantize_qat', 'quantize_qat', (['net'], {}), '(net)\n', (1045, 1050), False, 'from megengine.quantization.quantize import quantize_qat\n'), ((2023, 2034), 'test.utils.LinearOpr', 'LinearOpr', ([], {}), '()\n', (2032, 2034), False, 'from test.utils import LinearOpr\n'), ... |
import math
from itertools import groupby, chain
from operator import itemgetter
from aocd import get_data
def simplify(a, b):
if b == 0:
return (-1, 0) if a < 0 else (1, 0)
elif a == 0:
return (0, -1) if b < 0 else (0, 1)
gcd = math.gcd(a, b)
return a // gcd, b // gcd
def part1(a):... | [
"math.atan2",
"operator.itemgetter",
"aocd.get_data",
"math.gcd"
] | [((260, 274), 'math.gcd', 'math.gcd', (['a', 'b'], {}), '(a, b)\n', (268, 274), False, 'import math\n'), ((1243, 1270), 'aocd.get_data', 'get_data', ([], {'day': '(10)', 'year': '(2019)'}), '(day=10, year=2019)\n', (1251, 1270), False, 'from aocd import get_data\n'), ((470, 486), 'math.atan2', 'math.atan2', (['y', 'x']... |
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2020, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | [
"q2_dada2.DADA2StatsFormat"
] | [((655, 673), 'q2_dada2.DADA2StatsFormat', 'DADA2StatsFormat', ([], {}), '()\n', (671, 673), False, 'from q2_dada2 import DADA2StatsFormat\n')] |
"""
The MIT License (MIT)
Copyright (c) 2021 xXSergeyXx
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, p... | [
"typing.TypeVar",
"typing_extensions.ParamSpec",
"re.compile"
] | [((1886, 1898), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (1893, 1898), False, 'from typing import Any, Dict, Generic, List, Optional, TYPE_CHECKING, TypeVar, Union\n'), ((1906, 1957), 'typing.TypeVar', 'TypeVar', (['"""BotT"""'], {'bound': '"""Union[Bot, AutoShardedBot]"""'}), "('BotT', bound='Union[B... |
"""
Use this script to create JSON-Line description files that can be used to
train deep-speech models through this library.
This works with data directories that are organized like LibriSpeech:
data_directory/group/speaker/[file_id1.wav, file_id2.wav, ...,
speaker.trans.txt]
Where speake... | [
"wave.open",
"argparse.ArgumentParser",
"json.dumps",
"os.path.isfile",
"os.path.join",
"os.listdir"
] | [((600, 626), 'os.listdir', 'os.listdir', (['data_directory'], {}), '(data_directory)\n', (610, 626), False, 'import os\n'), ((2533, 2558), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2556, 2558), False, 'import argparse\n'), ((706, 741), 'os.path.join', 'os.path.join', (['data_directory', ... |
import json
from api.models import db_session, engine, BaseModel, User, Semester, Course, CourseDependency, InstructorPool, StudentDemand, StudentRecord
user_roles = {
'5': 'student',
'1': 'TA',
'3': 'professor',
'4': 'administrator'
}
# Students
students = {}
for (student, record) in db_session.query... | [
"api.models.db_session.query",
"json.dumps"
] | [((613, 639), 'api.models.db_session.query', 'db_session.query', (['Semester'], {}), '(Semester)\n', (629, 639), False, 'from api.models import db_session, engine, BaseModel, User, Semester, Course, CourseDependency, InstructorPool, StudentDemand, StudentRecord\n'), ((761, 785), 'api.models.db_session.query', 'db_sessi... |
# Copyright 2013 Metacloud
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | [
"copy.deepcopy"
] | [((844, 864), 'copy.deepcopy', 'copy.deepcopy', (['value'], {}), '(value)\n', (857, 864), False, 'import copy\n')] |
# System
import os
import sys
from pprint import pprint as pp
import argparse
import logging
import multiprocessing as mp
from functools import partial
from time import time
import shutil
# Externals
import yaml
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
from torch_scatter import scatter... | [
"numpy.load",
"numpy.empty",
"GraphLearning.src.trainers.get_trainer",
"shutil.rmtree",
"os.path.join",
"numpy.unique",
"sklearn.cluster.DBSCAN",
"pandas.DataFrame",
"os.path.exists",
"numpy.append",
"scipy.sparse.dok_matrix",
"Seeding.src.utils.data_utils.load_summaries",
"functools.partial... | [((579, 604), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (602, 604), False, 'import torch\n'), ((755, 793), 'numpy.array', 'np.array', (['[g.i for g in graph_dataset]'], {}), '([g.i for g in graph_dataset])\n', (763, 793), True, 'import numpy as np\n'), ((809, 827), 'numpy.array', 'np.array... |
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from .common import *
class ChannelAttention(nn.Module):
def __init__(self, in_planes, ratio=8):
super(ChannelAttention, self).__init__()
self.avg_pool = nn.AdaptiveAvgPool2d(1)
self.max_pool = nn.AdaptiveMaxPo... | [
"torch.mean",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.PReLU",
"torch.nn.ReLU",
"torch.nn.ConvTranspose2d",
"torch.nn.Sequential",
"torch.nn.AdaptiveMaxPool2d",
"torch.nn.Conv2d",
"torch.cat",
"torch.nn.Upsample",
"torch.max",
"torch.nn.Softmax",
"torch.nn.PixelShuffle",
"torch.nn.AvgPool2d... | [((256, 279), 'torch.nn.AdaptiveAvgPool2d', 'nn.AdaptiveAvgPool2d', (['(1)'], {}), '(1)\n', (276, 279), True, 'import torch.nn as nn\n'), ((304, 327), 'torch.nn.AdaptiveMaxPool2d', 'nn.AdaptiveMaxPool2d', (['(1)'], {}), '(1)\n', (324, 327), True, 'import torch.nn as nn\n'), ((371, 426), 'torch.nn.Conv2d', 'nn.Conv2d', ... |
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
from django.db import models
from django.utils.translation import ugettext_lazy as _
from common.models import IndexedTimeStampedModel
from .managers import UserManager
class User(AbstractBaseUser, PermissionsMixin, IndexedTimeStampedModel):
... | [
"django.db.models.CharField",
"django.utils.translation.ugettext_lazy",
"django.db.models.EmailField"
] | [((332, 378), 'django.db.models.EmailField', 'models.EmailField', ([], {'max_length': '(255)', 'unique': '(True)'}), '(max_length=255, unique=True)\n', (349, 378), False, 'from django.db import models\n'), ((394, 439), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)', 'unique': '(True)'}), ... |
# SPDX-License-Identifier: GPL-2.0
#
# Sphinx has deprecated its older logging interface, but the replacement
# only goes back to 1.6. So here's a wrapper layer to keep around for
# as long as we support 1.4.
#
import sphinx
if sphinx.__version__[:3] >= '1.6':
UseLogging = True
from sphinx.util import logging... | [
"sphinx.util.logging.getLogger"
] | [((334, 364), 'sphinx.util.logging.getLogger', 'logging.getLogger', (['"""kerneldoc"""'], {}), "('kerneldoc')\n", (351, 364), False, 'from sphinx.util import logging\n')] |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License
import io
import json
import uuid
from copy import copy
from datetime import timedelta
from enum import Enum, unique
from typing import Union, Callable
import requests
from requests.adapters import HTTPAdapter
from ._version import V... | [
"uuid.uuid4",
"requests.adapters.HTTPAdapter",
"requests.Session",
"copy.copy",
"json.dumps",
"datetime.timedelta"
] | [((21924, 21954), 'datetime.timedelta', 'timedelta', ([], {'hours': '(1)', 'seconds': '(30)'}), '(hours=1, seconds=30)\n', (21933, 21954), False, 'from datetime import timedelta\n'), ((21985, 22017), 'datetime.timedelta', 'timedelta', ([], {'minutes': '(4)', 'seconds': '(30)'}), '(minutes=4, seconds=30)\n', (21994, 220... |
import time
from typing import TYPE_CHECKING, List, Optional, Union, Dict, Any
from decimal import Decimal
import attr
from .json_db import StoredObject
from .i18n import _
from .util import age, InvoiceError
#from .lnaddr import lndecode, LnAddr
from . import constants
from .bitcoin import COIN, TOTAL_COIN_SUPPLY_LI... | [
"attr.validators.instance_of",
"attr.ib",
"decimal.Decimal"
] | [((2591, 2622), 'attr.ib', 'attr.ib', ([], {'type': 'int', 'kw_only': '(True)'}), '(type=int, kw_only=True)\n', (2598, 2622), False, 'import attr\n'), ((3534, 3565), 'attr.ib', 'attr.ib', ([], {'type': 'str', 'kw_only': '(True)'}), '(type=str, kw_only=True)\n', (3541, 3565), False, 'import attr\n'), ((3583, 3604), 'att... |
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th... | [
"st2common.models.db.stormbase.EscapedDynamicField",
"st2common.models.db.stormbase.UIDFieldMixin.get_indexes",
"mongoengine.EmailField",
"st2common.models.db.MongoDBAccess",
"mongoengine.StringField"
] | [((2591, 2612), 'st2common.models.db.MongoDBAccess', 'MongoDBAccess', (['PackDB'], {}), '(PackDB)\n', (2604, 2612), False, 'from st2common.models.db import MongoDBAccess\n'), ((2636, 2665), 'st2common.models.db.MongoDBAccess', 'MongoDBAccess', (['ConfigSchemaDB'], {}), '(ConfigSchemaDB)\n', (2649, 2665), False, 'from s... |
from evaluation import ResultsEvaluation
if __name__ == "__main__":
dataset = 'dodh'
table = 'base_models'
scorers_folder = "./scorers/{}/".format(dataset)
results_folder = f"./results/{dataset}/{table + '/' if table is not None else ''}"
if dataset == 'dodo':
result_evaluation = ResultsEva... | [
"evaluation.ResultsEvaluation"
] | [((310, 389), 'evaluation.ResultsEvaluation', 'ResultsEvaluation', ([], {'scorers_folder': 'scorers_folder', 'results_folder': 'results_folder'}), '(scorers_folder=scorers_folder, results_folder=results_folder)\n', (327, 389), False, 'from evaluation import ResultsEvaluation\n'), ((481, 732), 'evaluation.ResultsEvaluat... |
# Import required stuff
from cvxpy import *
import numpy as np
import matplotlib.pyplot as plt
# In this problem, we need both y.txt and beta.txt, so read them from input files.
# Please note that the path has to be changed accordingly before running.
with open('/home/akilesh/Desktop/Akilesh_opt/y.txt') as f:
y =... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"numpy.logspace",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.tight_layout"
] | [((865, 888), 'numpy.logspace', 'np.logspace', (['(-2)', '(1)', '(100)'], {}), '(-2, 1, 100)\n', (876, 888), True, 'import numpy as np\n'), ((1869, 1885), 'matplotlib.pyplot.subplot', 'plt.subplot', (['(211)'], {}), '(211)\n', (1880, 1885), True, 'import matplotlib.pyplot as plt\n'), ((1886, 1914), 'matplotlib.pyplot.p... |
#!/usr/bin/env python
import json
import os
import re
import math
import traceback
import urllib.parse as urlparse
from ..common import *
__all__ = ['huaban_download']
site_info = '花瓣 (Huaban)'
LIMIT = 100
class Board:
def __init__(self, title, pins):
self.title = title
self.pins = pins
... | [
"urllib.parse.urljoin",
"json.loads",
"urllib.parse.urlencode",
"re.match",
"os.path.join"
] | [((681, 707), 'urllib.parse.urlencode', 'urlparse.urlencode', (['params'], {}), '(params)\n', (699, 707), True, 'import urllib.parse as urlparse\n'), ((951, 974), 'json.loads', 'json.loads', (['json_string'], {}), '(json_string)\n', (961, 974), False, 'import json\n'), ((1638, 1675), 'os.path.join', 'os.path.join', (['... |
import os
import codecs
import base64
import string
import random
import logging
import argparse
from cryptography.hazmat.primitives import padding
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
KEY_LENGTH = 32
IV_LENGTH = 16
BLOCK... | [
"cryptography.hazmat.primitives.padding.PKCS7",
"random.SystemRandom",
"argparse.ArgumentParser",
"codecs.decode",
"logging.StreamHandler",
"cryptography.hazmat.primitives.ciphers.modes.CBC",
"base64.b64decode",
"cryptography.hazmat.primitives.ciphers.algorithms.AES",
"logging.Formatter",
"os.envi... | [((342, 369), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (359, 369), False, 'import logging\n'), ((410, 433), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (431, 433), False, 'import logging\n'), ((484, 529), 'logging.Formatter', 'logging.Formatter', (['"""%(asct... |
import requests
from ate import response, exception
from tests.base import ApiServerUnittest
class TestResponse(ApiServerUnittest):
def test_parse_response_object_json(self):
url = "http://127.0.0.1:5000/api/users"
resp = requests.get(url)
resp_obj = response.ResponseObject(resp)
p... | [
"requests.post",
"requests.get",
"ate.response.ResponseObject"
] | [((244, 261), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (256, 261), False, 'import requests\n'), ((281, 310), 'ate.response.ResponseObject', 'response.ResponseObject', (['resp'], {}), '(resp)\n', (304, 310), False, 'from ate import response, exception\n'), ((777, 794), 'requests.get', 'requests.get', ([... |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | [
"jinja2.Template",
"bokeh.resources.JSResources",
"bokeh.plotting.figure",
"bokeh.model.Model",
"bokeh.embed.standalone.autoload_static",
"bokeh.embed.standalone.components",
"bokeh.embed.standalone.file_html",
"mock.patch",
"bokeh.document.Document",
"bokeh.embed.standalone._ModelInDocument",
"... | [((1752, 1772), 'bokeh.util.testing.verify_api', 'verify_api', (['bes', 'api'], {}), '(bes, api)\n', (1762, 1772), False, 'from bokeh.util.testing import verify_api\n'), ((1990, 2005), 'bokeh.core.properties.Instance', 'Instance', (['Model'], {}), '(Model)\n', (1998, 2005), False, 'from bokeh.core.properties import Ins... |
# 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... | [
"pandas.DataFrame",
"functools.partial",
"numpy.nanpercentile",
"pandas.NamedAgg",
"flask_babel.gettext",
"geopy.point.Point",
"geohash.encode",
"prophet.Prophet",
"superset.utils.core.TIME_COMPARISION.join",
"pandas.concat",
"logging.getLogger"
] | [((28618, 28785), 'prophet.Prophet', 'Prophet', ([], {'interval_width': 'confidence_interval', 'yearly_seasonality': 'yearly_seasonality', 'weekly_seasonality': 'weekly_seasonality', 'daily_seasonality': 'daily_seasonality'}), '(interval_width=confidence_interval, yearly_seasonality=\n yearly_seasonality, weekly_sea... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Trains a neural network for bird classification.
For usage information, call with --help.
Author: <NAME>
"""
from __future__ import print_function
import sys
import os
import io
from argparse import ArgumentParser
try:
import cPickle as pickle
except ImportErro... | [
"numpy.load",
"config.parse_config_file",
"numpy.sum",
"argparse.ArgumentParser",
"model.cost",
"pickle.dump",
"lasagne.regularization.regularize_network_params",
"lasagne.layers.get_output",
"os.path.join",
"data.run_datafeed",
"model.architecture",
"os.path.dirname",
"os.path.exists",
"n... | [((628, 661), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': 'descr'}), '(description=descr)\n', (642, 661), False, 'from argparse import ArgumentParser\n'), ((3855, 3909), 'data.prepare_datafeed', 'data.prepare_datafeed', (['filelist', 'datadir', '"""train"""', 'cfg'], {}), "(filelist, datadir, 'tra... |
# Copyright 2009 by <NAME>. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
# Importing these functions with leading underscore as not intended for reuse
from Bio._py3k import url... | [
"xml.sax.expatreader.ExpatParser.feed",
"Bio._py3k.urlopen",
"Bio._py3k.urlencode",
"xml.sax.expatreader.ExpatParser.__init__"
] | [((1894, 1916), 'Bio._py3k.urlencode', '_urlencode', (['parameters'], {}), '(parameters)\n', (1904, 1916), True, 'from Bio._py3k import urlencode as _urlencode\n'), ((1995, 2008), 'Bio._py3k.urlopen', '_urlopen', (['url'], {}), '(url)\n', (2003, 2008), True, 'from Bio._py3k import urlopen as _urlopen\n'), ((2427, 2453)... |
#!/usr/bin/env python3
"""
Constants for use during tests
"""
# built-ins
import copy
import secrets
from pathlib import Path
from typing import Dict, List, Union
from xml.etree import ( # nosec (Used only when TYPE_CHECKING) # nosem: python.lang.security.use-defused-xml.use-defused-xml
ElementTree as InsecureEle... | [
"copy.deepcopy",
"secrets.token_hex",
"pathlib.Path",
"yaml.safe_load",
"defusedxml.ElementTree.fromstring"
] | [((999, 1020), 'secrets.token_hex', 'secrets.token_hex', (['(16)'], {}), '(16)\n', (1016, 1020), False, 'import secrets\n'), ((1059, 1080), 'secrets.token_hex', 'secrets.token_hex', (['(64)'], {}), '(64)\n', (1076, 1080), False, 'import secrets\n'), ((1183, 1215), 'copy.deepcopy', 'copy.deepcopy', (['VALID_RESULTS_API'... |
import unittest
import numpy as np
from neurolib.utils.parameterSpace import ParameterSpace
class TestParameterSpace(unittest.TestCase):
def test_parameterspace_init(self):
# init from list
par = ParameterSpace(["a", "b"], [[3], [3]])
# init from dict
par = ParameterSpace({"a": [1... | [
"numpy.zeros",
"neurolib.utils.parameterSpace.ParameterSpace",
"numpy.ones"
] | [((218, 256), 'neurolib.utils.parameterSpace.ParameterSpace', 'ParameterSpace', (["['a', 'b']", '[[3], [3]]'], {}), "(['a', 'b'], [[3], [3]])\n", (232, 256), False, 'from neurolib.utils.parameterSpace import ParameterSpace\n'), ((297, 339), 'neurolib.utils.parameterSpace.ParameterSpace', 'ParameterSpace', (["{'a': [1, ... |
"""Utility functions for classifying and solving
ordinary and partial differential equations.
Contains
========
_preprocess
ode_order
_desolve
"""
from sympy.core.compatibility import set_union
from sympy.core.function import Function, Derivative, AppliedUndef
from sympy.core.relational import Equality, Eq
from sympy... | [
"sympy.core.symbol.Wild"
] | [((3379, 3404), 'sympy.core.symbol.Wild', 'Wild', (['"""a"""'], {'exclude': '[func]'}), "('a', exclude=[func])\n", (3383, 3404), False, 'from sympy.core.symbol import Wild\n')] |
# -*- coding: utf-8 -*-
'''
Support for RFC 2136 dynamic DNS updates.
:depends: - dnspython Python module
:configuration: If you want to use TSIG authentication for the server, there
are a couple of optional configuration parameters made available to
support this (the keyname is only needed if the keyring co... | [
"json.load",
"logging.getLogger"
] | [((741, 768), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (758, 768), False, 'import logging\n'), ((1706, 1719), 'json.load', 'json.load', (['_f'], {}), '(_f)\n', (1715, 1719), False, 'import json\n')] |
import json
import os
import random
from unittest.mock import patch
import cv2
import numpy as np
import pytest
import albumentations as A
import albumentations.augmentations.functional as F
from albumentations.core.serialization import SERIALIZABLE_REGISTRY, shorten_class_name
from albumentations.core.transforms_int... | [
"albumentations.Lambda",
"numpy.random.seed",
"albumentations.Resize",
"albumentations.Flip",
"albumentations.Rotate",
"numpy.random.randint",
"albumentations.TemplateTransform",
"albumentations.load",
"pytest.mark.parametrize",
"albumentations.HorizontalFlip",
"os.path.join",
"albumentations.... | [((1467, 1505), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""p"""', '[0.5, 1]'], {}), "('p', [0.5, 1])\n", (1490, 1505), False, 'import pytest\n'), ((1507, 1550), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""seed"""', 'TEST_SEEDS'], {}), "('seed', TEST_SEEDS)\n", (1530, 1550), False, 'impo... |
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), '..'))
import shutil # NOQA E402
import gui.config as CONFIG # NOQA E402
from gui.window import Window ... | [
"os.mkdir",
"utils.predict_image.predict_image",
"gui.gui_components.get_button",
"gui.gui_components.get_image_label",
"PyQt5.QtWidgets.QFileDialog.getOpenFileName",
"PyQt5.QtWidgets.QApplication",
"shutil.rmtree",
"os.path.join",
"os.path.abspath",
"utils.misc.load_image",
"os.path.exists",
... | [((19461, 19493), 'PyQt5.QtWidgets.QApplication', 'QtWidgets.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (19483, 19493), False, 'from PyQt5 import QtCore, QtWidgets, QtGui\n'), ((19531, 19554), 'PyQt5.QtWidgets.QMainWindow', 'QtWidgets.QMainWindow', ([], {}), '()\n', (19552, 19554), False, 'from PyQt5 import QtC... |
# Natural Language Toolkit: Language Model Unit Tests
#
# Copyright (C) 2001-2020 NLTK Project
# Author: <NAME> <<EMAIL>>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
import unittest
from nltk.lm.preprocessing import padded_everygram_pipeline
class TestPreprocessing(unittest.TestCase):
de... | [
"nltk.lm.preprocessing.padded_everygram_pipeline"
] | [((756, 803), 'nltk.lm.preprocessing.padded_everygram_pipeline', 'padded_everygram_pipeline', (['(2)', "[['a', 'b', 'c']]"], {}), "(2, [['a', 'b', 'c']])\n", (781, 803), False, 'from nltk.lm.preprocessing import padded_everygram_pipeline\n')] |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from layers import *
from data import voc, coco
import os
class SSD(nn.Module):
"""Single Shot Multibox Architecture
The network is composed of a base VGG network followed by the
added multibox conv laye... | [
"torch.nn.ReLU",
"torch.nn.ModuleList",
"torch.load",
"torch.nn.Conv2d",
"torch.nn.BatchNorm2d",
"torch.nn.Softmax",
"os.path.splitext",
"torch.nn.MaxPool2d"
] | [((5234, 5282), 'torch.nn.MaxPool2d', 'nn.MaxPool2d', ([], {'kernel_size': '(3)', 'stride': '(1)', 'padding': '(1)'}), '(kernel_size=3, stride=1, padding=1)\n', (5246, 5282), True, 'import torch.nn as nn\n'), ((5295, 5353), 'torch.nn.Conv2d', 'nn.Conv2d', (['(512)', '(1024)'], {'kernel_size': '(3)', 'padding': '(6)', '... |
# coding: utf-8
import appex
from markdown2 import markdown
import ui
TEMPLATE = '''
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Preview</title>
<style type="text/css">
body {
font-family: helvetica;
font-size: 15px;
margin: 10px;
}
</style>
</head... | [
"markdown2.markdown",
"ui.WebView",
"appex.get_text"
] | [((380, 396), 'appex.get_text', 'appex.get_text', ([], {}), '()\n', (394, 396), False, 'import appex\n'), ((524, 538), 'markdown2.markdown', 'markdown', (['text'], {}), '(text)\n', (532, 538), False, 'from markdown2 import markdown\n'), ((601, 636), 'ui.WebView', 'ui.WebView', ([], {'name': '"""Markdown Preview"""'}), ... |
#!/usr/bin/env python3
"""
usage: paste.py [-h] [FILE ...]
copy each file into place as a column
positional arguments:
FILE a file to copy (default: stdin)
options:
-h, --help show this help message and exit
quirks:
no implementation
unsurprising quirks:
prompts for stdin, like mac bash "grep -R .... | [
"argdoc.format_usage",
"sys.stderr.write",
"sys.exit",
"argdoc.parse_args"
] | [((810, 829), 'argdoc.parse_args', 'argdoc.parse_args', ([], {}), '()\n', (827, 829), False, 'import argdoc\n'), ((944, 995), 'sys.stderr.write', 'sys.stderr.write', (['"""wc.py: error: not implemented\n"""'], {}), "('wc.py: error: not implemented\\n')\n", (960, 995), False, 'import sys\n'), ((1000, 1011), 'sys.exit', ... |
import json
from collections import OrderedDict
from django.conf import settings
from django.forms import Media, widgets
from django.utils.module_loading import import_string
from wagtail.utils.widgets import WidgetWithScript
from wagtail.admin.edit_handlers import RichTextFieldPanel
from wagtail.admin.rich_text.conv... | [
"django.utils.module_loading.import_string",
"wagtail.core.rich_text.features.get_editor_plugin",
"json.dumps",
"wagtail.core.rich_text.features.get_default_features",
"wagtail.admin.rich_text.converters.editor_html.EditorHTMLConverter",
"collections.OrderedDict",
"django.forms.Media"
] | [((5450, 5481), 'django.utils.module_loading.import_string', 'import_string', (["editor['WIDGET']"], {}), "(editor['WIDGET'])\n", (5463, 5481), False, 'from django.utils.module_loading import import_string\n'), ((868, 899), 'django.forms.Media', 'Media', ([], {'js': 'self.js', 'css': 'self.css'}), '(js=self.js, css=sel... |
from time import perf_counter as clock
import subprocess
import random
import numpy
# Constants
STEP = 1000 * 100 # the size of the buffer to fill the table, in rows
SCALE = 0.1 # standard deviation of the noise compared with actual
# values
NI_NTIMES = 1 # The number of queries fo... | [
"numpy.random.seed",
"getopt.getopt",
"cProfile.Profile",
"numpy.histogram",
"numpy.random.randint",
"numpy.arange",
"hotshot.stats.load",
"numpy.random.normal",
"cProfile.close",
"pytables_backend.PyTables_DB",
"pstats.Stats",
"psyco.bind",
"random.seed",
"hotshot.Profile",
"subprocess.... | [((3019, 3038), 'numpy.array', 'numpy.array', (['ltimes'], {}), '(ltimes)\n', (3030, 3038), False, 'import numpy\n'), ((4202, 4244), 'numpy.arange', 'numpy.arange', (['start', 'stop'], {'dtype': '"""float64"""'}), "(start, stop, dtype='float64')\n", (4214, 4244), False, 'import numpy\n'), ((4262, 4302), 'numpy.arange',... |
import numpy as np
import pandas as pd
from tqdm import tqdm
def bootstrap(x, iter=int(1E6), return_samples=False):
"""
Performs a simple bootstrap resampling method on an array of data.
Parameters
----------
x : numpy array
A one-dimensional numpy array containing values you wish to boo... | [
"numpy.percentile",
"numpy.empty",
"pandas.concat",
"pandas.DataFrame"
] | [((1029, 1043), 'numpy.empty', 'np.empty', (['iter'], {}), '(iter)\n', (1037, 1043), True, 'import numpy as np\n'), ((1739, 1762), 'numpy.percentile', 'np.percentile', (['means', 'v'], {}), '(means, v)\n', (1752, 1762), True, 'import numpy as np\n'), ((1989, 2015), 'pandas.concat', 'pd.concat', (['dfs'], {'sort': '(Fal... |
# -*- coding: utf-8 -*-
"""@package Methods.Machine.LamSlotWind.plot_winding
Plot the Lamination's Winding Methods
@date Created on Tue Dec 16 16:39:48 2014
@copyright (C) 2014-2015 EOMYS ENGINEERING.
@author pierre_b
@todo Matrix Zs*Qs for display (cf doc database/articles/electrical machines/
analytical modelling of ... | [
"matplotlib.pyplot.title",
"numpy.meshgrid",
"matplotlib.pyplot.plot",
"pyleecan.Functions.Winding.gen_phase_list.gen_name",
"pyleecan.Functions.Winding.comp_wind_sym.comp_wind_sym",
"matplotlib.lines.Line2D",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.axis",
"pyleecan.Functions.Winding.gen_phas... | [((1670, 1696), 'pyleecan.Functions.Winding.gen_phase_list.gen_color', 'gen_color', (['self.winding.qs'], {}), '(self.winding.qs)\n', (1679, 1696), False, 'from pyleecan.Functions.Winding.gen_phase_list import gen_color, gen_name\n'), ((1711, 1736), 'pyleecan.Functions.Winding.gen_phase_list.gen_name', 'gen_name', (['s... |
# Run unittests with python -m unittest Unittest[.ClassName[.test_func]]
from collections import Counter, defaultdict
import json
import logging
import os
import random
import re
import unittest
from ItemList import item_table
from ItemPool import remove_junk_items, item_groups
from LocationList import location_group... | [
"json.dump",
"json.load",
"LocationList.location_is_viewable",
"os.makedirs",
"ItemList.item_table.items",
"os.path.dirname",
"Settings.get_preset_files",
"logging.getLogger",
"collections.defaultdict",
"Main.main",
"Settings.Settings",
"random.seed",
"os.path.splitext",
"os.path.join",
... | [((526, 558), 'os.path.join', 'os.path.join', (['test_dir', '"""Output"""'], {}), "(test_dir, 'Output')\n", (538, 558), False, 'import os\n'), ((559, 597), 'os.makedirs', 'os.makedirs', (['output_dir'], {'exist_ok': '(True)'}), '(output_dir, exist_ok=True)\n', (570, 597), False, 'import os\n'), ((477, 502), 'os.path.di... |
import random
import os
from django.db import models
from django.db.models.signals import pre_save, post_save
from django.urls import reverse
from django.db.models import Q
from ShoeStore.utils import unique_slug_generator
def get_filename_ext(filepath):
base_name = os.path.basename(filepath)
name, ext = os.... | [
"django.db.models.signals.pre_save.connect",
"django.db.models.TextField",
"random.randint",
"os.path.basename",
"django.db.models.CharField",
"ShoeStore.utils.unique_slug_generator",
"django.db.models.Q",
"django.db.models.SlugField",
"django.db.models.BooleanField",
"django.db.models.ImageField"... | [((3163, 3222), 'django.db.models.signals.pre_save.connect', 'pre_save.connect', (['product_pre_save_receiver'], {'sender': 'Product'}), '(product_pre_save_receiver, sender=Product)\n', (3179, 3222), False, 'from django.db.models.signals import pre_save, post_save\n'), ((274, 300), 'os.path.basename', 'os.path.basename... |
# -*- coding: utf-8 -
#
# 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
... | [
"sys.stdout.write",
"socket.socket",
"bucky2.names.statname",
"time.sleep",
"logging.getLogger",
"pickle.dumps"
] | [((852, 879), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (869, 879), False, 'import logging\n'), ((946, 968), 'sys.stdout.write', 'sys.stdout.write', (['data'], {}), '(data)\n', (962, 968), False, 'import sys\n'), ((2504, 2530), 'bucky2.names.statname', 'names.statname', (['host', 'na... |
#
# 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... | [
"distributed.Client",
"airflow.configuration.conf.get",
"distributed.security.Security",
"airflow.exceptions.AirflowException",
"subprocess.check_call"
] | [((1844, 1870), 'airflow.configuration.conf.get', 'conf.get', (['"""dask"""', '"""tls_ca"""'], {}), "('dask', 'tls_ca')\n", (1852, 1870), False, 'from airflow.configuration import conf\n'), ((1894, 1921), 'airflow.configuration.conf.get', 'conf.get', (['"""dask"""', '"""tls_key"""'], {}), "('dask', 'tls_key')\n", (1902... |
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
#
# Copyright (c) 2014 <NAME>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundati... | [
"TestBase.TestBaseClass"
] | [((4650, 4728), 'TestBase.TestBaseClass', 'TestBaseClass', (['argv[1:]', '"""Test suite for the ns-3 unit test runner"""', '"""test-py"""'], {}), "(argv[1:], 'Test suite for the ns-3 unit test runner', 'test-py')\n", (4663, 4728), False, 'from TestBase import TestBaseClass\n')] |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import json
import platform
import time
import urllib
import urllib2
import xbmc
import xbmcgui
from resources.lib.utils import notice
class AuthException(Exception):
pass
cl... | [
"xbmc.sleep",
"platform.node",
"json.loads",
"resources.lib.utils.notice",
"xbmc.getInfoLabel",
"xbmcgui.DialogProgress",
"urllib2.Request",
"platform.machine",
"time.time",
"time.sleep",
"urllib.urlencode",
"xbmc.executebuiltin"
] | [((612, 636), 'xbmcgui.DialogProgress', 'xbmcgui.DialogProgress', ([], {}), '()\n', (634, 636), False, 'import xbmcgui\n'), ((775, 815), 'xbmc.executebuiltin', 'xbmc.executebuiltin', (['"""Container.Refresh"""'], {}), "('Container.Refresh')\n", (794, 815), False, 'import xbmc\n'), ((1736, 1756), 'json.loads', 'json.loa... |
from collections import Counter, defaultdict
from copy import copy
from datetime import datetime
def process_input(lines):
template = lines[0]
rules = {
line.split('->')[0].strip(): line.split('->')[1].strip() for line in lines[2:]
}
return template, rules
def apply_insertion(template, rules... | [
"collections.defaultdict",
"collections.Counter",
"datetime.datetime.now"
] | [((891, 907), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (902, 907), False, 'from collections import Counter, defaultdict\n'), ((1199, 1231), 'collections.Counter', 'Counter', (['actual_character_counts'], {}), '(actual_character_counts)\n', (1206, 1231), False, 'from collections import Counter... |
from flask import Blueprint, render_template, flash, request, redirect, url_for, abort, jsonify
from flask_login import login_required, current_user
from server.models.properties import Properties, PropertyImgs
from server.models.history import History, HistoryContent
from server.utils.authority_verification import is... | [
"flask.flash",
"server.db.session.delete",
"datetime.datetime.utcnow",
"flask.jsonify",
"flask.url_for",
"server.forms.forms.DeleteForm",
"server.db.session.rollback",
"flask.request.files.getlist",
"flask.abort",
"server.db.session.commit",
"server.models.properties.PropertyImgs.query.get",
"... | [((540, 586), 'flask.Blueprint', 'Blueprint', (['"""administration_property"""', '__name__'], {}), "('administration_property', __name__)\n", (549, 586), False, 'from flask import Blueprint, render_template, flash, request, redirect, url_for, abort, jsonify\n'), ((1060, 1154), 'flask.render_template', 'render_template'... |
# Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot module for keeping control who PM you. """
from telethon.tl.functions.contacts import BlockRequest, Unbloc... | [
"userbot.modules.sql_helper.globals.addgvar",
"userbot.LOGS.info",
"userbot.modules.sql_helper.globals.gvarstatus",
"userbot.LASTMSG.update",
"userbot.events.register",
"userbot.modules.sql_helper.pm_permit_sql.approve",
"telethon.tl.functions.messages.ReportSpamRequest",
"userbot.modules.sql_helper.g... | [((1093, 1158), 'userbot.events.register', 'register', ([], {'incoming': '(True)', 'disable_edited': '(True)', 'disable_errors': '(True)'}), '(incoming=True, disable_edited=True, disable_errors=True)\n', (1101, 1158), False, 'from userbot.events import register\n'), ((4614, 4679), 'userbot.events.register', 'register',... |
# 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
# distribu... | [
"openfermionpyscf.run_pyscf",
"os.path.exists",
"openfermion.chem.make_atomic_ring"
] | [((1103, 1148), 'openfermion.chem.make_atomic_ring', 'make_atomic_ring', (['n_electrons', 'spacing', 'basis'], {}), '(n_electrons, spacing, basis)\n', (1119, 1148), False, 'from openfermion.chem import make_atomic_ring\n'), ((1160, 1203), 'os.path.exists', 'os.path.exists', (["(molecule.filename + '.hdf5')"], {}), "(mo... |
from dagster import List, Nullable, Int, PipelineDefinition
from dagster.core.types.runtime import resolve_to_runtime_type, ALL_RUNTIME_BUILTINS
def inner_type_key_set(runtime_type):
return {t.key for t in runtime_type.inner_types}
def test_inner_types():
assert resolve_to_runtime_type(Int).inner_types == ... | [
"dagster.List",
"dagster.PipelineDefinition",
"dagster.core.types.runtime.resolve_to_runtime_type",
"dagster.Nullable"
] | [((810, 838), 'dagster.core.types.runtime.resolve_to_runtime_type', 'resolve_to_runtime_type', (['Int'], {}), '(Int)\n', (833, 838), False, 'from dagster.core.types.runtime import resolve_to_runtime_type, ALL_RUNTIME_BUILTINS\n'), ((1309, 1370), 'dagster.PipelineDefinition', 'PipelineDefinition', ([], {'name': '"""test... |
#Python Code Random Option Chooser
#imported random module
import random
print("Hello...! This is random option chooser program. ")
#define a empty list to store options
options = []
#variable for run the infinite while loop
inf=0
#start the while loop
while inf==0:
print("\nChoose a number to continue.")
... | [
"random.randint"
] | [((1193, 1217), 'random.randint', 'random.randint', (['(0)', '(c - 1)'], {}), '(0, c - 1)\n', (1207, 1217), False, 'import random\n')] |
import discord
import asyncio
import time
from datetime import datetime
from discord.ext import commands
from discord.ext.commands import Cog
from helpers.robocronp import add_job, get_crontab
class Remind(Cog):
def __init__(self, bot):
self.bot = bot
@commands.cooldown(1, 60, type=commands.BucketTyp... | [
"discord.ext.commands.command",
"discord.Embed",
"asyncio.sleep",
"helpers.robocronp.get_crontab",
"time.time",
"discord.ext.commands.cooldown",
"datetime.datetime.utcfromtimestamp",
"datetime.datetime.utcnow",
"discord.ext.commands.clean_content",
"helpers.robocronp.add_job"
] | [((272, 327), 'discord.ext.commands.cooldown', 'commands.cooldown', (['(1)', '(60)'], {'type': 'commands.BucketType.user'}), '(1, 60, type=commands.BucketType.user)\n', (289, 327), False, 'from discord.ext import commands\n'), ((333, 351), 'discord.ext.commands.command', 'commands.command', ([], {}), '()\n', (349, 351)... |
# MktdataPublisher.py
from __future__ import print_function
from __future__ import absolute_import
import time
from optparse import OptionParser, OptionValueError
import datetime
import threading
import os
import platform as plat
import sys
if sys.version_info >= (3, 8) and plat.system().lower() == "windows":
# p... | [
"optparse.OptionParser",
"blpapi.Topic",
"blpapi.AuthOptions.createWithUser",
"blpapi.AuthOptions.createWithApp",
"blpapi.AuthUser.createWithLogonName",
"blpapi.AuthUser.createWithManualOptions",
"threading.Condition",
"threading.Lock",
"blpapi.SessionOptions",
"threading.Event",
"blpapi.Provide... | [((472, 504), 'blpapi.Name', 'blpapi.Name', (['"""PermissionRequest"""'], {}), "('PermissionRequest')\n", (483, 504), False, 'import blpapi\n'), ((526, 558), 'blpapi.Name', 'blpapi.Name', (['"""ResolutionSuccess"""'], {}), "('ResolutionSuccess')\n", (537, 558), False, 'import blpapi\n'), ((580, 612), 'blpapi.Name', 'bl... |
from __future__ import print_function
import socket
import os
import sys
import pdb
import pprint
import builtins
import threading as mt
from inspect import currentframe, getframeinfo
from importlib import reload
from contextlib import contextmanager
from pprint import PrettyPrinter
from gcd.nix import flock, sh
_... | [
"os.getpid",
"pdb.Pdb.interaction",
"socket.socket",
"sys._getframe",
"threading.local",
"gcd.nix.flock",
"pprint.pprint",
"os.path.relpath",
"pdb.Pdb.__init__",
"os.fdopen",
"inspect.currentframe",
"gcd.nix.sh"
] | [((1992, 2002), 'threading.local', 'mt.local', ([], {}), '()\n', (2000, 2002), True, 'import threading as mt\n'), ((716, 746), 'os.path.relpath', 'os.path.relpath', (['info.filename'], {}), '(info.filename)\n', (731, 746), False, 'import os\n'), ((914, 962), 'pprint.pprint', 'pprint.pprint', (['obj', '*args'], {'stream... |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the ... | [
"sys.path.append",
"unittest.mock.patch.object",
"aea.mail.base.Envelope.decode",
"packages.fetchai.protocols.http.message.HttpMessage",
"packages.fetchai.protocols.http.dialogues.HttpDialogues.__init__",
"packages.fetchai.protocols.http.message.HttpMessage.serializer.decode",
"aea.mail.base.Envelope",
... | [((1510, 1535), 'sys.path.append', 'sys.path.append', (['ROOT_DIR'], {}), '(ROOT_DIR)\n', (1525, 1535), False, 'import sys\n'), ((1647, 1815), 'packages.fetchai.protocols.http.message.HttpMessage', 'HttpMessage', ([], {'performative': 'HttpMessage.Performative.REQUEST', 'method': '"""some_method"""', 'url': '"""url"""'... |
# -*- coding: utf-8 -*-
import os
import sys
import socket
import time
import _strptime
import requests
import xbmc
import xbmcgui
import xbmcaddon
import xbmcvfs
ADDON = xbmcaddon.Addon()
ADDONNAME = ADDON.getAddonInfo('name')
ADDONID = ADDON.getAddonInfo('id')
ADDONVERSION = ADDON.getAddonInfo('version')
CWD = ADDON... | [
"sys.path.append",
"xbmc.sleep",
"xbmcgui.Window",
"os.path.join",
"xbmcaddon.Addon",
"xbmcvfs.mkdir",
"time.strftime",
"socket.setdefaulttimeout",
"xbmcvfs.exists",
"xbmc.Monitor.__init__",
"xbmcgui.Dialog",
"requests.get",
"xbmc.getLocalizedString",
"time.strptime"
] | [((172, 189), 'xbmcaddon.Addon', 'xbmcaddon.Addon', ([], {}), '()\n', (187, 189), False, 'import xbmcaddon\n'), ((557, 578), 'xbmcgui.Window', 'xbmcgui.Window', (['(12600)'], {}), '(12600)\n', (571, 578), False, 'import xbmcgui\n'), ((580, 605), 'sys.path.append', 'sys.path.append', (['RESOURCE'], {}), '(RESOURCE)\n', ... |
#!/usr/bin/env python
import collections
import pyaudio
import snowboydetect
import time
import wave
import os
import logging
from ctypes import *
from contextlib import contextmanager
logging.basicConfig()
logger = logging.getLogger("snowboy")
logger.setLevel(logging.INFO)
TOP_DIR = os.path.dirname(os.path.abspath(_... | [
"wave.open",
"os.path.abspath",
"logging.basicConfig",
"collections.deque",
"time.sleep",
"time.time",
"pyaudio.PyAudio",
"os.path.join",
"logging.getLogger"
] | [((187, 208), 'logging.basicConfig', 'logging.basicConfig', ([], {}), '()\n', (206, 208), False, 'import logging\n'), ((218, 246), 'logging.getLogger', 'logging.getLogger', (['"""snowboy"""'], {}), "('snowboy')\n", (235, 246), False, 'import logging\n'), ((347, 392), 'os.path.join', 'os.path.join', (['TOP_DIR', '"""res... |
import unittest
import pandas as pd
from ta.momentum import (
KAMAIndicator,
PercentagePriceOscillator,
PercentageVolumeOscillator,
ROCIndicator,
RSIIndicator,
StochasticOscillator,
StochRSIIndicator,
TSIIndicator,
UltimateOscillator,
WilliamsRIndicator,
kama,
ppo,
p... | [
"ta.momentum.StochasticOscillator",
"pandas.read_csv",
"ta.momentum.roc",
"ta.momentum.ppo_signal",
"ta.momentum.rsi",
"ta.momentum.PercentagePriceOscillator",
"ta.momentum.ppo_hist",
"unittest.main",
"ta.momentum.kama",
"ta.momentum.WilliamsRIndicator",
"ta.momentum.tsi",
"ta.momentum.william... | [((13277, 13292), 'unittest.main', 'unittest.main', ([], {}), '()\n', (13290, 13292), False, 'import unittest\n'), ((758, 793), 'pandas.read_csv', 'pd.read_csv', (['cls._filename'], {'sep': '""","""'}), "(cls._filename, sep=',')\n", (769, 793), True, 'import pandas as pd\n'), ((895, 922), 'ta.momentum.ROCIndicator', 'R... |
# -*- coding: utf-8 -*-
import tensorflow as tf
import yolo_v3
import yolo_v3_tiny
from utils import load_coco_names, load_weights
FLAGS = tf.app.flags.FLAGS
tf.app.flags.DEFINE_string(
'class_names', 'coco.names', 'File with class names')
tf.app.flags.DEFINE_string(
'weights_file', 'yolov3.weights', 'Bina... | [
"tensorflow.app.flags.DEFINE_bool",
"tensorflow.Session",
"tensorflow.variable_scope",
"tensorflow.placeholder",
"tensorflow.global_variables",
"tensorflow.app.flags.DEFINE_string",
"utils.load_coco_names",
"tensorflow.app.run"
] | [((163, 248), 'tensorflow.app.flags.DEFINE_string', 'tf.app.flags.DEFINE_string', (['"""class_names"""', '"""coco.names"""', '"""File with class names"""'], {}), "('class_names', 'coco.names', 'File with class names'\n )\n", (189, 248), True, 'import tensorflow as tf\n'), ((249, 350), 'tensorflow.app.flags.DEFINE_st... |
# Copyright © 2019 National Institute of Advanced Industrial Science and Technology (AIST). All rights reserved.
# !/usr/bin/env python3.6
# coding=utf-8
import unittest
from qlib.utils.logging import get_logger, log
logger = get_logger()
@log(logger)
def log_test():
print('test')
@log(logger)
def log_test2(... | [
"unittest.main",
"qlib.utils.logging.log",
"qlib.utils.logging.get_logger"
] | [((229, 241), 'qlib.utils.logging.get_logger', 'get_logger', ([], {}), '()\n', (239, 241), False, 'from qlib.utils.logging import get_logger, log\n'), ((245, 256), 'qlib.utils.logging.log', 'log', (['logger'], {}), '(logger)\n', (248, 256), False, 'from qlib.utils.logging import get_logger, log\n'), ((294, 305), 'qlib.... |
# -*- coding: utf-8 -*
import torch.utils.data as data
from PIL import Image
import torchvision.transforms as transforms
class BaseDataset(data.Dataset):
def __init__(self):
super(BaseDataset, self).__init__()
def name(self):
return 'BaseDataset'
@staticmethod
def modify_commandline_... | [
"torchvision.transforms.RandomHorizontalFlip",
"torchvision.transforms.ToTensor",
"torchvision.transforms.Compose",
"torchvision.transforms.Normalize",
"torchvision.transforms.RandomCrop",
"torchvision.transforms.Resize"
] | [((2212, 2246), 'torchvision.transforms.Compose', 'transforms.Compose', (['transform_list'], {}), '(transform_list)\n', (2230, 2246), True, 'import torchvision.transforms as transforms\n'), ((1998, 2019), 'torchvision.transforms.ToTensor', 'transforms.ToTensor', ([], {}), '()\n', (2017, 2019), True, 'import torchvision... |
import os
from mahoudata.core import *
from pandas_profiling import ProfileReport
import pandas as pd
from flask import Flask, request, render_template, url_for, json
from flask_cors import CORS
from recommender import *
import json
import csv
self = {}
self['cats'] = ['graduacion','lupulo_afrutado_citrico','lupulo_... | [
"flask_cors.CORS",
"flask.Flask",
"json.dumps",
"flask.render_template",
"flask.request.get_json"
] | [((539, 554), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (544, 554), False, 'from flask import Flask, request, render_template, url_for, json\n'), ((555, 564), 'flask_cors.CORS', 'CORS', (['app'], {}), '(app)\n', (559, 564), False, 'from flask_cors import CORS\n'), ((1234, 1267), 'flask.render_template... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# 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... | [
"heronpy.api.global_metrics.init",
"heron.instance.src.python.utils.misc.SerializerHelper.get_serializer",
"heron.proto.tuple_pb2.HeronDataTuple",
"heron.common.src.python.pex_loader.import_and_get_class",
"heron.common.src.python.pex_loader.load_pex",
"heron.instance.src.python.utils.misc.OutgoingTupleHe... | [((2090, 2116), 'heron.proto.tuple_pb2.HeronDataTuple', 'tuple_pb2.HeronDataTuple', ([], {}), '()\n', (2114, 2116), False, 'from heron.proto import tuple_pb2\n'), ((2278, 2328), 'heron.instance.src.python.utils.misc.OutgoingTupleHelper', 'OutgoingTupleHelper', (['self.pplan_helper', 'out_stream'], {}), '(self.pplan_hel... |
import time
import tensorflow as tf
import tensorlayer as tl
from tensorlayer.layers import *
def SRGAN_g(t_image, is_train=False, reuse=False):
""" Generator in Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network
feature maps (n) and stride (s) feature maps (n) and stride (s)... | [
"tensorflow.split",
"tensorflow.variable_scope",
"tensorflow.concat",
"tensorlayer.act.lrelu",
"time.time",
"tensorlayer.layers.set_name_reuse",
"tensorflow.random_normal_initializer",
"tensorflow.nn.sigmoid"
] | [((342, 383), 'tensorflow.random_normal_initializer', 'tf.random_normal_initializer', ([], {'stddev': '(0.02)'}), '(stddev=0.02)\n', (370, 383), True, 'import tensorflow as tf\n'), ((453, 492), 'tensorflow.random_normal_initializer', 'tf.random_normal_initializer', (['(1.0)', '(0.02)'], {}), '(1.0, 0.02)\n', (481, 492)... |
import os
import apprise
valid_tokens = {
'base_url': '',
'watch_url': '',
'watch_uuid': '',
'watch_title': '',
'watch_tag': '',
'diff_url': '',
'preview_url': '',
'current_snapshot': ''
}
def process_notification(n_object, datastore):
import logging
log = logging.getLogger('a... | [
"copy.deepcopy",
"apprise.Apprise",
"logging.getLogger"
] | [((300, 328), 'logging.getLogger', 'logging.getLogger', (['"""apprise"""'], {}), "('apprise')\n", (317, 328), False, 'import logging\n'), ((367, 394), 'apprise.Apprise', 'apprise.Apprise', ([], {'debug': '(True)'}), '(debug=True)\n', (382, 394), False, 'import apprise\n'), ((2268, 2290), 'copy.deepcopy', 'deepcopy', ([... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Traffic Module.
# Stat traffic
#
import database, user, config
import re
from utils import get_stdout
# the command that runs iptables
IPTABLES = ('/sbin/iptables',)
CHAIN_NAME = 'SSLAND2'
def stat():
'''
Get the stat data and storage into database.
''... | [
"database.conn.cursor",
"database.conn.commit",
"utils.get_stdout",
"re.findall",
"user.get_all"
] | [((357, 401), 'utils.get_stdout', 'get_stdout', (["(IPTABLES + ('-nxvL', CHAIN_NAME))"], {}), "(IPTABLES + ('-nxvL', CHAIN_NAME))\n", (367, 401), False, 'from utils import get_stdout\n'), ((471, 512), 'utils.get_stdout', 'get_stdout', (["(IPTABLES + ('-Z', CHAIN_NAME))"], {}), "(IPTABLES + ('-Z', CHAIN_NAME))\n", (481,... |
import math
import json
# Source: https://janakiev.com/blog/gps-points-distance-python/
def _haversine(gps_1: tuple, gps_2: tuple) -> float:
"""
Calculate distance in meters between two GPS coordinates.
Takes 2x (latitude, longitude), return meters between them.
"""
R = 6372800 # Earth radius in ... | [
"json.dump",
"json.load",
"math.sqrt",
"math.radians",
"math.sin",
"math.cos"
] | [((441, 466), 'math.radians', 'math.radians', (['(lat2 - lat1)'], {}), '(lat2 - lat1)\n', (453, 466), False, 'import math\n'), ((481, 506), 'math.radians', 'math.radians', (['(lon2 - lon1)'], {}), '(lon2 - lon1)\n', (493, 506), False, 'import math\n'), ((391, 409), 'math.radians', 'math.radians', (['lat1'], {}), '(lat1... |
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
from main_app.models import Recipe, Tag, Ingredient
from recipe_app.serializers import RecipeSerializer, RecipeDetailSerializer
... | [
"main_app.models.Tag.objects.create",
"recipe_app.serializers.RecipeSerializer",
"django.contrib.auth.get_user_model",
"recipe_app.serializers.RecipeDetailSerializer",
"django.urls.reverse",
"main_app.models.Recipe.objects.filter",
"main_app.models.Recipe.objects.get",
"main_app.models.Recipe.objects.... | [((334, 367), 'django.urls.reverse', 'reverse', (['"""recipe_app:recipe-list"""'], {}), "('recipe_app:recipe-list')\n", (341, 367), False, 'from django.urls import reverse\n'), ((548, 601), 'django.urls.reverse', 'reverse', (['"""recipe_app:recipe-detail"""'], {'args': '[recipe_id]'}), "('recipe_app:recipe-detail', arg... |
##########################################################
#
# pinout tests
#
# Use a user-defined temporary directory if
# you have problems with multiple harddrives (like I do):
#
# >>> pytest --basetemp=temp
#
##########################################################
import filecmp
import pytest
import re
import sh... | [
"uuid.uuid4",
"importlib.reload",
"pinout.manager.export_diagram",
"pathlib.Path",
"shutil.copyfile",
"pytest.mark.parametrize",
"filecmp.cmp",
"re.sub",
"re.compile"
] | [((1133, 2235), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""module_path, ref_path"""', "[('../samples/arduino/arduino/uno/arduino_uno.py',\n '../samples/arduino/pinout_arduino_uno_rev3.svg'), (\n '../samples/arduino/arduino/rp2040/arduino_nano_rp2040_connect.py',\n '../samples/arduino/pinout_ar... |
# Copyright 2014 Google 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,... | [
"setuptools.find_packages",
"io.open"
] | [((772, 798), 'io.open', 'io.open', (['"""README.rst"""', '"""r"""'], {}), "('README.rst', 'r')\n", (779, 798), False, 'import io\n'), ((1134, 1184), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "('tests*', 'system_tests*')"}), "(exclude=('tests*', 'system_tests*'))\n", (1147, 1184), False, 'from setup... |
#!/usr/bin/env python3
import sys
sys.path.append('./lib')
import argparse
import os
import datetime
import numpy as np
import time
import pickle
import torch
from torch import optim
from param_stamp import get_param_stamp, get_param_stamp_from_args
import evaluate
from lib.encoder import Classifier
from lib.vae_mod... | [
"os.mkdir",
"numpy.random.seed",
"argparse.ArgumentParser",
"torch.cuda.device_count",
"pickle.load",
"lib.train.train_cl",
"param_stamp.get_param_stamp_from_args",
"os.path.join",
"lib.encoder.Classifier",
"sys.path.append",
"lib.callbacks._VAE_loss_cb",
"os.path.exists",
"datetime.datetime... | [((35, 59), 'sys.path.append', 'sys.path.append', (['"""./lib"""'], {}), "('./lib')\n", (50, 59), False, 'import sys\n'), ((564, 666), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""./main.py"""'], {'description': '"""Run individual continual learning experiment."""'}), "('./main.py', description=\n 'Ru... |
# -*- coding: utf-8 -*-
import numpy as np
from lab.device import BaseDriver, QInteger, QOption, QReal, QString, QVector
class Driver(BaseDriver):
support_models = ['IT6302']
quants = [
QReal('CH1 Voltage', unit='V',
#set_cmd='SYST:REM;INST CH1;VOLT %(value).13e'
set_... | [
"lab.device.QOption",
"lab.device.QReal"
] | [((216, 309), 'lab.device.QReal', 'QReal', (['"""CH1 Voltage"""'], {'unit': '"""V"""', 'set_cmd': '"""INST CH1;VOLT %(value).13e"""', 'get_cmd': '"""MEAS? CH1"""'}), "('CH1 Voltage', unit='V', set_cmd='INST CH1;VOLT %(value).13e',\n get_cmd='MEAS? CH1')\n", (221, 309), False, 'from lab.device import BaseDriver, QInt... |
#!/usr/bin/python3
import asyncio
from src.estimator import estimator
import audits.test_utils as test_utils
cases = [
["days", "ch-3"],
["weeks", "ch-3"],
["months", "ch-3"]
]
def test_challenge3():
for [period_type, challenge] in cases:
loop = asyncio.get_event_loop()
input = loop.run_until_c... | [
"asyncio.get_event_loop",
"src.estimator.estimator",
"audits.test_utils.format_float",
"audits.test_utils.mock_estimation_for",
"audits.test_utils.value_on_fields"
] | [((267, 291), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (289, 291), False, 'import asyncio\n'), ((482, 497), 'src.estimator.estimator', 'estimator', (['data'], {}), '(data)\n', (491, 497), False, 'from src.estimator import estimator\n'), ((511, 566), 'audits.test_utils.value_on_fields', 'tes... |
import pytest
from wagtail.core.models import Site
from tests.testapp.models import BlogPage, LivePageMixin
@pytest.mark.django_db
def test_home_fixture(home):
assert home == Site.objects.first().root_page
@pytest.mark.django_db
def test_blog_page_factory_instance(blog_page):
assert BlogPage.objects.count(... | [
"wagtail.core.models.Site.objects.first",
"tests.testapp.models.BlogPage.objects.count"
] | [((297, 321), 'tests.testapp.models.BlogPage.objects.count', 'BlogPage.objects.count', ([], {}), '()\n', (319, 321), False, 'from tests.testapp.models import BlogPage, LivePageMixin\n'), ((594, 618), 'tests.testapp.models.BlogPage.objects.count', 'BlogPage.objects.count', ([], {}), '()\n', (616, 618), False, 'from test... |
import json
import logging
from typing import Tuple
import redis
from intervaltree import Interval, IntervalTree
from dispatch.config import PLANNER_SERVER_ROLE, MAX_MINUTES_PER_TECH, MAX_TRANSACTION_RETRY
from dispatch import config
from dispatch.plugins.kandbox_planner.env.env_enums import *
# RTree and Intervaltre... | [
"dispatch.plugins.kandbox_planner.env.env_models.WorkingTimeSlot",
"json.loads",
"dispatch.plugins.kandbox_planner.env.env_models.JobLocationBase",
"json.dumps",
"intervaltree.IntervalTree",
"intervaltree.Interval",
"logging.getLogger"
] | [((700, 745), 'logging.getLogger', 'logging.getLogger', (['"""rl_env.working_time_slot"""'], {}), "('rl_env.working_time_slot')\n", (717, 745), False, 'import logging\n'), ((2363, 2377), 'intervaltree.IntervalTree', 'IntervalTree', ([], {}), '()\n', (2375, 2377), False, 'from intervaltree import Interval, IntervalTree\... |
import argparse
import logging
from twitter_scraper import write_tweets_to_csv, enable_logging
def run():
"""twitter-scraper entry point when used as a script"""
parser = argparse.ArgumentParser(
prog='twitter-scraper', description="Scrape twitter public pages without an API key",
)
parser.ad... | [
"twitter_scraper.write_tweets_to_csv",
"argparse.ArgumentParser",
"twitter_scraper.enable_logging"
] | [((182, 296), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'prog': '"""twitter-scraper"""', 'description': '"""Scrape twitter public pages without an API key"""'}), "(prog='twitter-scraper', description=\n 'Scrape twitter public pages without an API key')\n", (205, 296), False, 'import argparse\n'), (... |
import os
import pandas as pd
from pandas import DataFrame
def load_file(file_base: str, filename: str) -> DataFrame:
"""
Load data from a csv.gz file.
Parameters
----------
file_base : str
The director to use as the root.
filename : str
Name of csv.gz to load
Returns
... | [
"os.path.abspath",
"pandas.to_datetime",
"os.path.join",
"pandas.to_numeric"
] | [((481, 513), 'os.path.join', 'os.path.join', (['curr_dir', 'filename'], {}), '(curr_dir, filename)\n', (493, 513), False, 'import os\n'), ((558, 583), 'pandas.to_datetime', 'pd.to_datetime', (['data.Date'], {}), '(data.Date)\n', (572, 583), True, 'import pandas as pd\n'), ((663, 704), 'pandas.to_numeric', 'pd.to_numer... |
#! /usr/bin/env python
import unittest
import os
from gerenuk import utility
from gerenuk.test import TESTS_DATA_DIR
CONFIG_DATA_DIR = os.path.join(TESTS_DATA_DIR, "configuration-files")
class Fsc2DataExtractionTestCase(unittest.TestCase):
def test_parse_configuration(self):
config_filepath = os.path.joi... | [
"unittest.main",
"os.path.join",
"gerenuk.utility.parse_legacy_configuration"
] | [((136, 187), 'os.path.join', 'os.path.join', (['TESTS_DATA_DIR', '"""configuration-files"""'], {}), "(TESTS_DATA_DIR, 'configuration-files')\n", (148, 187), False, 'import os\n'), ((6606, 6621), 'unittest.main', 'unittest.main', ([], {}), '()\n', (6619, 6621), False, 'import unittest\n'), ((309, 353), 'os.path.join', ... |
"""Read and write Jupyter notebooks as text files"""
import os
import io
import sys
import logging
import warnings
from copy import copy, deepcopy
from nbformat.v4.rwbase import NotebookReader, NotebookWriter
from nbformat.v4.nbbase import new_notebook, new_code_cell, NotebookNode
import nbformat
from .formats import ... | [
"copy.deepcopy",
"sys.stdin.read",
"os.makedirs",
"os.path.isdir",
"os.path.dirname",
"copy.copy",
"logging.log",
"nbformat.reads",
"os.path.splitext",
"io.open",
"nbformat.read",
"warnings.warn",
"nbformat.v4.nbbase.NotebookNode",
"nbformat.v4.nbbase.new_code_cell",
"nbformat.v4.nbbase.... | [((13930, 13957), 'copy.deepcopy', 'deepcopy', (['notebook.metadata'], {}), '(notebook.metadata)\n', (13938, 13957), False, 'from copy import copy, deepcopy\n'), ((14010, 14019), 'copy.copy', 'copy', (['fmt'], {}), '(fmt)\n', (14014, 14019), False, 'from copy import copy, deepcopy\n'), ((16914, 17109), 'warnings.warn',... |
# UI.Flow 1.2 以前は buttonA, buttonB, buttonC
# UI.Flow 1.3 以降は btnA, btnB, btnC
from m5stack import lcd, btnA, btnB, btnC
from dht12 import DHT12
from bmp280 import BMP280
import i2c_bus
import machine
import time
import math
import gc
import ambient
# Ambientで取得したチャネルのチャネルId, ライトキーを指定
AMBIENT_CHANNEL_ID = '26938'
A... | [
"m5stack.lcd.setTextColor",
"m5stack.btnA.wasPressed",
"gc.collect",
"ntptime_custom.settime",
"machine.UART",
"m5stack.lcd.setColor",
"m5stack.lcd.winsize",
"m5stack.lcd.roundrect",
"math.radians",
"ambient.Ambient",
"time.localtime",
"bmp280.BMP280",
"i2c_bus.get",
"m5stack.lcd.font",
... | [((10912, 10945), 'wifiCfg.autoConnect', 'wifiCfg.autoConnect', ([], {'lcdShow': '(True)'}), '(lcdShow=True)\n', (10931, 10945), False, 'import wifiCfg\n'), ((11463, 11498), 'ntptime_custom.settime', 'ntptime_custom.settime', (['(9 * 60 * 60)'], {}), '(9 * 60 * 60)\n', (11485, 11498), False, 'import ntptime_custom\n'),... |