code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from copy import deepcopy
import numpy as np
from batchopt.optimizers.base_optimizer import BaseOptimizer, RandomRelocator
class SineCosineAlgorithm(BaseOptimizer):
"""
Sine-Cosine Algorithm
"""
A = 2.0
def __init__(
self,
domain_range,
log=True,
epoch=750,
... | [
"numpy.abs",
"numpy.where",
"numpy.random.uniform",
"numpy.cos",
"copy.deepcopy",
"numpy.sin",
"numpy.broadcast_to"
] | [((846, 904), 'numpy.random.uniform', 'np.random.uniform', ([], {'size': '(self.pop_size, self.problem_size)'}), '(size=(self.pop_size, self.problem_size))\n', (863, 904), True, 'import numpy as np\n'), ((992, 1015), 'copy.deepcopy', 'deepcopy', (['prev_position'], {}), '(prev_position)\n', (1000, 1015), False, 'from c... |
import numpy as np
import tensorflow as tf
from tensorflow.python.eager import context
from tensorflow.python.framework import tensor_shape
from tensorflow.python.keras import activations
from tensorflow.python.keras import backend
from tensorflow.python.keras import constraints
from tensorflow.python.keras import ini... | [
"tensorflow.math.reduce_prod",
"tensorflow.shape",
"tensorflow.transpose",
"tensorflow.python.keras.initializers.get",
"tensorflow.python.keras.regularizers.serialize",
"tensorflow.reduce_sum",
"tensorflow.python.keras.activations.get",
"tensorflow.cast",
"tensorflow.python.keras.activations.seriali... | [((1874, 1919), 'tensorflow.reduce_sum', 'tf.reduce_sum', (['(t * style_strength_map)'], {'axis': '(1)'}), '(t * style_strength_map, axis=1)\n', (1887, 1919), True, 'import tensorflow as tf\n'), ((1955, 1974), 'tensorflow.cast', 'tf.cast', (['y', 't.dtype'], {}), '(y, t.dtype)\n', (1962, 1974), True, 'import tensorflow... |
from typing import Any
import copy as cp
from utils.PhaseUtils.phase import Phase
from utils.Basic.position import Position3D
from utils.Basic.velocity import Velocity3D
class Collision:
count: int
tbd: Any
def __init__(self, count=0):
self.count = count
def __str__(self):
return st... | [
"utils.Basic.position.Position3D"
] | [((527, 539), 'utils.Basic.position.Position3D', 'Position3D', ([], {}), '()\n', (537, 539), False, 'from utils.Basic.position import Position3D\n'), ((560, 572), 'utils.Basic.position.Position3D', 'Position3D', ([], {}), '()\n', (570, 572), False, 'from utils.Basic.position import Position3D\n')] |
# Copyright (c) OpenMMLab. All rights reserved.
import argparse
import os
import cv2
import mmcv
import numpy as np
import torch
from mmedit.apis import init_model, restoration_video_inference
from mmedit.core import tensor2img
from mmedit.utils import modify_args
VIDEO_EXTENSIONS = ('.mp4', '.mov')
def parse_args... | [
"argparse.ArgumentParser",
"mmcv.imwrite",
"mmedit.apis.restoration_video_inference",
"os.path.splitext",
"mmedit.utils.modify_args",
"cv2.VideoWriter",
"mmedit.core.tensor2img",
"cv2.destroyAllWindows",
"cv2.VideoWriter_fourcc",
"torch.device"
] | [((328, 341), 'mmedit.utils.modify_args', 'modify_args', ([], {}), '()\n', (339, 341), False, 'from mmedit.utils import modify_args\n'), ((355, 410), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Restoration demo"""'}), "(description='Restoration demo')\n", (378, 410), False, 'import ar... |
from pathlib import Path
from simod.multitasking import adjust_durations
from simod.event_log import read, reformat_timestamps
def test_adjust_durations_purchasing_example(entry_point):
log_path = Path(entry_point) / 'PurchasingExampleMultitasking.xes'
log, log_path_csv = read(log_path)
result = adjust_d... | [
"simod.event_log.read",
"simod.multitasking.adjust_durations",
"simod.event_log.reformat_timestamps",
"pathlib.Path"
] | [((284, 298), 'simod.event_log.read', 'read', (['log_path'], {}), '(log_path)\n', (288, 298), False, 'from simod.event_log import read, reformat_timestamps\n'), ((312, 347), 'simod.multitasking.adjust_durations', 'adjust_durations', (['log'], {'verbose': '(True)'}), '(log, verbose=True)\n', (328, 347), False, 'from sim... |
import numpy as np
from proseco.core import get_kwargs_from_starcheck_text
# Vanilla observation info
STD_INFO = dict(att=(0, 0, 0),
detector='ACIS-S',
sim_offset=0,
focus_offset=0,
date='2018:001',
n_guide=5,
n_fid=3,
... | [
"numpy.full",
"proseco.core.get_kwargs_from_starcheck_text"
] | [((546, 588), 'numpy.full', 'np.full', ([], {'shape': '(1024, 1024)', 'fill_value': '(40)'}), '(shape=(1024, 1024), fill_value=40)\n', (553, 588), True, 'import numpy as np\n'), ((2915, 2970), 'proseco.core.get_kwargs_from_starcheck_text', 'get_kwargs_from_starcheck_text', (['chunk'], {'include_cat': '(True)'}), '(chun... |
from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Tag
from recipe.serializers import TagSerializer
TAGS_URL = reverse('recipe:tag-list')
class PublicTa... | [
"django.contrib.auth.get_user_model",
"core.models.Tag.objects.filter",
"core.models.Tag.objects.create",
"rest_framework.test.APIClient",
"recipe.serializers.TagSerializer",
"django.urls.reverse",
"core.models.Tag.objects.all"
] | [((277, 303), 'django.urls.reverse', 'reverse', (['"""recipe:tag-list"""'], {}), "('recipe:tag-list')\n", (284, 303), False, 'from django.urls import reverse\n'), ((433, 444), 'rest_framework.test.APIClient', 'APIClient', ([], {}), '()\n', (442, 444), False, 'from rest_framework.test import APIClient\n'), ((939, 950), ... |
import praw
import random
import itertools
from nsfw import isEnabled
def main():
print("--------------------")
print("asdf " + random_hot_post(''))
print("--------------------")
def random_hot_post(subreddit, limit, message):
r = praw.Reddit(user_agent='Discord Bot', client_id='byorb8K1SwaO1g', cl... | [
"nsfw.isEnabled",
"praw.Reddit",
"itertools.islice",
"random.randrange"
] | [((252, 344), 'praw.Reddit', 'praw.Reddit', ([], {'user_agent': '"""Discord Bot"""', 'client_id': '"""byorb8K1SwaO1g"""', 'client_secret': '"""<KEY>"""'}), "(user_agent='Discord Bot', client_id='byorb8K1SwaO1g',\n client_secret='<KEY>')\n", (263, 344), False, 'import praw\n'), ((1302, 1394), 'praw.Reddit', 'praw.Red... |
""" Miscellaneous utility functions """
import logging
import os
import pandas as pd
logger = logging.getLogger(__name__)
def load_df_from_dataset(file_name: str) -> pd.DataFrame:
""" Loads cleaned dataframe from csv
Fields with extra records get logged and dropped.
"""
df = pd.read_csv(file_name)
... | [
"logging.getLogger",
"pandas.isna",
"os.environ.get",
"pandas.read_csv"
] | [((96, 123), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (113, 123), False, 'import logging\n'), ((297, 319), 'pandas.read_csv', 'pd.read_csv', (['file_name'], {}), '(file_name)\n', (308, 319), True, 'import pandas as pd\n'), ((1278, 1335), 'os.environ.get', 'os.environ.get', (['"""DAT... |
#!/usr/bin/env python3
# Copyright (c) 2020 The DIVI developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Tests basic behaviour (standardness, fees) of OP_META transactions.
from test_framework import BitcoinTestFrame... | [
"random.sample",
"PowToPosTransition.generatePoSBlocks",
"PowToPosTransition.createPoSStacks"
] | [((1702, 1749), 'random.sample', 'random.sample', (['[x for x in staker_addresses]', '(5)'], {}), '([x for x in staker_addresses], 5)\n', (1715, 1749), False, 'import random\n'), ((2682, 2722), 'PowToPosTransition.createPoSStacks', 'createPoSStacks', (['[self.node]', 'self.nodes'], {}), '([self.node], self.nodes)\n', (... |
"""
Copyright (C) 2021 <NAME> - All Rights Reserved
You may use, distribute and modify this code under the
terms of the MIT license.
You should have received a copy of the MIT license with
this file. If not, please write to: <EMAIL>
"""
from src.modules.formatter import formatSearchQuery, formatTitle
def test_format... | [
"src.modules.formatter.formatSearchQuery",
"src.modules.formatter.formatTitle"
] | [((404, 428), 'src.modules.formatter.formatSearchQuery', 'formatSearchQuery', (['"""1 2"""'], {}), "('1 2')\n", (421, 428), False, 'from src.modules.formatter import formatSearchQuery, formatTitle\n'), ((449, 473), 'src.modules.formatter.formatSearchQuery', 'formatSearchQuery', (['"""A B"""'], {}), "('A B')\n", (466, 4... |
from distutils.core import setup
from setuptools import find_packages
setup(
name='pyrelate',
version='1.0.0',
author='sendwithus',
author_email='<EMAIL>',
packages=find_packages(),
scripts=[],
url='https://github.com/mrmch/pyrelate',
license='LICENSE.txt',
description='Python API c... | [
"setuptools.find_packages"
] | [((186, 201), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (199, 201), False, 'from setuptools import find_packages\n')] |
#!/usr/bin/env python3
import csv
import sys
import glob
################################# Parameters ##################################
#sys.argv = ["MakeSglpmOutput_PF.py", 500, 10]
if len(sys.argv) < 2:
print("Usage:",sys.argv[0],"[#User] [#Trace]" )
sys.exit(0)
# Prefix of the sg-LPM directory ... | [
"csv.writer",
"csv.reader",
"glob.glob",
"sys.exit"
] | [((1545, 1564), 'glob.glob', 'glob.glob', (['SglpmDir'], {}), '(SglpmDir)\n', (1554, 1564), False, 'import glob\n'), ((272, 283), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (280, 283), False, 'import sys\n'), ((1927, 1961), 'csv.writer', 'csv.writer', (['f'], {'lineterminator': '"""\n"""'}), "(f, lineterminator='\... |
from django.db import models
class Item(models.Model):
# 特に指定しない場合、blank=False(=入力必須)
name = models.CharField('Name', max_length=255) | [
"django.db.models.CharField"
] | [((102, 142), 'django.db.models.CharField', 'models.CharField', (['"""Name"""'], {'max_length': '(255)'}), "('Name', max_length=255)\n", (118, 142), False, 'from django.db import models\n')] |
from django import forms
from django.contrib import admin
from election.models import CandidateElection
class CustomModelChoiceField(forms.ModelChoiceField):
def label_from_instance(self, obj):
return '{} ({}): {} {}'.format(
obj.candidate.person.full_name,
obj.candidate.party.ap_... | [
"election.models.CandidateElection.objects.all"
] | [((507, 538), 'election.models.CandidateElection.objects.all', 'CandidateElection.objects.all', ([], {}), '()\n', (536, 538), False, 'from election.models import CandidateElection\n')] |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | [
"charms.reactive.hook"
] | [((1121, 1165), 'charms.reactive.hook', 'hook', (['"""{requires:benchmark}-relation-joined"""'], {}), "('{requires:benchmark}-relation-joined')\n", (1125, 1165), False, 'from charms.reactive import hook\n'), ((1278, 1323), 'charms.reactive.hook', 'hook', (['"""{requires:benchmark}-relation-changed"""'], {}), "('{requir... |
import click
import re
import sys
import json
import copy
from ruamel import yaml
from distutils.version import LooseVersion as LV
from collections import OrderedDict
from calm.dsl.api import get_resource_api, get_api_client
from calm.dsl.providers import get_provider_interface
from calm.dsl.tools import StrictDraft7... | [
"calm.dsl.tools.StrictDraft7Validator",
"collections.OrderedDict",
"json.loads",
"calm.dsl.store.version.Version.get_version",
"calm.dsl.api.get_resource_api",
"sys.exit",
"click.secho",
"calm.dsl.providers.get_provider_interface",
"calm.dsl.api.get_api_client",
"click.prompt",
"json.dumps",
"... | [((425, 453), 'calm.dsl.log.get_logging_handle', 'get_logging_handle', (['__name__'], {}), '(__name__)\n', (443, 453), False, 'from calm.dsl.log import get_logging_handle\n'), ((465, 489), 'calm.dsl.providers.get_provider_interface', 'get_provider_interface', ([], {}), '()\n', (487, 489), False, 'from calm.dsl.provider... |
# Copyright 2020 DeepMind Technologies Limited. 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 ... | [
"threading.local"
] | [((3691, 3708), 'threading.local', 'threading.local', ([], {}), '()\n', (3706, 3708), False, 'import threading\n')] |
import torch
from torch import nn
import numpy as np
import math
def t2v(tau, f, out_features, w, b, w0, b0, arg=None):
if arg:
v1 = f(torch.matmul(tau, w) + b, arg)
else:
#print(w.shape, t1.shape, b.shape)
v1 = f(torch.matmul(tau, w) + b)
v2 = torch.matmul(tau, w0) + b0
#print(... | [
"torch.matmul",
"torch.randn",
"torch.cat",
"torch.Tensor"
] | [((377, 399), 'torch.cat', 'torch.cat', (['[v1, v2]', '(2)'], {}), '([v1, v2], 2)\n', (386, 399), False, 'import torch\n'), ((282, 303), 'torch.matmul', 'torch.matmul', (['tau', 'w0'], {}), '(tau, w0)\n', (294, 303), False, 'import torch\n'), ((614, 641), 'torch.randn', 'torch.randn', (['in_features', '(1)'], {}), '(in... |
"""
Sequence I/O: Read and write FASTA and FASTQ files efficiently
"""
__all__ = [
'open',
'Sequence',
'FastaReader',
'FastaWriter',
'FastqReader',
'FastqWriter',
'UnknownFileFormat',
'FileFormatError',
'FastaFormatError',
'FastqFormatError',
'InterleavedSequenceReader',
... | [
"functools.partial",
"os.path.splitext",
"os.fspath",
"contextlib.ExitStack"
] | [((4592, 4614), 'os.path.splitext', 'os.path.splitext', (['name'], {}), '(name)\n', (4608, 4614), False, 'import os\n'), ((5320, 5340), 'os.fspath', 'fspath', (['file_or_path'], {}), '(file_or_path)\n', (5326, 5340), False, 'from os import fspath, PathLike\n'), ((5979, 6035), 'functools.partial', 'functools.partial', (... |
# ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by <NAME> (<EMAIL>)
# Modified by <NAME> (<EMAIL>), <NAME>(<EMAIL>)
# ------------------------------------------------------------------------------
from __future__ imp... | [
"yacs.config.CfgNode"
] | [((456, 460), 'yacs.config.CfgNode', 'CN', ([], {}), '()\n', (458, 460), True, 'from yacs.config import CfgNode as CN\n'), ((643, 647), 'yacs.config.CfgNode', 'CN', ([], {}), '()\n', (645, 647), True, 'from yacs.config import CfgNode as CN\n'), ((769, 773), 'yacs.config.CfgNode', 'CN', ([], {}), '()\n', (771, 773), Tru... |
# -*- coding: utf-8 -*-
"""
A pure implementation of the Monte Carlo Tree Search (MCTS)
@author: <NAME>
"""
import numpy as np
import copy
from operator import itemgetter
def rollout_policy_fn(board):
"""rollout_policy_fn -- a coarse, fast version of policy_fn used in the rollout phase."""
# rollout randomly... | [
"operator.itemgetter",
"numpy.sqrt",
"copy.deepcopy"
] | [((6139, 6159), 'copy.deepcopy', 'copy.deepcopy', (['state'], {}), '(state)\n', (6152, 6159), False, 'import copy\n'), ((2966, 2997), 'numpy.sqrt', 'np.sqrt', (['self._parent._n_visits'], {}), '(self._parent._n_visits)\n', (2973, 2997), True, 'import numpy as np\n'), ((5499, 5512), 'operator.itemgetter', 'itemgetter', ... |
# Class for use with interfacing with github via HTTP requests
import requests
from util import retry_multi, GLOBAL_TIMEOUT
class GithubAPI:
headers = {
"Accept": "application/vnd.github.v3+json"
}
url_root = "https://api.github.com"
def __init__(self, config):
self.config = config
... | [
"util.retry_multi",
"requests.patch",
"requests.get"
] | [((325, 339), 'util.retry_multi', 'retry_multi', (['(5)'], {}), '(5)\n', (336, 339), False, 'from util import retry_multi, GLOBAL_TIMEOUT\n'), ((680, 743), 'requests.get', 'requests.get', (['url'], {'headers': 'self.headers', 'timeout': 'GLOBAL_TIMEOUT'}), '(url, headers=self.headers, timeout=GLOBAL_TIMEOUT)\n', (692, ... |
from poop.hfdp.command.undo.command import Command
from poop.hfdp.command.undo.nocommand import NoCommand
class RemoteControlWithUndo:
def __init__(self) -> None:
no_command = NoCommand()
self.__on_commands: list[Command] = [no_command for _ in range(7)]
self.__off_commands: list[Command] ... | [
"poop.hfdp.command.undo.nocommand.NoCommand"
] | [((190, 201), 'poop.hfdp.command.undo.nocommand.NoCommand', 'NoCommand', ([], {}), '()\n', (199, 201), False, 'from poop.hfdp.command.undo.nocommand import NoCommand\n')] |
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# <NAME> <<EMAIL>>
#
# Copyright (C) 2012-2014 Idiap Research Institute, Martigny, Switzerland
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundat... | [
"pkg_resources.resource_filename",
"bob.db.base.utils.null"
] | [((1265, 1271), 'bob.db.base.utils.null', 'null', ([], {}), '()\n', (1269, 1271), False, 'from bob.db.base.utils import null\n'), ((1896, 1902), 'bob.db.base.utils.null', 'null', ([], {}), '()\n', (1900, 1902), False, 'from bob.db.base.utils import null\n'), ((2443, 2449), 'bob.db.base.utils.null', 'null', ([], {}), '(... |
#! /usr/bin/env python3
"""Demonstrate the simplest way to control the AnalogOut instrument."""
import time
import math
import argparse
from pydwf import DwfLibrary, DwfAnalogOutNode, DwfAnalogOutFunction, DwfAnalogOutIdle, PyDwfError
from pydwf.utilities import openDwfDevice
def demo_simple_analog_out(analogOut):... | [
"pydwf.utilities.openDwfDevice",
"argparse.ArgumentParser",
"time.monotonic",
"pydwf.DwfLibrary",
"math.cos",
"math.sin"
] | [((1337, 1353), 'time.monotonic', 'time.monotonic', ([], {}), '()\n', (1351, 1353), False, 'import time\n'), ((2101, 2201), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Demonstrate simple usage of the AnalogOut functionality."""'}), "(description=\n 'Demonstrate simple usage of the ... |
import os
from unittest import mock
from castero.config import Config
from castero.episode import Episode
from castero.feed import Feed
my_dir = os.path.dirname(os.path.realpath(__file__))
def get_primary_perspective(display):
"""Retrieve the Primary perspective.
Args:
display: the display containi... | [
"os.path.realpath",
"castero.episode.Episode",
"unittest.mock.MagicMock",
"castero.feed.Feed"
] | [((163, 189), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (179, 189), False, 'import os\n'), ((1068, 1112), 'castero.feed.Feed', 'Feed', ([], {'file': "(my_dir + '/feeds/valid_basic.xml')"}), "(file=my_dir + '/feeds/valid_basic.xml')\n", (1072, 1112), False, 'from castero.feed import Fee... |
import urllib.request
from panda3d.core import Vec4, Vec3, TextNode, PNMImage, StringStream, Texture, HTTPClient, DocumentSpec, Ramfile, Point3, ConfigVariableBool, ConfigVariableString
from direct.task.Task import Task
from direct.gui.DirectGui import DirectFrame, DirectLabel, DirectButton, DirectScrolledList, DirectC... | [
"panda3d.core.DocumentSpec",
"panda3d.core.ConfigVariableString",
"direct.directnotify.DirectNotifyGlobal.directNotify.newCategory",
"toontown.toonbase.ToontownGlobals.getMinnieFont",
"panda3d.core.Point3",
"toontown.parties.PartyUtils.formatTime",
"panda3d.core.PNMImage",
"toontown.parties.PartyUtils... | [((1077, 1134), 'direct.directnotify.DirectNotifyGlobal.directNotify.newCategory', 'DirectNotifyGlobal.directNotify.newCategory', (['"""EventsPage"""'], {}), "('EventsPage')\n", (1120, 1134), False, 'from direct.directnotify import DirectNotifyGlobal\n'), ((1152, 1190), 'panda3d.core.ConfigVariableBool', 'ConfigVariabl... |
import setuptools
d = {}
exec(open("spikeextractors/version.py").read(), None, d)
version = d['version']
pkg_name = "spikeextractors"
long_description = open("README.md").read()
setuptools.setup(
name=pkg_name,
version=version,
author="<NAME>, <NAME>, <NAME>, <NAME>",
author_email="<EMAIL>",
descr... | [
"setuptools.find_packages"
] | [((606, 632), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (630, 632), False, 'import setuptools\n')] |
# -*- coding: utf-8 -*-
"""Card tabs, brings together various tabs."""
import dash_bootstrap_components as dbc
import dash_html_components as html
from app.dashboard.tab import census, parameter, report, upload # noqa
content = dbc.Card(
[
dbc.CardHeader(
[
dbc.Tabs(
... | [
"dash_bootstrap_components.Tab",
"dash_html_components.Div"
] | [((848, 875), 'dash_html_components.Div', 'html.Div', ([], {'id': '"""card-content"""'}), "(id='card-content')\n", (856, 875), True, 'import dash_html_components as html\n'), ((357, 414), 'dash_bootstrap_components.Tab', 'dbc.Tab', ([], {'label': '"""Model Parameters"""', 'tab_id': '"""parameter-tab"""'}), "(label='Mod... |
import click
import json
import numpy as np
import os
import tensorflow.compat.v1 as tf
import time
from luminoth.datasets import get_dataset
from luminoth.models import get_model
from luminoth.utils.bbox_overlap import bbox_overlap
from luminoth.utils.config import get_config
from luminoth.utils.image_vis import imag... | [
"tensorflow.compat.v1.gfile.GFile",
"tensorflow.compat.v1.shape",
"tensorflow.compat.v1.gfile.Exists",
"tensorflow.compat.v1.train.start_queue_runners",
"time.sleep",
"numpy.argsort",
"tensorflow.compat.v1.logging.error",
"tensorflow.compat.v1.set_random_seed",
"tensorflow.compat.v1.train.Coordinato... | [((339, 398), 'click.command', 'click.command', ([], {'help': '"""Evaluate trained (or training) models"""'}), "(help='Evaluate trained (or training) models')\n", (352, 398), False, 'import click\n'), ((400, 490), 'click.option', 'click.option', (['"""dataset_split"""', '"""--split"""'], {'default': '"""val"""', 'help'... |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"research.carls.kernels.gen_carls_ops.dynamic_embedding_update",
"tensorflow.Variable",
"research.carls.kernels.gen_carls_ops.dynamic_embedding_lookup_grad",
"research.carls.kernels.gen_carls_ops.dynamic_embedding_lookup",
"tensorflow.constant",
"tensorflow.reshape",
"research.carls.context.add_to_colle... | [((6607, 6652), 'tensorflow.RegisterGradient', 'tf.RegisterGradient', (['"""DynamicEmbeddingLookup"""'], {}), "('DynamicEmbeddingLookup')\n", (6626, 6652), True, 'import tensorflow as tf\n'), ((4536, 4579), 'research.carls.context.add_to_collection', 'context.add_to_collection', (['var_name', 'config'], {}), '(var_name... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'tlb6700_gui_1um.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 i... | [
"PyQt5.QtWidgets.QWidget",
"PyQt5.QtWidgets.QTextEdit",
"PyQt5.QtWidgets.QTextBrowser",
"PyQt5.QtGui.QFont",
"pyqtgraph.GraphicsLayoutWidget",
"PyQt5.QtCore.QMetaObject.connectSlotsByName",
"PyQt5.QtWidgets.QFrame",
"PyQt5.QtCore.QRect",
"PyQt5.QtWidgets.QStatusBar",
"PyQt5.QtWidgets.QLabel",
"P... | [((598, 627), 'PyQt5.QtWidgets.QWidget', 'QtWidgets.QWidget', (['MainWindow'], {}), '(MainWindow)\n', (615, 627), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((720, 761), 'PyQt5.QtWidgets.QPushButton', 'QtWidgets.QPushButton', (['self.centralwidget'], {}), '(self.centralwidget)\n', (741, 761), False, 'from ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""This is the GoReport class. GoReport handles everything from connecting to the target Gophish
server to pulling campaign information and reporting the results.
"""
# Try to import gophish
try:
from gophish import Gophish
except:
print("[!] Could not import the... | [
"requests.packages.urllib3.disable_warnings",
"configparser.ConfigParser",
"user_agents.parse",
"requests.get",
"collections.Counter",
"faker.Faker",
"collections.defaultdict",
"sys.exit",
"gophish.Gophish",
"xlsxwriter.Workbook"
] | [((1349, 1415), 'requests.packages.urllib3.disable_warnings', 'requests.packages.urllib3.disable_warnings', (['InsecureRequestWarning'], {}), '(InsecureRequestWarning)\n', (1391, 1415), False, 'import requests\n'), ((5984, 6028), 'gophish.Gophish', 'Gophish', (['API_KEY'], {'host': 'GP_HOST', 'verify': '(False)'}), '(A... |
import argparse
import pandas_ta as ta
import matplotlib.pyplot as plt
from pandas.plotting import register_matplotlib_converters
from helper_funcs import check_positive
register_matplotlib_converters()
# ------------------------------------------------------- AD ----------------------------------------------------... | [
"matplotlib.pyplot.grid",
"argparse.ArgumentParser",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.minorticks_on",
"matplotlib.pyplot.axhline",
"pandas_ta.obv",
"matplotlib.pyplot.bar",
"pandas.plotting.register_matplotlib_converters",
"pand... | [((173, 205), 'pandas.plotting.register_matplotlib_converters', 'register_matplotlib_converters', ([], {}), '()\n', (203, 205), False, 'from pandas.plotting import register_matplotlib_converters\n'), ((385, 1552), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'prog': '"""ad"""', 'description': '""" The Ac... |
#! /usr/bin/env python
import rospy
from geometry_msgs.msg import Twist
from std_msgs.msg import Empty
def takeoff_callback(msg):
twist_msg.linear.z = 0.4
i = 0
while i < 3:
cmd_vel_pub.publish(twist_msg)
i = i + 1
rate.sleep()
twist_msg.linear.z = 0
cmd_vel_pub.publish(twist_msg)
d... | [
"rospy.Subscriber",
"geometry_msgs.msg.Twist",
"rospy.init_node",
"rospy.Rate",
"rospy.spin",
"rospy.Publisher",
"std_msgs.msg.Empty"
] | [((530, 560), 'rospy.init_node', 'rospy.init_node', (['"""takoff_land"""'], {}), "('takoff_land')\n", (545, 560), False, 'import rospy\n'), ((568, 581), 'rospy.Rate', 'rospy.Rate', (['(1)'], {}), '(1)\n', (578, 581), False, 'import rospy\n'), ((597, 650), 'rospy.Subscriber', 'rospy.Subscriber', (['"""/takeoff"""', 'Emp... |
from lf3py.api.errors import ApiError
from lf3py.api.response import ErrorBody, Response
from lf3py.api.symbols import IApiRender
from lf3py.lang.error import stacktrace
from lf3py.routing.errors import RouteMismatchError
from lf3py.task.data import Result
class ApiRender(IApiRender):
def __init__(self, response:... | [
"lf3py.task.data.Result",
"lf3py.api.response.Response",
"lf3py.lang.error.stacktrace"
] | [((426, 434), 'lf3py.task.data.Result', 'Result', ([], {}), '()\n', (432, 434), False, 'from lf3py.task.data import Result\n'), ((972, 1061), 'lf3py.api.response.Response', 'Response', ([], {'statusCode': 'status', 'headers': '{**self._response.headers, **headers}', 'body': 'body'}), '(statusCode=status, headers={**sel... |
"""Support for INSTEON dimmers via PowerLinc Modem."""
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from .insteon_entity import InsteonEntity
_LOGGER = logging.getLogger(__name__)
SENSOR_TYPES = {
"openClosedSensor": "opening",
"ioLincSensor": "opening",
"motionSe... | [
"logging.getLogger"
] | [((195, 222), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (212, 222), False, 'import logging\n')] |
import json
class ipblock:
def get_ipblock(self, ipblock_id):
"""
Retrieves a single IP block by ID.
:param ipblock_id: The unique ID of the IP block.
:type ipblock_id: ``str``
"""
response = self._perform_request('/ipblocks/%s' % ipblock_id)
re... | [
"json.dumps"
] | [((1414, 1429), 'json.dumps', 'json.dumps', (['raw'], {}), '(raw)\n', (1424, 1429), False, 'import json\n')] |
from kamui.application import create_app
from kamui.configuration.database import init_db
application = create_app()
@application.cli.command("initdb")
def _init_db() -> None:
init_db()
if __name__ == "__main__":
application.run()
| [
"kamui.application.create_app",
"kamui.configuration.database.init_db"
] | [((105, 117), 'kamui.application.create_app', 'create_app', ([], {}), '()\n', (115, 117), False, 'from kamui.application import create_app\n'), ((183, 192), 'kamui.configuration.database.init_db', 'init_db', ([], {}), '()\n', (190, 192), False, 'from kamui.configuration.database import init_db\n')] |
#!/usr/bin/env python
"""Functions for working with command-line arguments."""
def create_arg_parser():
"""Return an parser that handles all the arguments."""
import argparse
# create a new argument parser
parser = argparse.ArgumentParser(
description='Create projects'
)
apis_example... | [
"argparse.ArgumentParser"
] | [((234, 288), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Create projects"""'}), "(description='Create projects')\n", (257, 288), False, 'import argparse\n')] |
# -*- coding: utf-8 -*-
"""
cepstrum.py
ケプストラム分析
"""
import scipy as sp
from pylufia.signal.common import *
from .fft import *
def cepstrum(x, framesize=256, fs=44100):
"""
Calculate cepstrum from 1-frame signal
Parameters:
x: ndarray
input signal
framesize: int
framesi... | [
"scipy.log10",
"scipy.ceil",
"scipy.absolute"
] | [((496, 510), 'scipy.absolute', 'sp.absolute', (['X'], {}), '(X)\n', (507, 510), True, 'import scipy as sp\n'), ((539, 558), 'scipy.log10', 'sp.log10', (['(X + 1e-05)'], {}), '(X + 1e-05)\n', (547, 558), True, 'import scipy as sp\n'), ((1174, 1204), 'scipy.ceil', 'sp.ceil', (['((framesize + 1) / 2.0)'], {}), '((framesi... |
import json
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.sites.shortcuts import get_current_site
from django.core.mail import EmailMessage
from django.db.models import Q
from django.http import JsonResponse
from django.shortcuts ... | [
"common.models.User.objects.all",
"teams.models.Teams.objects.all",
"cases.forms.CaseCommentForm",
"django.urls.reverse",
"django.shortcuts.render",
"django.shortcuts.get_object_or_404",
"json.dumps",
"django.shortcuts.redirect",
"common.models.User.objects.filter",
"django.contrib.sites.shortcuts... | [((1259, 1278), 'teams.models.Teams.objects.all', 'Teams.objects.all', ([], {}), '()\n', (1276, 1278), False, 'from teams.models import Teams\n'), ((1539, 1557), 'django.http.JsonResponse', 'JsonResponse', (['data'], {}), '(data)\n', (1551, 1557), False, 'from django.http import JsonResponse\n'), ((4350, 4412), 'accoun... |
#
# Copyright (c) 2015 Intel Corporation
#
# 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 i... | [
"os.path.exists",
"os.makedirs",
"lib.logger.LOGGER.info",
"os.path.join",
"lib.logger.LOGGER.error"
] | [((941, 986), 'os.path.join', 'os.path.join', (['PLATFORM_PARENT_PATH', 'self.name'], {}), '(PLATFORM_PARENT_PATH, self.name)\n', (953, 986), False, 'import os\n'), ((1099, 1141), 'os.path.join', 'os.path.join', (['PLATFORM_PARENT_PATH', '"""logs"""'], {}), "(PLATFORM_PARENT_PATH, 'logs')\n", (1111, 1141), False, 'impo... |
import os
import pytest
import nucleus
from tests.helpers import TEST_DATASET_ITEMS, TEST_DATASET_NAME
assert "NUCLEUS_PYTEST_API_KEY" in os.environ, (
"You must set the 'NUCLEUS_PYTEST_API_KEY' environment variable to a valid "
"Nucleus API key to run the test suite"
)
API_KEY = os.environ["NUCLEUS_PYTEST_... | [
"pytest.fixture",
"nucleus.NucleusClient"
] | [((333, 364), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (347, 364), False, 'import pytest\n'), ((444, 460), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (458, 460), False, 'import pytest\n'), ((392, 422), 'nucleus.NucleusClient', 'nucleus.NucleusClient', (['AP... |
from skimage.measure import compare_ssim as ssim
import matplotlib.pyplot as plt
import cv2
import urllib.request
import urllib.parse
import urllib.error
import tkinter as tk
from tkinter import font as tkfont
from tkinter import *
import os
from tkinter import filedialog
import sqlite3
import numpy as np
import shuti... | [
"cv2.BFMatcher",
"tkinter.Button",
"tkinter.Label",
"cv2.xfeatures2d.SIFT_create",
"tkinter.Frame",
"matplotlib.pyplot.imshow",
"os.listdir",
"cv2.drawMatchesKnn",
"matplotlib.pyplot.axis",
"random.randint",
"glob.glob",
"os.rename",
"tkinter.Tk.__init__",
"cv2.cvtColor",
"cv2.resize",
... | [((434, 471), 'tkinter.Tk.__init__', 'tk.Tk.__init__', (['self', '*args'], {}), '(self, *args, **kwargs)\n', (448, 471), True, 'import tkinter as tk\n'), ((499, 552), 'tkinter.font.Font', 'tkfont.Font', ([], {'family': '"""Calibri"""', 'size': '(18)', 'weight': '"""bold"""'}), "(family='Calibri', size=18, weight='bold'... |
# -*- coding: utf-8 -*-
"""
@author: <NAME> <<EMAIL>>
"""
import os
import csv
import argparse
import torch
import torch.nn.functional as F
from torch.utils.data import DataLoader
from torch.autograd import Variable
from src.utils import *
from src.dataset import GermanDataset
def get_args():
parser = argparse.A... | [
"csv.DictWriter",
"src.dataset.GermanDataset",
"argparse.ArgumentParser",
"torch.load",
"torch.utils.data.DataLoader",
"torch.autograd.Variable",
"torch.nn.functional.softmax",
"torch.cat"
] | [((310, 378), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""Use pre-trained model to predict new data"""'], {}), "('Use pre-trained model to predict new data')\n", (333, 378), False, 'import argparse\n'), ((1119, 1143), 'src.dataset.GermanDataset', 'GermanDataset', (['opt.input'], {}), '(opt.input)\n', (1... |
# Copyright 2019 - 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 ... | [
"logging.getLogger",
"acloud.internal.lib.adb_tools.AdbTools",
"acloud.errors.CreateError",
"sys.exit",
"os.remove",
"os.path.exists",
"acloud.internal.lib.ota_tools.FindOtaTools",
"subprocess.Popen",
"acloud.internal.lib.utils.GetUserAnswerYes",
"acloud.internal.lib.ota_tools.OtaTools",
"os.mkd... | [((2163, 2190), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (2180, 2190), False, 'import logging\n'), ((4122, 4170), 'os.path.join', 'os.path.join', (['image_dir', "(partition_name + '.img')"], {}), "(image_dir, partition_name + '.img')\n", (4134, 4170), False, 'import os\n'), ((4182, ... |
import cv2
import numpy as np
import dlib
webcam = 1
cap = cv2.VideoCapture(0)
detector = dlib.get_frontal_face_detector()
predictor = dlib.shape_predictor("shape_predictor_68_face_landmarks.dat")
def creatBox(img,points,scale =5,masked = False, cropped = True):
if masked:
mask = np.zeros_like(img)
... | [
"cv2.fillPoly",
"cv2.imread",
"numpy.zeros_like",
"dlib.shape_predictor",
"cv2.bitwise_and",
"cv2.putText",
"cv2.imshow",
"dlib.get_frontal_face_detector",
"numpy.array",
"cv2.addWeighted",
"cv2.VideoCapture",
"cv2.cvtColor",
"cv2.resize",
"cv2.waitKey",
"cv2.boundingRect"
] | [((60, 79), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (76, 79), False, 'import cv2\n'), ((93, 125), 'dlib.get_frontal_face_detector', 'dlib.get_frontal_face_detector', ([], {}), '()\n', (123, 125), False, 'import dlib\n'), ((138, 199), 'dlib.shape_predictor', 'dlib.shape_predictor', (['"""shape_pr... |
r"""Command-line tool to cropfaces
Usage::
$ cropfaces image.jpg NEAR
"""
import sys
import sbrowser
import pkg_resources # part of setuptools
HELP="""sbrowser, automate web browser.
Usage:
webbrowser [options]
webbrowser [options] <input>
webbrowser (-h | --help)
webbrowser (-V | --version)
Options:... | [
"sys.stderr.write",
"sbrowser.Browser"
] | [((485, 506), 'sys.stderr.write', 'sys.stderr.write', (['msg'], {}), '(msg)\n', (501, 506), False, 'import sys\n'), ((509, 531), 'sys.stderr.write', 'sys.stderr.write', (['"""\n"""'], {}), "('\\n')\n", (525, 531), False, 'import sys\n'), ((1044, 1062), 'sbrowser.Browser', 'sbrowser.Browser', ([], {}), '()\n', (1060, 10... |
# coding=utf-8
# Copyright 2018 The TF-Agents 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... | [
"tensorflow.numpy_function",
"tf_agents.utils.nest_utils.batch_nested_tensors",
"absl.logging.info",
"tf_agents.utils.example_encoding.get_example_decoder",
"tensorflow.core.protobuf.struct_pb2.StructuredValue.FromString",
"tf_agents.utils.eager_utils.get_next",
"tf_agents.utils.eager_utils.dataset_iter... | [((1640, 1678), 'tf_agents.specs.tensor_spec.to_proto', 'tensor_spec.to_proto', (['tensor_data_spec'], {}), '(tensor_data_spec)\n', (1660, 1678), False, 'from tf_agents.specs import tensor_spec\n'), ((2220, 2270), 'tensorflow.data.TFRecordDataset', 'tf.data.TFRecordDataset', (['input_path'], {'buffer_size': '(1)'}), '(... |
import os
import seaice.nasateam as nt
def this_dir():
return os.path.dirname(os.path.abspath(__file__))
def parent_dir():
return os.path.dirname(this_dir())
def default_config_dir():
return os.path.join(parent_dir(), 'seaice.tools', 'configs')
def output_image_dir():
return os.path.join(parent... | [
"os.path.abspath"
] | [((85, 110), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (100, 110), False, 'import os\n')] |
from django import forms
class SampleSearchForm(forms.Form):
"""Search form for test purposes"""
query = forms.CharField(widget=forms.TextInput(attrs={'class': 'input-xlarge search-query',
'autocomplete': 'off'}))
| [
"django.forms.TextInput"
] | [((138, 226), 'django.forms.TextInput', 'forms.TextInput', ([], {'attrs': "{'class': 'input-xlarge search-query', 'autocomplete': 'off'}"}), "(attrs={'class': 'input-xlarge search-query', 'autocomplete':\n 'off'})\n", (153, 226), False, 'from django import forms\n')] |
from application.factory import create_app
import pytest
from ..context import application
@pytest.fixture
def client():
return create_app().test_client()
def test_home_route(client):
response = client.get('/moon/')
assert response.get_json() == 'Moon API', 'Route should return "Moon API"'
... | [
"application.factory.create_app"
] | [((141, 153), 'application.factory.create_app', 'create_app', ([], {}), '()\n', (151, 153), False, 'from application.factory import create_app\n')] |
##
# File: ObjectExtractorTests.py
# Author: <NAME>
# Date: 25-Apr-2019
#
# Updates:
#
##
"""
Tests for extractor selected values from collections (limited tests from mock-data repos)
"""
__docformat__ = "google en"
__author__ = "<NAME>"
__email__ = "<EMAIL>"
__license__ = "Apache 2.0"
import logging
import o... | [
"logging.basicConfig",
"unittest.TestSuite",
"logging.getLogger",
"rcsb.utils.io.TimeUtil.TimeUtil",
"resource.getrusage",
"os.path.join",
"rcsb.db.mongo.Connection.Connection",
"pprint.pformat",
"os.path.dirname",
"platform.system",
"rcsb.utils.config.ConfigUtil.ConfigUtil",
"collections.defa... | [((638, 757), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': '"""%(asctime)s [%(levelname)s]-%(module)s.%(funcName)s: %(message)s"""'}), "(level=logging.INFO, format=\n '%(asctime)s [%(levelname)s]-%(module)s.%(funcName)s: %(message)s')\n", (657, 757), False, 'import logging\n... |
from __future__ import annotations
import ast
from dataclasses import dataclass, field
from typing import List, Union
from pynano.compiler import CompilationError, Compiler, context_change
from pynano.interfaces import NanoSymbolError, Scopes, parse
WASM_TYPES = {"integer": "i32", "float": "f32"}
WASM_PY_TYPES = {in... | [
"pynano.interfaces.parse",
"dataclasses.dataclass",
"dataclasses.field",
"pynano.interfaces.NanoSymbolError"
] | [((509, 549), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)', 'unsafe_hash': '(True)'}), '(frozen=True, unsafe_hash=True)\n', (518, 549), False, 'from dataclasses import dataclass, field\n'), ((647, 668), 'dataclasses.dataclass', 'dataclass', ([], {'init': '(False)'}), '(init=False)\n', (656, 668), Fals... |
# -*- coding: utf-8 -*-
__all__ = []
from lazypkg import LazyPkg
LazyPkg(__name__, ['tea', 'process_settings', 'species', 'system', 'utils', 'model'])
| [
"lazypkg.LazyPkg"
] | [((66, 155), 'lazypkg.LazyPkg', 'LazyPkg', (['__name__', "['tea', 'process_settings', 'species', 'system', 'utils', 'model']"], {}), "(__name__, ['tea', 'process_settings', 'species', 'system', 'utils',\n 'model'])\n", (73, 155), False, 'from lazypkg import LazyPkg\n')] |
from django.shortcuts import render
# Create your views here.
def index(request):
return render(request, 'index.html')
def note(request):
return render(request, 'note.html')
def send(request):
return render(request, 'send.html')
| [
"django.shortcuts.render"
] | [((96, 125), 'django.shortcuts.render', 'render', (['request', '"""index.html"""'], {}), "(request, 'index.html')\n", (102, 125), False, 'from django.shortcuts import render\n'), ((158, 186), 'django.shortcuts.render', 'render', (['request', '"""note.html"""'], {}), "(request, 'note.html')\n", (164, 186), False, 'from ... |
import numpy as np
from skimage.transform import resize
import skimage
import torchvision.utils as tvutils
import torch
import PIL
from PIL import Image
import torchvision
class UnNormalize(object):
def __init__(self, mean, std):
self.mean = torch.tensor(mean).unsqueeze(0).unsqueeze(2).unsqueeze(3)
... | [
"numpy.clip",
"PIL.Image.fromarray",
"skimage.img_as_float",
"numpy.array",
"torch.tensor",
"torch.chunk",
"torchvision.utils.make_grid",
"skimage.transform.resize",
"torch.zeros",
"torch.cat"
] | [((2026, 2051), 'torch.cat', 'torch.cat', (['stacked'], {'dim': '(1)'}), '(stacked, dim=1)\n', (2035, 2051), False, 'import torch\n'), ((3979, 4003), 'skimage.img_as_float', 'skimage.img_as_float', (['im'], {}), '(im)\n', (3999, 4003), False, 'import skimage\n'), ((5885, 5910), 'skimage.img_as_float', 'skimage.img_as_f... |
import argparse
import logging
import os
from torch.backends import cudnn
from data_loader_svhn_mnist import get_loader
from solver_mnist_to_svhn import Solver
def str2bool(v):
return v.lower() in ('true')
def main(config):
svhn_loader, mnist_loader, svhn_test_loader, mnist_test_loader = get_loader(config)... | [
"logging.basicConfig",
"os.path.exists",
"solver_mnist_to_svhn.Solver",
"argparse.ArgumentParser",
"os.makedirs",
"data_loader_svhn_mnist.get_loader",
"os.path.isdir",
"os.mkdir"
] | [((302, 320), 'data_loader_svhn_mnist.get_loader', 'get_loader', (['config'], {}), '(config)\n', (312, 320), False, 'from data_loader_svhn_mnist import get_loader\n'), ((335, 376), 'solver_mnist_to_svhn.Solver', 'Solver', (['config', 'svhn_loader', 'mnist_loader'], {}), '(config, svhn_loader, mnist_loader)\n', (341, 37... |
#coding=utf-8
import sys
import os
import json
import jinja2
import time
import Filter
class Generator(object):
def __new__(cls, name):
if name == 'FlatView':
return FlatViewGenerator()
elif name == 'MemoView':
return MemoViewGenerator()
class BaseGenerator(object):
de... | [
"Filter.ArticleJsonHandler",
"os.path.exists",
"os.path.join",
"os.mkdir",
"jinja2.FileSystemLoader",
"time.time"
] | [((675, 712), 'Filter.ArticleJsonHandler', 'Filter.ArticleJsonHandler', (['site', 'view'], {}), '(site, view)\n', (700, 712), False, 'import Filter\n'), ((968, 1006), 'os.path.join', 'os.path.join', (['site.output', 'view.output'], {}), '(site.output, view.output)\n', (980, 1006), False, 'import os\n'), ((1506, 1542), ... |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | [
"aiida.common.timezone.now",
"aiida.orm.QueryBuilder",
"aiida.cmdline.utils.query.mapping.CalculationProjectionMapper",
"datetime.timedelta"
] | [((5813, 5831), 'aiida.orm.QueryBuilder', 'orm.QueryBuilder', ([], {}), '()\n', (5829, 5831), False, 'from aiida import orm\n'), ((1699, 1751), 'aiida.cmdline.utils.query.mapping.CalculationProjectionMapper', 'CalculationProjectionMapper', (['self._valid_projections'], {}), '(self._valid_projections)\n', (1726, 1751), ... |
# GENERATED BY KOMAND SDK - DO NOT EDIT
import komand
import json
class Component:
DESCRIPTION = "Returns status of the cuckoo server"
class Input:
pass
class Output:
CPULOAD = "cpuload"
DISKSPACE = "diskspace"
HOSTNAME = "hostname"
MACHINES = "machines"
TASKS = "tasks"
VERSION = "v... | [
"json.loads"
] | [((386, 413), 'json.loads', 'json.loads', (['"""\n {}\n """'], {}), "('\\n {}\\n ')\n", (396, 413), False, 'import json\n'), ((555, 7003), 'json.loads', 'json.loads', (['"""\n {\n "type": "object",\n "title": "Variables",\n "properties": {\n "cpuload": {\n "type": "array",\n "title": "CPU Lo... |
# -*- coding: utf-8 -*-
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
"google.cloud.accessapproval_v1.gapic.transports.access_approval_grpc_transport.AccessApprovalGrpcTransport",
"google.oauth2.service_account.Credentials.from_service_account_file",
"google.cloud.accessapproval_v1.proto.accessapproval_pb2.DismissApprovalRequestMessage",
"google.cloud.accessapproval_v1.proto.ac... | [((1588, 1650), 'pkg_resources.get_distribution', 'pkg_resources.get_distribution', (['"""google-cloud-access-approval"""'], {}), "('google-cloud-access-approval')\n", (1618, 1650), False, 'import pkg_resources\n'), ((4394, 4457), 'google.oauth2.service_account.Credentials.from_service_account_file', 'service_account.C... |
# -*- coding: utf-8 -*-
# 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
#
# Un... | [
"tensorflow.summary.merge_all",
"tensorflow.reset_default_graph",
"tensorboard.plugins.distribution.distributions_plugin.DistributionsPlugin",
"tensorflow.Session",
"tensorflow.placeholder",
"tensorboard.backend.event_processing.event_multiplexer.EventMultiplexer",
"tensorflow.test.main",
"tensorflow.... | [((5169, 5183), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (5181, 5183), True, 'import tensorflow as tf\n'), ((1811, 1920), 'tensorboard.backend.event_processing.event_multiplexer.EventMultiplexer', 'event_multiplexer.EventMultiplexer', ([], {'size_guidance': '{event_accumulator.COMPRESSED_HISTOGRAMS: se... |
# Copyright (C) 2014,2015 VA Linux Systems Japan K.K.
# Copyright (C) 2014,2015 <NAME> <yamamoto at valinux co jp>
# 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... | [
"oslo_utils.excutils.save_and_reraise_exception",
"neutron.common.ipv6_utils.valid_ipv6_url",
"neutron.common.log_utils.get_fname",
"neutron._i18n._",
"oslo_log.log.getLogger"
] | [((1237, 1264), 'oslo_log.log.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1254, 1264), True, 'from oslo_log import log as logging\n'), ((1426, 1448), 'neutron.common.log_utils.get_fname', 'log_utils.get_fname', (['(1)'], {}), '(1)\n', (1445, 1448), False, 'from neutron.common import log_utils\... |
# Copyright (c) 2017-present, Facebook, 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... | [
"logging.getLogger",
"core.test.ct_detect_all",
"mitok.detect.bound3d.combine_bounds_3d_direct",
"os.path.exists",
"utils.ImageIO.windowing",
"utils.net.load_ckpt",
"numpy.where",
"utils.timer.Timer",
"numpy.max",
"utils.io.save_object",
"numpy.empty",
"cv2.merge",
"numpy.ones",
"yaml.dump... | [((1871, 1898), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1888, 1898), False, 'import logging\n'), ((6056, 6063), 'utils.timer.Timer', 'Timer', ([], {}), '()\n', (6061, 6063), False, 'from utils.timer import Timer\n'), ((6780, 6802), 'utils.env.get_runtime_dir', 'envu.get_runtime_di... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Bokeh Visualization Template
This template is a general outline for turning your data into a
visualization using Bokeh.
"""
from __future__ import (division, absolute_import, print_function,
unicode_literals)
import numpy as np
# Bokeh librari... | [
"bokeh.io.output_file",
"bokeh.plotting.show",
"bokeh.plotting.figure",
"numpy.linspace",
"numpy.cumsum"
] | [((428, 450), 'numpy.linspace', 'np.linspace', (['(1)', '(10)', '(10)'], {}), '(1, 10, 10)\n', (439, 450), True, 'import numpy as np\n'), ((535, 557), 'numpy.cumsum', 'np.cumsum', (['daily_words'], {}), '(daily_words)\n', (544, 557), True, 'import numpy as np\n'), ((611, 678), 'bokeh.io.output_file', 'output_file', (['... |
# -*- coding: utf-8 -*-
"""
Created on Fri Sep 20 12:18:17 2019
@author: jkcle
"""
from setuptools import setup
setup(name='chowtest',
version=' 1.0',
description='Package to test for structural breaks at a specified date.',
url='https://github.com/jkclem/chowtest',
author='<NAME... | [
"setuptools.setup"
] | [((124, 451), 'setuptools.setup', 'setup', ([], {'name': '"""chowtest"""', 'version': '""" 1.0"""', 'description': '"""Package to test for structural breaks at a specified date."""', 'url': '"""https://github.com/jkclem/chowtest"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'license': '"""MIT"""', 'pa... |
from django.db import models
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin, BaseUserManager
from django.contrib.auth.hashers import make_password
class UserManager(BaseUserManager):
def create_user(self, username, password=None):
"""
Creates and saves a user with the giv... | [
"django.db.models.EmailField",
"django.contrib.auth.hashers.make_password",
"django.db.models.BigIntegerField",
"django.db.models.CharField"
] | [((968, 1014), 'django.db.models.BigIntegerField', 'models.BigIntegerField', (['"""Id"""'], {'primary_key': '(True)'}), "('Id', primary_key=True)\n", (990, 1014), False, 'from django.db import models\n'), ((1029, 1085), 'django.db.models.CharField', 'models.CharField', (['"""Username"""'], {'max_length': '(15)', 'uniqu... |
from datetime import datetime
def decideCurrentTimeFrame(last_signals):
current_timeframes = []
now = datetime.now()
minute = int(now.minute)
hour = int(now.hour)
day = int(now.day)
month = int(now.month)
year = int(now.year)
key = str(year) + "/" + str(month) + "/" + str(day)
key ... | [
"datetime.datetime.now"
] | [((111, 125), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (123, 125), False, 'from datetime import datetime\n')] |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# >>
# cfc, 2021
# <NAME> <<EMAIL>>
# <<
import os
import pwd
import json
import math
import asyncio
import operator as op
import mimetypes
from enum import Enum
from pathlib import Path
from functools import cached_property
from collections import deque
from typing ... | [
"pydantic.PrivateAttr",
"collections.deque",
"pydantic.validator",
"humanize.naturalsize",
"pydantic.Field",
"pathlib.Path",
"mimetypes.guess_type",
"pydantic.ValidationError",
"pendulum.DateTime.fromtimestamp",
"cfc.errors.ConfigurationError",
"json.load",
"pendulum.Duration",
"cfc.utils.s_... | [((910, 922), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (917, 922), False, 'from typing import List, Deque, Union, TypeVar, Callable, Optional, Awaitable\n'), ((927, 939), 'typing.TypeVar', 'TypeVar', (['"""V"""'], {}), "('V')\n", (934, 939), False, 'from typing import List, Deque, Union, TypeVar, Call... |
import unittest
from synful import synapse
class TestSynapse(unittest.TestCase):
def test_cluster_synapses(self):
syn_1 = synapse.Synapse(id=1, location_pre=(1, 2, 3),
location_post=(10, 10, 0), id_segm_pre=1,
id_segm_post=10)
syn_2 ... | [
"unittest.main",
"synful.synapse.cluster_synapses",
"synful.synapse.Synapse"
] | [((1604, 1619), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1617, 1619), False, 'import unittest\n'), ((137, 245), 'synful.synapse.Synapse', 'synapse.Synapse', ([], {'id': '(1)', 'location_pre': '(1, 2, 3)', 'location_post': '(10, 10, 0)', 'id_segm_pre': '(1)', 'id_segm_post': '(10)'}), '(id=1, location_pre=(1... |
import sqlmlutils
connection=sqlmlutils.ConnectionInfo(server="localhost",database="Test")
sqlmlutils.SQLPackageManager(connection).install("textblob") | [
"sqlmlutils.SQLPackageManager",
"sqlmlutils.ConnectionInfo"
] | [((29, 91), 'sqlmlutils.ConnectionInfo', 'sqlmlutils.ConnectionInfo', ([], {'server': '"""localhost"""', 'database': '"""Test"""'}), "(server='localhost', database='Test')\n", (54, 91), False, 'import sqlmlutils\n'), ((91, 131), 'sqlmlutils.SQLPackageManager', 'sqlmlutils.SQLPackageManager', (['connection'], {}), '(con... |
###############################################################################
# Copyright (c) 2017-2020 <NAME> (Cisco Systems), #
# <NAME> (Cisco Systems), <NAME> (Cisco Systems) and others #
# #
# All rights r... | [
"listen.events.event_base.EventResult"
] | [((1137, 1174), 'listen.events.event_base.EventResult', 'EventResult', ([], {'result': '(False)', 'retry': '(True)'}), '(result=False, retry=True)\n', (1148, 1174), False, 'from listen.events.event_base import EventBase, EventResult\n')] |
from setuptools import setup, find_packages
"""
Instructions for creating a release of the scispacy library.
1. Make sure your working directory is clean.
2. Make sure that you have changed the versions in "scispacy/version.py".
3. Create the distribution by running "python setup.py sdist" in the root of the reposit... | [
"setuptools.find_packages"
] | [((1718, 1785), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['*.tests', '*.tests.*', 'tests.*', 'tests']"}), "(exclude=['*.tests', '*.tests.*', 'tests.*', 'tests'])\n", (1731, 1785), False, 'from setuptools import setup, find_packages\n')] |
from __future__ import annotations
import json
import pathlib
from enum import Enum
from typing import Dict, List, Optional
import jsonschema
import networkx as nx
import parchmint
from parchmint.component import Component
from parchmint.connection import Connection
from parchmint.layer import Layer
from parchmint.p... | [
"networkx.MultiDiGraph",
"json.loads",
"pathlib.Path",
"parchmint.similaritymatcher.SimilarityMatcher",
"jsonschema.Draft7Validator",
"parchmint.component.Component",
"json.load",
"parchmint.params.Params",
"parchmint.layer.Layer",
"parchmint.connection.Connection"
] | [((1722, 1730), 'parchmint.params.Params', 'Params', ([], {}), '()\n', (1728, 1730), False, 'from parchmint.params import Params\n'), ((1891, 1908), 'networkx.MultiDiGraph', 'nx.MultiDiGraph', ([], {}), '()\n', (1906, 1908), True, 'import networkx as nx\n'), ((4601, 4632), 'parchmint.similaritymatcher.SimilarityMatcher... |
#!/usr/bin/env python3
# author: greyshell
# description: stack using queue.LifoQueue
from queue import LifoQueue
def main():
"""
- used for parallel computing / multi producer and consumer scenarios
- locking and un-locking needs to be implemented manually
:return:
"""
s = LifoQueue()
#... | [
"queue.LifoQueue"
] | [((303, 314), 'queue.LifoQueue', 'LifoQueue', ([], {}), '()\n', (312, 314), False, 'from queue import LifoQueue\n')] |
import pandas as pd
import openpyxl
"""
Pandas perdeu suporte para arquivos xlsx por isso usamos o openpyxl
engine -> motor de busca, usamos o openpyxl
sheet_name -> para especificar qual aba usaremos
"""
df = pd.read_excel("Excel/Arquivo.xlsx", engine="openpyxl", sheet_name=0)
print(df.head()) | [
"pandas.read_excel"
] | [((211, 279), 'pandas.read_excel', 'pd.read_excel', (['"""Excel/Arquivo.xlsx"""'], {'engine': '"""openpyxl"""', 'sheet_name': '(0)'}), "('Excel/Arquivo.xlsx', engine='openpyxl', sheet_name=0)\n", (224, 279), True, 'import pandas as pd\n')] |
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2008-present MagicStack Inc. and the EdgeDB 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... | [
"itertools.groupby",
"edb.common.typeutils.is_container",
"re.compile",
"edb.common.ast.base.is_ast_node",
"edb.common.ast.base.iter_fields"
] | [((969, 1015), 're.compile', 're.compile', (['"""^(?!=\\\\d)\\\\w+(\\\\.(?!=\\\\d)\\\\w+)*$"""'], {}), "('^(?!=\\\\d)\\\\w+(\\\\.(?!=\\\\d)\\\\w+)*$')\n", (979, 1015), False, 'import re\n'), ((1031, 1066), 're.compile', 're.compile', (['b"[\\\\\'\\x00-\\x1f~-\\xff]"'], {}), '(b"[\\\\\'\\x00-\\x1f~-\\xff]")\n', (1041, 1... |
import datetime
import logging
import os
import typing
from kerasltiprovider import context
from kerasltiprovider.database import Database
from kerasltiprovider.exceptions import (
NoDatabaseException,
SubmissionAfterDeadlineException,
SubmissionValidationError,
UnknownAssignmentException,
UnknownD... | [
"logging.getLogger",
"logging.NullHandler",
"kerasltiprovider.exceptions.NoDatabaseException",
"kerasltiprovider.database.Database.assignments.hmget",
"kerasltiprovider.utils.Datetime.now",
"kerasltiprovider.exceptions.UnknownAssignmentException",
"kerasltiprovider.database.Database.assignments.scan_ite... | [((684, 721), 'logging.getLogger', 'logging.getLogger', (['"""kerasltiprovider"""'], {}), "('kerasltiprovider')\n", (701, 721), False, 'import logging\n'), ((737, 758), 'logging.NullHandler', 'logging.NullHandler', ([], {}), '()\n', (756, 758), False, 'import logging\n'), ((621, 652), 'logging.getLogger', 'logging.getL... |
# -*- mode: python -*-
#!/usr/bin/env sage
import sys
from sage.all import *
def usage():
print("Usage: {0} Lmax [precision]".format(sys.argv[0]))
def gen_gaunt_table(lmax, prec = None):
tmpl = "{0:4d} {1:4d} {2:4d} {3:4d} {4:4d} {5:5d} {6:23.15e}\n"
with open("gaunt_lmax{0}".format(lmax), 'w') as out:... | [
"sys.exit"
] | [((1005, 1016), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (1013, 1016), False, 'import sys\n')] |
# Generated by Django 3.1.2 on 2020-11-28 01:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('camphoric', '0014_auto_20201025_0058'),
]
operations = [
migrations.AlterField(
model_name='camper',
name='attribute... | [
"django.db.models.JSONField"
] | [((342, 369), 'django.db.models.JSONField', 'models.JSONField', ([], {'null': '(True)'}), '(null=True)\n', (358, 369), False, 'from django.db import migrations, models\n'), ((496, 523), 'django.db.models.JSONField', 'models.JSONField', ([], {'null': '(True)'}), '(null=True)\n', (512, 523), False, 'from django.db import... |
from cart.services.inventory_services import InventoryService
class CartItem:
product_id: int
quantity: int
class ShoppingCart:
id: int
voucher: str
discount_ratio: float
@property
def items(self):
return tuple(self._items)
def __init__(self):
self._items = []
... | [
"cart.services.inventory_services.InventoryService"
] | [((340, 358), 'cart.services.inventory_services.InventoryService', 'InventoryService', ([], {}), '()\n', (356, 358), False, 'from cart.services.inventory_services import InventoryService\n')] |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use ... | [
"numpy.issubdtype",
"numpy.dtype",
"io.StringIO"
] | [((1530, 1546), 'numpy.dtype', 'np.dtype', (['object'], {}), '(object)\n', (1538, 1546), True, 'import numpy as np\n'), ((3521, 3531), 'io.StringIO', 'StringIO', ([], {}), '()\n', (3529, 3531), False, 'from io import StringIO\n'), ((6243, 6280), 'numpy.issubdtype', 'np.issubdtype', (['right.dtype', 'np.number'], {}), '... |
# -*- coding: utf-8 -*-
# MooQuant
#
# Copyright 2011-2015 <NAME>
#
# 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 appli... | [
"mooquant.dataseries.SequenceDataSeries",
"mooquant.technical.bollinger.BollingerBands"
] | [((1914, 1945), 'mooquant.dataseries.SequenceDataSeries', 'dataseries.SequenceDataSeries', ([], {}), '()\n', (1943, 1945), False, 'from mooquant import dataseries\n'), ((1963, 2001), 'mooquant.technical.bollinger.BollingerBands', 'bollinger.BollingerBands', (['seqDS', '(20)', '(2)'], {}), '(seqDS, 20, 2)\n', (1987, 200... |
import argparse
SHOW = False
COUNT = 5 # Default value
arguments = argparse.ArgumentParser()
arguments.add_argument("image")
arguments.add_argument("-c", "--count",
help="Number of colors to find")
arguments.add_argument("-s", "--show",
action="store_true",
... | [
"argparse.ArgumentParser"
] | [((70, 95), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (93, 95), False, 'import argparse\n')] |
# Copyright 2019 The FastEstimator Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | [
"numpy.array",
"tensorflow.cast",
"tensorflow.is_tensor",
"typing.TypeVar"
] | [((884, 938), 'typing.TypeVar', 'TypeVar', (['"""Tensor"""', 'tf.Tensor', 'torch.Tensor', 'np.ndarray'], {}), "('Tensor', tf.Tensor, torch.Tensor, np.ndarray)\n", (891, 938), False, 'from typing import Collection, TypeVar, Union\n'), ((3119, 3137), 'tensorflow.is_tensor', 'tf.is_tensor', (['data'], {}), '(data)\n', (31... |
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [
"mindspore.train.model.Model",
"mindspore.context.set_context",
"mindspore.ops.operations._grad_ops.TanhGrad",
"numpy.random.randn",
"mindspore.Tensor"
] | [((871, 914), 'mindspore.context.set_context', 'context.set_context', ([], {'device_target': '"""Ascend"""'}), "(device_target='Ascend')\n", (890, 914), True, 'import mindspore.context as context\n'), ((1196, 1212), 'mindspore.Tensor', 'Tensor', (['input_np'], {}), '(input_np)\n', (1202, 1212), False, 'from mindspore i... |
from concurrent.futures.thread import ThreadPoolExecutor
from typing import List
from provider.aws.common_aws import get_paginator
from provider.aws.limit.command import LimitOptions
from provider.aws.limit.data.allowed_resources import (
ALLOWED_SERVICES_CODES,
FILTER_EC2_BIGFAMILY,
SPECIAL_RESOURCES,
)
f... | [
"provider.aws.common_aws.get_paginator",
"concurrent.futures.thread.ThreadPoolExecutor",
"shared.common.ResourceDigest",
"shared.common.ResourceCache",
"shared.common.message_handler"
] | [((991, 1006), 'shared.common.ResourceCache', 'ResourceCache', ([], {}), '()\n', (1004, 1006), False, 'from shared.common import ResourceProvider, Resource, ResourceDigest, message_handler, ResourceCache, LimitsValues\n'), ((5426, 5539), 'provider.aws.common_aws.get_paginator', 'get_paginator', ([], {'client': 'client'... |
# Copyright (c) 2021, NVIDIA CORPORATION. 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 appli... | [
"sklearn.cluster._kmeans.k_means",
"torch.from_numpy",
"numpy.argsort",
"numpy.array",
"numpy.mean",
"numpy.repeat",
"sklearn.metrics.pairwise.cosine_similarity",
"numpy.where",
"numpy.sort",
"numpy.diag_indices",
"numpy.real",
"numpy.linspace",
"numpy.vstack",
"numpy.random.seed",
"nump... | [((2002, 2036), 'sklearn.preprocessing.MinMaxScaler', 'MinMaxScaler', ([], {'feature_range': '(0, 1)'}), '(feature_range=(0, 1))\n', (2014, 2036), False, 'from sklearn.preprocessing import MinMaxScaler\n'), ((3531, 3558), 'numpy.zeros_like', 'np.zeros_like', (['affinity_mat'], {}), '(affinity_mat)\n', (3544, 3558), Tru... |
import guidance_sys
import numpy as np
import cv2, os
from cv2 import aruco
import matplotlib.pyplot as plt
import matplotlib as mpl
import pandas as pd
from picamera.array import PiRGBArray
from picamera import PiCamera
import time
import serial
ternimal_UART= False
try:
os.system("sudo chmod a+rw /dev/seria... | [
"RPi.GPIO.setup",
"guidance_sys.process",
"guidance_sys.camera",
"cv2.waitKey",
"serial.Serial",
"os.system",
"time.time",
"RPi.GPIO.setmode"
] | [((627, 649), 'RPi.GPIO.setmode', 'GPIO.setmode', (['GPIO.BCM'], {}), '(GPIO.BCM)\n', (639, 649), True, 'import RPi.GPIO as GPIO\n'), ((283, 324), 'os.system', 'os.system', (['"""sudo chmod a+rw /dev/serial0"""'], {}), "('sudo chmod a+rw /dev/serial0')\n", (292, 324), False, 'import cv2, os\n'), ((335, 381), 'serial.Se... |
# %%
from functools import reduce
import numpy as np
import pandas as pd
from pandas.tseries.offsets import DateOffset
pd.set_option("display.max_rows", None)
pd.set_option("display.max_columns", None)
# %%
def build_gvkeys(prc, fund):
gvkeys_fund = fund.gvkey.unique()
gvkeys_prc = prc[prc.close > 5].gvkey.un... | [
"numpy.intersect1d",
"pandas.read_csv",
"pandas.set_option",
"pandas.tseries.offsets.DateOffset",
"pandas.concat",
"pandas.to_datetime"
] | [((120, 159), 'pandas.set_option', 'pd.set_option', (['"""display.max_rows"""', 'None'], {}), "('display.max_rows', None)\n", (133, 159), True, 'import pandas as pd\n'), ((160, 202), 'pandas.set_option', 'pd.set_option', (['"""display.max_columns"""', 'None'], {}), "('display.max_columns', None)\n", (173, 202), True, '... |
# -*- coding: utf-8 -*-
"""
Orbital functions
-----------------
Functions used within multiple orbital classes in Stone Soup
"""
import numpy as np
from . import dotproduct
from ..types.array import StateVector
def stumpff_s(z):
r"""The Stumpff S function
.. math::
S(z) = \begin{cases}\frac{\sqrt... | [
"numpy.abs",
"numpy.sqrt",
"numpy.sinh",
"numpy.array",
"numpy.cos",
"numpy.concatenate",
"numpy.cosh",
"numpy.sin"
] | [((3063, 3086), 'numpy.sqrt', 'np.sqrt', (['grav_parameter'], {}), '(grav_parameter)\n', (3070, 3086), True, 'import numpy as np\n'), ((6021, 6044), 'numpy.sqrt', 'np.sqrt', (['grav_parameter'], {}), '(grav_parameter)\n', (6028, 6044), True, 'import numpy as np\n'), ((9816, 9836), 'numpy.cos', 'np.cos', (['true_anomaly... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import datetime
import logging
import re
from django.conf import settings
from django.contrib.contenttypes.models import C... | [
"logging.getLogger",
"ralph.cmdb.models_changes.CIChange",
"ralph.cmdb.models_changes.CIChangeCMDBHistory",
"ralph.cmdb.importer.CIImporter",
"django.contrib.contenttypes.models.ContentType.objects.get_for_model",
"re.compile",
"datetime.datetime.strptime",
"ralph.cmdb.models_ci.CI.get_by_content_obje... | [((1042, 1069), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1059, 1069), False, 'import logging\n'), ((1084, 1113), 're.compile', 're.compile', (['""".*\\\\<(.*)@.*\\\\>"""'], {}), "('.*\\\\<(.*)@.*\\\\>')\n", (1094, 1113), False, 'import re\n'), ((2708, 2801), 'django.dispatch.receiv... |
from django import template
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.mixins import PermissionRequiredMixin
from django.contrib.contenttypes.models import ContentType
from django.db.models import Count, Q
from django.http import Http404, HttpResponseForbidden
from dja... | [
"django.shortcuts.render",
"django.contrib.contenttypes.models.ContentType.objects.get_for_model",
"django.db.models.Count",
"django.shortcuts.get_object_or_404",
"django.http.HttpResponseForbidden",
"utilities.forms.ConfirmationForm",
"django.shortcuts.redirect",
"django_tables2.RequestConfig",
"dj... | [((1465, 1498), 'django.shortcuts.get_object_or_404', 'get_object_or_404', (['Tag'], {'slug': 'slug'}), '(Tag, slug=slug)\n', (1482, 1498), False, 'from django.shortcuts import get_object_or_404, redirect, render\n'), ((3799, 3838), 'django.shortcuts.get_object_or_404', 'get_object_or_404', (['ConfigContext'], {'pk': '... |
from pathlib import Path
from typing import cast
import arrow
from fastapi import APIRouter, Depends, FastAPI, Request, Response
from importlib_metadata import entry_points
from jinja2 import Environment, FileSystemLoader
from .model import Feed, Plugin
app = FastAPI()
templates = Environment(loader=FileSystemLoade... | [
"fastapi.FastAPI",
"fastapi.Response",
"pathlib.Path",
"importlib_metadata.entry_points",
"fastapi.APIRouter",
"fastapi.Depends"
] | [((264, 273), 'fastapi.FastAPI', 'FastAPI', ([], {}), '()\n', (271, 273), False, 'from fastapi import APIRouter, Depends, FastAPI, Request, Response\n'), ((416, 455), 'importlib_metadata.entry_points', 'entry_points', ([], {'group': '"""rsserpent.plugins"""'}), "(group='rsserpent.plugins')\n", (428, 455), False, 'from ... |
#
# 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
# ... | [
"logging.getLogger",
"json.dumps",
"os.environ.copy",
"testtools.testcase.skip",
"yaml.safe_load",
"fixtures.TempDir"
] | [((704, 739), 'logging.getLogger', 'logging.getLogger', (['"""test_hook_salt"""'], {}), "('test_hook_salt')\n", (721, 739), False, 'import logging\n'), ((2310, 2358), 'testtools.testcase.skip', 'testcase.skip', (['"""Skip untill salt issue resolved"""'], {}), "('Skip untill salt issue resolved')\n", (2323, 2358), False... |
from align.schema.types import set_context
import pathlib
import pytest
from align.schema.parser import SpiceParser
from align.schema import constraint
@pytest.fixture
def library():
parser = SpiceParser()
align_home = pathlib.Path(__file__).resolve().parent.parent / "files"
basic_lib_path = align_home / ... | [
"align.schema.constraint.SymmetricBlocks",
"align.schema.types.set_context",
"pathlib.Path",
"align.schema.parser.SpiceParser"
] | [((198, 211), 'align.schema.parser.SpiceParser', 'SpiceParser', ([], {}), '()\n', (209, 211), False, 'from align.schema.parser import SpiceParser\n'), ((973, 994), 'align.schema.types.set_context', 'set_context', (['dp_const'], {}), '(dp_const)\n', (984, 994), False, 'from align.schema.types import set_context\n'), ((1... |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from compas.geometry import subtract_vectors
from compas.geometry import normalize_vector
from compas.geometry import centroid_points
__all__ = ['bestfit_plane']
def bestfit_plane(points):
"""Fit a pla... | [
"compas.geometry.centroid_points",
"compas.geometry.subtract_vectors",
"compas.geometry.normalize_vector"
] | [((1265, 1288), 'compas.geometry.centroid_points', 'centroid_points', (['points'], {}), '(points)\n', (1280, 1288), False, 'from compas.geometry import centroid_points\n'), ((1393, 1426), 'compas.geometry.subtract_vectors', 'subtract_vectors', (['point', 'centroid'], {}), '(point, centroid)\n', (1409, 1426), False, 'fr... |