code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import numpy as np
import random
from collections import namedtuple, deque
from DQNmodel import QNetwork
import torch
import torch.nn.functional as F
import torch.optim as optim
BUFFER_SIZE = int(1e5) # replay buffer size
BATCH_SIZE = 64 # minibatch size
GAMMA = 0.99 # discount factor
TAU = 1e-3 ... | [
"random.sample",
"torch.nn.functional.mse_loss",
"collections.deque",
"collections.namedtuple",
"DQNmodel.QNetwork",
"random.seed",
"torch.min",
"torch.from_numpy",
"torch.cuda.is_available",
"numpy.vstack",
"torch.no_grad",
"random.random",
"numpy.arange"
] | [((506, 531), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (529, 531), False, 'import torch\n'), ((1006, 1023), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (1017, 1023), False, 'import random\n'), ((3648, 3679), 'torch.nn.functional.mse_loss', 'F.mse_loss', (['Q_expected', 'Q1_c... |
#!/usr/bin/env python3
#
# # Copyright (c) 2021 Facebook, inc. and its affiliates. All Rights Reserved
#
#
"""
Calibrates the models
"""
import copy
import argparse
import os
import submitit
import pickle
from pathlib import Path
from omegaconf import OmegaConf
import submitit
from uimnet import utils
from uimnet imp... | [
"os.getenv",
"argparse.ArgumentParser",
"pathlib.Path",
"uimnet.utils.load_model_cls",
"uimnet.utils.calibration_done",
"pickle.load",
"uimnet.utils.load_cfg",
"uimnet.utils.partition_dataset",
"uimnet.workers.Calibrator",
"uimnet.utils.handle_jobs",
"copy.deepcopy",
"omegaconf.OmegaConf.creat... | [((1042, 1081), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '""""""'}), "(description='')\n", (1065, 1081), False, 'import argparse\n'), ((1399, 1525), 'uimnet.utils.partition_dataset', 'utils.partition_dataset', ([], {'name': 'name', 'root': 'root', 'split': 'split', 'partitions': "clust... |
# new version of binary2source mapping:
# using understands to obtain the source line -- source entities mapping
# using IDA Pro to disassemble
# using readelf to get the line number mapping information
# using understand to get the source level depends
import csv
import os
import re
import json
from fuzzywuzzy impor... | [
"os.path.exists",
"fuzzywuzzy.fuzz.ratio",
"json.dumps",
"os.path.join",
"re.match",
"os.path.basename",
"json.load",
"os.walk"
] | [((5330, 5382), 'os.path.join', 'os.path.join', (['project_dir', 'source_file_relative_path'], {}), '(project_dir, source_file_relative_path)\n', (5342, 5382), False, 'import os\n'), ((6476, 6496), 'os.walk', 'os.walk', (['project_dir'], {}), '(project_dir)\n', (6483, 6496), False, 'import os\n'), ((9424, 9461), 'os.pa... |
"""
A script to convert between the J2000 and the sun.
"""
from sunpy.coordinates.sun import sky_position as sun_position
import sunpy.coordinates.sun as sun_coord
import numpy as np
def j2000xy(RA,DEC,t_sun):
[RA_sun, DEC_sun] = sun_position(t_sun,False)
rotate_angel = sun_coord.P(t_sun)
# shift the ce... | [
"numpy.sin",
"sunpy.coordinates.sun.P",
"numpy.cos",
"sunpy.coordinates.sun.sky_position"
] | [((237, 263), 'sunpy.coordinates.sun.sky_position', 'sun_position', (['t_sun', '(False)'], {}), '(t_sun, False)\n', (249, 263), True, 'from sunpy.coordinates.sun import sky_position as sun_position\n'), ((282, 300), 'sunpy.coordinates.sun.P', 'sun_coord.P', (['t_sun'], {}), '(t_sun)\n', (293, 300), True, 'import sunpy.... |
# Copyright (C) 2018 <NAME>
#
# SPDX-License-Identifier: MIT
from floodsystem.stationdata import build_station_list, update_water_levels
from floodsystem.flood import stations_highest_rel_level
stations = build_station_list()
def run():
update_water_levels(stations)
msg = "\nThe \033[1m10 highest risk\033[0m... | [
"floodsystem.stationdata.build_station_list",
"floodsystem.flood.stations_highest_rel_level",
"floodsystem.stationdata.update_water_levels"
] | [((207, 227), 'floodsystem.stationdata.build_station_list', 'build_station_list', ([], {}), '()\n', (225, 227), False, 'from floodsystem.stationdata import build_station_list, update_water_levels\n'), ((244, 273), 'floodsystem.stationdata.update_water_levels', 'update_water_levels', (['stations'], {}), '(stations)\n', ... |
from django.conf.urls import patterns, include, url
from sketch import views
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'whiteboard.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^$', views.in... | [
"django.conf.urls.url"
] | [((301, 337), 'django.conf.urls.url', 'url', (['"""^$"""', 'views.index'], {'name': '"""index"""'}), "('^$', views.index, name='index')\n", (304, 337), False, 'from django.conf.urls import patterns, include, url\n'), ((431, 473), 'django.conf.urls.url', 'url', (['"""^login/$"""', 'views.login'], {'name': '"""login"""'}... |
from django.conf import settings as site_settings
from django.db import models, transaction
from django.utils.translation import ugettext_lazy as _
from taggit.managers import TaggableManager
from uuid import uuid4
from . import helpers, query, settings, tasks
import django_rq
import string
class ContentObject(models... | [
"django.db.models.TextField",
"django.core.urlresolvers.reverse",
"django.db.models.ImageField",
"django.db.models.ForeignKey",
"django.db.models.FileField",
"django.db.models.DateTimeField",
"django.db.models.CharField",
"django.db.models.OneToOneField",
"django.utils.translation.ugettext_lazy",
... | [((341, 449), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(1)', 'choices': "(('a', 'active'), ('t', 'trashed'))", 'default': '"""a"""', 'editable': '(False)'}), "(max_length=1, choices=(('a', 'active'), ('t', 'trashed')),\n default='a', editable=False)\n", (357, 449), False, 'from django.d... |
# -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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... | [
"rogerthat.wsgi.AuthenticatedRogerthatWSGIApplication",
"mcfw.restapi.rest_functions"
] | [((1770, 1871), 'rogerthat.wsgi.AuthenticatedRogerthatWSGIApplication', 'AuthenticatedRogerthatWSGIApplication', (['handlers'], {'redirect_login_required': '(False)', 'name': '"""main_rest"""'}), "(handlers, redirect_login_required=\n False, name='main_rest')\n", (1807, 1871), False, 'from rogerthat.wsgi import Auth... |
# -*- coding: utf-8 -*-
__author__ = "<NAME> (Srce Cde)"
__license__ = "MIT"
__email__ = "<EMAIL>"
__maintainer__ = "<NAME> (Srce Cde)"
import json
import boto3
s3 = boto3.client('s3')
comprehend = boto3.client("comprehend")
def lambda_handler(event, context):
if event:
s3_object = event["Records"][0]... | [
"boto3.client"
] | [((170, 188), 'boto3.client', 'boto3.client', (['"""s3"""'], {}), "('s3')\n", (182, 188), False, 'import boto3\n'), ((202, 228), 'boto3.client', 'boto3.client', (['"""comprehend"""'], {}), "('comprehend')\n", (214, 228), False, 'import boto3\n')] |
# Copyright (c) 2017 LINE Corporation
# These sources are released under the terms of the MIT license: see LICENSE
from unittest import mock
from requests.exceptions import RequestException
from django.test import override_settings
from promgen import models, rest, tests
from promgen.notification.webhook import Not... | [
"promgen.tests.Data",
"promgen.models.Service.objects.get",
"promgen.notification.webhook.NotificationWebhook.create",
"promgen.models.Alert.objects.first",
"unittest.mock.call",
"promgen.models.Project.objects.get",
"django.test.override_settings",
"unittest.mock.patch",
"requests.exceptions.Reques... | [((417, 469), 'unittest.mock.patch', 'mock.patch', (['"""django.dispatch.dispatcher.Signal.send"""'], {}), "('django.dispatch.dispatcher.Signal.send')\n", (427, 469), False, 'from unittest import mock\n'), ((855, 896), 'django.test.override_settings', 'override_settings', ([], {'PROMGEN': 'tests.SETTINGS'}), '(PROMGEN=... |
#!/usr/bin/env python
# Draws a molecule from its InChi representation
# Dependencies: rdkit
import argparse
from rdkit import Chem
from rdkit.Chem import AllChem, Draw
from rdkit.Chem.inchi import MolFromInchi
def draw_inchi(inchi, imgfile):
molecule = Chem.AddHs(MolFromInchi(inchi))
AllChem.EmbedMolecule... | [
"rdkit.Chem.inchi.MolFromInchi",
"rdkit.Chem.Draw.MolToFile",
"argparse.ArgumentParser",
"rdkit.Chem.AllChem.MMFFOptimizeMolecule",
"rdkit.Chem.AllChem.EmbedMolecule"
] | [((299, 330), 'rdkit.Chem.AllChem.EmbedMolecule', 'AllChem.EmbedMolecule', (['molecule'], {}), '(molecule)\n', (320, 330), False, 'from rdkit.Chem import AllChem, Draw\n'), ((335, 373), 'rdkit.Chem.AllChem.MMFFOptimizeMolecule', 'AllChem.MMFFOptimizeMolecule', (['molecule'], {}), '(molecule)\n', (363, 373), False, 'fro... |
"""django_project URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Clas... | [
"django.urls.path",
"django.conf.urls.url"
] | [((890, 924), 'django.urls.path', 'path', (['""""""', 'view.index'], {'name': '"""index"""'}), "('', view.index, name='index')\n", (894, 924), False, 'from django.urls import path\n'), ((930, 968), 'django.urls.path', 'path', (['"""robots.txt"""', 'smviews.robots_txt'], {}), "('robots.txt', smviews.robots_txt)\n", (934... |
import string
from typing import List, Union, Any, Tuple, Iterable
from sympy import MatrixSymbol, BlockMatrix, Symbol, Inverse, Transpose, MatMul, MatAdd, ZeroMatrix, \
MatrixExpr, S, Identity
from sympy.core.decorators import call_highest_priority
from sympy.strategies import (rm_id, unpack, typed, flatten, sort... | [
"symgp.utils.utils.create_distr_name",
"sympy.core.decorators.call_highest_priority",
"sympy.MatrixSymbol.__new__",
"symgp.utils.utils.is_square",
"symgp.utils.utils.partition_block",
"symgp.utils.utils.is_vector",
"symgp.utils.utils.matinv",
"symgp.utils.utils.is_matrix",
"symgp.utils.utils.expand_... | [((24681, 24714), 'sympy.core.decorators.call_highest_priority', 'call_highest_priority', (['"""__radd__"""'], {}), "('__radd__')\n", (24702, 24714), False, 'from sympy.core.decorators import call_highest_priority\n'), ((25111, 25143), 'sympy.core.decorators.call_highest_priority', 'call_highest_priority', (['"""__add_... |
'''
Created on Aug 15, 2012
@author: leo
'''
import unittest
import os
import pydevd
#import pydevd
def init(runtime):
#from results.results_app import ResultsApp
#pydevd.settrace()
loader = unittest.TestLoader()
#suite.loadTestsFromTestCase(Test)
test_runner = unittest.TextTestRunner()
... | [
"os.path.abspath",
"unittest.TextTestRunner",
"unittest.TestLoader"
] | [((210, 231), 'unittest.TestLoader', 'unittest.TestLoader', ([], {}), '()\n', (229, 231), False, 'import unittest\n'), ((294, 319), 'unittest.TextTestRunner', 'unittest.TextTestRunner', ([], {}), '()\n', (317, 319), False, 'import unittest\n'), ((526, 551), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__... |
import argparse
import os.path as osp
import random
from time import perf_counter as t
import yaml
from yaml import SafeLoader
import torch
import torch_geometric.transforms as T
import torch.nn.functional as F
import torch.nn as nn
from torch_geometric.datasets import Planetoid, CitationFull
from torch_geometric.util... | [
"torch.manual_seed",
"datasets.get_citation_dataset",
"argparse.ArgumentParser",
"eval_digcl.label_classification",
"model_digcl.Model",
"time.perf_counter",
"random.seed",
"torch.nn.PReLU",
"numpy.exp",
"torch.cuda.is_available",
"model_digcl.Encoder",
"torch.nn.RReLU",
"torch.cuda.set_devi... | [((681, 714), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (704, 714), False, 'import warnings\n'), ((1011, 1047), 'model_digcl.drop_feature', 'drop_feature', (['x', 'drop_feature_rate_1'], {}), '(x, drop_feature_rate_1)\n', (1023, 1047), False, 'from model_digcl import ... |
from setuptools import setup, find_packages
base = None
setup(
name="hiMoon",
version="0.12.4",
classifiers=[
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Development Status :: 4 - Beta",
... | [
"setuptools.find_packages"
] | [((695, 710), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (708, 710), False, 'from setuptools import setup, find_packages\n')] |
#!/usr/bin/env python
# coding: utf-8
"""
This script loads a template file and fills in IDs in columns where they are missing
author: <NAME> for Knocean Inc., 22 September 2020
"""
import pandas as pd
import numpy as np
from pathlib import Path
from argparse import ArgumentParser
parser = ArgumentParser()
parser.ad... | [
"numpy.isnan",
"pathlib.Path",
"argparse.ArgumentParser",
"pandas.read_csv"
] | [((294, 310), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (308, 310), False, 'from argparse import ArgumentParser\n'), ((1340, 1392), 'pandas.read_csv', 'pd.read_csv', (['args.template_file'], {'sep': '"""\t"""', 'dtype': 'str'}), "(args.template_file, sep='\\t', dtype=str)\n", (1351, 1392), True, 'i... |
import datetime
import os
import warnings
import hydra
import omegaconf
import pytorch_lightning as pl
from loguru import logger
import scripts.training.lightning_modules as lm
@hydra.main(
config_path=os.path.join(os.getcwd(), "configs"), config_name="training_experiment"
)
@logger.catch
def main(configs: omeg... | [
"loguru.logger.add",
"scripts.training.lightning_modules.HumanHeadSegmentationDataModule",
"loguru.logger.success",
"loguru.logger.info",
"scripts.training.lightning_modules.HumanHeadSegmentationModelModule",
"pytorch_lightning.callbacks.early_stopping.EarlyStopping",
"os.getcwd",
"pytorch_lightning.l... | [((351, 374), 'loguru.logger.add', 'logger.add', (['"""train.log"""'], {}), "('train.log')\n", (361, 374), False, 'from loguru import logger\n'), ((379, 421), 'loguru.logger.info', 'logger.info', (['"""🚀 Training process started."""'], {}), "('🚀 Training process started.')\n", (390, 421), False, 'from loguru import l... |
# coding: utf-8
import os
import sys
import torch
import datetime
import subprocess as sb
import torch.nn.functional as F
from progress import ProgressMeter, Average, Accuracy
class Trainer(object):
"""
Ported from
https://github.com/narumiruna/pytorch-distributed-example/blob/master/mnist/main.py
""... | [
"subprocess.check_output",
"progress.Average",
"progress.Accuracy",
"datetime.datetime.now",
"os.path.isdir",
"os.mkdir",
"torch.nn.functional.cross_entropy",
"torch.no_grad"
] | [((1451, 1460), 'progress.Average', 'Average', ([], {}), '()\n', (1458, 1460), False, 'from progress import ProgressMeter, Average, Accuracy\n'), ((1481, 1491), 'progress.Accuracy', 'Accuracy', ([], {}), '()\n', (1489, 1491), False, 'from progress import ProgressMeter, Average, Accuracy\n'), ((2340, 2349), 'progress.Av... |
#!/usr/bin/env python
import argparse
import trimesh
from tqdm import tqdm
from ll4ma_util import file_util, ui_util
if __name__ == '__main__':
"""
Simple mesh conversion script using Trimesh https://trimsh.org/index.html.
Right now this assumes you want to convert all files in a directory with a
pa... | [
"argparse.ArgumentParser",
"ll4ma_util.file_util.change_extension",
"tqdm.tqdm",
"ll4ma_util.ui_util.print_happy",
"trimesh.load",
"trimesh.available_formats",
"ll4ma_util.file_util.list_dir"
] | [((476, 501), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (499, 501), False, 'import argparse\n'), ((1245, 1298), 'll4ma_util.file_util.list_dir', 'file_util.list_dir', (['args.input_dir', 'args.in_extension'], {}), '(args.input_dir, args.in_extension)\n', (1263, 1298), False, 'from ll4ma_ut... |
# -*- coding: utf-8 -*-
import tensorflow as tf
import numpy as np
import functools
def doublewrap(function):
"""
A decorator decorator, allowing to use the decorator to be used without
parentheses if not arguments are provided. All arguments must be optional.
"""
@functools.wraps(function)
d... | [
"numpy.sqrt",
"tensorflow.variable_scope",
"tensorflow.Variable",
"functools.wraps",
"tensorflow.random_uniform"
] | [((289, 314), 'functools.wraps', 'functools.wraps', (['function'], {}), '(function)\n', (304, 314), False, 'import functools\n'), ((1220, 1245), 'functools.wraps', 'functools.wraps', (['function'], {}), '(function)\n', (1235, 1245), False, 'import functools\n'), ((1787, 1832), 'tensorflow.random_uniform', 'tf.random_un... |
from api.decorators import api_post
from customer.booking_helper import do_booking_vendor_request, do_booking_save, do_add_vendor, do_delete_vendor
from customer.decorators import authenticated_user
@api_post
@authenticated_user
def booking_vendor_request(request):
return do_booking_vendor_request(request)
@api... | [
"customer.booking_helper.do_delete_vendor",
"customer.booking_helper.do_add_vendor",
"customer.booking_helper.do_booking_vendor_request",
"customer.booking_helper.do_booking_save"
] | [((279, 313), 'customer.booking_helper.do_booking_vendor_request', 'do_booking_vendor_request', (['request'], {}), '(request)\n', (304, 313), False, 'from customer.booking_helper import do_booking_vendor_request, do_booking_save, do_add_vendor, do_delete_vendor\n'), ((384, 408), 'customer.booking_helper.do_booking_save... |
#! /usr/bin/env python3
# -*- coding:utf-8 -*-
###############################################################
# kenwaldek MIT-license
#
# Title: kivy A20 Version: 1.0
# Date: 22-01-2017 Language: python3
# Description: kivy button on the A20 micro from ... | [
"kivy.require",
"pyA20.gpio.gpio.output",
"pyA20.gpio.gpio.init",
"kivy.graphics.Rectangle",
"kivy.uix.gridlayout.GridLayout",
"pyA20.gpio.gpio.setcfg",
"kivy.uix.togglebutton.ToggleButton",
"sys.exit",
"os.getegid",
"kivy.graphics.Color"
] | [((439, 460), 'kivy.require', 'kivy.require', (['"""1.8.0"""'], {}), "('1.8.0')\n", (451, 460), False, 'import kivy\n'), ((865, 876), 'pyA20.gpio.gpio.init', 'gpio.init', ([], {}), '()\n', (874, 876), False, 'from pyA20.gpio import gpio\n'), ((907, 940), 'pyA20.gpio.gpio.setcfg', 'gpio.setcfg', (['ledPin1', 'gpio.OUTPU... |
from qualifier import make_table
table = make_table(
# rows=[
# ["Duck<NAME>", 3],
# ["<NAME>", 12],
# ["Duck<NAME>", 7],
# ["<NAME>", 1]
# ],
# labels=["Name", "Duckiness"],
rows=[
["Lemon", 18_3285, "Owner"],
["Sebastiaan", 18_3285.1, "Owner"],
["Kuti... | [
"qualifier.make_table"
] | [((43, 277), 'qualifier.make_table', 'make_table', ([], {'rows': "[['Lemon', 183285, 'Owner'], ['Sebastiaan', 183285.1, 'Owner'], [\n 'KutieKatj', 15000, 'Admin'], ['Jake', 'MoreThanU', 'Helper'], ['Joe', \n -12, 'Idk Tbh']]", 'labels': "['User', 'Messages', 'Role']", 'centered': '(True)'}), "(rows=[['Lemon', 183... |
from animation.animation_utils import flush_all_animations
from distributor.ops import GenericProtocolBufferOp
from element_utils import soft_sleep_forever, build_critical_section
from placement import FGLTuning
from protocolbuffers import DistributorOps_pb2 as protocols
from routing import SurfaceType, SurfaceIdentifi... | [
"placement.PositionIncrementInfo",
"services.current_zone_id",
"element_utils.soft_sleep_forever",
"placement.create_starting_location",
"clock.interval_in_real_seconds",
"routing.test_connectivity_pt_pt",
"services.sim_spawner_service",
"routing.get_default_agent_radius",
"placement.ScoringFunction... | [((2867, 3035), 'sims4.tuning.tunable.Tunable', 'Tunable', (['float', '(5.0)'], {'description': '"""Distance at which a Sim will start checking their LoS and in use on the object they\'re routing to and cancel if it\'s taken."""'}), '(float, 5.0, description=\n "Distance at which a Sim will start checking their LoS ... |
#!/usr/bin/env python
import sample
import location
import collector
import test_googleform2isoformat
import test_csvimport
def test():
sample.test_sample()
location.test_location()
collector.test_collector()
test_googleform2isoformat.test_googleform2isodatetime
test_csvimport.test_csvimport_row()... | [
"test_csvimport.test_csvimport_row",
"location.test_location",
"sample.test_sample",
"collector.test_collector"
] | [((142, 162), 'sample.test_sample', 'sample.test_sample', ([], {}), '()\n', (160, 162), False, 'import sample\n'), ((167, 191), 'location.test_location', 'location.test_location', ([], {}), '()\n', (189, 191), False, 'import location\n'), ((196, 222), 'collector.test_collector', 'collector.test_collector', ([], {}), '(... |
from oidcmsg.oauth2 import AccessTokenResponse
import pytest
from oidcrp.entity import Entity
from oidcrp.util import rndstr
KEYDEF = [{"type": "EC", "crv": "P-256", "use": ["sig"]}]
class TestRP():
@pytest.fixture(autouse=True)
def create_service(self):
client_config = {
'client_id': 'c... | [
"pytest.fixture",
"oidcmsg.oauth2.AccessTokenResponse",
"oidcrp.entity.Entity",
"oidcrp.util.rndstr"
] | [((208, 236), 'pytest.fixture', 'pytest.fixture', ([], {'autouse': '(True)'}), '(autouse=True)\n', (222, 236), False, 'import pytest\n'), ((749, 796), 'oidcrp.entity.Entity', 'Entity', ([], {'config': 'client_config', 'services': 'services'}), '(config=client_config, services=services)\n', (755, 796), False, 'from oidc... |
# Generated by Django 3.0.6 on 2020-05-23 07:06
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('students', '0003_auto_20200523_0616'),
]
operations = [
migrations.AlterField(
model_name='klas... | [
"django.db.models.ForeignKey"
] | [((372, 488), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'on_delete': 'django.db.models.deletion.CASCADE', 'related_name': '"""klasses"""', 'to': '"""students.Programme"""'}), "(on_delete=django.db.models.deletion.CASCADE, related_name\n ='klasses', to='students.Programme')\n", (389, 488), False, 'fro... |
import time
import sys
sys.path.append('..')
import log.custom_logger as custom_logger
import notification.email_notification as email_notification
import notification.wechat_notification as wechat_notification
import strategy.time_strategy_equity_bond_yield as time_strategy_equity_bond_yield
class NotificationPlanAf... | [
"strategy.time_strategy_equity_bond_yield.TimeStrategyEquityBondYield",
"log.custom_logger.CustomLogger",
"notification.wechat_notification.WechatNotification",
"time.time",
"notification.email_notification.EmailNotification",
"time.localtime",
"sys.path.append"
] | [((24, 45), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (39, 45), False, 'import sys\n'), ((1776, 1787), 'time.time', 'time.time', ([], {}), '()\n', (1785, 1787), False, 'import time\n'), ((1903, 1914), 'time.time', 'time.time', ([], {}), '()\n', (1912, 1914), False, 'import time\n'), ((545, 5... |
"""Implementation of Model-Free Policy Gradient Algorithms."""
import torch.nn.modules.loss as loss
from torch.optim import Adam
from rllib.algorithms.ac import ActorCritic
from rllib.policy import NNPolicy
from rllib.value_function import NNQFunction
from .on_policy_agent import OnPolicyAgent
class ActorCriticAge... | [
"rllib.policy.NNPolicy.default",
"rllib.value_function.NNQFunction.default"
] | [((1757, 1786), 'rllib.policy.NNPolicy.default', 'NNPolicy.default', (['environment'], {}), '(environment)\n', (1773, 1786), False, 'from rllib.policy import NNPolicy\n'), ((1835, 1867), 'rllib.value_function.NNQFunction.default', 'NNQFunction.default', (['environment'], {}), '(environment)\n', (1854, 1867), False, 'fr... |
"""
Code modified from PyTorch DCGAN examples: https://github.com/pytorch/examples/tree/master/dcgan
"""
from __future__ import print_function
import argparse
import os
import numpy as np
import random
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
from utils import den... | [
"torch.cuda.manual_seed_all",
"torch.manual_seed",
"numpy.random.normal",
"random.randint",
"argparse.ArgumentParser",
"os.makedirs",
"network._netG",
"torch.LongTensor",
"network._netD_CIFAR10",
"os.path.join",
"random.seed",
"torch.from_numpy",
"network._netG_CIFAR10",
"numpy.zeros",
"... | [((523, 548), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (546, 548), False, 'import argparse\n'), ((1797, 1824), 'random.seed', 'random.seed', (['opt.manualSeed'], {}), '(opt.manualSeed)\n', (1808, 1824), False, 'import random\n'), ((1829, 1862), 'torch.manual_seed', 'torch.manual_seed', ([... |
#!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name="sample-n-files",
version="1.0",
author="<NAME>",
description="Randomly sample N files from a directory.",
py_modules=['sample_n_files'],
install_requires=[
'Click'
],
entry_points='''
[console... | [
"setuptools.find_packages"
] | [((394, 409), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (407, 409), False, 'from setuptools import setup, find_packages\n')] |
"""
MicroFaaS - FaaS without the faff.
Provides functions as a service on a small scale using Docker.
Copyright 2019 <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.or... | [
"ufaas.tasks.task_cleanup_coro",
"asyncio.PriorityQueue",
"quart.json.jsonify",
"ufaas.tasks.create_container_coro",
"async_timeout.timeout",
"quart.request.get_json",
"ufaas.tasks.task_runner_coro",
"asyncio.get_event_loop",
"quart.Quart"
] | [((3010, 3025), 'asyncio.PriorityQueue', 'PriorityQueue', ([], {}), '()\n', (3023, 3025), False, 'from asyncio import PriorityQueue, create_task, get_event_loop\n'), ((3333, 3348), 'asyncio.PriorityQueue', 'PriorityQueue', ([], {}), '()\n', (3346, 3348), False, 'from asyncio import PriorityQueue, create_task, get_event... |
"""
The game of Reversi. Warning: this game is not coded in an optimal
way, the AI will be slow.
"""
import numpy as np
from easyAI import TwoPlayersGame
to_string = lambda a : "ABCDEFGH"[a[0]] + str(a[1]+1)
to_array = lambda s : np.array(["ABCDEFGH".index(s[0]),int(s[1])-1])
class Reversi( TwoPlayersGame ):
"""... | [
"easyAI.Negamax",
"numpy.array",
"numpy.zeros",
"numpy.sum"
] | [((3016, 3243), 'numpy.array', 'np.array', (['[[9, 3, 3, 3, 3, 3, 3, 9], [3, 1, 1, 1, 1, 1, 1, 3], [3, 1, 1, 1, 1, 1, 1, \n 3], [3, 1, 1, 1, 1, 1, 1, 3], [3, 1, 1, 1, 1, 1, 1, 3], [3, 1, 1, 1, 1,\n 1, 1, 3], [3, 1, 1, 1, 1, 1, 1, 3], [9, 3, 3, 3, 3, 3, 3, 9]]'], {}), '([[9, 3, 3, 3, 3, 3, 3, 9], [3, 1, 1, 1, 1, 1... |
from flask import Flask, send_from_directory
import os
app = Flask(__name__)
FOLDER = os.path.dirname(os.path.abspath(__file__))
@app.route('/static/<path:filename>')
def static_overwrite(filename):
static_folder = os.path.join(FOLDER, 'static')
# return app.send_static_file(filename)
return send_from_di... | [
"os.path.abspath",
"flask.send_from_directory",
"os.path.join",
"flask.Flask"
] | [((63, 78), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (68, 78), False, 'from flask import Flask, send_from_directory\n'), ((104, 129), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (119, 129), False, 'import os\n'), ((222, 252), 'os.path.join', 'os.path.join', (['FOLDER', '... |
from TechApp import db, models
from TechApp.models import Usuario, Endereco
from management import *
import unittest
class TestCase(unittest.TestCase):
def setUp(self):
# create the database
db.drop_all()
db.create_all()
#Testes da entidade Usuário
def test_obter_usuarios(self):
db.session.add(U... | [
"TechApp.db.create_all",
"TechApp.db.drop_all",
"TechApp.models.Usuario.query.filter_by",
"TechApp.db.session.commit",
"unittest.main",
"TechApp.models.Usuario.query.get",
"TechApp.models.Usuario"
] | [((1607, 1622), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1620, 1622), False, 'import unittest\n'), ((205, 218), 'TechApp.db.drop_all', 'db.drop_all', ([], {}), '()\n', (216, 218), False, 'from TechApp import db, models\n'), ((222, 237), 'TechApp.db.create_all', 'db.create_all', ([], {}), '()\n', (235, 237),... |
from fastapi import FastAPI
from fastapi.responses import HTMLResponse
from fastapi.logger import logger
app = FastAPI()
@app.get("/", response_class=HTMLResponse)
async def root():
return """
<a href="/info">info</a><br/>
<a href="/error">error</a><br/>
<a href="/warning">warning</a><br/>
"""
@app... | [
"fastapi.logger.logger.info",
"fastapi.FastAPI",
"fastapi.logger.logger.error",
"fastapi.logger.logger.warning"
] | [((114, 123), 'fastapi.FastAPI', 'FastAPI', ([], {}), '()\n', (121, 123), False, 'from fastapi import FastAPI\n'), ((356, 384), 'fastapi.logger.logger.info', 'logger.info', (['"""log test info"""'], {}), "('log test info')\n", (367, 384), False, 'from fastapi.logger import logger\n'), ((471, 501), 'fastapi.logger.logge... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware 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 ... | [
"tests.base.startServer",
"tests.base.enabledPlugins.append",
"girder.models.model_base.ModelImporter.model",
"tests.base.stopServer"
] | [((891, 939), 'tests.base.enabledPlugins.append', 'base.enabledPlugins.append', (['"""slicer_cli_web_ssr"""'], {}), "('slicer_cli_web_ssr')\n", (917, 939), False, 'from tests import base\n'), ((944, 962), 'tests.base.startServer', 'base.startServer', ([], {}), '()\n', (960, 962), False, 'from tests import base\n'), ((9... |
"""
regulaaravaldised.py
Mõned regulaaravaldiste näide
"""
import re
muster = r"(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)" # alternatiivne r"[^@]+@[^@]+\.[^@]+"
while True:
sisend = input("Sisesta emaili aadress: ")
if len(sisend) == 0:
break
if re.match(muster, sisend):
prin... | [
"re.match"
] | [((282, 306), 're.match', 're.match', (['muster', 'sisend'], {}), '(muster, sisend)\n', (290, 306), False, 'import re\n')] |
# -*- coding: utf-8 -*-
import pytest
from casperlabs_client import InternalError
from casperlabs_client.consts import ED25519_KEY_ALGORITHM
from tests.conftest import key_paths
def test_simple_deploy_build_to_node_comm_failure(client, account_keys_directory):
private_key_pem_path, _ = key_paths(ED25519_KEY_ALGO... | [
"pytest.raises",
"tests.conftest.key_paths"
] | [((294, 350), 'tests.conftest.key_paths', 'key_paths', (['ED25519_KEY_ALGORITHM', 'account_keys_directory'], {}), '(ED25519_KEY_ALGORITHM, account_keys_directory)\n', (303, 350), False, 'from tests.conftest import key_paths\n'), ((360, 388), 'pytest.raises', 'pytest.raises', (['InternalError'], {}), '(InternalError)\n'... |
# Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
Google App Engine adapter module.
Sets up basic type mapping and class mappings for using the Datastore API
in Google App Engine.
@see: U{Datastore API on Google App Engine<http://
code.google.com/appengine/docs/python/datastore>}
@since: 0.3.... | [
"pyamf.add_type",
"pyamf.register_alias_type",
"pyamf.ClassAlias._compile_base_class",
"pyamf.ClassAlias.getEncodableAttributes",
"pyamf.ClassAlias.getDecodableAttributes"
] | [((10709, 10765), 'pyamf.register_alias_type', 'pyamf.register_alias_type', (['DataStoreClassAlias', 'db.Model'], {}), '(DataStoreClassAlias, db.Model)\n', (10734, 10765), False, 'import pyamf\n'), ((10766, 10804), 'pyamf.add_type', 'pyamf.add_type', (['db.Query', 'util.to_list'], {}), '(db.Query, util.to_list)\n', (10... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import wx
from . import datascanframe_ui as dsfui
from .funutils import getFileToLoad
import imp
import os
from inspect import getmembers, isfunction
class FuncListFrame(dsfui.FuncListFrame):
def __init__(self, parent, fullpath='.', type='op'):
dsfui.FuncLis... | [
"os.path.abspath",
"imp.load_source",
"inspect.getmembers",
"os.path.isfile"
] | [((1442, 1477), 'imp.load_source', 'imp.load_source', (['"""myfunc"""', 'fullpath'], {}), "('myfunc', fullpath)\n", (1457, 1477), False, 'import imp\n'), ((1498, 1524), 'inspect.getmembers', 'getmembers', (['mm', 'isfunction'], {}), '(mm, isfunction)\n', (1508, 1524), False, 'from inspect import getmembers, isfunction\... |
from tests.test_base import app, client, login
_SCRIPT_ID_HELLO = "pyscriptdemo.helloworld.HelloWorld"
_SCRIPT_ID_HELLO_WITH_PARAMS = "pyscriptdemo.helloworld.HelloWorldWithParams"
def test_hello(app, client):
login(client)
response = client.post("/api/scripts/" + _SCRIPT_ID_HELLO + "/_run")
assert resp... | [
"tests.test_base.login",
"tests.test_base.client.post"
] | [((217, 230), 'tests.test_base.login', 'login', (['client'], {}), '(client)\n', (222, 230), False, 'from tests.test_base import app, client, login\n'), ((247, 304), 'tests.test_base.client.post', 'client.post', (["('/api/scripts/' + _SCRIPT_ID_HELLO + '/_run')"], {}), "('/api/scripts/' + _SCRIPT_ID_HELLO + '/_run')\n",... |
from marshmallow import Schema, fields, validate, ValidationError, validates_schema
from schemas.cars import GetCarSchema
from schemas.validators import username_starts_with_capital_letter
class LoginSchema(Schema):
class Meta:
ordered = True
username = fields.String(required=True,
... | [
"marshmallow.ValidationError",
"schemas.cars.GetCarSchema",
"marshmallow.validate.Length",
"marshmallow.fields.String",
"marshmallow.fields.Integer"
] | [((1256, 1272), 'marshmallow.fields.Integer', 'fields.Integer', ([], {}), '()\n', (1270, 1272), False, 'from marshmallow import Schema, fields, validate, ValidationError, validates_schema\n'), ((1288, 1303), 'marshmallow.fields.String', 'fields.String', ([], {}), '()\n', (1301, 1303), False, 'from marshmallow import Sc... |
import os.path
import numpy as np
import math
from collections import namedtuple
from typing import Dict, Any, Tuple, List, Optional
from models.adaptive_model import AdaptiveModel
from models.standard_model import StandardModel
from dataset.dataset import Dataset, DataSeries
from utils.file_utils import save_by_file_... | [
"utils.file_utils.read_by_file_suffix",
"collections.namedtuple",
"numpy.isclose",
"numpy.argmax",
"numpy.any",
"utils.file_utils.save_by_file_suffix",
"numpy.count_nonzero",
"numpy.sum",
"numpy.zeros",
"numpy.array",
"numpy.concatenate",
"numpy.argmin",
"numpy.bincount"
] | [((563, 642), 'collections.namedtuple', 'namedtuple', (['"""ModelResults"""', "['predictions', 'labels', 'stop_probs', 'accuracy']"], {}), "('ModelResults', ['predictions', 'labels', 'stop_probs', 'accuracy'])\n", (573, 642), False, 'from collections import namedtuple\n'), ((1447, 1491), 'utils.file_utils.save_by_file_... |
# -*- coding: utf-8 -*-
#
# General-purpose Photovoltaic Device Model - a drift diffusion base/Shockley-Read-Hall
# model for 1st, 2nd and 3rd generation solar cells.
# Copyright (C) 2008-2022 <NAME> r.c.i.mackenzie at googlemail.com
#
# https://www.gpvdm.com
#
# This program is free software; you can ... | [
"psutil.cpu_percent",
"PyQt5.QtGui.QPainter",
"psutil.disk_io_counters",
"PyQt5.QtCore.QTimer",
"PyQt5.QtGui.QColor",
"server.server_get"
] | [((1613, 1625), 'server.server_get', 'server_get', ([], {}), '()\n', (1623, 1625), False, 'from server import server_get\n'), ((1825, 1833), 'PyQt5.QtCore.QTimer', 'QTimer', ([], {}), '()\n', (1831, 1833), False, 'from PyQt5.QtCore import Qt, QTimer\n'), ((1996, 2009), 'psutil.cpu_percent', 'cpu_percent', ([], {}), '()... |
'''
Resampling methods
==================
'''
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn import datasets
import sklearn.linear_model as lm
from sklearn.model_selection import train_test_split, KFold, PredefinedSplit
from sklearn.model_selection import cro... | [
"numpy.sqrt",
"sklearn.metrics.balanced_accuracy_score",
"sklearn.model_selection.StratifiedKFold",
"numpy.array",
"sklearn.linear_model.LogisticRegressionCV",
"sklearn.linear_model.RidgeCV",
"seaborn.violinplot",
"sklearn.model_selection.KFold",
"sklearn.metrics.r2_score",
"numpy.arange",
"nump... | [((389, 483), 'sklearn.datasets.make_regression', 'datasets.make_regression', ([], {'n_samples': '(100)', 'n_features': '(100)', 'n_informative': '(10)', 'random_state': '(42)'}), '(n_samples=100, n_features=100, n_informative=10,\n random_state=42)\n', (413, 483), False, 'from sklearn import datasets\n'), ((3002, 3... |
from ...pipeline.BPtPipeline import BPtPipeline
from ...pipeline.BPtSearchCV import NevergradSearchCV
from ...pipeline.ScopeObjs import ScopeTransformer
from ...pipeline.BPtModel import BPtModel
from ..input import (Model, ModelPipeline, Pipeline, CV, Scaler,
ProblemSpec, ParamSearch, Imputer, Tran... | [
"sklearn.preprocessing.RobustScaler",
"sklearn.linear_model.Ridge",
"numpy.ones",
"pytest.raises"
] | [((20233, 20240), 'sklearn.linear_model.Ridge', 'Ridge', ([], {}), '()\n', (20238, 20240), False, 'from sklearn.linear_model import Ridge\n'), ((20644, 20651), 'sklearn.linear_model.Ridge', 'Ridge', ([], {}), '()\n', (20649, 20651), False, 'from sklearn.linear_model import Ridge\n'), ((21922, 21939), 'numpy.ones', 'np.... |
# Generated by Django 2.0.5 on 2019-01-11 11:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tweets', '0003_auto_20190110_1752'),
]
operations = [
migrations.CreateModel(
name='Tag',
fields=[
(... | [
"django.db.models.AutoField",
"django.db.models.ManyToManyField",
"django.db.models.CharField"
] | [((607, 667), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([], {'related_name': '"""tags"""', 'to': '"""tweets.Tag"""'}), "(related_name='tags', to='tweets.Tag')\n", (629, 667), False, 'from django.db import migrations, models\n'), ((326, 419), 'django.db.models.AutoField', 'models.AutoField', ([], {'... |
import unittest
from pysapets.ox import Ox
from pysapets.animal import Animal
import pysapets.constants as constants
from unittest.mock import patch
from io import StringIO
from copy import deepcopy
class OxTest(unittest.TestCase):
def setUp(self):
self.ox = Ox()
self.friends = [self.ox, Animal(2, 2), Anim... | [
"pysapets.animal.Animal",
"pysapets.ox.Ox"
] | [((268, 272), 'pysapets.ox.Ox', 'Ox', ([], {}), '()\n', (270, 272), False, 'from pysapets.ox import Ox\n'), ((857, 872), 'pysapets.ox.Ox', 'Ox', ([], {'addHealth': '(3)'}), '(addHealth=3)\n', (859, 872), False, 'from pysapets.ox import Ox\n'), ((1045, 1060), 'pysapets.ox.Ox', 'Ox', ([], {'addAttack': '(3)'}), '(addAtta... |
import redis
import logging
from django.conf.urls import url
from django.conf import settings
from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter
from . import consumers
logger = logging.getLogger('awx.main.routing')
class AWXProtocolTypeRouter(ProtocolTypeRou... | [
"logging.getLogger",
"channels.routing.URLRouter",
"redis.Redis.from_url",
"django.conf.urls.url"
] | [((237, 274), 'logging.getLogger', 'logging.getLogger', (['"""awx.main.routing"""'], {}), "('awx.main.routing')\n", (254, 274), False, 'import logging\n'), ((791, 834), 'django.conf.urls.url', 'url', (['"""websocket/$"""', 'consumers.EventConsumer'], {}), "('websocket/$', consumers.EventConsumer)\n", (794, 834), False,... |
from rest_framework import status
from rest_framework.reverse import reverse
from resource_tracker.models import ResourceGroupAttributeDefinition
from tests.test_resource_tracker.test_api.base_test_api import BaseTestAPI
class TestAttributeDefinitionCreate(BaseTestAPI):
def setUp(self):
super(TestAttrib... | [
"resource_tracker.models.ResourceGroupAttributeDefinition.objects.latest",
"resource_tracker.models.ResourceGroupAttributeDefinition.objects.all",
"rest_framework.reverse.reverse"
] | [((374, 462), 'rest_framework.reverse.reverse', 'reverse', (['"""api_attribute_definition_list_create"""'], {'args': '[self.rg_physical_servers.id]'}), "('api_attribute_definition_list_create', args=[self.\n rg_physical_servers.id])\n", (381, 462), False, 'from rest_framework.reverse import reverse\n'), ((549, 595),... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, V... | [
"subprocess.check_output",
"os.kill",
"socket.getfqdn",
"argparse.ArgumentParser",
"re.compile",
"os.getuid",
"psutil.Process",
"psutil.process_iter",
"time.time",
"time.sleep",
"re.match",
"socket.getaddrinfo",
"sys.exit",
"socket.gethostname"
] | [((3797, 3827), 're.compile', 're.compile', (['"""^(10|192|127)\\\\."""'], {}), "('^(10|192|127)\\\\.')\n", (3807, 3827), False, 'import re\n'), ((2171, 2187), 'socket.getfqdn', 'socket.getfqdn', ([], {}), '()\n', (2185, 2187), False, 'import socket\n'), ((4196, 4217), 'psutil.process_iter', 'psutil.process_iter', ([],... |
# -*- coding: utf-8 -*-
"""Tests for delete command."""
import habito
import habito.commands
from tests.commands import HabitoCommandTestCase
class HabitoDeleteTestCase(HabitoCommandTestCase):
def test_delete_removes_habit_activity(self):
habit = self.create_habit()
self.add_summary(habit)
... | [
"habito.models.Habit.select",
"habito.models.Activity.select"
] | [((859, 887), 'habito.models.Habit.select', 'habito.models.Habit.select', ([], {}), '()\n', (885, 887), False, 'import habito\n'), ((1428, 1456), 'habito.models.Habit.select', 'habito.models.Habit.select', ([], {}), '()\n', (1454, 1456), False, 'import habito\n'), ((2102, 2133), 'habito.models.Activity.select', 'habito... |
#EPN-ESFOT
#ALGORITMOS FUNDAMENTALES
#TIEMPOS EJECUCION DE UN SCRIPT
#<NAME>
#VERSION 3.2
from time import time #importamos la libreria time
def fact_recursivo(n): #en esta funcion recursiva se plantea un caso base
if n <= 1: #un caso base cuando es <= 1 para que nos retorne 1
return ... | [
"time.time"
] | [((1070, 1076), 'time.time', 'time', ([], {}), '()\n', (1074, 1076), False, 'from time import time\n'), ((1521, 1527), 'time.time', 'time', ([], {}), '()\n', (1525, 1527), False, 'from time import time\n'), ((1281, 1287), 'time.time', 'time', ([], {}), '()\n', (1285, 1287), False, 'from time import time\n'), ((1739, 17... |
import sys,pyperclip
passwords={
'qq':'<PASSWORD>',
'weibo':'<PASSWORD>',
'163':'<PASSWORD>',
}
if len(sys.argv)<2:
print('usage: py pw.py[account]- copy account password')
account=sys.argv[1]
if account in passwords.keys():
pyperclip.copy(passwords[account])
print('password has copied to th... | [
"pyperclip.copy"
] | [((249, 283), 'pyperclip.copy', 'pyperclip.copy', (['passwords[account]'], {}), '(passwords[account])\n', (263, 283), False, 'import sys, pyperclip\n')] |
import numpy as np
import pandas as pd
def autocorr_single_tp(a: np.array, t: int) -> float:
"""Do autocorrelation for a single time point.
Parameters
----------
a : np.array
The array to correlate (complex or real number)
t : int
The distance (in the index)
Returns
-----... | [
"pandas.DataFrame",
"numpy.conj"
] | [((798, 812), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (810, 812), True, 'import pandas as pd\n'), ((420, 433), 'numpy.conj', 'np.conj', (['a[t]'], {}), '(a[t])\n', (427, 433), True, 'import numpy as np\n')] |
# Generated by Django 2.2.6 on 2019-10-11 00:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('league_analysis', '0002_auto_20191008_1832'),
]
operations = [
migrations.RenameField(
model_name='playerrollingstatistics',
... | [
"django.db.models.FloatField",
"django.db.migrations.RenameField",
"django.db.models.IntegerField"
] | [((243, 372), 'django.db.migrations.RenameField', 'migrations.RenameField', ([], {'model_name': '"""playerrollingstatistics"""', 'old_name': '"""creep_stats_average"""', 'new_name': '"""average_creep_stats"""'}), "(model_name='playerrollingstatistics', old_name=\n 'creep_stats_average', new_name='average_creep_stats... |
#!/usr/bin/env python3
from typing import Dict, List
from captum.concept.fb._core.concept import Concept
import torch
import os
class CAV:
r"""
A Concept Activation Vector (CAV) is a vector orthogonal to the decision
boundary provided by a classifier to distinguish between activations
produced by co... | [
"os.path.exists",
"torch.load",
"os.path.join",
"os.mkdir",
"torch.save",
"captum.concept.fb._core.concept.Concept"
] | [((2810, 2839), 'os.path.join', 'os.path.join', (['path', 'file_name'], {}), '(path, file_name)\n', (2822, 2839), False, 'import os\n'), ((4021, 4053), 'torch.save', 'torch.save', (['save_dict', 'cavs_path'], {}), '(save_dict, cavs_path)\n', (4031, 4053), False, 'import torch\n'), ((5066, 5091), 'os.path.exists', 'os.p... |
from os import sys, path
if __name__ == '__main__' and __package__ is None:
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
from watson_bots_communicator.processor import main
main()
| [
"os.path.abspath",
"watson_bots_communicator.processor.main"
] | [((210, 216), 'watson_bots_communicator.processor.main', 'main', ([], {}), '()\n', (214, 216), False, 'from watson_bots_communicator.processor import main\n'), ((123, 145), 'os.path.abspath', 'path.abspath', (['__file__'], {}), '(__file__)\n', (135, 145), False, 'from os import sys, path\n')] |
import __future__
import argparse
import ConfigParser
import requests
from os import path
def main():
# Configure ConfigParser
base_dir = path.dirname(path.realpath(__file__))
config = ConfigParser.ConfigParser()
config.optionxform = str
home = path.expanduser('~')
config.read('{}/.sms'.format(home))
... | [
"requests.post",
"argparse.ArgumentParser",
"ConfigParser.ConfigParser",
"os.path.realpath",
"os.path.expanduser"
] | [((192, 219), 'ConfigParser.ConfigParser', 'ConfigParser.ConfigParser', ([], {}), '()\n', (217, 219), False, 'import ConfigParser\n'), ((256, 276), 'os.path.expanduser', 'path.expanduser', (['"""~"""'], {}), "('~')\n", (271, 276), False, 'from os import path\n'), ((688, 828), 'argparse.ArgumentParser', 'argparse.Argume... |
import datetime
from mantabot import command
class Clear(command.Command):
""" Bot command that deletes messages """
name = 'clear'
errors = {
'usage': '{name} <number>|<text>|me\n'
'→ *<number>*: clear that many messages.\n'
'→ *<text>*: clear all messages since... | [
"datetime.datetime.now"
] | [((1704, 1727), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (1725, 1727), False, 'import datetime\n')] |
"""
:Copyright: 2006-2021 <NAME>
:License: Revised BSD (see `LICENSE` file for details)
"""
from byceps.services.authentication.session.models.current_user import (
CurrentUser,
)
from byceps.services.authentication.session import service as session_service
from byceps.services.shop.cart.models import Cart
from by... | [
"byceps.services.shop.cart.models.Cart",
"tests.integration.services.shop.helpers.create_orderer",
"byceps.services.shop.order.service.place_order"
] | [((729, 749), 'tests.integration.services.shop.helpers.create_orderer', 'create_orderer', (['user'], {}), '(user)\n', (743, 749), False, 'from tests.integration.services.shop.helpers import create_orderer\n'), ((762, 768), 'byceps.services.shop.cart.models.Cart', 'Cart', ([], {}), '()\n', (766, 768), False, 'from bycep... |
import time
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
class RegisterPage:
#URL
URL = "https://www.reserved.com/ro/ro/customer/account/login/#register"
#locators
EMAIL_FIELD = (B... | [
"selenium.webdriver.support.ui.WebDriverWait",
"selenium.webdriver.support.expected_conditions.element_to_be_clickable"
] | [((1488, 1542), 'selenium.webdriver.support.expected_conditions.element_to_be_clickable', 'EC.element_to_be_clickable', (['self.CREATE_ACCOUNT_BUTTON'], {}), '(self.CREATE_ACCOUNT_BUTTON)\n', (1514, 1542), True, 'from selenium.webdriver.support import expected_conditions as EC\n'), ((1450, 1481), 'selenium.webdriver.su... |
import os
import numpy as np
import scipy.io
from sklearn.manifold import TSNE
from sklearn.svm import SVC
from sklearn.model_selection import train_test_split
from sklearn.metrics import confusion_matrix, classification_report
import matplotlib.pyplot as plt
from matplotlib import style
style.use('fivethirtyeight')
im... | [
"numpy.ones",
"sklearn.model_selection.train_test_split",
"sklearn.metrics.classification_report",
"numpy.array",
"numpy.zeros",
"matplotlib.style.use",
"numpy.vstack",
"numpy.save",
"numpy.load",
"xgboost.XGBClassifier",
"sklearn.metrics.confusion_matrix"
] | [((289, 317), 'matplotlib.style.use', 'style.use', (['"""fivethirtyeight"""'], {}), "('fivethirtyeight')\n", (298, 317), False, 'from matplotlib import style\n'), ((377, 421), 'numpy.load', 'np.load', (['"""realChinesesignetf95_features.npy"""'], {}), "('realChinesesignetf95_features.npy')\n", (384, 421), True, 'import... |
import boto3
import time
def make_config(origin_domain, origin_id, access_id, path='/'):
return {'Aliases': {'Quantity': 0},
'CacheBehaviors': {'Quantity': 0},
'CallerReference': str(time.time()),
'Comment': '',
'CustomErrorResponses': {'Quantity': 0},
'DefaultCacheBehavior': {'AllowedMet... | [
"boto3.client",
"time.time"
] | [((2969, 2995), 'boto3.client', 'boto3.client', (['"""cloudfront"""'], {}), "('cloudfront')\n", (2981, 2995), False, 'import boto3\n'), ((199, 210), 'time.time', 'time.time', ([], {}), '()\n', (208, 210), False, 'import time\n'), ((3336, 3347), 'time.time', 'time.time', ([], {}), '()\n', (3345, 3347), False, 'import ti... |
import pandas as pd
import numpy as np
from enrest.functions import run_test, get_threshold, get_deg_gene_ids, get_other_gene_ids_for_deg_case, split_scores_by_gene_ids
from enrest.parsers import matrices_parser, promoters_parser, read_set_of_genes
import enrest.speedup as sup
def work_with_matrix(name, pwm, pfm, mat... | [
"enrest.functions.split_scores_by_gene_ids",
"pandas.read_csv",
"numpy.searchsorted",
"enrest.parsers.promoters_parser",
"enrest.functions.get_other_gene_ids_for_deg_case",
"enrest.functions.get_threshold",
"enrest.functions.get_deg_gene_ids",
"enrest.functions.run_test",
"numpy.max",
"numpy.array... | [((496, 522), 'enrest.speedup.scaner', 'sup.scaner', (['promoters', 'pwm'], {}), '(promoters, pwm)\n', (506, 522), True, 'import enrest.speedup as sup\n'), ((541, 567), 'numpy.max', 'np.max', (['all_scores'], {'axis': '(1)'}), '(all_scores, axis=1)\n', (547, 567), True, 'import numpy as np\n'), ((629, 653), 'enrest.spe... |
import numpy as np
import pandas as pd
from bokeh.io import output_file
from bokeh.layouts import column
from bokeh.models import ColumnDataSource, RangeTool
from bokeh.plotting import figure, show
# from bokeh import sampledata
# sampledata.download(progress=False)
# from bokeh.sampledata.stocks import AAPL
# get d... | [
"bokeh.io.output_file",
"bokeh.layouts.column",
"bokeh.plotting.figure",
"pandas.read_csv",
"bokeh.models.ColumnDataSource",
"bokeh.models.RangeTool"
] | [((388, 406), 'pandas.read_csv', 'pd.read_csv', (['fpath'], {}), '(fpath)\n', (399, 406), True, 'import pandas as pd\n'), ((605, 625), 'bokeh.models.ColumnDataSource', 'ColumnDataSource', (['df'], {}), '(df)\n', (621, 625), False, 'from bokeh.models import ColumnDataSource, RangeTool\n'), ((632, 822), 'bokeh.plotting.f... |
from rdflib.namespace import Namespace, NamespaceManager
from rdflib import Graph
#Our data namespace
D = Namespace('https://expert.gwu.edu/individual/')
#The VIVO namespace
VIVO = Namespace('http://vivoweb.org/ontology/core#')
#The VCARD namespace
VCARD = Namespace('http://www.w3.org/2006/vcard/ns#')
#The OBO namespa... | [
"rdflib.Graph",
"rdflib.namespace.Namespace"
] | [((107, 154), 'rdflib.namespace.Namespace', 'Namespace', (['"""https://expert.gwu.edu/individual/"""'], {}), "('https://expert.gwu.edu/individual/')\n", (116, 154), False, 'from rdflib.namespace import Namespace, NamespaceManager\n'), ((182, 228), 'rdflib.namespace.Namespace', 'Namespace', (['"""http://vivoweb.org/onto... |
"""
BSD 3-Clause License
Copyright (c) 2018, <NAME>, Aalto University, Finland
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, t... | [
"utils.execute_list",
"helpers_n_wrappers.utils3.set_attributes"
] | [((2367, 2390), 'utils.execute_list', 'utils.execute_list', (['cmd'], {}), '(cmd)\n', (2385, 2390), False, 'import utils\n'), ((2465, 2517), 'helpers_n_wrappers.utils3.set_attributes', 'utils3.set_attributes', (['self'], {'override': '(True)'}), '(self, override=True, **kwargs)\n', (2486, 2517), False, 'from helpers_n_... |
from __future__ import unicode_literals
import mock
try:
import unittest2 as unittest # Python2.6
except ImportError:
import unittest
import trovebox
class TestAlbums(unittest.TestCase):
test_host = "test.example.com"
test_photos_dict = [{"id": "1a", "tags": ["tag1", "tag2"]},
... | [
"mock.patch.object",
"trovebox.Trovebox",
"trovebox.objects.album.Album",
"trovebox.objects.photo.Photo"
] | [((1412, 1455), 'mock.patch.object', 'mock.patch.object', (['trovebox.Trovebox', '"""get"""'], {}), "(trovebox.Trovebox, 'get')\n", (1429, 1455), False, 'import mock\n'), ((1993, 2036), 'mock.patch.object', 'mock.patch.object', (['trovebox.Trovebox', '"""get"""'], {}), "(trovebox.Trovebox, 'get')\n", (2010, 2036), Fals... |
# import packages
from __future__ import print_function
from pipeline.license_plate import LicensePlateDetector
from pipeline.descriptors import BlockBinaryPixelSum
from sklearn.svm import LinearSVC
from imutils import paths
import argparse
import pickle
import random
import glob
import cv2
# construct the argument pa... | [
"pipeline.descriptors.BlockBinaryPixelSum",
"argparse.ArgumentParser",
"pipeline.license_plate.LicensePlateDetector.preprocessChar",
"pickle.dumps",
"sklearn.svm.LinearSVC",
"imutils.paths.list_images",
"cv2.cvtColor",
"cv2.imread",
"glob.glob"
] | [((354, 379), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (377, 379), False, 'import argparse\n'), ((939, 1002), 'pipeline.descriptors.BlockBinaryPixelSum', 'BlockBinaryPixelSum', ([], {'targetSize': '(30, 15)', 'blockSizes': 'blockSizes'}), '(targetSize=(30, 15), blockSizes=blockSizes)\n', ... |
'''
This file is intended for a sequential bulk update of either Redditors or Subreddits
contained within a directory consisting of a single type.
'''
from glob import glob
from pathlib import Path
from os import listdir
import typer
from ruidl import Redditor, Subreddit
APP = typer.Typer()
def _update(
kind,
... | [
"os.listdir",
"pathlib.Path",
"typer.Option",
"typer.Typer",
"typer.echo",
"glob.glob"
] | [((281, 294), 'typer.Typer', 'typer.Typer', ([], {}), '()\n', (292, 294), False, 'import typer\n'), ((415, 450), 'pathlib.Path', 'Path', (['download_directory', 'kind_path'], {}), '(download_directory, kind_path)\n', (419, 450), False, 'from pathlib import Path\n'), ((455, 473), 'typer.echo', 'typer.echo', (['dl_dir'],... |
# (c) 2012-2014, <NAME> <<EMAIL>>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansi... | [
"os.path.isdir"
] | [((1705, 1725), 'os.path.isdir', 'os.path.isdir', (['entry'], {}), '(entry)\n', (1718, 1725), False, 'import os\n')] |
import argparse
import os
from os import path
import time
import shutil
from random import sample
import pickle
import ast
from model.discriminator import Discriminator
from model.generator import Generator
from lib.utils.avgmeter import AverageMeter
from lib.dataloader import CelebADataset
def arg_as_list(s):
v ... | [
"torchvision.utils.make_grid",
"torch.utils.tensorboard.SummaryWriter",
"os.path.exists",
"argparse.ArgumentParser",
"model.discriminator.Discriminator",
"lib.dataloader.CelebADataset",
"torch.randn",
"model.generator.Generator",
"torch.optim.lr_scheduler.ExponentialLR",
"argparse.ArgumentTypeErro... | [((474, 559), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Pytorch Training DCGAN for CelebA Dataset"""'}), "(description='Pytorch Training DCGAN for CelebA Dataset'\n )\n", (497, 559), False, 'import argparse\n'), ((322, 341), 'ast.literal_eval', 'ast.literal_eval', (['s'], {}), '(... |
"""Partial implementation of a Piwik Reporting API Client."""
from urllib.parse import urlencode
from json.decoder import JSONDecodeError
import requests
from . import modules
from .base import BaseModule
class PiwikAPI:
"""Piwik Reporting API client class."""
REQUEST_ARGS = {
'format': 'json',
... | [
"urllib.parse.urlencode",
"requests.get"
] | [((1186, 1222), 'requests.get', 'requests.get', (['self.url', 'request_args'], {}), '(self.url, request_args)\n', (1198, 1222), False, 'import requests\n'), ((1942, 1954), 'urllib.parse.urlencode', 'urlencode', (['r'], {}), '(r)\n', (1951, 1954), False, 'from urllib.parse import urlencode\n')] |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# GUI module generated by PAGE version 4.20
# in conjunction with Tcl version 8.6
# Feb 20, 2019 02:41:59 PM -0300 platform: Windows NT
"""
Created on Mon Feb 18 10:08:04 2019
@author: <NAME>
"""
import sys
try:
import Tkinter as tk
except ImportError:
im... | [
"tkinter.Menu",
"VStat_support.op_frame2param",
"tkinter.LabelFrame",
"VStat_support.btn_export",
"Estilos.mnStyle",
"tkinter.Toplevel",
"tkinter.Button",
"VStat_support.init",
"tkinter.Tk",
"Estilos.frStyle",
"VStat_support.btn_connect",
"tkinter.Label",
"Controller.connection.disconnect",
... | [((624, 631), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (629, 631), True, 'import tkinter as tk\n'), ((663, 692), 'VStat_support.init', 'VStat_support.init', (['root', 'top'], {}), '(root, top)\n', (681, 692), False, 'import VStat_support\n'), ((883, 900), 'tkinter.Toplevel', 'tk.Toplevel', (['root'], {}), '(root)\n', (... |
import matplotlib.pyplot as plt
from functools import partial
dt = .1
times = range(start=0, stop=6, step=dt)
param = {
'a': 2,
'b': 1,
}
def x(time):
state = time
def func(param, state, time):
return param['b']*state*state + state*param['a'] + time
def simulate(func, state, init, times):
... | [
"functools.partial"
] | [((417, 437), 'functools.partial', 'partial', (['func', 'param'], {}), '(func, param)\n', (424, 437), False, 'from functools import partial\n')] |
from queue import Queue
from threading import Thread
import logging
class AudioThread:
def __init__(self, stream, chunk, timeout=0, rate=16000):
self.run = True
self.queue = Queue(maxsize=0)
self.thread = Thread(target=self.read_stream, args=(stream, chunk, rate, timeout))
self.thr... | [
"threading.Thread",
"queue.Queue",
"logging.info"
] | [((196, 212), 'queue.Queue', 'Queue', ([], {'maxsize': '(0)'}), '(maxsize=0)\n', (201, 212), False, 'from queue import Queue\n'), ((235, 303), 'threading.Thread', 'Thread', ([], {'target': 'self.read_stream', 'args': '(stream, chunk, rate, timeout)'}), '(target=self.read_stream, args=(stream, chunk, rate, timeout))\n',... |
from unittest import TestCase
import ByteStreamHandler
class TestOpenArrayBlock(TestCase):
def setUp(self):
stack = [ByteStreamHandler.State()]
self.open_array_block = ByteStreamHandler.OpenArrayBlock(stack)
def test_handle(self):
self.assertIsInstance(self.open_array_block.handle("]"... | [
"ByteStreamHandler.OpenArrayBlock",
"ByteStreamHandler.State"
] | [((190, 229), 'ByteStreamHandler.OpenArrayBlock', 'ByteStreamHandler.OpenArrayBlock', (['stack'], {}), '(stack)\n', (222, 229), False, 'import ByteStreamHandler\n'), ((817, 842), 'ByteStreamHandler.State', 'ByteStreamHandler.State', ([], {}), '()\n', (840, 842), False, 'import ByteStreamHandler\n'), ((862, 898), 'ByteS... |
# 二分法
# TODO: a,bの選び直し
# 解が二つあるので,初期値によっては収束しなくなる.why?
import matplotlib.pyplot as plt
EQUATION = 1
def f(x):
if EQUATION == 1:
return x ** 2 + 2 * x - 1 # 手計算の解は√2 - 1, -1 - √2
elif EQUATION == 2:
return x
def main():
epsilon = 0.1 ** 16
n = 0
c_old = 0.191
WRITE = 1
cl... | [
"matplotlib.pyplot.show"
] | [((890, 900), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (898, 900), True, 'import matplotlib.pyplot as plt\n')] |
import argparse
import logging
import aiohttp
import asyncio
from cachetools import TTLCache
from aiohttp.server import ServerHttpProtocol
loop = asyncio.get_event_loop()
logging.basicConfig(level=logging.NOTSET, format="%(asctime)s %(threadName)-20s %(levelname)s %(message)s")
logger = logging.getLogger(__name__)
... | [
"logging.basicConfig",
"logging.getLogger",
"aiohttp.ClientSession",
"argparse.ArgumentParser",
"aiohttp.Response",
"cachetools.TTLCache",
"asyncio.get_event_loop"
] | [((147, 171), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (169, 171), False, 'import asyncio\n'), ((173, 285), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.NOTSET', 'format': '"""%(asctime)s %(threadName)-20s %(levelname)s %(message)s"""'}), "(level=logging.NOTSET, for... |
# https://leetcode.com/problems/power-of-three/
import math
class Solution:
def isPowerOfThree(self, n: int) -> bool:
if n <= 1:
return n == 1
base = 3
exponent = int(math.log(n, base))
return 3 ** exponent == n or 3 ** (exponent + 1) == n
| [
"math.log"
] | [((210, 227), 'math.log', 'math.log', (['n', 'base'], {}), '(n, base)\n', (218, 227), False, 'import math\n')] |
from time import sleep
from sense_hat import SenseHat
sense = SenseHat()
yellow = (255, 255, 0)
blue = (0, 0, 255)
black = (0,0,0)
white = (255,255,255)
sense.show_message("I Win", text_colour=yellow, back_colour=blue)
sense.clear(black)
r = (255,0,0)
g = (0,255,0)
b = (0,0,255)
creeper_pixels = [
g,g,g,g,g,g,g,g... | [
"sense_hat.SenseHat",
"time.sleep"
] | [((62, 72), 'sense_hat.SenseHat', 'SenseHat', ([], {}), '()\n', (70, 72), False, 'from sense_hat import SenseHat\n'), ((497, 505), 'time.sleep', 'sleep', (['(1)'], {}), '(1)\n', (502, 505), False, 'from time import sleep\n')] |
# ----------------------------------------------------------------- #
# This code was taken from github repo: #
# "Connectionist Temporal Classification (CTC) decoding algorithms" #
# developed by <NAME> #
# https://github.com/githubharald/CTCDec... | [
"itertools.groupby",
"numpy.argmax"
] | [((758, 780), 'numpy.argmax', 'np.argmax', (['mat'], {'axis': '(1)'}), '(mat, axis=1)\n', (767, 780), True, 'import numpy as np\n'), ((1022, 1040), 'itertools.groupby', 'groupby', (['best_path'], {}), '(best_path)\n', (1029, 1040), False, 'from itertools import groupby\n')] |
from pathlib import Path
import pytest
from sb.sb import Sb
tests_path = Path(__file__).parent.parent
sub_path = 'fixtures/empty/empty_benchmark.py'
bench_file = (tests_path / sub_path).resolve()
@pytest.fixture
def sb():
return Sb(bench_file, log_level='DEBUG', debug=True)
def test_dollar_sign(sb):
spec =... | [
"sb.sb.Sb",
"pathlib.Path"
] | [((236, 281), 'sb.sb.Sb', 'Sb', (['bench_file'], {'log_level': '"""DEBUG"""', 'debug': '(True)'}), "(bench_file, log_level='DEBUG', debug=True)\n", (238, 281), False, 'from sb.sb import Sb\n'), ((74, 88), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (78, 88), False, 'from pathlib import Path\n')] |
#!/usr/bin/env python3
"""
This module is used to get an access token to MS Graph.
Parameters
----------
TENANT_NAME : str
The name of the Azure tenant
CLIENT_ID : str
The ID of the registered Azure AD application
CLIENT_SECRET : str
Secret of the registered Azure AD application
"""
from adal import Auth... | [
"adal.AuthenticationContext"
] | [((452, 525), 'adal.AuthenticationContext', 'AuthenticationContext', (["('https://login.microsoftonline.com/' + TENANT_NAME)"], {}), "('https://login.microsoftonline.com/' + TENANT_NAME)\n", (473, 525), False, 'from adal import AuthenticationContext\n')] |
import argparse
import gc
import glob
import logging
import math
import os
import sys
import time
import numpy as np
import torch
import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.nn.functional as F
import data
import model_search_rnn as model
from architect_rnn import Architect
from utils_rnn i... | [
"logging.getLogger",
"architect_rnn.Architect",
"numpy.log",
"utils_rnn.get_batch",
"torch.cuda.is_available",
"model_search_rnn.cuda",
"math.exp",
"logging.info",
"argparse.ArgumentParser",
"numpy.random.random",
"utils_rnn.save_checkpoint",
"model_search_rnn.RNNModelSearch",
"utils.get_dir... | [((404, 493), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""PyTorch PennTreeBank/WikiText2 Language Model"""'}), "(description=\n 'PyTorch PennTreeBank/WikiText2 Language Model')\n", (427, 493), False, 'import argparse\n'), ((5783, 5894), 'logging.basicConfig', 'logging.basicConfig',... |
#!/usr/bin/env python3
# Scan for BLE devices, print them when found
from cobble import cobble
from time import sleep
def main():
cobble.init()
cobble.start_scan()
print("Scanning for devices, press Ctrl-C to quit")
# Results can be dispatched more than once for the same peripheral, but that isn'... | [
"cobble.cobble.get_updatevalue",
"cobble.cobble.connect",
"cobble.cobble.get_scanresult",
"time.sleep",
"cobble.cobble.init",
"cobble.cobble.start_scan",
"cobble.cobble.run_with"
] | [((1227, 1248), 'cobble.cobble.run_with', 'cobble.run_with', (['main'], {}), '(main)\n', (1242, 1248), False, 'from cobble import cobble\n'), ((138, 151), 'cobble.cobble.init', 'cobble.init', ([], {}), '()\n', (149, 151), False, 'from cobble import cobble\n'), ((156, 175), 'cobble.cobble.start_scan', 'cobble.start_scan... |
import os
import time
from functools import partial
from multiprocessing import Pool
from typing import Dict, Callable
from jina.parsers import set_client_cli_parser
from jina.clients import Client, WebSocketClient
from pydantic import validate_arguments
from logger import logger
from helper import GatewayClients, Ta... | [
"jina.clients.Client",
"logger.logger.info",
"os.getenv",
"logger.logger.error",
"functools.partial",
"multiprocessing.Pool",
"jina.clients.WebSocketClient",
"jina.parsers.set_client_cli_parser",
"time.time"
] | [((2336, 2397), 'logger.logger.info', 'logger.info', (['f"""👍 Starting indexing for {execution_time} secs"""'], {}), "(f'👍 Starting indexing for {execution_time} secs')\n", (2347, 2397), False, 'from logger import logger\n'), ((2410, 2421), 'time.time', 'time.time', ([], {}), '()\n', (2419, 2421), False, 'import time... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import os
import joblib
from utils import normalize_MPU9250_data, split_df, get_intervals_from_moments, EventIntervals
from GeneralAnalyser import GeneralAnalyser, plot_measurements
# plt.interactive(True)
pd.options.display.max_columns = 15
pic_pr... | [
"torch.utils.data.DataLoader",
"torch.nn.LSTM",
"joblib.load",
"utils.get_intervals_from_moments",
"torch.nn.utils.rnn.pack_sequence",
"torch.Tensor",
"pandas.to_datetime",
"torch.utils.data.TensorDataset",
"sklearn.preprocessing.StandardScaler",
"torch.nn.utils.rnn.pack_padded_sequence",
"panda... | [((465, 498), 'joblib.load', 'joblib.load', (['"""data/sessions_dict"""'], {}), "('data/sessions_dict')\n", (476, 498), False, 'import joblib\n'), ((515, 548), 'joblib.load', 'joblib.load', (['"""data/gamedata_dict"""'], {}), "('data/gamedata_dict')\n", (526, 548), False, 'import joblib\n'), ((2745, 2771), 'pandas.Peri... |
# coding=utf-8
import json
import requests
from globalvars import GlobalVars
import threading
# noinspection PyPackageRequirements
import websocket
from collections import Iterable
from datetime import datetime, timedelta
from glob import glob
from regex import sub
import sys
import traceback
import time
import os
impo... | [
"globalvars.GlobalVars.posts_scan_stats_lock.acquire",
"chatcommunicate.tell_rooms_with",
"time.sleep",
"datahandling.add_ignored_post",
"datahandling.add_false_positive",
"sys.exc_info",
"globalvars.GlobalVars.metasmoke_ws.settimeout",
"datetime.timedelta",
"datahandling.remove_blacklisted_user",
... | [((2745, 2762), 'datetime.datetime.utcnow', 'datetime.utcnow', ([], {}), '()\n', (2760, 2762), False, 'from datetime import datetime, timedelta\n'), ((17634, 17676), 'globalvars.GlobalVars.posts_scan_stats_lock.acquire', 'GlobalVars.posts_scan_stats_lock.acquire', ([], {}), '()\n', (17674, 17676), False, 'from globalva... |
from __future__ import unicode_literals
from datetime import datetime
from os.path import dirname, join
from django.test.utils import modify_settings, override_settings
from django.utils import timezone
from django.utils.encoding import smart_str
from test_plus import TestCase
from touchtechnology.common.tests.test_t... | [
"datetime.datetime",
"touchtechnology.common.tests.test_timezone_forms.TestForm1",
"django.utils.timezone.get_current_timezone",
"django.utils.timezone.get_default_timezone_name",
"os.path.dirname",
"django.utils.encoding.smart_str",
"django.test.utils.override_settings",
"django.test.utils.modify_set... | [((3790, 3840), 'django.test.utils.override_settings', 'override_settings', ([], {'ROOT_URLCONF': '"""example_app.urls"""'}), "(ROOT_URLCONF='example_app.urls')\n", (3807, 3840), False, 'from django.test.utils import modify_settings, override_settings\n'), ((3842, 3941), 'django.test.utils.modify_settings', 'modify_set... |
# coding: utf8
from request import Request
from vk_api.sending import send_plain_message
from resources import RESPONSE_FREQUENT_REQUEST, RESPONSE_DUPLICATE_REQUEST, RESPONSE_REQUEST_LENGTH
def build_error_frequency_request(user_id, dt):
r = Request(user_id, dt, '')
r.response_text = RESPONSE_FREQUENT_REQUES... | [
"vk_api.sending.send_plain_message",
"request.Request"
] | [((249, 273), 'request.Request', 'Request', (['user_id', 'dt', '""""""'], {}), "(user_id, dt, '')\n", (256, 273), False, 'from request import Request\n'), ((339, 383), 'vk_api.sending.send_plain_message', 'send_plain_message', (['user_id', 'r.response_text'], {}), '(user_id, r.response_text)\n', (357, 383), False, 'fro... |
import re
from nb_utils import line_macros
"""
TODO: Separation of concerns between LessonPreprocessor and MacroProcessor is
muddled. For historical reasons, LessonPreprocessor currently owns the logic for
expander macros. Eventually, would like to move all macro stuff here (and in
modules like line_macros.py)
"""
c... | [
"re.match"
] | [((888, 925), 're.match', 're.match', (['cell_macro_pattern', 'topline'], {}), '(cell_macro_pattern, topline)\n', (896, 925), False, 'import re\n'), ((1922, 1953), 're.match', 're.match', (['line_macro_pattern', 'l'], {}), '(line_macro_pattern, l)\n', (1930, 1953), False, 'import re\n')] |
import logging
from django.core.paginator import Paginator
from rest_framework.views import APIView
from rest_framework import status
from rest_framework.permissions import IsAuthenticated
from drf_yasg.utils import swagger_auto_schema
import constants
from response_utils import ApiResponse, get_error_message
from wa... | [
"logging.getLogger",
"wall.models.Wall.objects.get",
"response_utils.get_error_message",
"wall.models.Wall.objects.filter",
"response_utils.ApiResponse",
"drf_yasg.utils.swagger_auto_schema",
"wall.serializers.CommentSerializer",
"wall.models.Comment.objects.get",
"wall.serializers.WallSerializer",
... | [((476, 503), 'logging.getLogger', 'logging.getLogger', (['"""django"""'], {}), "('django')\n", (493, 503), False, 'import logging\n'), ((2287, 2432), 'drf_yasg.utils.swagger_auto_schema', 'swagger_auto_schema', ([], {'request_body': 'WallSerializer', 'operation_description': '"""API is used to post the Wall detail and... |
from detect_secrets.core.audit import get_secrets_list_from_file
from detect_secrets.core.report.constants import ReportCheckResult
from detect_secrets.core.report.constants import ReportExitCode
from detect_secrets.core.report.constants import ReportSecretType
def fail_on_unaudited(baseline_filename: str) -> ReportC... | [
"detect_secrets.core.audit.get_secrets_list_from_file",
"detect_secrets.core.report.constants.ReportCheckResult"
] | [((561, 606), 'detect_secrets.core.audit.get_secrets_list_from_file', 'get_secrets_list_from_file', (['baseline_filename'], {}), '(baseline_filename)\n', (587, 606), False, 'from detect_secrets.core.audit import get_secrets_list_from_file\n'), ((1174, 1222), 'detect_secrets.core.report.constants.ReportCheckResult', 'Re... |
import math
from leveleditorlibs import tool, resources
from leveleditorlibs import graphics, draw, level
from leveleditorlibs import gui
class Decal(tool.Tool):
decal_name = 1
def select(self):
self.button_group = gui.ButtonGroup()
images = []
names = []
for decal in... | [
"leveleditorlibs.gui.ButtonGroup",
"leveleditorlibs.level.simple_objects.append",
"leveleditorlibs.level.DecalSprite",
"leveleditorlibs.tool.generate_button_row",
"leveleditorlibs.level.get_id",
"math.atan2"
] | [((243, 260), 'leveleditorlibs.gui.ButtonGroup', 'gui.ButtonGroup', ([], {}), '()\n', (258, 260), False, 'from leveleditorlibs import gui\n'), ((634, 696), 'leveleditorlibs.tool.generate_button_row', 'tool.generate_button_row', (['images', 'functions', 'self.button_group'], {}), '(images, functions, self.button_group)\... |
"""
Sumatra Server
:copyright: Copyright 2010-2020 <NAME>
:license: BSD 2-clause, see COPYING for details.
"""
import json
from django.http import (
HttpResponse,
JsonResponse,
HttpResponseBadRequest, # 400
HttpResponseForbidden, # 403
HttpResponseNotFound, # 404
HttpResponseNotAllowed, #... | [
"json.loads",
"django.http.HttpResponseBadRequest",
"sumatra.recordstore.django_store.models.Project.objects.filter",
"django.http.HttpResponse",
"sumatra.recordstore.django_store.models.Project.objects.get_or_create",
"sumatra.recordstore.django_store.models.Record",
"django.http.HttpResponseForbidden"... | [((6039, 6063), 'json.loads', 'json.loads', (['request.body'], {}), '(request.body)\n', (6049, 6063), False, 'import json\n'), ((9891, 9942), 'sumatra.recordstore.django_store.models.Project.objects.get_or_create', 'Project.objects.get_or_create', ([], {'id': "kwargs['project']"}), "(id=kwargs['project'])\n", (9920, 99... |
from __future__ import print_function
import os
import sys
from pandas.util.testing import assert_frame_equal
sys.path.insert(1, os.path.join("..","..",".."))
from h2o.automl import H2OAutoML, get_automl, get_leaderboard
from tests import pyunit_utils as pu
from _automl_utils import import_dataset
all_algos = ["De... | [
"_automl_utils.import_dataset",
"h2o.automl.H2OAutoML",
"os.path.join",
"tests.pyunit_utils.run_tests",
"h2o.automl.get_automl",
"h2o.automl.get_leaderboard"
] | [((2841, 2915), 'tests.pyunit_utils.run_tests', 'pu.run_tests', (['[test_custom_leaderboard, test_custom_leaderboard_as_method]'], {}), '([test_custom_leaderboard, test_custom_leaderboard_as_method])\n', (2853, 2915), True, 'from tests import pyunit_utils as pu\n'), ((131, 161), 'os.path.join', 'os.path.join', (['"""..... |