code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
#Filename: initialize.py
#Institute: IIT Roorkee
import torch.nn as nn
import numpy as np
def weights_init_kaimingUniform(module):
for m in module.modules():
if isinstance(m, nn.Conv2d):
nn.init.kaiming_uniform_(m.weight, mode = 'fan_in', nonlinearity = 'relu')
if m.bias is not No... | [
"numpy.sqrt",
"torch.nn.init.constant_",
"torch.nn.init.kaiming_normal_",
"torch.nn.init.kaiming_uniform_",
"torch.nn.init.uniform_",
"torch.nn.init.normal_"
] | [((214, 284), 'torch.nn.init.kaiming_uniform_', 'nn.init.kaiming_uniform_', (['m.weight'], {'mode': '"""fan_in"""', 'nonlinearity': '"""relu"""'}), "(m.weight, mode='fan_in', nonlinearity='relu')\n", (238, 284), True, 'import torch.nn as nn\n'), ((851, 920), 'torch.nn.init.kaiming_normal_', 'nn.init.kaiming_normal_', (... |
#!/usr/bin/env python
# Get the version number from git tags:
# Fetch version from git tags, and write to version.py.
# Also, when git is not available (PyPi package), use stored version.py.
import os, subprocess
from distutils.core import setup
versionFileName = os.path.join(os.path.dirname(__file__), "timidi", '_ver... | [
"subprocess.check_output",
"os.path.dirname",
"distutils.core.setup"
] | [((868, 1034), 'distutils.core.setup', 'setup', ([], {'name': '"""timidi"""', 'version': 'vn', 'description': '"""MIDI Tools"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'url': '"""https://www.github.com/timidi"""', 'packages': "['timidi']"}), "(name='timidi', version=vn, description='MIDI Tools', au... |
#!/usr/bin/env python
import os
from setuptools import setup, find_packages
setup(
name='localtunnel',
version='0.4.0',
author='<NAME>',
author_email='<EMAIL>',
description='',
packages=find_packages(),
install_requires=['ginkgo', 'ws4py'],
data_files=[],
entry_points={
'con... | [
"setuptools.find_packages"
] | [((211, 226), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (224, 226), False, 'from setuptools import setup, find_packages\n')] |
"""Parse ReadCloud files."""
from gimmebio.seqs.fastx_io import iterFastq
from .exceptions import NoGemcodeException, GemcodeMismatchException
from .readclouds import ReadCloud, ChromiumReadPair
def iterReadCloud(filelike):
rC = ReadCloud(None)
for rP in iterFastq(filelike, interleaved=True):
try:
... | [
"gimmebio.seqs.fastx_io.iterFastq"
] | [((267, 304), 'gimmebio.seqs.fastx_io.iterFastq', 'iterFastq', (['filelike'], {'interleaved': '(True)'}), '(filelike, interleaved=True)\n', (276, 304), False, 'from gimmebio.seqs.fastx_io import iterFastq\n')] |
import time
import logging
import traceback
from multiprocessing import Process
from threading import Lock
LOG = logging.getLogger(__name__)
class _Task:
def __init__(self, func, args, kwargs):
self.func = func
self.args = args
self.kwargs = kwargs
def __call__(self):
return... | [
"logging.getLogger",
"traceback.format_exc",
"threading.Lock",
"multiprocessing.Process",
"time.sleep",
"time.time"
] | [((115, 142), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (132, 142), False, 'import logging\n'), ((452, 458), 'threading.Lock', 'Lock', ([], {}), '()\n', (456, 458), False, 'from threading import Lock\n'), ((537, 557), 'multiprocessing.Process', 'Process', ([], {'target': 'task'}), '(... |
import warnings
from modelkit.core.library import ModelLibrary, load_model # NOQA
from modelkit.core.model import Model # NOQA
# Silence Tensorflow warnings
# https://github.com/tensorflow/tensorflow/issues/30427
warnings.simplefilter(action="ignore", category=FutureWarning)
__version__ = "0.0.9"
| [
"warnings.simplefilter"
] | [((217, 279), 'warnings.simplefilter', 'warnings.simplefilter', ([], {'action': '"""ignore"""', 'category': 'FutureWarning'}), "(action='ignore', category=FutureWarning)\n", (238, 279), False, 'import warnings\n')] |
import os
import tempfile
import numpy as np
from microscopium.screens.cellomics import SPIRAL_CLOCKWISE_RIGHT_25
from microscopium import preprocess as pre
from microscopium import io as mio
import pytest
import warnings
@pytest.fixture
def image_files():
# for clarity we define images as integer arrays in [0, 1... | [
"numpy.clip",
"numpy.testing.assert_equal",
"numpy.array",
"microscopium.io.temporary_file",
"numpy.random.RandomState",
"os.remove",
"microscopium.preprocess.correct_multiimage_illumination",
"numpy.testing.assert_array_almost_equal",
"microscopium.preprocess.montage_with_missing",
"microscopium.... | [((3552, 3610), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""fns, expected"""', 'missing_test_fns'], {}), "('fns, expected', missing_test_fns)\n", (3575, 3610), False, 'import pytest\n'), ((4590, 4676), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""missing, order, rows, cols, expected"""', ... |
#! /usr/bin/env python
import _pickle as cPickle, gzip
import numpy as np
from tqdm import tqdm
import torch
import torch.autograd as autograd
import torch.nn.functional as F
import torch.nn as nn
import sys
sys.path.append("..")
import utils
from utils import *
from train_utils import batchify_data, run_epoch, train_... | [
"torch.manual_seed",
"torch.nn.ReLU",
"torch.nn.LeakyReLU",
"train_utils.batchify_data",
"train_utils.train_model",
"numpy.random.seed",
"torch.nn.Linear",
"sys.path.append",
"numpy.random.shuffle"
] | [((209, 230), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (224, 230), False, 'import sys\n'), ((816, 846), 'numpy.random.shuffle', 'np.random.shuffle', (['permutation'], {}), '(permutation)\n', (833, 846), True, 'import numpy as np\n'), ((997, 1040), 'train_utils.batchify_data', 'batchify_data... |
"""
Utility functions for QS files.
"""
import traceback
import re
import math
from PyQt5 import QtCore
from pineboolib.core.utils.utils_base import ustr
from pineboolib.core.utils import logging
from typing import Any, Optional, Union, Match, List, Pattern, Generator, Callable
logger = logging.getLogger("qsa.utils"... | [
"traceback.format_exc",
"math.ceil",
"re.compile",
"math.floor",
"math.pow",
"pineboolib.core.utils.utils_base.ustr",
"PyQt5.QtCore.QTimer",
"math.fabs",
"pineboolib.core.utils.logging.getLogger",
"pineboolib.application.project.message_manager",
"math.isnan"
] | [((291, 321), 'pineboolib.core.utils.logging.getLogger', 'logging.getLogger', (['"""qsa.utils"""'], {}), "('qsa.utils')\n", (308, 321), False, 'from pineboolib.core.utils import logging\n'), ((1286, 1316), 'pineboolib.core.utils.logging.getLogger', 'logging.getLogger', (['"""qsaRegExp"""'], {}), "('qsaRegExp')\n", (130... |
"""
Rollouts, the inferface of different components in the NAS system.
"""
# pylint: disable=unused-import
from aw_nas.utils.exception import expect
from aw_nas.rollout.base import (
BaseRollout,
Rollout,
DifferentiableRollout
)
from aw_nas.rollout.mutation import (
MutationRollout,
CellMutation,
... | [
"aw_nas.rollout.base.BaseRollout.all_classes_"
] | [((789, 815), 'aw_nas.rollout.base.BaseRollout.all_classes_', 'BaseRollout.all_classes_', ([], {}), '()\n', (813, 815), False, 'from aw_nas.rollout.base import BaseRollout, Rollout, DifferentiableRollout\n')] |
from lolviz import *
import refcycle
from print_schema import print_schema
stores = [
{
'name': 'store_1',
'items':
[
{'name': 'store_1_item_1',
'price': 15.99,
'available_qty': 12},
{
'name': 'sto... | [
"print_schema.print_schema",
"refcycle.objects_reachable_from"
] | [((1643, 1663), 'print_schema.print_schema', 'print_schema', (['stores'], {}), '(stores)\n', (1655, 1663), False, 'from print_schema import print_schema\n'), ((1674, 1713), 'refcycle.objects_reachable_from', 'refcycle.objects_reachable_from', (['stores'], {}), '(stores)\n', (1705, 1713), False, 'import refcycle\n')] |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | [
"azure.cli.command_modules.monitor.operations.activity_log._build_odata_filter",
"azure.cli.command_modules.monitor.operations.activity_log._activity_log_select_filter_builder",
"re.search",
"azure.cli.command_modules.monitor.operations.activity_log._build_activity_log_odata_filter"
] | [((1162, 1210), 'azure.cli.command_modules.monitor.operations.activity_log._build_activity_log_odata_filter', '_build_activity_log_odata_filter', (['correlation_id'], {}), '(correlation_id)\n', (1194, 1210), False, 'from azure.cli.command_modules.monitor.operations.activity_log import _build_activity_log_odata_filter, ... |
from __future__ import print_function
import os
import sys
import pickle
import json
import datetime
from collections import namedtuple
import numpy as np
import sqlite3
from sqlalchemy import create_engine
from sqlalchemy_utils import drop_database
from sqlalchemy.orm import sessionmaker
from sqlalchemy.exc import Int... | [
"sqlalchemy.orm.sessionmaker",
"sqlalchemy_utils.drop_database",
"analysis.delayedfeedback.database.EventType",
"datetime.datetime.fromtimestamp",
"sqlalchemy.create_engine",
"os.path.join",
"numpy.diff",
"analysis.delayedfeedback.database.Subject",
"analysis.delayedfeedback.database.Base.metadata.c... | [((2862, 2883), 'sqlalchemy.create_engine', 'create_engine', (['db_url'], {}), '(db_url)\n', (2875, 2883), False, 'from sqlalchemy import create_engine\n'), ((2668, 2689), 'sqlalchemy.create_engine', 'create_engine', (['db_url'], {}), '(db_url)\n', (2681, 2689), False, 'from sqlalchemy import create_engine\n'), ((2698,... |
# Generated by Django 2.2.4 on 2019-08-22 13:47
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('account', '0002_auto_20190822_1009'),
]
operations = [
migrations.AddField(
model_name='account',
... | [
"django.db.models.DateTimeField",
"django.db.models.DecimalField"
] | [((365, 430), 'django.db.models.DecimalField', 'models.DecimalField', ([], {'decimal_places': '(2)', 'default': '(0.0)', 'max_digits': '(10)'}), '(decimal_places=2, default=0.0, max_digits=10)\n', (384, 430), False, 'from django.db import migrations, models\n'), ((557, 628), 'django.db.models.DateTimeField', 'models.Da... |
from caia.items.steps.parse_source_response import ParseSourceResponse
def test_parse_source_response_with_valid_response():
source_response_file = 'tests/resources/items/valid_src_response.json'
with open(source_response_file, 'r') as file:
src_response_str = file.read()
parse_source_response = ... | [
"caia.items.steps.parse_source_response.ParseSourceResponse"
] | [((320, 357), 'caia.items.steps.parse_source_response.ParseSourceResponse', 'ParseSourceResponse', (['src_response_str'], {}), '(src_response_str)\n', (339, 357), False, 'from caia.items.steps.parse_source_response import ParseSourceResponse\n')] |
import yake
import gensim
import numpy as np
import itertools
import nltk
from nltk.corpus import stopwords
def extract_keywords(text):
"""
Extract keywords from a text using yake model.
"""
# extract keywords
kw_extractor = yake.KeywordExtractor()
keywords = kw_extractor.extract_keywords(text... | [
"yake.KeywordExtractor",
"gensim.models.KeyedVectors.load_word2vec_format",
"numpy.argsort",
"numpy.zeros",
"numpy.linalg.norm"
] | [((247, 270), 'yake.KeywordExtractor', 'yake.KeywordExtractor', ([], {}), '()\n', (268, 270), False, 'import yake\n'), ((914, 927), 'numpy.zeros', 'np.zeros', (['(300)'], {}), '(300)\n', (922, 927), True, 'import numpy as np\n'), ((1128, 1242), 'gensim.models.KeyedVectors.load_word2vec_format', 'gensim.models.KeyedVect... |
# coding: utf-8
from django.db import models
from django_th.models.services import Services
from django_th.models import TriggerService
class Github(Services):
"""
github model to be adapted for the new service
"""
# put whatever you need here
# eg title = models.CharField(max_length=80)
... | [
"django.db.models.CharField",
"django.db.models.ForeignKey"
] | [((361, 392), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(80)'}), '(max_length=80)\n', (377, 392), False, 'from django.db import models\n'), ((416, 447), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(80)'}), '(max_length=80)\n', (432, 447), False, 'from django.db im... |
import renpy
import pygame
import os
import math
import ctypes
import euclid
from OpenGL import GL as gl
FONT_SIZE = 18
FONT = None
def drawText(canvas, text, pos, color, align=-1, background=(128, 128, 128)):
global FONT
if FONT is None:
pygame.font.init()
FONT = pygame.font.Font(None, FONT_... | [
"ctypes.byref",
"os.path.join",
"renpy.exports.file",
"math.radians",
"renpy.exports.list_files",
"pygame.font.init",
"ctypes.c_int",
"pygame.font.Font",
"euclid.Vector3",
"math.atan",
"os.walk",
"euclid.Matrix4.new_look_at"
] | [((1186, 1209), 'euclid.Vector3', 'euclid.Vector3', (['(0)', '(0)', '(1)'], {}), '(0, 0, 1)\n', (1200, 1209), False, 'import euclid\n'), ((1219, 1242), 'euclid.Vector3', 'euclid.Vector3', (['(0)', '(0)', '(0)'], {}), '(0, 0, 0)\n', (1233, 1242), False, 'import euclid\n'), ((1252, 1275), 'euclid.Vector3', 'euclid.Vector... |
import json
def parse_notebook_cells(notebook_path):
with open(notebook_path) as f:
notebook_data = json.load(f)
cells = []
for cell in notebook_data["cells"]:
if cell["cell_type"] == "code":
source = "".join(cell["source"])
outputs = []
for output in c... | [
"json.load"
] | [((114, 126), 'json.load', 'json.load', (['f'], {}), '(f)\n', (123, 126), False, 'import json\n')] |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Update cbpf
------------
"""
from hdx.data.resource import Resource
from hdx.utilities.dictandlist import write_list_to_csv
from src.helpers import cannonize_name
def update_cbpf(base_url, downloader, poolfundabbrv, today, valid_names, replace_values, resource_updates):... | [
"src.helpers.cannonize_name",
"hdx.utilities.dictandlist.write_list_to_csv"
] | [((2190, 2315), 'hdx.utilities.dictandlist.write_list_to_csv', 'write_list_to_csv', (['rows', "resource_updates['cbpf']['path']"], {'headers': "['Admin Location', 'Cashflow Type', 'Cashflow Value']"}), "(rows, resource_updates['cbpf']['path'], headers=[\n 'Admin Location', 'Cashflow Type', 'Cashflow Value'])\n", (22... |
#!/usr/bin/env python
# type: ignore
import asyncio
import json
from datetime import datetime
import nest_asyncio
from fastapi import FastAPI, Header, Path
from fastapi.middleware.cors import CORSMiddleware
from starlette.requests import Request
from starlette.responses import HTMLResponse, JSONResponse, Response
f... | [
"src.controllers.tools.ToolsController.delete_tool",
"fastapi.Path",
"fastapi.Header",
"fastapi.FastAPI",
"starlette.responses.Response",
"src.controllers.tools.ToolsController.find_tools",
"src.helpers.queue.SCRAPPING_LINK_TOPIC_KAFKA.send",
"datetime.datetime.now",
"asyncio.get_event_loop",
"nes... | [((721, 741), 'nest_asyncio.apply', 'nest_asyncio.apply', ([], {}), '()\n', (739, 741), False, 'import nest_asyncio\n'), ((749, 778), 'fastapi.FastAPI', 'FastAPI', ([], {'title': '"""CRUD - KAFKA"""'}), "(title='CRUD - KAFKA')\n", (756, 778), False, 'from fastapi import FastAPI, Header, Path\n'), ((1032, 1046), 'dateti... |
from jobs_pb2_grpc import JobServiceServicer
from jobs_pb2 import JobRunResponse, JobStatusResponse, JobStatus
from ..jobs.defs import JOBNAME_JOBDEF_MAP
class JobServicer(JobServiceServicer):
def RunJob(self, request, context):
job_response = JobRunResponse()
job_response.launchSuccess = True
... | [
"jobs_pb2.JobRunResponse",
"jobs_pb2.JobStatusResponse"
] | [((259, 275), 'jobs_pb2.JobRunResponse', 'JobRunResponse', ([], {}), '()\n', (273, 275), False, 'from jobs_pb2 import JobRunResponse, JobStatusResponse, JobStatus\n'), ((861, 880), 'jobs_pb2.JobStatusResponse', 'JobStatusResponse', ([], {}), '()\n', (878, 880), False, 'from jobs_pb2 import JobRunResponse, JobStatusResp... |
#!/usr/bin/env python
import matplotlib.pyplot as plt
import numpy as np
from utils import util
from scipy.special import logit
import sklearn.linear_model as lm
from sklearn.linear_model import LogisticRegressionCV, LogisticRegression
from sklearn.metrics.pairwise import linear_kernel, polynomial_kernel, rbf_kernel
f... | [
"sklearn.preprocessing.PolynomialFeatures",
"sklearn.metrics.pairwise.rbf_kernel",
"scipy.stats.multivariate_normal",
"matplotlib.pyplot.pcolormesh",
"numpy.random.RandomState",
"numpy.linspace",
"matplotlib.pyplot.scatter",
"numpy.eye",
"matplotlib.pyplot.savefig",
"numpy.ones",
"sklearn.metric... | [((3144, 3154), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (3152, 3154), True, 'import matplotlib.pyplot as plt\n'), ((477, 501), 'numpy.random.RandomState', 'np.random.RandomState', (['(0)'], {}), '(0)\n', (498, 501), True, 'import numpy as np\n'), ((1089, 1110), 'sklearn.preprocessing.PolynomialFeatures'... |
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
"""Core rules for Pants to operate correctly.
These are always activated and cannot be disabled.
"""
from pants.core.goals import fmt, lint, package, repl, run, test, typecheck
from pant... | [
"pants.core.target_types.rules",
"pants.core.util_rules.pants_bin.rules",
"pants.core.util_rules.external_tool.rules",
"pants.core.goals.test.rules",
"pants.core.goals.typecheck.rules",
"pants.core.goals.package.rules",
"pants.core.util_rules.subprocess_environment.rules",
"pants.core.util_rules.distd... | [((783, 794), 'pants.core.goals.fmt.rules', 'fmt.rules', ([], {}), '()\n', (792, 794), False, 'from pants.core.goals import fmt, lint, package, repl, run, test, typecheck\n'), ((805, 817), 'pants.core.goals.lint.rules', 'lint.rules', ([], {}), '()\n', (815, 817), False, 'from pants.core.goals import fmt, lint, package,... |
from copy import deepcopy
from unittest.mock import Mock
from dataactcore.utils import fileE
_VALID_CONFIG = {'sam': {
'wsdl': 'http://example.com', 'username': 'un', 'password': '<PASSWORD>'}}
def test_configValid_empty(monkeypatch):
monkeypatch.setattr(fileE, 'CONFIG_BROKER', {})
assert not fileE.con... | [
"unittest.mock.Mock",
"dataactcore.utils.fileE.retrieveRows",
"dataactcore.utils.fileE.Row",
"dataactcore.utils.fileE.sudsToRow",
"dataactcore.utils.fileE.configValid",
"copy.deepcopy"
] | [((451, 470), 'dataactcore.utils.fileE.configValid', 'fileE.configValid', ([], {}), '()\n', (468, 470), False, 'from dataactcore.utils import fileE\n'), ((534, 557), 'copy.deepcopy', 'deepcopy', (['_VALID_CONFIG'], {}), '(_VALID_CONFIG)\n', (542, 557), False, 'from copy import deepcopy\n'), ((744, 767), 'copy.deepcopy'... |
#!/usr/bin/env python
from flask_script import Manager, Shell
from app import create_app,db
from flask_migrate import Migrate,MigrateCommand
app = create_app()
if __name__ == '__main__':
app.run(debug=True)
| [
"app.create_app"
] | [((148, 160), 'app.create_app', 'create_app', ([], {}), '()\n', (158, 160), False, 'from app import create_app, db\n')] |
#! /usr/bin/python
# -*- coding: utf-8 -*-
# @Time : 2017/6/21 12:26
# @Author : HouJP
# @Email : <EMAIL>
import ConfigParser
import random
import numpy as np
from scipy import sparse
from bin.featwheel.utils import LogUtil
from ..featwheel.feature import Feature
from ..postprocessor import PostProcessor
cl... | [
"numpy.array",
"random.random",
"bin.featwheel.utils.LogUtil.log",
"ConfigParser.ConfigParser"
] | [((434, 461), 'ConfigParser.ConfigParser', 'ConfigParser.ConfigParser', ([], {}), '()\n', (459, 461), False, 'import ConfigParser\n'), ((2935, 3002), 'bin.featwheel.utils.LogUtil.log', 'LogUtil.log', (['"""INFO"""', "('save train features (%s) done' % feature_name)"], {}), "('INFO', 'save train features (%s) done' % fe... |
from django.contrib import admin
from django.conf import settings
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.forms import UserChangeForm, UserCreationForm
from django.utils.translation import ugettext_lazy as _
# Register your models here.
from .models import CustomerInfo, ContactInfo, Add... | [
"django.contrib.admin.register"
] | [((332, 360), 'django.contrib.admin.register', 'admin.register', (['CustomerInfo'], {}), '(CustomerInfo)\n', (346, 360), False, 'from django.contrib import admin\n'), ((416, 443), 'django.contrib.admin.register', 'admin.register', (['ContactInfo'], {}), '(ContactInfo)\n', (430, 443), False, 'from django.contrib import ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# __init__.py
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# Copyright (C) 2021 ETH Zurich
#
# 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
#
# ... | [
"logging.getLogger",
"threading.Thread.__init__",
"datetime.datetime.now",
"time.sleep"
] | [((1040, 1067), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1057, 1067), False, 'import logging\n'), ((1366, 1387), 'threading.Thread.__init__', 'Thread.__init__', (['self'], {}), '(self)\n', (1381, 1387), False, 'from threading import Thread\n'), ((2004, 2018), 'datetime.datetime.now... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import string
import random
def random_password_generator():
chars = string.ascii_uppercase + string.ascii_lowercase + string.digits
size = 8
return ''.join(random.choice(chars) for x in range(size, 20))
def random_password_generator_ico():
random_password_ge... | [
"random.choice"
] | [((216, 236), 'random.choice', 'random.choice', (['chars'], {}), '(chars)\n', (229, 236), False, 'import random\n')] |
# -*- coding=utf-8 -*-
import os
import pip_shims.shims
import pytest
from vistir.compat import Path
from vistir.contextmanagers import temp_environ
from requirementslib import utils as base_utils
from requirementslib.models import utils
from requirementslib.models.requirements import Requirement
from requirementslib.... | [
"requirementslib.models.utils.expand_env_variables",
"requirementslib.models.utils.format_specifier",
"requirementslib.models.utils.split_markers_from_line",
"requirementslib.models.utils.build_vcs_uri",
"requirementslib.models.utils.flat_map",
"vistir.compat.Path",
"requirementslib.models.requirements.... | [((890, 934), 'requirementslib.models.utils.init_requirement', 'utils.init_requirement', (['"""requests[security]"""'], {}), "('requests[security]')\n", (912, 934), False, 'from requirementslib.models import utils\n'), ((1018, 1073), 'requirementslib.models.utils.init_requirement', 'utils.init_requirement', (['"""reque... |
#!/bin/python
# -*- coding: utf-8 -*-
def evolve_func(ser_algo_pop):
# The evolve function that is actually run from the separate processes in the desert island
import dill
algo, pop = dill.loads(ser_algo_pop)
new_pop = algo.evolve(pop)
return dill.dumps((algo, new_pop))
class Desert_island(obje... | [
"pathos.pools.ProcessPool",
"dill.dumps",
"dill.loads",
"pathos.multiprocessing.cpu_count"
] | [((199, 223), 'dill.loads', 'dill.loads', (['ser_algo_pop'], {}), '(ser_algo_pop)\n', (209, 223), False, 'import dill\n'), ((266, 293), 'dill.dumps', 'dill.dumps', (['(algo, new_pop)'], {}), '((algo, new_pop))\n', (276, 293), False, 'import dill\n'), ((750, 785), 'pathos.pools.ProcessPool', 'pathos.pools.ProcessPool', ... |
from django.db import models
class ConsentForm(models.Model):
user_id = models.CharField(max_length=80)
perm1 = models.CharField(max_length=80)
perm2 = models.CharField(max_length=80)
username = models.TextField()
date = models.DateField(max_length=80)
city = models.TextField(max_length=80)
... | [
"django.db.models.TextField",
"django.db.models.DateField",
"django.db.models.CharField"
] | [((79, 110), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(80)'}), '(max_length=80)\n', (95, 110), False, 'from django.db import models\n'), ((123, 154), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(80)'}), '(max_length=80)\n', (139, 154), False, 'from django.db impo... |
"""
This RNN is used for predicting stock trends of the Google stock.
@Editor: <NAME>
"""
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from sklearn.preprocessing import MinMaxScaler
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from keras.l... | [
"numpy.reshape",
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"keras.models.Sequential",
"numpy.array",
"keras.layers.LSTM",
"keras.layers.Dropout",
"pandas.concat",
"keras.layers.Dense",
"matplotlib.pyplot.title",
"sklearn.preprocessin... | [((497, 540), 'pandas.read_csv', 'pd.read_csv', (['"""Google_Stock_Price_Train.csv"""'], {}), "('Google_Stock_Price_Train.csv')\n", (508, 540), True, 'import pandas as pd\n'), ((784, 829), 'sklearn.preprocessing.MinMaxScaler', 'MinMaxScaler', ([], {'feature_range': '(0, 1)', 'copy': '(True)'}), '(feature_range=(0, 1), ... |
from nutshell.algorithms.information_retrieval import ClassicalIR
from nutshell.algorithms.ranking import BaseRanker, TextRank
from nutshell.algorithms.similarity import BaseSimilarityAlgo, BM25Plus
from nutshell.preprocessing.cleaner import NLTKCleaner
from nutshell.preprocessing.preprocessor import TextPreProcessor
... | [
"nutshell.preprocessing.preprocessor.TextPreProcessor",
"nutshell.algorithms.similarity.BM25Plus",
"nutshell.algorithms.information_retrieval.ClassicalIR.cumulative_weight",
"nutshell.preprocessing.cleaner.NLTKCleaner",
"nutshell.algorithms.ranking.TextRank",
"nutshell.algorithms.information_retrieval.Cla... | [((408, 426), 'nutshell.preprocessing.preprocessor.TextPreProcessor', 'TextPreProcessor', ([], {}), '()\n', (424, 426), False, 'from nutshell.preprocessing.preprocessor import TextPreProcessor\n'), ((478, 488), 'nutshell.algorithms.similarity.BM25Plus', 'BM25Plus', ([], {}), '()\n', (486, 488), False, 'from nutshell.al... |
import unittest
import os
from Crypto.Cipher import AES
from random import choice, randint
from crypto.cbc import CBCCipher
from util.oracle import BBoxType, oracle_guess_cipher_type
from util.sample_text import text as sample_text
from util.somecode import rand_n_string, pad16_PKCS7
def random_bbox_types():
while... | [
"util.oracle.oracle_guess_cipher_type",
"random.randint",
"util.somecode.rand_n_string",
"util.sample_text.text.encode"
] | [((1363, 1383), 'util.sample_text.text.encode', 'sample_text.encode', ([], {}), '()\n', (1381, 1383), True, 'from util.sample_text import text as sample_text\n'), ((1678, 1716), 'util.oracle.oracle_guess_cipher_type', 'oracle_guess_cipher_type', (['mystery_text'], {}), '(mystery_text)\n', (1702, 1716), False, 'from uti... |
import numpy as np
# Matrix for converting axial coordinates to pixel coordinates
axial_to_pixel_mat = np.array([[np.sqrt(3), np.sqrt(3) / 2], [0, 3 / 2.]])
# Matrix for converting pixel coordinates to axial coordinates
pixel_to_axial_mat = np.linalg.inv(axial_to_pixel_mat)
# These are the vectors for moving from ... | [
"numpy.abs",
"numpy.sqrt",
"numpy.arange",
"numpy.squeeze",
"numpy.array",
"numpy.zeros",
"numpy.linalg.inv",
"numpy.vstack",
"numpy.round"
] | [((244, 277), 'numpy.linalg.inv', 'np.linalg.inv', (['axial_to_pixel_mat'], {}), '(axial_to_pixel_mat)\n', (257, 277), True, 'import numpy as np\n'), ((358, 378), 'numpy.array', 'np.array', (['(1, 0, -1)'], {}), '((1, 0, -1))\n', (366, 378), True, 'import numpy as np\n'), ((384, 404), 'numpy.array', 'np.array', (['(0, ... |
from neorl import SA
import matplotlib.pyplot as plt
import random
#Define the fitness function
def FIT(individual):
"""Sphere test objective function.
"""
y=sum(x**2 for x in individual)
return y
#Setup the parameter space (d=5)
nx=5
BOUNDS={}
for i in range(1,nx+1):
BOUNDS['x'+str... | [
"random.uniform",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"neorl.SA",
"matplotlib.pyplot.legend"
] | [((730, 893), 'neorl.SA', 'SA', ([], {'mode': '"""min"""', 'bounds': 'BOUNDS', 'fit': 'FIT', 'chain_size': '(50)', 'chi': '(0.2)', 'Tmax': '(10000)', 'move_func': 'my_move', 'reinforce_best': '"""soft"""', 'cooling': '"""boltzmann"""', 'ncores': '(1)', 'seed': '(1)'}), "(mode='min', bounds=BOUNDS, fit=FIT, chain_size=5... |
#!/usr/bin/env python
"""
Add MR comments from the Scan Completed instrument on REDCap to the database.
Usage:
dm_redcap_scan_completed.py [options] <study>
Arguments:
<study> Name of the study to process
Options:
-q --quiet Less logging
-v --verbose Verbose logging
-d... | [
"logging.getLogger",
"requests.post",
"logging.StreamHandler",
"os.path.isfile",
"os.path.basename",
"docopt.docopt",
"datman.dashboard.get_session"
] | [((544, 570), 'os.path.basename', 'os.path.basename', (['__file__'], {}), '(__file__)\n', (560, 570), False, 'import os\n'), ((1255, 1291), 'requests.post', 'requests.post', (['api_url'], {'data': 'payload'}), '(api_url, data=payload)\n', (1268, 1291), False, 'import requests\n'), ((1627, 1663), 'requests.post', 'reque... |
from traceback import print_exc
from aiogram import types
from aiogram.dispatcher import FSMContext
from loader import dp, bot
from states import Request
from keyboards import create_kb_coustom_main_menu
from utils import get_data_to_show
# from create_request.py
@dp.callback_query_handler(state=Request.operation_ty... | [
"states.Request.temp_sum_state.set",
"states.Request.how_much_recive.set",
"loader.dp.callback_query_handler",
"loader.bot.send_message",
"keyboards.create_kb_coustom_main_menu",
"states.Request.type_end.set",
"utils.get_data_to_show"
] | [((268, 323), 'loader.dp.callback_query_handler', 'dp.callback_query_handler', ([], {'state': 'Request.operation_type'}), '(state=Request.operation_type)\n', (293, 323), False, 'from loader import dp, bot\n'), ((806, 875), 'loader.bot.send_message', 'bot.send_message', ([], {'chat_id': 'call.message.chat.id', 'text': '... |
from logging import info
import cv2
import numpy as np
import matplotlib.pyplot as plt
from .TabDetectDewarp import detect_bbox, get_dewarped_table
def detect_line(im):
'''
Args:
im (np.array): input image
Returns:
dict:
{
'address_line_1': [left,top,ri... | [
"cv2.imread"
] | [((915, 929), 'cv2.imread', 'cv2.imread', (['""""""'], {}), "('')\n", (925, 929), False, 'import cv2\n')] |
# -*- coding: utf-8 -*-
# Based on https://gist.github.com/voldmar/1264102
# and https://gist.github.com/runekaagaard/2eecf0a8367959dc634b7866694daf2c
import gc
import inspect
import weakref
from collections import defaultdict
from django.apps import apps
from django.core.management.base import BaseCommand
from djang... | [
"inspect.getsourcefile",
"inspect.getsourcelines",
"django.apps.apps.get_models",
"django.utils.encoding.force_str",
"collections.defaultdict",
"gc.get_objects"
] | [((991, 1055), 'django.apps.apps.get_models', 'apps.get_models', ([], {'include_auto_created': '(True)', 'include_swapped': '(True)'}), '(include_auto_created=True, include_swapped=True)\n', (1006, 1055), False, 'from django.apps import apps\n'), ((2162, 2195), 'django.utils.encoding.force_str', 'force_str', (['key._me... |
"""hamming CLI"""
import typer
from enum import Enum
import sys
import hamming_codec
class ParityLocationChoices(str, Enum):
default = ("DEFAULT",)
msb = ("MSB",)
lsb = "LSB"
def encode(
ctx: typer.Context,
input: str = typer.Argument(..., help="Input data word as hex string"),
n_bits: in... | [
"hamming_codec.encode",
"sys.exit",
"hamming_codec.decode",
"typer.Argument"
] | [((247, 304), 'typer.Argument', 'typer.Argument', (['...'], {'help': '"""Input data word as hex string"""'}), "(..., help='Input data word as hex string')\n", (261, 304), False, 'import typer\n'), ((324, 399), 'typer.Argument', 'typer.Argument', (['...'], {'help': '"""Length of the input data word in number of bits"""'... |
from allauth.socialaccount.providers.agave_provider.provider import AgaveProvider
from allauth.socialaccount.providers.oauth2_provider.urls import default_urlpatterns
urlpatterns = default_urlpatterns(AgaveProvider)
| [
"allauth.socialaccount.providers.oauth2_provider.urls.default_urlpatterns"
] | [((183, 217), 'allauth.socialaccount.providers.oauth2_provider.urls.default_urlpatterns', 'default_urlpatterns', (['AgaveProvider'], {}), '(AgaveProvider)\n', (202, 217), False, 'from allauth.socialaccount.providers.oauth2_provider.urls import default_urlpatterns\n')] |
from django.contrib import admin
from .models import Doctor
from .forms import DoctorForm
class DoctorAdmin(admin.ModelAdmin):
list_display = [
"nombre_doctor",
"cedula_doctor",
"direccion_doctor",
]
form = DoctorForm
search_fields = [
"nombre_doctor",
"cedul... | [
"django.contrib.admin.site.register"
] | [((342, 382), 'django.contrib.admin.site.register', 'admin.site.register', (['Doctor', 'DoctorAdmin'], {}), '(Doctor, DoctorAdmin)\n', (361, 382), False, 'from django.contrib import admin\n')] |
# -*- coding: utf-8 -*-
# Copyright (C) 2020. Huawei Technologies Co., Ltd. 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-... | [
"argparse.ArgumentTypeError",
"argparse.ArgumentParser"
] | [((1106, 1181), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'desc', 'formatter_class': 'CustomHelpFormat'}), '(description=desc, formatter_class=CustomHelpFormat)\n', (1129, 1181), False, 'import argparse\n'), ((982, 1035), 'argparse.ArgumentTypeError', 'argparse.ArgumentTypeError', (['""... |
# Copyright 2018 - The Android Open Source Project
#
# 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 ... | [
"acloud.setup.host_setup_runner.CuttlefishCommonPkgInstaller",
"os.path.exists",
"acloud.setup.host_setup_runner.AvdPkgInstaller",
"os.environ.get",
"acloud.public.config.AcloudConfigManager",
"acloud.setup.host_setup_runner.CuttlefishHostSetup",
"acloud.setup.host_setup_runner.HostBasePkgInstaller",
... | [((1637, 1677), 'acloud.setup.host_setup_runner.HostBasePkgInstaller', 'host_setup_runner.HostBasePkgInstaller', ([], {}), '()\n', (1675, 1677), False, 'from acloud.setup import host_setup_runner\n'), ((1700, 1735), 'acloud.setup.host_setup_runner.AvdPkgInstaller', 'host_setup_runner.AvdPkgInstaller', ([], {}), '()\n',... |
import numpy as np
import scipy
from scipy.stats import binom
# numpy.seterr(all='raise')
#
# Decision tree: Regression
#
class Tree():
def __init__(self, X, y, maxDepth, alpha0 = None, baseline_features = None, peek_ahead_max_depth=0, split_val_quantiles = [], peek_ahead_quantiles = [], nSamples = ... | [
"numpy.mean",
"numpy.unique",
"numpy.append",
"numpy.nanmean",
"numpy.quantile",
"numpy.sum",
"numpy.isnan",
"numpy.array",
"scipy.stats.binom.cdf",
"numpy.min",
"numpy.argmin",
"numpy.isinf",
"numpy.var",
"numpy.random.permutation"
] | [((9593, 9611), 'numpy.nanmean', 'np.nanmean', (['self.y'], {}), '(self.y)\n', (9603, 9611), True, 'import numpy as np\n'), ((12297, 12325), 'numpy.isnan', 'np.isnan', (['best_split_feature'], {}), '(best_split_feature)\n', (12305, 12325), True, 'import numpy as np\n'), ((17461, 17483), 'numpy.isinf', 'np.isinf', (['be... |
"""Test becquerel's Spectrum."""
import pytest
import datetime
import numpy as np
from uncertainties import ufloat, UFloat, unumpy
import becquerel as bq
TEST_DATA_LENGTH = 256
TEST_COUNTS = 4
TEST_GAIN = 8.23
TEST_EDGES_KEV = np.arange(TEST_DATA_LENGTH + 1) * TEST_GAIN
def make_data(lam=TEST_COUNTS, size=TEST_DAT... | [
"numpy.sqrt",
"numpy.array",
"becquerel.Spectrum.from_listmode",
"pytest.fixture",
"uncertainties.ufloat",
"numpy.arange",
"datetime.datetime",
"numpy.random.poisson",
"numpy.where",
"becquerel.Calibration.from_linear",
"numpy.logspace",
"uncertainties.unumpy.uarray",
"numpy.random.normal",
... | [((5201, 5276), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""spec_type"""', "['uncal', 'cal', 'uncal_long', 'cal']"], {}), "('spec_type', ['uncal', 'cal', 'uncal_long', 'cal'])\n", (5224, 5276), False, 'import pytest\n'), ((5819, 5859), 'numpy.random.normal', 'np.random.normal', (['MEAN', 'STDDEV', 'NSAM... |
"""Provide helper functions for generating configuration.
ONLY the constants module should import this module.
"""
import copy
import csv
import functools
import os
from pathlib import Path
# HACK HACK HACK HACK HACK HACK HACK HACK HACK THIS IS A DUMB HACK HACK HACK
# Importing qgis before fiona is absolutely necess... | [
"qgreenland.util.misc.directory_size_bytes",
"yamale.make_data",
"yamale.make_schema",
"humanize.naturalsize",
"qgreenland.exceptions.QgrInvalidConfigError",
"qgreenland.util.misc.get_layer_path",
"os.path.join",
"os.path.isfile",
"fiona.open",
"copy.deepcopy",
"os.path.abspath",
"functools.lr... | [((4955, 4988), 'functools.lru_cache', 'functools.lru_cache', ([], {'maxsize': 'None'}), '(maxsize=None)\n', (4974, 4988), False, 'import functools\n'), ((1210, 1251), 'os.path.join', 'os.path.join', (['config_dir', 'config_filename'], {}), '(config_dir, config_filename)\n', (1222, 1251), False, 'import os\n'), ((1268,... |
import time
from selenium import webdriver
def register_my_car(
url_,
apt_,
make_,
model_,
color_,
plate_,
phone_,
email_,
apt_unit,
apt_owner_fname,
apt_owner_lname,
**kwargs,
):
"""
Literally every step is spelled out but that is ok. Simple site.
"""
#... | [
"selenium.webdriver.Chrome",
"time.sleep"
] | [((392, 410), 'selenium.webdriver.Chrome', 'webdriver.Chrome', ([], {}), '()\n', (408, 410), False, 'from selenium import webdriver\n'), ((650, 663), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (660, 663), False, 'import time\n'), ((2538, 2551), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (2548, 2551), ... |
from __future__ import division, print_function, absolute_import
"""
Author: PinAxe
Project: Convolutional Auto Encoder Example.
A 7 layers auto-encoder with TensorFlow Convolutional layers
trains on noised MNIST set. Supposed to do some serious denoising.
Also it saves and automaticaly restores the model and does vis... | [
"numpy.clip",
"tensorflow.image.resize_images",
"tensorflow.examples.tutorials.mnist.input_data.read_data_sets",
"tensorflow.reduce_mean",
"matplotlib.pyplot.imshow",
"tensorflow.pow",
"tensorflow.placeholder",
"tensorflow.Session",
"tensorflow.layers.conv2d",
"tensorflow.nn.sigmoid",
"numpy.emp... | [((2607, 2660), 'tensorflow.examples.tutorials.mnist.input_data.read_data_sets', 'input_data.read_data_sets', (['"""/tmp/data/"""'], {'one_hot': '(True)'}), "('/tmp/data/', one_hot=True)\n", (2632, 2660), False, 'from tensorflow.examples.tutorials.mnist import input_data\n'), ((2661, 2685), 'tensorflow.reset_default_gr... |
import matplotlib.pyplot as plt
import numpy as np
from sklearn.datasets import load_boston
from sklearn.ensemble import StackingRegressor
from sklearn.linear_model import LinearRegression, TheilSenRegressor
from sklearn.metrics import mean_squared_error
from sklearn.model_selection import train_test_split
from sklearn... | [
"sklearn.utils.check_random_state",
"numpy.median",
"numpy.ones",
"matplotlib.pyplot.ylabel",
"sklearn.model_selection.train_test_split",
"numpy.average",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"sklearn.datasets.load_boston",
"sklearn.linear_model.TheilSenRegressor",
"sklearn.metr... | [((485, 517), 'sklearn.utils.check_random_state', 'check_random_state', (['random_state'], {}), '(random_state)\n', (503, 517), False, 'from sklearn.utils import check_random_state\n'), ((4933, 4978), 'matplotlib.pyplot.plot', 'plt.plot', (['p', 'ensemble_ols', '"""b"""'], {'label': '"""enols"""'}), "(p, ensemble_ols, ... |
"""
Module that contains the command line app.
Why does this file exist, and why not put this in __main__?
You might be tempted to import things from __main__ later, but that will cause
problems: the code will get executed twice:
- When you run `python -mscrrpy` python will execute
``__main__.py`` as a scr... | [
"click.argument",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.ylabel",
"click.option",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.yscale",
"matplotlib.pyplot.errorbar",
"click.command",
"matplotlib.pyplot.xscale"
] | [((656, 671), 'click.command', 'click.command', ([], {}), '()\n', (669, 671), False, 'import click\n'), ((673, 695), 'click.argument', 'click.argument', (['"""name"""'], {}), "('name')\n", (687, 695), False, 'import click\n'), ((697, 736), 'click.argument', 'click.argument', (['"""sma"""'], {'type': 'click.FLOAT'}), "(... |
# A simple rewriter to produce a source that eliminates
# (most) non-atomic sub-expressions
# Some constucts (such as for-statements) only rewrite
# the branches, but not the entire statement, as there may be dependencies
# between rewritten body and the test condition, which complicates things
from argparse import Ar... | [
"ast.Load",
"argparse.ArgumentParser",
"pdb.post_mortem",
"astunparse.unparse",
"ast.Store",
"ast.Expr",
"copy.deepcopy",
"ast.parse",
"ast.copy_location",
"ast.Assign"
] | [((15798, 15818), 'astunparse.unparse', 'unparse', (['lifted_tree'], {}), '(lifted_tree)\n', (15805, 15818), False, 'from astunparse import unparse\n'), ((15960, 15980), 'astunparse.unparse', 'unparse', (['lifted_tree'], {}), '(lifted_tree)\n', (15967, 15980), False, 'from astunparse import unparse\n'), ((16094, 16141)... |
# ==============================================================================
# # Import Modules
# ==============================================================================
from collections import Counter, defaultdict
import matplotlib.ticker as mtick
import plotly.graph_objects as go
import numpy as np ... | [
"matplotlib.rcParams.update",
"matplotlib.ticker.PercentFormatter",
"seaborn.histplot",
"seaborn.set_style",
"matplotlib.pyplot.figure",
"seaborn.barplot",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((661, 701), 'matplotlib.rcParams.update', 'mpl.rcParams.update', (['mpl.rcParamsDefault'], {}), '(mpl.rcParamsDefault)\n', (680, 701), True, 'import matplotlib as mpl\n'), ((1238, 1283), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(5, 2)', 'facecolor': '"""white"""'}), "(figsize=(5, 2), facecolor='whi... |
import csv
import spacy
nlp = spacy.load('en')
count = 0
keys = [
'VideoID',
'Start',
'End',
'WorkerID',
'Source',
'AnnotationTime',
'Language',
'Description'
]
word_freq = {}
sentences = []
with open('MSR_en.csv', newline='') as csvfile:
reader = csv.DictReader(csvfile)
for ... | [
"spacy.load",
"csv.DictReader"
] | [((31, 47), 'spacy.load', 'spacy.load', (['"""en"""'], {}), "('en')\n", (41, 47), False, 'import spacy\n'), ((288, 311), 'csv.DictReader', 'csv.DictReader', (['csvfile'], {}), '(csvfile)\n', (302, 311), False, 'import csv\n')] |
import openl3
from pathlib import Path
import numpy as np
import librosa
import tensorflow_hub as hub
class AudioL3:
def __init__(self, input_repr: str = 'mel256', content_type: str = 'music', embedding_size: int = 512) -> None:
self.model = openl3.models.load_audio_embedding_model(input_repr=input_repr... | [
"numpy.mean",
"openl3.models.load_audio_embedding_model",
"tensorflow_hub.load",
"openl3.get_audio_embedding",
"librosa.load"
] | [((258, 383), 'openl3.models.load_audio_embedding_model', 'openl3.models.load_audio_embedding_model', ([], {'input_repr': 'input_repr', 'content_type': 'content_type', 'embedding_size': 'embedding_size'}), '(input_repr=input_repr,\n content_type=content_type, embedding_size=embedding_size)\n', (298, 383), False, 'im... |
"""
MIT License
Copyright (c) 2020 <NAME> <<EMAIL>>
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, publi... | [
"tensorflow.keras.layers.Concatenate",
"tensorflow.keras.layers.UpSampling2D",
"xtreme_vision.Detection.yolov4.model.common.YOLOConv2D"
] | [((1414, 1518), 'xtreme_vision.Detection.yolov4.model.common.YOLOConv2D', 'YOLOConv2D', ([], {'filters': '(256)', 'kernel_size': '(1)', 'activation': 'activation', 'kernel_regularizer': 'kernel_regularizer'}), '(filters=256, kernel_size=1, activation=activation,\n kernel_regularizer=kernel_regularizer)\n', (1424, 15... |
# -*- coding: utf-8 -*-
# Copyright (c) 2019-2020 <NAME>.
# All rights reserved.
# Licensed under BSD-3-Clause-Clear. See LICENSE file for details.
from django import forms
from Account.models import account_test_wachtwoord_sterkte
class RegistreerForm(forms.Form):
"""
Dit formulier wordt gebruikt o... | [
"django.forms.EmailField",
"Account.models.account_test_wachtwoord_sterkte",
"django.forms.PasswordInput",
"django.forms.TextInput"
] | [((670, 747), 'django.forms.EmailField', 'forms.EmailField', ([], {'label': '"""E-mail adres zoals bekend bij de NHB"""', 'required': '(True)'}), "(label='E-mail adres zoals bekend bij de NHB', required=True)\n", (686, 747), False, 'from django import forms\n'), ((613, 655), 'django.forms.TextInput', 'forms.TextInput',... |
import pyjsparser
from space import Space
import fill_space
from byte_trans import ByteCodeGenerator
from code import Code
from simplex import MakeError
import sys
sys.setrecursionlimit(100000)
pyjsparser.parser.ENABLE_JS2PY_ERRORS = lambda msg: MakeError(u'SyntaxError', unicode(msg))
def get_js_bytecode(js):
a ... | [
"sys.setrecursionlimit",
"space.Space",
"code.Code",
"pyjsparser.parse",
"fill_space.fill_space"
] | [((164, 193), 'sys.setrecursionlimit', 'sys.setrecursionlimit', (['(100000)'], {}), '(100000)\n', (185, 193), False, 'import sys\n'), ((356, 376), 'pyjsparser.parse', 'pyjsparser.parse', (['js'], {}), '(js)\n', (372, 376), False, 'import pyjsparser\n'), ((481, 488), 'space.Space', 'Space', ([], {}), '()\n', (486, 488),... |
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE.md file in the project root for full license information.
# <code>
import azure.cognitiveservices.speech as speechsdk
# Creates an instance of a speech config with specified subscription key and service region.
# Replace wit... | [
"azure.cognitiveservices.speech.SpeechRecognizer",
"azure.cognitiveservices.speech.SpeechConfig"
] | [((481, 551), 'azure.cognitiveservices.speech.SpeechConfig', 'speechsdk.SpeechConfig', ([], {'subscription': 'speech_key', 'region': 'service_region'}), '(subscription=speech_key, region=service_region)\n', (503, 551), True, 'import azure.cognitiveservices.speech as speechsdk\n'), ((620, 675), 'azure.cognitiveservices.... |
"""
Author: <NAME>
Source:
Content: File includes calculation of values on cubic Bézier curve.
"""
import numpy as np
# calculates one point on a cubic Bézier curve
# input: - uVal (float): parameter of value u
# - b (list) = [b0, b1, ..., bn] control and Bézier points as list
# output: - poin... | [
"numpy.linspace"
] | [((743, 763), 'numpy.linspace', 'np.linspace', (['(0)', '(1)', 'N'], {}), '(0, 1, N)\n', (754, 763), True, 'import numpy as np\n')] |
#!/usr/bin/env python3
import logging
import re
import function_access
from param_source import ParamSource
from copy import deepcopy
class Runnable(ParamSource):
"""An object of Runnable class is a non-persistent container of parameters (inherited) and code (own)
that may optionally also have a parent o... | [
"logging.basicConfig",
"function_access.expected_call_structure",
"function_access.prep",
"function_access.list_function_names",
"function_access.feed",
"argparse.Namespace",
"copy.deepcopy"
] | [((22270, 22364), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG', 'format': '"""%(levelname)s:%(funcName)s %(message)s"""'}), "(level=logging.DEBUG, format=\n '%(levelname)s:%(funcName)s %(message)s')\n", (22289, 22364), False, 'import logging\n'), ((13830, 13901), 'function_access.prep... |
import discord
import random
import yaml
from .ignore import canDm
with open("./conf.yaml", encoding="utf-8") as conf:
config = yaml.load(conf, Loader=yaml.FullLoader)
async def haunt(ctx, user):
target = user or ctx.author
if (canDm(target.id)):
channel = await target.create_dm()
f = ran... | [
"random.choice",
"yaml.load",
"discord.File"
] | [((134, 173), 'yaml.load', 'yaml.load', (['conf'], {'Loader': 'yaml.FullLoader'}), '(conf, Loader=yaml.FullLoader)\n', (143, 173), False, 'import yaml\n'), ((317, 460), 'random.choice', 'random.choice', (["['doot_intensifies.png', 'skelly_gun.gif', 'oh_no.png', 'skelly_dance.gif',\n 'skelly_daddy.png', 'doot.png', '... |
from itertools import combinations
from solvatore import Solvatore
from cipher_description import CipherDescription
from ciphers import present
cipher = present.present
rounds = 9
solver = Solvatore()
solver.load_cipher(cipher)
solver.set_rounds(rounds)
# Look over all combination for one non active bit
for bits in ... | [
"solvatore.Solvatore"
] | [((191, 202), 'solvatore.Solvatore', 'Solvatore', ([], {}), '()\n', (200, 202), False, 'from solvatore import Solvatore\n')] |
# -*- coding: utf-8 -*-
"""
Plotting planet population Joint PDF
Written By: <NAME>
2/1/2019
"""
try:
import cPickle as pickle
except:
import pickle
import os
if not 'DISPLAY' in os.environ.keys(): #Check environment for keys
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt ... | [
"matplotlib.ticker.LogLocator",
"matplotlib.pyplot.ylabel",
"numpy.nanmin",
"os.path.exists",
"re.split",
"numpy.where",
"matplotlib.pyplot.xlabel",
"EXOSIMS.util.vprint.vprint",
"numpy.asarray",
"numpy.max",
"matplotlib.pyplot.close",
"numpy.linspace",
"numpy.nanmax",
"numpy.min",
"os.e... | [((262, 283), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (276, 283), False, 'import matplotlib\n'), ((189, 206), 'os.environ.keys', 'os.environ.keys', ([], {}), '()\n', (204, 206), False, 'import os\n'), ((1022, 1034), 'EXOSIMS.util.vprint.vprint', 'vprint', (['args'], {}), '(args)\n', (1028,... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import hydra
from hydra import HydraConfig
@hydra.main(config_path="config.yaml")
def experiment(_cfg):
print(HydraConfig().hydra.job.name)
if __name__ == "__main__":
experiment()
| [
"hydra.HydraConfig",
"hydra.main"
] | [((117, 154), 'hydra.main', 'hydra.main', ([], {'config_path': '"""config.yaml"""'}), "(config_path='config.yaml')\n", (127, 154), False, 'import hydra\n'), ((187, 200), 'hydra.HydraConfig', 'HydraConfig', ([], {}), '()\n', (198, 200), False, 'from hydra import HydraConfig\n')] |
from school_scraper.fsdscraper import FSDScraper
from school_scraper.fsdschool import FSDSchool
def test_properties(fsd_test_data):
obj = FSDScraper(fsd_test_data)
dist = obj.districts[0]
expected_name = dist.school_names[0]
res = dist.get_school(expected_name)
assert res is not None
assert re... | [
"school_scraper.fsdscraper.FSDScraper"
] | [((144, 169), 'school_scraper.fsdscraper.FSDScraper', 'FSDScraper', (['fsd_test_data'], {}), '(fsd_test_data)\n', (154, 169), False, 'from school_scraper.fsdscraper import FSDScraper\n'), ((572, 597), 'school_scraper.fsdscraper.FSDScraper', 'FSDScraper', (['fsd_test_data'], {}), '(fsd_test_data)\n', (582, 597), False, ... |
from test.integration.base import DBTIntegrationTest, use_profile
class TestBaseBigQueryResults(DBTIntegrationTest):
@property
def schema(self):
return "bigquery_test_022"
@property
def models(self):
return "models"
@property
def project_config(self):
return {
... | [
"test.integration.base.use_profile"
] | [((402, 425), 'test.integration.base.use_profile', 'use_profile', (['"""bigquery"""'], {}), "('bigquery')\n", (413, 425), False, 'from test.integration.base import DBTIntegrationTest, use_profile\n')] |
# -*- coding: utf-8 -*-
###########################################################
# それぞれのスループットのデータから、send_bytes毎の最大baudrate探し出し、折れ線グラフにまとめる。
# analyze_throuputで生成したテキストを参照するので、事前にanalyze_throuputを実行しておくこと。
###########################################################
import re
import matplotlib.pyplot as plt
import ... | [
"re.split",
"matplotlib.pyplot.savefig",
"os.makedirs",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure"
] | [((701, 729), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(10, 10)'}), '(figsize=(10, 10))\n', (711, 729), True, 'import matplotlib.pyplot as plt\n'), ((3869, 3943), 'matplotlib.pyplot.savefig', 'plt.savefig', (["(pdf_path + '/' + 'compare_maxbaudrate(' + shift_way + ').pdf')"], {}), "(pdf_path + '/' + ... |
import math
class Ship:
def __init__(self):
self.pos = [0.0, 0.0]
self.waypoint = [10.0, 1.0]
self.dir = 90
self.map = {
"F": self.forward,
"L": self.left,
"R": self.right,
"N": self.north,
"S": self.south,
"E":... | [
"math.radians"
] | [((702, 724), 'math.radians', 'math.radians', (['self.dir'], {}), '(self.dir)\n', (714, 724), False, 'import math\n'), ((764, 786), 'math.radians', 'math.radians', (['self.dir'], {}), '(self.dir)\n', (776, 786), False, 'import math\n'), ((1395, 1414), 'math.radians', 'math.radians', (['angle'], {}), '(angle)\n', (1407,... |
# -*- coding: utf-8 -*-
"""Tests for the Debug Helper."""
from flask_testing import TestCase
from tests.sites import MDTestSiteDebugHelper, MDTestSite
class TestDebugHelperOn(TestCase):
"""Debug helper tests.
Can't use pyfakefs for this or partials won't load"""
def create_app(self):
app = MDTe... | [
"tests.sites.MDTestSite",
"tests.sites.MDTestSiteDebugHelper"
] | [((316, 362), 'tests.sites.MDTestSiteDebugHelper', 'MDTestSiteDebugHelper', (['"""MDWeb"""'], {'app_options': '{}'}), "('MDWeb', app_options={})\n", (337, 362), False, 'from tests.sites import MDTestSiteDebugHelper, MDTestSite\n'), ((892, 927), 'tests.sites.MDTestSite', 'MDTestSite', (['"""MDWeb"""'], {'app_options': '... |
import pytest
from cmd_exec.builder.AppContextBuilder import AppContextBuilder
from cmd_exec.context.AppContext import AppContext
from cmd_exec.error.CmdExecError import CmdExecError
from tests.src.utils.TestUtil import TestUtil
class TestAppService:
def setup_method(method):
TestUtil.setupTest... | [
"tests.src.utils.TestUtil.TestUtil.useConfigFilesInConfigsDir",
"tests.src.utils.TestUtil.TestUtil.useServicesInModule",
"tests.src.utils.TestUtil.TestUtil.buildModuleFiles",
"cmd_exec.builder.AppContextBuilder.AppContextBuilder.buildBaseAppContext",
"tests.src.utils.TestUtil.TestUtil.setupTestingEnvironmen... | [((302, 336), 'tests.src.utils.TestUtil.TestUtil.setupTestingEnvironment', 'TestUtil.setupTestingEnvironment', ([], {}), '()\n', (334, 336), False, 'from tests.src.utils.TestUtil import TestUtil\n'), ((382, 418), 'tests.src.utils.TestUtil.TestUtil.destroyTestingEnvironment', 'TestUtil.destroyTestingEnvironment', ([], {... |
#!/bin/usr/python3
# coding=UTF-8
#Copyright (c) 2021 <NAME>(<EMAIL>)
#
# 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 r... | [
"rosky2_interfaces.action.OdomRecord.Result",
"rosky2_interfaces.msg.Point",
"rclpy.callback_groups.ReentrantCallbackGroup",
"rclpy.action.ActionServer",
"math.pow",
"math.asin",
"multiprocessing.cpu_count",
"sys.path.remove",
"rosky2_interfaces.action.OdomRecord.Feedback",
"math.atan2",
"rclpy.... | [((748, 769), 'sys.path.remove', 'sys.path.remove', (['path'], {}), '(path)\n', (763, 769), False, 'import sys, time, threading, math\n'), ((6194, 6215), 'rclpy.init', 'rclpy.init', ([], {'args': 'args'}), '(args=args)\n', (6204, 6215), False, 'import rclpy\n'), ((6793, 6809), 'rclpy.shutdown', 'rclpy.shutdown', ([], {... |
from django.conf import settings
from django.urls.conf import path
from rest_framework.routers import DefaultRouter, SimpleRouter
from ado.apps.buses.api.views import BusesViewSet, PassengerView
from ado.apps.drivers.api.views import DriverViewSet
from ado.apps.passengers.api.views import PassengerViewSet
from ado.app... | [
"rest_framework.routers.SimpleRouter",
"ado.apps.buses.api.views.PassengerView.as_view",
"rest_framework.routers.DefaultRouter"
] | [((441, 456), 'rest_framework.routers.DefaultRouter', 'DefaultRouter', ([], {}), '()\n', (454, 456), False, 'from rest_framework.routers import DefaultRouter, SimpleRouter\n'), ((476, 490), 'rest_framework.routers.SimpleRouter', 'SimpleRouter', ([], {}), '()\n', (488, 490), False, 'from rest_framework.routers import De... |
# python3.7
"""Implements image cropping."""
import numpy as np
try:
import nvidia.dali.fn as fn
except ImportError:
fn = None
try:
import cupy
except ImportError:
cupy = None
from utils.formatting_utils import format_image_size
from .base_transformation import BaseTransformation
__all__ = ['Cente... | [
"cupy.ascontiguousarray",
"nvidia.dali.fn.random.uniform",
"numpy.ascontiguousarray",
"cupy.random.uniform",
"numpy.random.uniform",
"utils.formatting_utils.format_image_size",
"nvidia.dali.fn.crop"
] | [((681, 709), 'utils.formatting_utils.format_image_size', 'format_image_size', (['crop_size'], {}), '(crop_size)\n', (698, 709), False, 'from utils.formatting_utils import format_image_size\n'), ((1657, 1788), 'nvidia.dali.fn.crop', 'fn.crop', (['data'], {'crop_pos_x': '(0.5)', 'crop_pos_y': '(0.5)', 'crop_w': 'self.cr... |
#!/usr/bin/env python3
# Copyright (C) 2017-2019 The btclib developers
#
# This file is part of btclib. It is subject to the license terms in the
# LICENSE file found in the top-level directory of this distribution.
#
# No part of btclib including this file, may be copied, modified, propagated,
# or distributed except... | [
"btclib.electrum.bip32_xpub_from_xprv",
"btclib.electrum.electrum_entropy_from_mnemonic",
"json.load",
"btclib.electrum.electrum_master_prvkey_from_raw_entropy",
"os.path.dirname",
"btclib.electrum.electrum_master_prvkey_from_mnemonic",
"btclib.electrum.electrum_mnemonic_from_raw_entropy",
"unittest.m... | [((2858, 2873), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2871, 2873), False, 'import unittest\n'), ((856, 919), 'btclib.electrum.electrum_mnemonic_from_raw_entropy', 'electrum_mnemonic_from_raw_entropy', (['raw_entropy', 'lang', 'eversion'], {}), '(raw_entropy, lang, eversion)\n', (890, 919), False, 'from b... |
import json
import discord
from discord.ext import tasks
from discord.ext import commands
import pymysql.cursors
#read config file
with open('config/config.json', 'r') as file:
configFile = json.load(file)
prefix = configFile["prefix"]
token = configFile["token"]
host = configFile["host"]
user = configFile["user... | [
"discord.Client",
"json.load",
"discord.ext.commands.Bot"
] | [((402, 418), 'discord.Client', 'discord.Client', ([], {}), '()\n', (416, 418), False, 'import discord\n'), ((425, 460), 'discord.ext.commands.Bot', 'commands.Bot', ([], {'command_prefix': 'prefix'}), '(command_prefix=prefix)\n', (437, 460), False, 'from discord.ext import commands\n'), ((196, 211), 'json.load', 'json.... |
# Copyright 2015 Red Hat, Inc.
# 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... | [
"re.compile",
"ironic_python_agent.utils.execute",
"shlex.split",
"ironic_python_agent.utils.get_efi_part_on_device",
"os.path.ismount",
"os.walk",
"oslo_log.log.getLogger",
"os.path.exists",
"os.listdir",
"shutil.copy2",
"ironic_python_agent.extensions.base.async_command",
"ironic_python_agen... | [((1109, 1132), 'oslo_log.log.getLogger', 'log.getLogger', (['__name__'], {}), '(__name__)\n', (1122, 1132), False, 'from oslo_log import log\n'), ((6455, 6490), 'ironic_python_agent.utils.execute', 'utils.execute', (['"""file"""', '"""-s"""', 'device'], {}), "('file', '-s', device)\n", (6468, 6490), False, 'from ironi... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Author : 陈坤泽
# @Email : <EMAIL>
# @Date : 2021/06/09 11:02
import logging
import os
import shutil
from typing import Callable, List, Optional
from urllib import request
import requests
from bs4 import BeautifulSoup
from pyxllib.file.specialist.dirlib import File, ... | [
"logging.getLogger",
"os.makedirs",
"shutil.move",
"urllib.request.urlretrieve",
"pyxllib.file.specialist.dirlib.File",
"tqdm.tqdm",
"os.path.join",
"requests.get",
"os.path.split",
"bs4.BeautifulSoup",
"os.path.isfile",
"os.unlink",
"os.stat"
] | [((1039, 1056), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (1051, 1056), False, 'import requests\n'), ((1068, 1097), 'bs4.BeautifulSoup', 'BeautifulSoup', (['r.text', '"""lxml"""'], {}), "(r.text, 'lxml')\n", (1081, 1097), False, 'from bs4 import BeautifulSoup\n'), ((1874, 1905), 'os.makedirs', 'os.maked... |
# Generated by Django 2.1.13 on 2019-12-10 10:15
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import filer.fields.image
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swapp... | [
"django.db.models.AutoField",
"django.db.migrations.swappable_dependency",
"django.db.models.ManyToManyField",
"django.db.models.CharField"
] | [((304, 363), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.FILER_IMAGE_MODEL'], {}), '(settings.FILER_IMAGE_MODEL)\n', (335, 363), False, 'from django.db import migrations, models\n'), ((2444, 2484), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([], {'to':... |
from socket import socket
def check_port(ip: str, port: int = 21, timeout: float = 0.2) -> str:
"""Check tcp port, returns ip if connection established"""
with socket() as sock:
sock.settimeout(timeout)
return ip if sock.connect_ex((ip, port)) == 0 else ''
def portchecker(port: int, timeout:... | [
"functools.partial",
"socket.socket"
] | [((443, 490), 'functools.partial', 'partial', (['check_port'], {'port': 'port', 'timeout': 'timeout'}), '(check_port, port=port, timeout=timeout)\n', (450, 490), False, 'from functools import partial\n'), ((170, 178), 'socket.socket', 'socket', ([], {}), '()\n', (176, 178), False, 'from socket import socket\n')] |
# Generated by Django 2.0.13 on 2019-12-12 09:31
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('annotations', '0036_logimageaction'),
]
operations = [
migrations.AddField(
model_name='logimageaction',
name='ip',... | [
"django.db.models.GenericIPAddressField"
] | [((339, 378), 'django.db.models.GenericIPAddressField', 'models.GenericIPAddressField', ([], {'null': '(True)'}), '(null=True)\n', (367, 378), False, 'from django.db import migrations, models\n')] |
# Copyright 2019-2020 The Lux 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
#
# Unless required by applicable law or agreed... | [
"lux.Clause",
"pandas.read_csv"
] | [((657, 688), 'pandas.read_csv', 'pd.read_csv', (['"""lux/data/car.csv"""'], {}), "('lux/data/car.csv')\n", (668, 688), True, 'import pandas as pd\n'), ((852, 883), 'pandas.read_csv', 'pd.read_csv', (['"""lux/data/car.csv"""'], {}), "('lux/data/car.csv')\n", (863, 883), True, 'import pandas as pd\n'), ((1186, 1217), 'p... |
#_ __
# | |/ /___ ___ _ __ ___ _ _ ®
# | ' </ -_) -_) '_ \/ -_) '_|
# |_|\_\___\___| .__/\___|_|
# |_|
#
# <NAME>
# Copyright 2019 Keeper Security Inc.
# Contact: <EMAIL>
#
import argparse
import logging
import requests
from contextlib import contextmanager
from .. import api
from . import imp_exp
fro... | [
"requests.get",
"logging.info",
"logging.error",
"argparse.ArgumentParser"
] | [((746, 842), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'prog': '"""import"""', 'description': '"""Import data from local file to Keeper"""'}), "(prog='import', description=\n 'Import data from local file to Keeper')\n", (769, 842), False, 'import argparse\n'), ((1800, 1896), 'argparse.ArgumentPars... |
import logging
def pytest_addoption(parser):
parser.addoption(
"--no-linting",
action="store_true",
default=False,
help="Skip linting checks",
)
parser.addoption(
"--linting",
action="store_true",
default=False,
help="Only run linting checks"... | [
"logging.getLogger"
] | [((727, 754), 'logging.getLogger', 'logging.getLogger', (['"""flake8"""'], {}), "('flake8')\n", (744, 754), False, 'import logging\n')] |
import unittest
from PyQt4 import QtGui
import sys
from FlatCAMApp import App
from FlatCAMObj import FlatCAMExcellon, FlatCAMCNCjob
from ObjectUI import ExcellonObjectUI
import tempfile
import os
from time import sleep
class ExcellonFlowTestCase(unittest.TestCase):
"""
This is a top-level test covering the Ex... | [
"PyQt4.QtGui.QApplication",
"FlatCAMApp.App",
"time.sleep",
"os.path.isfile",
"tempfile.NamedTemporaryFile",
"os.remove"
] | [((485, 513), 'PyQt4.QtGui.QApplication', 'QtGui.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (503, 513), False, 'from PyQt4 import QtGui\n'), ((620, 644), 'FlatCAMApp.App', 'App', ([], {'user_defaults': '(False)'}), '(user_defaults=False)\n', (623, 644), False, 'from FlatCAMApp import App\n'), ((6412, 6438), 'os... |
import numpy as np
import nept
def bayesian_prob(counts, tuning_curves, binsize, min_neurons, min_spikes=1):
"""Computes the bayesian probability of location based on spike counts.
Parameters
----------
counts : nept.AnalogSignal
Where each inner array is the number of spikes (int) in each bi... | [
"numpy.nanargmax",
"nept.Position",
"numpy.where",
"numpy.nansum",
"numpy.log",
"numpy.asarray",
"nept.Epoch",
"numpy.any",
"numpy.sum",
"numpy.empty",
"numpy.isnan",
"numpy.finfo",
"numpy.shape",
"numpy.isinf",
"numpy.seterr",
"numpy.arange"
] | [((1569, 1593), 'numpy.seterr', 'np.seterr', ([], {'over': '"""ignore"""'}), "(over='ignore')\n", (1578, 1593), True, 'import numpy as np\n'), ((2408, 2435), 'numpy.seterr', 'np.seterr', ([], {}), '(**error_settings)\n', (2417, 2435), True, 'import numpy as np\n'), ((2798, 2839), 'numpy.sum', 'np.sum', (['(counts.data ... |
# -*- coding: utf-8 -*-
"""VISA VPP-4.3 data types (VPP-4.3.2 spec, section 3) using ctypes constants.
This file is part of PyVISA.
All data types that are defined by VPP-4.3.2.
The module exports all data types including the pointer and array types. This
means "ViUInt32" and such.
:copyright: 2014-2020 by PyVISA ... | [
"ctypes.POINTER"
] | [((3021, 3044), 'ctypes.POINTER', '_ctypes.POINTER', (['ViChar'], {}), '(ViChar)\n', (3036, 3044), True, 'import ctypes as _ctypes\n'), ((3535, 3566), 'ctypes.POINTER', '_ctypes.POINTER', (['_ctypes.c_char'], {}), '(_ctypes.c_char)\n', (3550, 3566), True, 'import ctypes as _ctypes\n'), ((3645, 3668), 'ctypes.POINTER', ... |
import sys, os
import gi
gi.require_version('Gst', '1.0')
from gi.repository import Gst, Gtk, GObject
# important!!! needed by window.get_xid(), xvimagesink.set_window_handle.
from gi.repository import GdkX11, GstVideo
GObject.threads_init()
Gst.init(None)
class PlayBin(Gtk.Window):
def __init__(self):
... | [
"gi.repository.Gst.init",
"gi.repository.Gtk.HBox",
"gi.repository.Gst.ElementFactory.make",
"gi.repository.Gtk.Window.__init__",
"gi.require_version",
"os.path.isfile",
"gi.repository.GObject.threads_init",
"gi.repository.Gtk.Entry",
"gi.repository.Gtk.DrawingArea",
"gi.repository.Gtk.ToggleButto... | [((25, 57), 'gi.require_version', 'gi.require_version', (['"""Gst"""', '"""1.0"""'], {}), "('Gst', '1.0')\n", (43, 57), False, 'import gi\n'), ((221, 243), 'gi.repository.GObject.threads_init', 'GObject.threads_init', ([], {}), '()\n', (241, 243), False, 'from gi.repository import Gst, Gtk, GObject\n'), ((244, 258), 'g... |
import numpy as np
from heuristics import lex, equalweight
from utils import select_p_based_on_experiment
class environment():
def __init__(self, x1, y1, x2, y2, p, experiment):
"""
The environment is initiated with different parameters of x1, x2, y1, y2 and p.
:param x1: uniform[-10, 10]... | [
"heuristics.lex",
"utils.select_p_based_on_experiment",
"heuristics.equalweight"
] | [((1948, 1993), 'utils.select_p_based_on_experiment', 'select_p_based_on_experiment', (['self.experiment'], {}), '(self.experiment)\n', (1976, 1993), False, 'from utils import select_p_based_on_experiment\n'), ((1797, 1831), 'heuristics.lex', 'lex', (['probability_dict', 'values_dict'], {}), '(probability_dict, values_... |
#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
"""Test A&AI Element."""
import pytest
from unittest import mock
from onapsdk.sdnc.sdnc_element import SdncElement
from onapsdk.utils.gui import GuiList
@mock.patch.object(SdncElement, "send_message")
def test_get_guis(send_message_mock):
component = Sd... | [
"onapsdk.sdnc.sdnc_element.SdncElement",
"unittest.mock.patch.object"
] | [((217, 263), 'unittest.mock.patch.object', 'mock.patch.object', (['SdncElement', '"""send_message"""'], {}), "(SdncElement, 'send_message')\n", (234, 263), False, 'from unittest import mock\n'), ((318, 331), 'onapsdk.sdnc.sdnc_element.SdncElement', 'SdncElement', ([], {}), '()\n', (329, 331), False, 'from onapsdk.sdnc... |
import numpy as np
import torch
import torch.nn as nn
from torch.autograd import Variable
import math
import torch.nn.functional as F
import pdb
def Entropy(input_):
bs = input_.size(0)
epsilon = 1e-5
entropy = -input_ * torch.log(input_ + epsilon)
entropy = torch.sum(entropy, dim=1)
return entropy... | [
"torch.ones_like",
"torch.log",
"torch.log_softmax",
"torch.mean",
"torch.exp",
"torch.softmax",
"numpy.array",
"torch.nn.BCELoss",
"torch.sum",
"torch.nn.LogSoftmax",
"torch.nn.functional.softmax"
] | [((276, 301), 'torch.sum', 'torch.sum', (['entropy'], {'dim': '(1)'}), '(entropy, dim=1)\n', (285, 301), False, 'import torch\n'), ((234, 261), 'torch.log', 'torch.log', (['(input_ + epsilon)'], {}), '(input_ + epsilon)\n', (243, 261), False, 'import torch\n'), ((1187, 1211), 'torch.ones_like', 'torch.ones_like', (['en... |
# Copyright (c) 2019, CRS4
#
# 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, distribu... | [
"logging.getLogger",
"random.choice",
"django.contrib.auth.models.Group.objects.get",
"uuid.uuid4",
"datetime.datetime.now",
"reviews_manager.models.ClinicalAnnotation.objects.all",
"reviews_manager.models.ClinicalAnnotation",
"reviews_manager.models.ROIsAnnotation.objects.exclude",
"django.core.man... | [((1503, 1540), 'logging.getLogger', 'logging.getLogger', (['"""promort_commands"""'], {}), "('promort_commands')\n", (1520, 1540), False, 'import logging, random\n'), ((1961, 2027), 'django.contrib.auth.models.Group.objects.get', 'Group.objects.get', ([], {'name': "DEFAULT_GROUPS['clinical_manager']['name']"}), "(name... |
# Generated by Django 2.2.13 on 2020-06-19 09:41
from django.db import migrations
def add_permission_groups(apps, schema_editor):
Group = apps.get_model("auth", "Group")
Group.objects.create(name="Sifter")
Group.objects.create(name="Editor")
Group.objects.create(name="Publisher")
Group.objects.cr... | [
"django.db.migrations.RunPython"
] | [((674, 761), 'django.db.migrations.RunPython', 'migrations.RunPython', (['add_permission_groups'], {'reverse_code': 'delete_permission_groups'}), '(add_permission_groups, reverse_code=\n delete_permission_groups)\n', (694, 761), False, 'from django.db import migrations\n')] |
'''
Written by <NAME> (<EMAIL>)
Github repository: https://github.com/tmunzer/Mist_library/
'''
#######################################################################################################################################
#######################################################################################... | [
"getopt.getopt",
"random.choice",
"os.environ.get",
"requests.get",
"dotenv.load_dotenv",
"datetime.datetime.now",
"requests.put",
"sys.exit",
"mist_smtp.mist_smtp.Mist_SMTP"
] | [((1378, 1424), 'os.environ.get', 'os.environ.get', (['"""MIST_SMTP_HOST"""'], {'default': 'None'}), "('MIST_SMTP_HOST', default=None)\n", (1392, 1424), False, 'import os\n'), ((1442, 1487), 'os.environ.get', 'os.environ.get', (['"""MIST_SMTP_PORT"""'], {'default': '(587)'}), "('MIST_SMTP_PORT', default=587)\n", (1456,... |
import logging
from collections import OrderedDict
from datetime import datetime, timedelta
import numpy as np
logger = logging.getLogger(__name__)
class TrackedObject:
def __init__(self, pos: np.ndarray):
self.pos = pos
self.last_seen = self._now()
self.id = None
self.tracking_... | [
"logging.getLogger",
"datetime.datetime.now",
"collections.OrderedDict",
"datetime.timedelta"
] | [((123, 150), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (140, 150), False, 'import logging\n'), ((758, 772), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (770, 772), False, 'from datetime import datetime, timedelta\n'), ((873, 886), 'collections.OrderedDict', 'OrderedDi... |
from django.shortcuts import render
from WangBlog.models import *
# Create your views here.
def hello(request):
name = "wangtieguo"
return render(request, "index.html", locals())
# return HttpResponse("<h1>hello world, 我是王铁锅</h1>")
def login(request):
print('hello')
if "POST" == request.method:
... | [
"django.shortcuts.render"
] | [((1898, 1942), 'django.shortcuts.render', 'render', (['request', '"""register.html"""', "{'uf': uf}"], {}), "(request, 'register.html', {'uf': uf})\n", (1904, 1942), False, 'from django.shortcuts import render\n'), ((1799, 1852), 'django.shortcuts.render', 'render', (['request', '"""login.html"""', "{'username': usern... |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
"tensorflow.contrib.py2tf.utils.set_element_type",
"tensorflow.contrib.py2tf.converters.lists.transform",
"tensorflow.python.platform.test.main"
] | [((1834, 1845), 'tensorflow.python.platform.test.main', 'test.main', ([], {}), '()\n', (1843, 1845), False, 'from tensorflow.python.platform import test\n'), ((1428, 1459), 'tensorflow.contrib.py2tf.converters.lists.transform', 'lists.transform', (['node', 'self.ctx'], {}), '(node, self.ctx)\n', (1443, 1459), False, 'f... |