code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from django.shortcuts import render
from models import Testrun, Testresult, Project
from django.shortcuts import get_object_or_404
from django.utils import simplejson
from django.http import HttpResponse
def testrun_list(request):
projects = Project.objects.filter(active=True)
return render(request, 'eukalypse... | [
"django.shortcuts.render",
"models.Project.objects.filter",
"django.shortcuts.get_object_or_404",
"django.utils.simplejson.dumps"
] | [((247, 282), 'models.Project.objects.filter', 'Project.objects.filter', ([], {'active': '(True)'}), '(active=True)\n', (269, 282), False, 'from models import Testrun, Testresult, Project\n'), ((294, 368), 'django.shortcuts.render', 'render', (['request', '"""eukalypse_now/testrun/list.html"""', "{'projects': projects}... |
import sys
from azsentinel import current_config
from azsentinel.api import AzureSentinelApi
from azsentinel.auth import TokenRequester
def list_incidents(
only_assigned: bool = False, filter: str = "properties/status ne 'Closed'"
):
"""
Retrieves a list of incidents (default: non-closed)
"""
_, w... | [
"azsentinel.current_config.get_workspace",
"azsentinel.auth.TokenRequester",
"azsentinel.api.AzureSentinelApi",
"sys.exit"
] | [((334, 364), 'azsentinel.current_config.get_workspace', 'current_config.get_workspace', ([], {}), '()\n', (362, 364), False, 'from azsentinel import current_config\n'), ((489, 507), 'azsentinel.api.AzureSentinelApi', 'AzureSentinelApi', ([], {}), '()\n', (505, 507), False, 'from azsentinel.api import AzureSentinelApi\... |
import gtimer as gt
from rlkit.core import logger
from ROLL.online_LSTM_replay_buffer import OnlineLSTMRelabelingBuffer
import rlkit.torch.vae.vae_schedules as vae_schedules
import ROLL.LSTM_schedule as lstm_schedules
from rlkit.torch.torch_rl_algorithm import (
TorchBatchRLAlgorithm,
)
import rlkit.torch.pytorch_u... | [
"os.path.exists",
"torch.multiprocessing.Pipe",
"threading.Thread",
"numpy.load",
"gtimer.stamp",
"rlkit.core.logger.get_snapshot_dir"
] | [((3062, 3086), 'gtimer.stamp', 'gt.stamp', (['"""vae training"""'], {}), "('vae training')\n", (3070, 3086), True, 'import gtimer as gt\n'), ((8488, 8494), 'torch.multiprocessing.Pipe', 'Pipe', ([], {}), '()\n', (8492, 8494), False, 'from torch.multiprocessing import Process, Pipe\n'), ((12963, 12989), 'os.path.exists... |
#!/home/hiroya/Documents/Git-Repos/Lets_Play_Your_Waveform/.venv/bin/python
# -*- coding: utf-8 -*-
import cv2
import sys
import struct
import pyaudio
import pygame
import numpy as np
from matplotlib import pyplot
import matplotlib.gridspec as gridspec
from pygame.locals import K_s, K_d, K_f, K_g, K_h, K_j, K_k, K_l
f... | [
"numpy.sqrt",
"pygame.init",
"pygame.quit",
"cv2.destroyAllWindows",
"sys.exit",
"pygame.event.pump",
"numpy.where",
"pygame.display.set_mode",
"numpy.fft.fft",
"matplotlib.pyplot.close",
"matplotlib.gridspec.GridSpec",
"pygame.display.update",
"pygame.Rect",
"numpy.hamming",
"matplotlib... | [((8863, 8876), 'pygame.init', 'pygame.init', ([], {}), '()\n', (8874, 8876), False, 'import pygame\n'), ((8890, 8927), 'pygame.display.set_mode', 'pygame.display.set_mode', (['DISPLAY_SIZE'], {}), '(DISPLAY_SIZE)\n', (8913, 8927), False, 'import pygame\n'), ((8932, 8975), 'pygame.display.set_caption', 'pygame.display.... |
import json
import unittest
from unittest.mock import PropertyMock, patch
import sys
import io
import os
from fzfaws.utils import FileLoader, BaseSession
from fzfaws.ec2 import EC2
from fzfaws.ec2.ls_instance import ls_instance, dump_response
import boto3
from botocore.stub import Stubber
from pathlib import Path
cla... | [
"boto3.client",
"pathlib.Path",
"fzfaws.ec2.ls_instance.ls_instance",
"fzfaws.ec2.ls_instance.dump_response",
"botocore.stub.Stubber",
"fzfaws.utils.FileLoader",
"unittest.mock.patch.object",
"json.load",
"io.StringIO",
"os.path.abspath"
] | [((1022, 1084), 'unittest.mock.patch.object', 'patch.object', (['BaseSession', '"""client"""'], {'new_callable': 'PropertyMock'}), "(BaseSession, 'client', new_callable=PropertyMock)\n", (1034, 1084), False, 'from unittest.mock import PropertyMock, patch\n'), ((1090, 1127), 'unittest.mock.patch.object', 'patch.object',... |
import numpy as np
from predictions.utils.future import set_future_series
def random_forecast(series, steps_ahead=3, freq='D', series_name='random'):
"""
Function fits data into the random values within the interval given by a one standard deviation of a data.
INPUT:
:param series: pandas Series of ... | [
"predictions.utils.future.set_future_series",
"numpy.random.uniform"
] | [((649, 708), 'numpy.random.uniform', 'np.random.uniform', ([], {'low': '_bottom', 'high': '_top', 'size': 'steps_ahead'}), '(low=_bottom, high=_top, size=steps_ahead)\n', (666, 708), True, 'import numpy as np\n'), ((722, 862), 'predictions.utils.future.set_future_series', 'set_future_series', ([], {'forecasted_values'... |
import hyperopt
from hyperopt import hp, fmin, tpe
from hyperopt.mongoexp import MongoTrials
import hyperopt_optimizer
if __name__ == '__main__':
exp_key = 'deepface15'
print('---- %s ----' % exp_key)
space = hp.choice('parameters', [
{
'crop_y_ratio': hp.uniform('crop_y_ratio', 0.3, ... | [
"hyperopt.fmin",
"hyperopt.space_eval",
"hyperopt.hp.uniform",
"hyperopt.mongoexp.MongoTrials"
] | [((418, 510), 'hyperopt.mongoexp.MongoTrials', 'MongoTrials', (['"""mongo://hyper-mongo.devel.kakao.com:10247/curtis_db/jobs"""'], {'exp_key': 'exp_key'}), "('mongo://hyper-mongo.devel.kakao.com:10247/curtis_db/jobs',\n exp_key=exp_key)\n", (429, 510), False, 'from hyperopt.mongoexp import MongoTrials\n'), ((518, 62... |
from project.posts.models import PostAlbum
def create(post, photos):
for photo in photos:
PostAlbum.objects.create(post=post, photo=photo, photo_original=photo)
def get_post_album(post):
return PostAlbum.objects.filter(post=post) | [
"project.posts.models.PostAlbum.objects.create",
"project.posts.models.PostAlbum.objects.filter"
] | [((221, 256), 'project.posts.models.PostAlbum.objects.filter', 'PostAlbum.objects.filter', ([], {'post': 'post'}), '(post=post)\n', (245, 256), False, 'from project.posts.models import PostAlbum\n'), ((107, 177), 'project.posts.models.PostAlbum.objects.create', 'PostAlbum.objects.create', ([], {'post': 'post', 'photo':... |
# -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
import matplotlib.pyplot as plt
import matplotlib.axes
import matplotlib.figure
from multiprocessing import Process
from RRtoolbox.lib.config import FLAG_DEBUG
wins = [0] # keeps track of image number through different process... | [
"matplotlib.pyplot.imshow",
"argparse.ArgumentParser",
"matplotlib.pyplot.xticks",
"multiprocessing.Process",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show"
] | [((2070, 2129), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""fast plot of images."""'}), "(description='fast plot of images.')\n", (2093, 2129), False, 'import argparse\n'), ((1582, 1592), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (1590, 1592), True, 'import matplotlib.py... |
from behavioral_syntax.utilities.angle_and_skel import angle
import numpy as np
import scipy, h5py
import os
#filepath = 'C:/Users/ltopuser/behavioral_syntax/utilities/data.mat'
direc = '/Users/cyrilrocke/Documents/c_elegans/data/off_food/'
def get_skeletons(file):
"""get sequence of skeletons from a particular ... | [
"scipy.io.loadmat",
"os.listdir",
"behavioral_syntax.utilities.angle_and_skel.angle",
"h5py.File"
] | [((1454, 1475), 'os.listdir', 'os.listdir', (['directory'], {}), '(directory)\n', (1464, 1475), False, 'import os\n'), ((366, 381), 'h5py.File', 'h5py.File', (['file'], {}), '(file)\n', (375, 381), False, 'import scipy, h5py\n'), ((1976, 1995), 'behavioral_syntax.utilities.angle_and_skel.angle', 'angle', (['skeletons[i... |
from kdaHDFE.legacy.DemeanDataframe import demean_dataframe
from kdaHDFE.formula_transform import formula_transform
from kdaHDFE.legacy.OLSFixed import OLSFixed
from kdaHDFE.robust_error import robust_err
from kdaHDFE.clustering import *
from kdaHDFE.calculate_df import cal_df
from kdaHDFE.legacy.CalFullModel import ca... | [
"kdaHDFE.calculate_df.cal_df",
"kdaHDFE.legacy.DemeanDataframe.demean_dataframe",
"numpy.mat",
"numpy.abs",
"numpy.sqrt",
"kdaHDFE.legacy.OLSFixed.OLSFixed",
"kdaHDFE.robust_error.robust_err",
"numpy.diag",
"statsmodels.api.add_constant",
"kdaHDFE.formula_transform.formula_transform",
"time.proc... | [((1704, 1715), 'time.time', 'time.time', ([], {}), '()\n', (1713, 1715), False, 'import time\n'), ((1771, 1797), 'kdaHDFE.formula_transform.formula_transform', 'formula_transform', (['formula'], {}), '(formula)\n', (1788, 1797), False, 'from kdaHDFE.formula_transform import formula_transform\n'), ((2485, 2539), 'stats... |
#!/usr/bin/env python3
#
# A PyMol extension script to test extrusion of a hub from a single module's
# c-term
#
def main():
"""main"""
raise RuntimeError('This module should not be executed as a script')
if __name__ =='__main__':
main()
in_pymol = False
try:
import pymol
in_py... | [
"pymol.cmd.set_name",
"pymol.cmd.load",
"os.getcwd"
] | [((1159, 1213), 'pymol.cmd.load', 'cmd.load', (["(pdb_dir + '/singles/' + single_name + '.pdb')"], {}), "(pdb_dir + '/singles/' + single_name + '.pdb')\n", (1167, 1213), False, 'from pymol import cmd\n'), ((1227, 1262), 'pymol.cmd.set_name', 'cmd.set_name', (['single_name', '"""single"""'], {}), "(single_name, 'single'... |
# Copyright 2019 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"os.urandom",
"datetime.timedelta",
"datastore.ndb.delete_multi",
"datastore.data_types.CSRFToken",
"libs.helpers.get_user_email",
"base.utils.utcnow"
] | [((895, 909), 'base.utils.utcnow', 'utils.utcnow', ([], {}), '()\n', (907, 909), False, 'from base import utils\n'), ((1282, 1316), 'datastore.ndb.delete_multi', 'ndb.delete_multi', (['tokens_to_delete'], {}), '(tokens_to_delete)\n', (1298, 1316), False, 'from datastore import ndb\n'), ((1384, 1406), 'datastore.data_ty... |
import numpy as np
class TrendLine(object):
def __init__(self, name, data):
self.name = name
self.values = data
def plot(self, ax):
z = np.polyfit(range(0, len(self.values)), self.values, 1)
p = np.poly1d(z)
for k, v in ax.spines.items():
v.set_edgecolor('#... | [
"numpy.poly1d"
] | [((238, 250), 'numpy.poly1d', 'np.poly1d', (['z'], {}), '(z)\n', (247, 250), True, 'import numpy as np\n')] |
import os
import sys
sys.path.append(os.path.dirname(__name__))
from app import app
from settings import DEFAULT_WEB_SERVER
app.run(host=DEFAULT_WEB_SERVER['host'], port=DEFAULT_WEB_SERVER['port'], debug=True)
| [
"os.path.dirname",
"app.app.run"
] | [((127, 216), 'app.app.run', 'app.run', ([], {'host': "DEFAULT_WEB_SERVER['host']", 'port': "DEFAULT_WEB_SERVER['port']", 'debug': '(True)'}), "(host=DEFAULT_WEB_SERVER['host'], port=DEFAULT_WEB_SERVER['port'],\n debug=True)\n", (134, 216), False, 'from app import app\n'), ((38, 63), 'os.path.dirname', 'os.path.dirn... |
import logging
import os
import sys
import arguments
from app.core import files
from cli.main import start_cli
from gui.main import start_gui
def main():
app_path = files.get_app_path()
if not os.path.exists(app_path):
os.mkdir(app_path)
if not os.path.isfile(files.get_config_path()):
ope... | [
"logging.getLogger",
"os.path.exists",
"logging.StreamHandler",
"logging.Formatter",
"arguments.use_cli",
"app.core.files.get_aws_path",
"app.core.files.get_app_path",
"logging.getLevelName",
"logging.FileHandler",
"arguments.parse",
"os.mkdir",
"gui.main.start_gui",
"app.core.files.get_conf... | [((172, 192), 'app.core.files.get_app_path', 'files.get_app_path', ([], {}), '()\n', (190, 192), False, 'from app.core import files\n'), ((467, 487), 'app.core.files.get_aws_path', 'files.get_aws_path', ([], {}), '()\n', (485, 487), False, 'from app.core import files\n'), ((564, 593), 'arguments.parse', 'arguments.pars... |
#
# Copyright (c) 2018-2019 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
# vim: tabstop=4 shiftwidth=4 softtabstop=4
from __future__ import absolute_import
import logging
import fmclient as fm_client
from django.conf import settings
from openstack_dashboard.api import base
# Fault managemen... | [
"logging.getLogger",
"fmclient.Client",
"openstack_dashboard.api.base.get_request_page_size",
"openstack_dashboard.api.base.url_for"
] | [((664, 691), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (681, 691), False, 'import logging\n'), ((1103, 1158), 'openstack_dashboard.api.base.url_for', 'base.url_for', (['request', '"""faultmanagement"""'], {'region': 'region'}), "(request, 'faultmanagement', region=region)\n", (1115,... |
"""BERT finetuning runner."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import logging
import glob
import math
import json
import argparse
from tqdm import tqdm, trange
from pathlib import Path
import numpy as np
import torch
from... | [
"logging.getLogger",
"logging.StreamHandler",
"math.floor",
"torch.cuda.device_count",
"torch.utils.data.distributed.DistributedSampler",
"torch.cuda.is_available",
"copy.deepcopy",
"pytorch_pretrained_bert.optimization.warmup_linear",
"visdom.Visdom",
"vdbert.data_parallel.DataParallelImbalance",... | [((1449, 1474), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1472, 1474), False, 'import argparse\n'), ((13492, 13535), 'os.makedirs', 'os.makedirs', (['args.output_dir'], {'exist_ok': '(True)'}), '(args.output_dir, exist_ok=True)\n', (13503, 13535), False, 'import os\n'), ((13916, 13943), '... |
"""Manage Fields."""
import mailerlite.client as client
from mailerlite.constants import Field
class Fields:
def __init__(self, headers):
"""Initialize Fields object.
Parameters
----------
headers : dict
request header containing your mailerlite api_key.
... | [
"mailerlite.client.build_url",
"mailerlite.constants.Field",
"mailerlite.client.put",
"mailerlite.client.get",
"mailerlite.client.post",
"mailerlite.client.delete",
"mailerlite.client.check_headers"
] | [((434, 463), 'mailerlite.client.check_headers', 'client.check_headers', (['headers'], {}), '(headers)\n', (454, 463), True, 'import mailerlite.client as client\n'), ((933, 959), 'mailerlite.client.build_url', 'client.build_url', (['"""fields"""'], {}), "('fields')\n", (949, 959), True, 'import mailerlite.client as cli... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-09-18 02:07
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('wildlifecompliance', '0080_auto_20180912_0932'),
]
operations = [
migrations.Remove... | [
"django.db.migrations.RemoveField"
] | [((303, 381), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""applicationgrouptype"""', 'name': '"""display_name"""'}), "(model_name='applicationgrouptype', name='display_name')\n", (325, 381), False, 'from django.db import migrations\n')] |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import ... | [
"pulumi.get",
"pulumi.getter",
"pulumi.set",
"warnings.warn",
"pulumi.log.warn",
"pulumi.ResourceOptions"
] | [((15061, 15098), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""addonJobTimeout"""'}), "(name='addonJobTimeout')\n", (15074, 15098), False, 'import pulumi\n'), ((15843, 15879), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""addonsIncludes"""'}), "(name='addonsIncludes')\n", (15856, 15879), False, 'import pul... |
"""Use EDIA to assess quality of model fitness to electron density."""
import numpy as np
from . import Structure, XMap, ElectronDensityRadiusTable
from . import ResolutionBins, BondLengthTable
import argparse
import logging
import os
import time
logger = logging.getLogger(__name__)
class ediaOptions:
def __init... | [
"logging.getLogger",
"numpy.ceil",
"argparse.ArgumentParser",
"os.makedirs",
"numpy.asarray",
"numpy.zeros_like",
"numpy.floor",
"numpy.dot",
"numpy.linalg.inv",
"numpy.bincount",
"numpy.linalg.norm",
"numpy.transpose",
"time.time"
] | [((257, 284), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (274, 284), False, 'import logging\n'), ((17936, 17980), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__'}), '(description=__doc__)\n', (17959, 17980), False, 'import argparse\n'), ((18940, 18... |
from __future__ import division
from annotypes import Anno, add_call_types
from malcolm.core import Part, NumberMeta, Widget, config_tag, APartName, \
PartRegistrar, Display
from ..infos import ExposureDeadtimeInfo, ParameterTweakInfo
from ..util import exposure_attribute
from ..hooks import ReportStatusHook, Val... | [
"annotypes.Anno",
"malcolm.core.Widget.TEXTINPUT.tag",
"malcolm.core.config_tag",
"malcolm.core.Display"
] | [((476, 494), 'annotypes.Anno', 'Anno', (['readout_desc'], {}), '(readout_desc)\n', (480, 494), False, 'from annotypes import Anno, add_call_types\n'), ((628, 657), 'annotypes.Anno', 'Anno', (['frequency_accuracy_desc'], {}), '(frequency_accuracy_desc)\n', (632, 657), False, 'from annotypes import Anno, add_call_types\... |
import re
text = input()
pattern = r'(( |^)[a-zA-Z0-9]+([\.\-_][a-zA-Z0-9]+)*@[a-zA-Z0-9]+([\-][a-zA-Z0-9]+)*([\.][a-z]+)+)'
matches = re.finditer(pattern, text)
for match in matches:
print(match.group(0))
| [
"re.finditer"
] | [((142, 168), 're.finditer', 're.finditer', (['pattern', 'text'], {}), '(pattern, text)\n', (153, 168), False, 'import re\n')] |
from __future__ import print_function
import sys
sys.path.insert(1, "../../../")
import random
import h2o
from tests import pyunit_utils
from h2o.estimators.deeplearning import H2ODeepLearningEstimator
from h2o.estimators.gbm import H2OGradientBoostingEstimator
from h2o.estimators.glm import H2OGeneralizedLinearEstim... | [
"h2o.estimators.kmeans.H2OKMeansEstimator",
"h2o.estimators.random_forest.H2ORandomForestEstimator",
"h2o.estimators.glm.H2OGeneralizedLinearEstimator",
"sys.path.insert",
"random.randint",
"h2o.create_frame",
"h2o.estimators.glrm.H2OGeneralizedLowRankEstimator",
"tests.pyunit_utils.locate",
"h2o.es... | [((51, 82), 'sys.path.insert', 'sys.path.insert', (['(1)', '"""../../../"""'], {}), "(1, '../../../')\n", (66, 82), False, 'import sys\n'), ((822, 852), 'tests.pyunit_utils.locate', 'pyunit_utils.locate', (['"""results"""'], {}), "('results')\n", (841, 852), False, 'from tests import pyunit_utils\n'), ((1939, 1980), 'h... |
import numpy as np
import matplotlib.pyplot as plt
import emcee
paramnames = ["Offset days", "Init patients", "Infection rate", "Confirmed prob",
"Recovery rate", "Infect delay mean", "Infect delay std",
"Confirmed delay mean", "Confirmed delay std",
"Days to recover mean", "Days to recover std",
"Days... | [
"numpy.median",
"matplotlib.pyplot.hist",
"numpy.logical_and",
"matplotlib.pyplot.xlabel",
"numpy.array",
"emcee.backends.HDFBackend",
"numpy.std",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show"
] | [((813, 1000), 'numpy.array', 'np.array', (['[[0.0, 10.0], [2.0, 100.0], [1.0, 2.5], [0.0, 1.0], [0.0, 1.0], [1.0, 14.0],\n [1.0, 10.0], [1.0, 10.0], [1.0, 10.0], [1.0, 20.0], [1.0, 10.0], [1.0, \n 10.0], [1.0, 10.0]]'], {}), '([[0.0, 10.0], [2.0, 100.0], [1.0, 2.5], [0.0, 1.0], [0.0, 1.0], [\n 1.0, 14.0], [1.... |
from django.contrib.auth.models import AnonymousUser
from app.testing import register
@register
def user(self, **kwargs):
return self.mixer.blend('users.User', **kwargs)
@register
def anon(self, **kwargs):
return AnonymousUser()
| [
"django.contrib.auth.models.AnonymousUser"
] | [((226, 241), 'django.contrib.auth.models.AnonymousUser', 'AnonymousUser', ([], {}), '()\n', (239, 241), False, 'from django.contrib.auth.models import AnonymousUser\n')] |
import math
from typing import Optional
import torch
from torch import nn
ACT = {
'silu': nn.SiLU,
'relu': nn.ReLU,
'prelu': nn.PReLU,
'sigmoid': nn.Sigmoid,
'tanh': nn.Tanh,
'identity': nn.Identity
}
class DenseBlock(nn.Sequential):
def __init__(self, input_dim, output_dim, activation=... | [
"math.sqrt",
"torch.nn.Linear",
"torch.Tensor",
"torch.nn.init.zeros_"
] | [((1631, 1656), 'torch.nn.init.zeros_', 'nn.init.zeros_', (['self.bias'], {}), '(self.bias)\n', (1645, 1656), False, 'from torch import nn\n'), ((367, 410), 'torch.nn.Linear', 'nn.Linear', (['input_dim', 'output_dim'], {'bias': '(True)'}), '(input_dim, output_dim, bias=True)\n', (376, 410), False, 'from torch import nn... |
from nox_poetry import Session, session
@session()
def tests(session: Session) -> None:
args = session.posargs or ["--cov=kiez/", "--cov-report=xml", "tests/"]
session.install(".[all]")
session.install("pytest")
session.install("pytest-cov")
session.run("pytest", *args)
locations = ["kiez", "tes... | [
"nox_poetry.session.run",
"nox_poetry.session",
"nox_poetry.session.run_always",
"nox_poetry.session.install"
] | [((43, 52), 'nox_poetry.session', 'session', ([], {}), '()\n', (50, 52), False, 'from nox_poetry import Session, session\n'), ((342, 351), 'nox_poetry.session', 'session', ([], {}), '()\n', (349, 351), False, 'from nox_poetry import Session, session\n'), ((524, 533), 'nox_poetry.session', 'session', ([], {}), '()\n', (... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import builtins
import math
import warnings
import inspect
from functools import partial
import tensorflow as tf
from trident.backend.common import TensorShape
from trident.backend.tensorflow_backend import *
f... | [
"math.sqrt",
"trident.backend.common.camel2snake",
"tensorflow.random.truncated_normal",
"functools.partial",
"inspect.isfunction"
] | [((13633, 13657), 'trident.backend.common.camel2snake', 'camel2snake', (['initializer'], {}), '(initializer)\n', (13644, 13657), False, 'from trident.backend.common import get_function, camel2snake\n'), ((13727, 13760), 'functools.partial', 'partial', (['initializer_fn'], {}), '(initializer_fn, **kwargs)\n', (13734, 13... |
# -*- coding: utf-8 -*-
"""060 - Criando um Menu de Opções
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1ZRWz8qDYyffRbOffElSZ19QOPh6WqCEY
"""
from time import sleep
v=0
op='4'
while v!=5:
while op=='4':
n1=int(input('Digite Um Valor: '))
n2=int... | [
"time.sleep"
] | [((985, 993), 'time.sleep', 'sleep', (['(2)'], {}), '(2)\n', (990, 993), False, 'from time import sleep\n'), ((897, 905), 'time.sleep', 'sleep', (['(3)'], {}), '(3)\n', (902, 905), False, 'from time import sleep\n')] |
import discord
from discord.ext import commands
cogs = ["cogs.channel-management"]
intents = discord.Intents.default()
intents.voice_states = True
intents.members = True
bot = commands.Bot(command_prefix='!', intents=intents)
with open("token.txt", "r") as file:
TOKEN = file.read()
with open("authenticated_use... | [
"discord.ext.commands.Bot",
"discord.Intents.default"
] | [((95, 120), 'discord.Intents.default', 'discord.Intents.default', ([], {}), '()\n', (118, 120), False, 'import discord\n'), ((179, 228), 'discord.ext.commands.Bot', 'commands.Bot', ([], {'command_prefix': '"""!"""', 'intents': 'intents'}), "(command_prefix='!', intents=intents)\n", (191, 228), False, 'from discord.ext... |
import torch
import torch.nn.functional as F
import torchvision.transforms as transforms
from random import randint
import numpy as np
import cv2
from PIL import Image
import random
###################################################################
# random mask generation
############################################... | [
"torch.ones_like",
"PIL.Image.fromarray",
"cv2.line",
"cv2.ellipse",
"numpy.zeros",
"cv2.circle",
"torch.nn.functional.interpolate",
"torch.moveaxis",
"random.random",
"torchvision.transforms.ToTensor",
"random.randint"
] | [((429, 449), 'torch.ones_like', 'torch.ones_like', (['img'], {}), '(img)\n', (444, 449), False, 'import torch\n'), ((482, 502), 'random.randint', 'random.randint', (['(1)', '(5)'], {}), '(1, 5)\n', (496, 502), False, 'import random\n'), ((1013, 1033), 'torch.ones_like', 'torch.ones_like', (['img'], {}), '(img)\n', (10... |
#A function for randomly generating prime numbers, including very large primes. The function does this by generating random odd numbers
#and testing their primality using the Fermat primality test. Note that the Fermat test is a probabilistic test which incorrectly labels
#some composite numbers ("pseudoprimes") as pri... | [
"random.randrange"
] | [((1243, 1286), 'random.randrange', 'random.randrange', (['lowerBound', 'upperBound', '(2)'], {}), '(lowerBound, upperBound, 2)\n', (1259, 1286), False, 'import random\n'), ((1416, 1459), 'random.randrange', 'random.randrange', (['lowerBound', 'upperBound', '(2)'], {}), '(lowerBound, upperBound, 2)\n', (1432, 1459), Fa... |
from pspnet import PSPNet
from PIL import Image
import cv2
import time
# #def process(sourcepath, storepath, name):
# pspnet = PSPNet()
# img = sourcepath
# image = Image.open(img)
# print('Open Error! Try again!')
# start = time.process_time()
# #中间写上代码块
# r_image = pspnet.detect_ima... | [
"time.process_time",
"pspnet.PSPNet",
"PIL.Image.open"
] | [((512, 520), 'pspnet.PSPNet', 'PSPNet', ([], {}), '()\n', (518, 520), False, 'from pspnet import PSPNet\n'), ((533, 549), 'PIL.Image.open', 'Image.open', (['path'], {}), '(path)\n', (543, 549), False, 'from PIL import Image\n'), ((562, 581), 'time.process_time', 'time.process_time', ([], {}), '()\n', (579, 581), False... |
import cv2
import numpy as np
# erosion
# used for noise removal, only kernels with all one values
# result in one.
img = cv2.imread('j.png',0)
kernel = np.ones((5,5),np.uint8)
erosion = cv2.erode(img, kernel,viterations=1)
cv2.imshow('img', img)
cv2.imshow('erode', erosion)
| [
"cv2.erode",
"cv2.imread",
"numpy.ones",
"cv2.imshow"
] | [((131, 153), 'cv2.imread', 'cv2.imread', (['"""j.png"""', '(0)'], {}), "('j.png', 0)\n", (141, 153), False, 'import cv2\n'), ((163, 188), 'numpy.ones', 'np.ones', (['(5, 5)', 'np.uint8'], {}), '((5, 5), np.uint8)\n', (170, 188), True, 'import numpy as np\n'), ((198, 235), 'cv2.erode', 'cv2.erode', (['img', 'kernel'], ... |
import moviepy.editor as mp
def extraction(audio_path, video_path):
try:
clip = mp.VideoFileClip(video_path)
clip.audio.write_audiofile(audio_path)
print("Audio Extraction Success")
except:
print("Audio Extraction Failure")
def merger(audio_path, result_video_path, final_video... | [
"moviepy.editor.AudioFileClip",
"moviepy.editor.VideoFileClip"
] | [((94, 122), 'moviepy.editor.VideoFileClip', 'mp.VideoFileClip', (['video_path'], {}), '(video_path)\n', (110, 122), True, 'import moviepy.editor as mp\n'), ((352, 387), 'moviepy.editor.VideoFileClip', 'mp.VideoFileClip', (['result_video_path'], {}), '(result_video_path)\n', (368, 387), True, 'import moviepy.editor as ... |
#########
#
# Copyright (c) 2005 <NAME>
#
# This file is part of the vignette-removal library.
#
# Vignette-removal is free software; you can redistribute it and/or modify
# it under the terms of the X11 Software License (see the LICENSE file
# for details).
#
# This program is distributed in the hope that it will be ... | [
"numpy.sqrt",
"numpy.ones",
"functools.reduce",
"numpy.array",
"numpy.dot",
"numpy.linalg.inv",
"numpy.arctan2",
"numpy.cos",
"numpy.sin"
] | [((2128, 2159), 'numpy.array', 'np.array', (['[p0[1], p0[0], p0[2]]'], {}), '([p0[1], p0[0], p0[2]])\n', (2136, 2159), True, 'import numpy as np\n'), ((2168, 2199), 'numpy.array', 'np.array', (['[p1[1], p1[0], p1[2]]'], {}), '([p1[1], p1[0], p1[2]])\n', (2176, 2199), True, 'import numpy as np\n'), ((2674, 2689), 'funct... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import nltk
from nltk.corpus import stopwords
amazon = pd.read_csv('amazon.csv')
print(amazon.head())
| [
"pandas.read_csv"
] | [((137, 162), 'pandas.read_csv', 'pd.read_csv', (['"""amazon.csv"""'], {}), "('amazon.csv')\n", (148, 162), True, 'import pandas as pd\n')] |
#!/usr/bin/env python
import os, sys, json, warnings
from functools import wraps
import numpy as np
from PyQt5.QtGui import QColor
from qgis.core import (
Qgis,
QgsApplication,
QgsMeshLayer,
QgsMeshDatasetIndex,
QgsMeshUtils,
QgsProject,
QgsRasterLayer,
QgsRasterFileWriter,
QgsRaste... | [
"PyQt5.QtGui.QColor",
"numpy.array",
"qgis.core.QgsMeshUtils.exportRasterBlock",
"sys.path.append",
"qgis.core.QgsRasterHistogram",
"numpy.arange",
"qgis.core.QgsMeshLayer",
"qgis.core.QgsRasterLayer",
"qgis.core.QgsRasterShader",
"numpy.where",
"qgis.core.QgsMeshDatasetIndex",
"functools.wrap... | [((7056, 7079), 'json.loads', 'json.loads', (['sys.argv[1]'], {}), '(sys.argv[1])\n', (7066, 7079), False, 'import os, sys, json, warnings\n'), ((546, 554), 'functools.wraps', 'wraps', (['f'], {}), '(f)\n', (551, 554), False, 'from functools import wraps\n'), ((835, 888), 'sys.path.append', 'sys.path.append', (['"""/op... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from conversationinsights.channels.channel import InputChannel
class HttpInputChannel(InputChannel):
"""An input channel that collects messages from an HTTP endpoin... | [
"gevent.wsgi.WSGIServer",
"flask.Flask"
] | [((1384, 1399), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (1389, 1399), False, 'from flask import Flask\n'), ((1786, 1830), 'gevent.wsgi.WSGIServer', 'WSGIServer', (["('0.0.0.0', self.http_port)", 'app'], {}), "(('0.0.0.0', self.http_port), app)\n", (1796, 1830), False, 'from gevent.wsgi import WSGISe... |
#!/usr/bin/python
import math;
import os;
import re;
import subprocess;
import sys;
GDAL="/home/akm26/Downloads/gdal-1.7.2/apps/";
ICE="/home/akm26/Documents/CDI/GLIMS/Glaciers/CDI_UTM_ICE.dat";
ROCK="/home/akm26/Documents/CDI/GLIMS/Glaciers/CDI_UTM_ROCK.dat";
UTM_ZONE="19F";
SRTM="/home/akm26/Documents/CDI/SRTM/SRTM... | [
"os.path.exists",
"os.listdir",
"subprocess.Popen",
"subprocess.call",
"re.search"
] | [((645, 677), 'subprocess.call', 'subprocess.call', (['cmd'], {'shell': '(True)'}), '(cmd, shell=True)\n', (660, 677), False, 'import subprocess\n'), ((1618, 1633), 'os.listdir', 'os.listdir', (['dir'], {}), '(dir)\n', (1628, 1633), False, 'import os\n'), ((713, 770), 'subprocess.Popen', 'subprocess.Popen', (['cmd'], {... |
'''
Make a mask of the emission
'''
from astropy.io import fits
from spectral_cube import SpectralCube, BooleanArrayMask
from signal_id import RadioMask, Noise
from astropy import units as u
make_mask = True
save_mask = False
cube = SpectralCube.read("M33_206_b_c_HI.fits")
cube = cube.with_mask(cube != 0*u.Jy)
if... | [
"spectral_cube.SpectralCube.read",
"signal_id.utils.get_pixel_scales",
"astropy.io.fits.getdata",
"signal_id.RadioMask"
] | [((238, 278), 'spectral_cube.SpectralCube.read', 'SpectralCube.read', (['"""M33_206_b_c_HI.fits"""'], {}), "('M33_206_b_c_HI.fits')\n", (255, 278), False, 'from spectral_cube import SpectralCube, BooleanArrayMask\n'), ((547, 596), 'astropy.io.fits.getdata', 'fits.getdata', (['"""../../../Arecibo/M33_newmask.fits"""'], ... |
# Copyright © 2013, 2014, 2017 <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
# There is NO WARRANTY.
"""Populate the table of URLs to resc... | [
"shared.url_database.ensure_database",
"csv.DictReader",
"shared.url_database.add_url_string"
] | [((435, 469), 'shared.url_database.ensure_database', 'url_database.ensure_database', (['args'], {}), '(args)\n', (463, 469), False, 'from shared import url_database\n'), ((594, 611), 'csv.DictReader', 'csv.DictReader', (['f'], {}), '(f)\n', (608, 611), False, 'import csv\n'), ((721, 764), 'shared.url_database.add_url_s... |
import dash
from dash.dependencies import Input, Output
import dash_table
import dash_core_components as dcc
import dash_html_components as html
import pandas as pd
df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/gapminder2007.csv')
# add an id column and set it as the index
# in this case t... | [
"pandas.read_csv",
"dash.dependencies.Output",
"dash.dependencies.Input",
"dash.Dash",
"dash_html_components.Div",
"dash_core_components.Graph"
] | [((171, 270), 'pandas.read_csv', 'pd.read_csv', (['"""https://raw.githubusercontent.com/plotly/datasets/master/gapminder2007.csv"""'], {}), "(\n 'https://raw.githubusercontent.com/plotly/datasets/master/gapminder2007.csv'\n )\n", (182, 270), True, 'import pandas as pd\n'), ((595, 614), 'dash.Dash', 'dash.Dash', (... |
"""Component to manage a shoppling list."""
import asyncio
import logging
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.components import http
from homeassistant.helpers import intent
import homeassistant.helpers.config_validation as cv
DOMAIN = 'shopping_list'
DEPENDENCIES = [... | [
"logging.getLogger",
"voluptuous.Schema"
] | [((338, 365), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (355, 365), False, 'import logging\n'), ((382, 429), 'voluptuous.Schema', 'vol.Schema', (['{DOMAIN: {}}'], {'extra': 'vol.ALLOW_EXTRA'}), '({DOMAIN: {}}, extra=vol.ALLOW_EXTRA)\n', (392, 429), True, 'import voluptuous as vol\n')... |
# coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | [
"oci.util.formatted_flat_dict",
"oci.util.value_allowed_none_or_none_sentinel"
] | [((8385, 8410), 'oci.util.formatted_flat_dict', 'formatted_flat_dict', (['self'], {}), '(self)\n', (8404, 8410), False, 'from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel\n'), ((5665, 5727), 'oci.util.value_allowed_none_or_none_sentinel', 'value_allowed_none_or_none_sentinel',... |
import dash
from utils.code_and_show import example_app
dash.register_page(
__name__, description="Compare three regression models to predict revenue"
)
filename = __name__.split("pages.")[1]
notes = """
#### Plotly Documentation:
- [Visualize regression in scikit-learn](https://plotly.com/python/ml-regre... | [
"utils.code_and_show.example_app",
"dash.register_page"
] | [((59, 158), 'dash.register_page', 'dash.register_page', (['__name__'], {'description': '"""Compare three regression models to predict revenue"""'}), "(__name__, description=\n 'Compare three regression models to predict revenue')\n", (77, 158), False, 'import dash\n'), ((440, 474), 'utils.code_and_show.example_app'... |
from django.test import TestCase
from django.contrib.auth.models import User
from .models import *
# Create your tests here.
class NeighborHoodTestClass(TestCase):
# Set up method
def setUp(self):
self.neighborhood = Neighborhood(name = 'name', location = 'location',
... | [
"django.contrib.auth.models.User"
] | [((1682, 1688), 'django.contrib.auth.models.User', 'User', ([], {}), '()\n', (1686, 1688), False, 'from django.contrib.auth.models import User\n')] |
import unittest
import main
class TestAnagrams(unittest.TestCase):
def test_one(self):
""" Should return an array of all the anagrams """
self.assertEqual(['aabb', 'bbaa'], main.anagrams('abba', ['aabb', 'abcd', 'bbaa', 'dada']))
self.assertEqual(['carer', 'racer'], main.anagrams('racer', ... | [
"unittest.main",
"main.anagrams"
] | [((562, 577), 'unittest.main', 'unittest.main', ([], {}), '()\n', (575, 577), False, 'import unittest\n'), ((195, 250), 'main.anagrams', 'main.anagrams', (['"""abba"""', "['aabb', 'abcd', 'bbaa', 'dada']"], {}), "('abba', ['aabb', 'abcd', 'bbaa', 'dada'])\n", (208, 250), False, 'import main\n'), ((297, 367), 'main.anag... |
"""
"""
from keras.models import Model
from keras.layers import Input, Dropout, Dense, Embedding, concatenate
from keras.layers import GRU, LSTM, Flatten
from keras.preprocessing.sequence import pad_sequences
#from keras.preprocessing import text, sequence
from keras.preprocessing.text import Tokenizer
from keras impor... | [
"numpy.clip",
"sklearn.preprocessing.LabelEncoder",
"numpy.sqrt",
"numpy.array",
"keras.layers.Dense",
"keras.backend.square",
"keras.layers.LSTM",
"keras.layers.concatenate",
"keras.models.Model",
"pandas.DataFrame",
"keras.layers.Flatten",
"sklearn.model_selection.train_test_split",
"aisim... | [((609, 642), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (632, 642), False, 'import warnings\n'), ((9648, 9667), 'keras.layers.concatenate', 'concatenate', (['layers'], {}), '(layers)\n', (9659, 9667), False, 'from keras.layers import Input, Dropout, Dense, Embedding, ... |
# Created by matveyev at 06.05.2021
from PyQt5 import QtCore, QtWidgets
from petra_viewer.gui.batch_ui import Ui_batch
# ----------------------------------------------------------------------
class BatchProgress(QtWidgets.QWidget):
stop_batch = QtCore.pyqtSignal()
# ---------------------------------------... | [
"PyQt5.QtCore.pyqtSignal",
"petra_viewer.gui.batch_ui.Ui_batch"
] | [((254, 273), 'PyQt5.QtCore.pyqtSignal', 'QtCore.pyqtSignal', ([], {}), '()\n', (271, 273), False, 'from PyQt5 import QtCore, QtWidgets\n'), ((442, 452), 'petra_viewer.gui.batch_ui.Ui_batch', 'Ui_batch', ([], {}), '()\n', (450, 452), False, 'from petra_viewer.gui.batch_ui import Ui_batch\n')] |
# -*- coding: utf-8 -*-
from django.db import models, migrations
from allauth.socialaccount.models import SocialAccount
def copy_fb_data(apps, schema_editor):
model = apps.get_model('xsd_members', 'MemberProfile')
db_alias = schema_editor.connection.alias
objects = model.objects.using(db_alias).all()
... | [
"django.db.migrations.RunPython",
"django.db.migrations.RemoveField",
"allauth.socialaccount.models.SocialAccount"
] | [((848, 882), 'django.db.migrations.RunPython', 'migrations.RunPython', (['copy_fb_data'], {}), '(copy_fb_data)\n', (868, 882), False, 'from django.db import models, migrations\n'), ((892, 959), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""memberprofile"""', 'name': '"""about_me... |
import logging
from collections import deque
from PyQt6.QtWidgets import QWidget, QLabel
from PyQt6.QtCore import pyqtSignal
from core.utils.win32.utilities import get_monitor_hwnd
from core.event_service import EventService
from core.event_enums import KomorebiEvent
from core.widgets.base import BaseWidget
from core.u... | [
"collections.deque",
"PyQt6.QtWidgets.QWidget.winId",
"logging.warning",
"logging.exception",
"core.event_service.EventService",
"PyQt6.QtWidgets.QLabel",
"core.utils.komorebi.client.KomorebiClient",
"PyQt6.QtCore.pyqtSignal"
] | [((1147, 1163), 'PyQt6.QtCore.pyqtSignal', 'pyqtSignal', (['dict'], {}), '(dict)\n', (1157, 1163), False, 'from PyQt6.QtCore import pyqtSignal\n'), ((1190, 1202), 'PyQt6.QtCore.pyqtSignal', 'pyqtSignal', ([], {}), '()\n', (1200, 1202), False, 'from PyQt6.QtCore import pyqtSignal\n'), ((1232, 1254), 'PyQt6.QtCore.pyqtSi... |
#!/usr/bin/env python
# Copyright (C) 2021 ByteDance 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... | [
"common.cmd_executer.exec_commands",
"common.cmd_executer.get_complete_abd_cmd",
"common.cmd_executer.exec_adb_shell_with_append_commands",
"sys.exit",
"common.cmd_executer.exec_write_value",
"enhanced_systrace.systrace_env.get_executable_systrace"
] | [((1843, 1881), 'enhanced_systrace.systrace_env.get_executable_systrace', 'systrace_env.get_executable_systrace', ([], {}), '()\n', (1879, 1881), False, 'from enhanced_systrace import systrace_env\n'), ((2135, 2166), 'common.cmd_executer.exec_commands', 'cmd_executer.exec_commands', (['cmd'], {}), '(cmd)\n', (2161, 216... |
import json
from collections import namedtuple
from bottle import request, response
from graphql import GraphQLError, format_error as format_graphql_error
def format_error(error):
if isinstance(error, GraphQLError):
return format_graphql_error(error)
return {"message": str(error)}
def handle_grap... | [
"json.dumps",
"graphql.format_error",
"collections.namedtuple",
"bottle.request.query.get"
] | [((1048, 1088), 'bottle.request.query.get', 'request.query.get', (['"""operationName"""', 'None'], {}), "('operationName', None)\n", (1065, 1088), False, 'from bottle import request, response\n'), ((1451, 1493), 'collections.namedtuple', 'namedtuple', (['"""DataItem"""', "['data', 'errors']"], {}), "('DataItem', ['data... |
from django.core.management.base import BaseCommand
from django.db import connection
from django.template.loader import render_to_string
class Command(BaseCommand):
help = "Insert procedures."
def handle(self, *args, **options):
with connection.cursor() as cursor:
insert_urls = render_to_... | [
"django.db.connection.cursor",
"django.template.loader.render_to_string"
] | [((253, 272), 'django.db.connection.cursor', 'connection.cursor', ([], {}), '()\n', (270, 272), False, 'from django.db import connection\n'), ((310, 354), 'django.template.loader.render_to_string', 'render_to_string', (['"""insert_url_procedure.sql"""'], {}), "('insert_url_procedure.sql')\n", (326, 354), False, 'from d... |
# Generated by Django 3.0.6 on 2020-10-01 17:47
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('base', '0006_auto_20201001_1731'),
]
operations = [
migrations.CreateModel(
name='City',
... | [
"django.db.models.UniqueConstraint",
"django.db.models.ForeignKey",
"django.db.migrations.AlterModelOptions",
"django.db.models.AutoField",
"django.db.migrations.RemoveField",
"django.db.models.CharField"
] | [((1937, 2057), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""patient"""', 'options': "{'verbose_name': 'Patient', 'verbose_name_plural': 'Patients'}"}), "(name='patient', options={'verbose_name':\n 'Patient', 'verbose_name_plural': 'Patients'})\n", (1965, 2057), False, ... |
#!/usr/bin/env python3 -B
import os
import sys
import csv
import bonobo
from cromulent import model, vocab
from cromulent.model import factory
from pipeline.projects.knoedler import KnoedlerFilePipeline, KnoedlerPipeline
from settings import project_data_path, output_file_path, arches_models, DEBUG
### Pipeline
if ... | [
"settings.project_data_path",
"bonobo.parse_args",
"os.environ.get",
"pipeline.projects.knoedler.KnoedlerFilePipeline",
"cromulent.vocab.conceptual_only_parts",
"cromulent.model.factory.cache_hierarchy",
"bonobo.get_argument_parser",
"cromulent.vocab.add_linked_art_boundary_check"
] | [((345, 370), 'cromulent.model.factory.cache_hierarchy', 'factory.cache_hierarchy', ([], {}), '()\n', (368, 370), False, 'from cromulent.model import factory\n'), ((627, 656), 'cromulent.vocab.conceptual_only_parts', 'vocab.conceptual_only_parts', ([], {}), '()\n', (654, 656), False, 'from cromulent import model, vocab... |
# import native Python packages
import random
# import third party packages
from fastapi import APIRouter, Request
from fastapi.responses import HTMLResponse
from fastapi.templating import Jinja2Templates
import pandas
import numpy
import scipy
# import api stuff
from src.api.autobracket import single_sim_bracket
#... | [
"pandas.read_csv",
"numpy.where",
"fastapi.templating.Jinja2Templates",
"fastapi.APIRouter",
"src.api.autobracket.single_sim_bracket",
"pandas.isna"
] | [((362, 394), 'fastapi.APIRouter', 'APIRouter', ([], {'prefix': '"""/autobracket"""'}), "(prefix='/autobracket')\n", (371, 394), False, 'from fastapi import APIRouter, Request\n'), ((407, 445), 'fastapi.templating.Jinja2Templates', 'Jinja2Templates', ([], {'directory': '"""templates"""'}), "(directory='templates')\n", ... |
import sys
import os
import time
import shutil
import torch
from torch.utils.data import DataLoader, RandomSampler, SequentialSampler
sys.path.append(os.path.dirname(__file__))
from callback.optimizater.adamw import AdamW
from callback.lr_scheduler import get_linear_schedule_with_warmup
from callback.progressbar impo... | [
"tools.dutils.load_and_cache_examples",
"torch.cuda.is_available",
"callback.optimizater.adamw.AdamW",
"os.path.exists",
"os.listdir",
"time.localtime",
"tools.config.get_argparse",
"torch.utils.data.SequentialSampler",
"os.path.dirname",
"tools.common.logger.info",
"torch.cuda.empty_cache",
"... | [((152, 177), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (167, 177), False, 'import os\n'), ((962, 987), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (977, 987), False, 'import os\n'), ((3226, 3277), 'os.path.join', 'os.path.join', (['args.data_dir', '"""log""... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import contextlib
import re
import sys
# NOTE: this module doesn't import sublime module so we can mock view/region etc in tests
LIST_ENTRY_BEGIN_RE = re.compile(
r"""^(
\s+[*] |
\s*[-+] |
\s*[0-9]+[.] |
\s[a-zA-Z][.]
... | [
"unittest.main",
"mock_sublime.View",
"re.compile"
] | [((201, 444), 're.compile', 're.compile', (['"""^(\n \\\\s+[*] |\n \\\\s*[-+] |\n \\\\s*[0-9]+[.] |\n \\\\s[a-zA-Z][.]\n )\\\\s+\n (?:\n (?P<tick_box>\\\\[[- xX]\\\\])\n \\\\s\n )?\n """', 're.VERBOSE'], {}), '(\n """^(\n ... |
import inspect
import unittest
from config.database import DATABASES
from src.masoniteorm.models import Model
from src.masoniteorm.query import QueryBuilder
from src.masoniteorm.query.grammars import MySQLGrammar
from src.masoniteorm.relationships import has_many
from src.masoniteorm.scopes import SoftDeleteScope
from... | [
"tests.utils.MockConnectionFactory",
"src.masoniteorm.scopes.SoftDeleteScope",
"src.masoniteorm.query.QueryBuilder"
] | [((558, 689), 'src.masoniteorm.query.QueryBuilder', 'QueryBuilder', ([], {'grammar': 'MySQLGrammar', 'connection_class': 'connection', 'connection': '"""mysql"""', 'table': 'table', 'connection_details': 'DATABASES'}), "(grammar=MySQLGrammar, connection_class=connection, connection=\n 'mysql', table=table, connectio... |
# -*- coding: 850 -*-
from django.shortcuts import render
from django.shortcuts import render, get_object_or_404
from django.contrib.auth.decorators import login_required
from .models import Caso, Avance, UsuarioAseguradora
import logging
# Get an instance of a logger
logger = logging.getLogger(__name__)
import sy... | [
"logging.getLogger",
"django.shortcuts.render",
"django.shortcuts.get_object_or_404",
"django.contrib.auth.decorators.login_required"
] | [((283, 310), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (300, 310), False, 'import logging\n'), ((350, 393), 'django.contrib.auth.decorators.login_required', 'login_required', ([], {'login_url': '"""/account/login/"""'}), "(login_url='/account/login/')\n", (364, 393), False, 'from dj... |
# 在前面的几个章节中我们脚本上是用 python 解释器来编程,
# 如果你从 Python 解释器退出再进入,那么你定义的所有的方法和变量就都消失了。
# 为此 Python 提供了一个办法,把这些定义存放在文件中,
# 为一些脚本或者交互式的解释器实例使用,这个文件被称为模块。
# 模块是一个包含所有你定义的函数和变量的文件,其后缀名是.py。
# 模块可以被别的程序引入,以使用该模块中的函数等功能。这也是使用 python 标准库的方法。
from songxin.P2 import FileIO
import sys
print('命令行参数如下:')
for i in sys.argv:
print(i)
pr... | [
"songxin.P2.FileIO.print_p2"
] | [((359, 376), 'songxin.P2.FileIO.print_p2', 'FileIO.print_p2', ([], {}), '()\n', (374, 376), False, 'from songxin.P2 import FileIO\n')] |
from collections import UserString
from ruamel import yaml
from typing import Any, Union
import yatiml
# Create document class
class TitleCaseString(UserString):
def __init__(self, seq: Any) -> None:
super().__init__(seq)
if not self.data.istitle():
raise ValueError('Invalid TitleCaseS... | [
"yatiml.set_document_type",
"ruamel.yaml.load",
"yatiml.add_to_loader"
] | [((686, 747), 'yatiml.add_to_loader', 'yatiml.add_to_loader', (['MyLoader', '[TitleCaseString, Submission]'], {}), '(MyLoader, [TitleCaseString, Submission])\n', (706, 747), False, 'import yatiml\n'), ((748, 794), 'yatiml.set_document_type', 'yatiml.set_document_type', (['MyLoader', 'Submission'], {}), '(MyLoader, Subm... |
from casa import importuvfits
import sys
import os
def find_uvfits_files(path=None, polarization="xx"):
"""
Finds all of the uvfits files in a given directory
Parameters
----------
path : str
Folder path where the function looks for uvfits files.
Default is the current working di... | [
"os.listdir",
"casa.importuvfits",
"os.path.join",
"os.getcwd",
"os.path.isdir",
"os.path.basename"
] | [((611, 627), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (621, 627), False, 'import os\n'), ((1416, 1459), 'casa.importuvfits', 'importuvfits', ([], {'fitsfile': 'folder', 'vis': 'vis_file'}), '(fitsfile=folder, vis=vis_file)\n', (1428, 1459), False, 'from casa import importuvfits\n'), ((562, 573), 'os.get... |
#!/usr/bin/env python
#
# Copyright (c) 2017 All rights reserved
# This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
import logging
import re
imp... | [
"logging.getLogger",
"sdnvpn.lib.utils.create_subnet",
"sdnvpn.lib.utils.cleanup_nova",
"sdnvpn.lib.openstack_utils.create_security_group_full",
"multiprocessing.Process",
"time.sleep",
"sdnvpn.lib.utils.get_instance_ip",
"sdnvpn.lib.openstack_utils.get_neutron_client",
"sdnvpn.lib.config.CommonConf... | [((582, 611), 'logging.getLogger', 'logging.getLogger', (['"""__name__"""'], {}), "('__name__')\n", (599, 611), False, 'import logging\n'), ((628, 634), 'multiprocessing.Lock', 'Lock', ([], {}), '()\n', (632, 634), False, 'from multiprocessing import Process, Manager, Lock\n'), ((652, 680), 'sdnvpn.lib.config.CommonCon... |
#!/usr/bin/env python
import requests
import json
import time
import bs4 as bs
import datetime as dt
import os
import pandas_datareader.data as web
import pickle
import requests
import yaml
import yfinance as yf
import pandas as pd
import dateutil.relativedelta
import numpy as np
from datetime import date
from datetim... | [
"pandas.Series",
"datetime.datetime.fromtimestamp",
"pickle.dump",
"numpy.minimum",
"os.path.join",
"requests.get",
"datetime.timedelta",
"os.path.realpath",
"bs4.BeautifulSoup",
"yfinance.download",
"yaml.safe_load",
"numpy.isnan",
"datetime.date.today",
"time.time",
"json.dump"
] | [((2520, 2567), 'os.path.join', 'os.path.join', (['DIR', '"""data"""', '"""price_history.json"""'], {}), "(DIR, 'data', 'price_history.json')\n", (2532, 2567), False, 'import os\n'), ((361, 387), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (377, 387), False, 'import os\n'), ((1244, 1261)... |
import horovod.tensorflow as hvd
import os
import tensorflow as tf
from preprocessing import resnet_preprocessing, imagenet_preprocessing, darknet_preprocessing
import functools
def create_dataset(data_dir, batch_size, preprocessing='resnet', validation=False):
filenames = [os.path.join(data_dir, i) for i in os.li... | [
"tensorflow.one_hot",
"tensorflow.data.TFRecordDataset",
"os.listdir",
"preprocessing.imagenet_preprocessing.preprocess_image",
"horovod.tensorflow.rank",
"tensorflow.io.parse_single_example",
"preprocessing.darknet_preprocessing.preprocess_image",
"os.path.join",
"preprocessing.resnet_preprocessing... | [((1715, 1759), 'tensorflow.io.parse_single_example', 'tf.io.parse_single_example', (['record', 'features'], {}), '(record, features)\n', (1741, 1759), True, 'import tensorflow as tf\n'), ((1778, 1823), 'tensorflow.reshape', 'tf.reshape', (["parsed['image/encoded']"], {'shape': '[]'}), "(parsed['image/encoded'], shape=... |
"""
# @Time : 2020/8/31
# @Author : <NAME>
"""
import jieba
text_list = jieba.lcut('粉丝的芳草飞机饿哦平均分')
print(text_list)
text = '---'.join(text_list)
print(text) | [
"jieba.lcut"
] | [((79, 105), 'jieba.lcut', 'jieba.lcut', (['"""粉丝的芳草飞机饿哦平均分"""'], {}), "('粉丝的芳草飞机饿哦平均分')\n", (89, 105), False, 'import jieba\n')] |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
# {fact rule=missing-pagination@v1.0 defects=1}
def s3_loop_noncompliant(s3bucket_name, s3prefix_name):
import boto3
s3_client = boto3.resource('s3').meta.client
# Noncompliant: loops through the c... | [
"boto3.resource",
"boto3.client"
] | [((1150, 1168), 'boto3.client', 'boto3.client', (['"""s3"""'], {}), "('s3')\n", (1162, 1168), False, 'import boto3\n'), ((248, 268), 'boto3.resource', 'boto3.resource', (['"""s3"""'], {}), "('s3')\n", (262, 268), False, 'import boto3\n')] |
import os
import unittest
from rtfdoc.config import get_user_config
class ConfigTestCase(unittest.TestCase):
def test_get_config(self):
config_dir = os.path.abspath("config")
config = get_user_config(config_dir)
expected_config = {
'root_dir': '.',
'version': 'v1.0... | [
"unittest.main",
"os.path.abspath",
"rtfdoc.config.get_user_config"
] | [((539, 554), 'unittest.main', 'unittest.main', ([], {}), '()\n', (552, 554), False, 'import unittest\n'), ((164, 189), 'os.path.abspath', 'os.path.abspath', (['"""config"""'], {}), "('config')\n", (179, 189), False, 'import os\n'), ((207, 234), 'rtfdoc.config.get_user_config', 'get_user_config', (['config_dir'], {}), ... |
# Generated by Django 3.1.2 on 2020-11-10 09:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('restAPI', '0003_auto_20201110_1356'),
]
operations = [
migrations.CreateModel(
name='Layouting',
field... | [
"django.db.models.AutoField",
"django.db.models.CharField"
] | [((348, 441), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (364, 441), False, 'from django.db import migrations, models\... |
import os
import time
from requests import get
from pathlib import Path
from threading import Thread
from datetime import datetime
from shutil import copyfileobj
# url is formatted as follows
# https://storage.roundshot.com/5595515f75aba9.83008277/2021-10-11/10-10-00/2021-10-11-10-10-00_full.jpg
def create_url(pre_ur... | [
"threading.Thread.__init__",
"os.path.exists",
"shutil.copyfileobj",
"os.makedirs",
"pathlib.Path",
"os.path.join",
"requests.get",
"time.sleep"
] | [((807, 852), 'threading.Thread.__init__', 'Thread.__init__', (['self'], {'name': '"""ThreadedFetcher"""'}), "(self, name='ThreadedFetcher')\n", (822, 852), False, 'from threading import Thread\n'), ((1465, 1503), 'os.path.join', 'os.path.join', (['self.output_folder', 'path'], {}), '(self.output_folder, path)\n', (147... |
import os
import sys
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "src.settings")
sys.path[0:0] = [os.path.expanduser("~/django")]
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
| [
"os.environ.setdefault",
"django.core.wsgi.get_wsgi_application",
"os.path.expanduser"
] | [((21, 84), 'os.environ.setdefault', 'os.environ.setdefault', (['"""DJANGO_SETTINGS_MODULE"""', '"""src.settings"""'], {}), "('DJANGO_SETTINGS_MODULE', 'src.settings')\n", (42, 84), False, 'import os\n'), ((199, 221), 'django.core.wsgi.get_wsgi_application', 'get_wsgi_application', ([], {}), '()\n', (219, 221), False, ... |
# cannot combine, regulons are different in different datasets
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from pathlib import Path
#----------------------variable------------------------
fmt='tif'
n=10 #rows to plot
o=20 #overlap check
fd_rss='./out/a07_regulon_01_... | [
"seaborn.set",
"matplotlib.pyplot.savefig",
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xticks",
"pathlib.Path",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.close",
"numpy.zeros",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.title",
... | [((743, 774), 'pandas.read_csv', 'pd.read_csv', (['fname'], {'index_col': '(0)'}), '(fname, index_col=0)\n', (754, 774), True, 'import pandas as pd\n'), ((1454, 1465), 'numpy.zeros', 'np.zeros', (['n'], {}), '(n)\n', (1462, 1465), True, 'import numpy as np\n'), ((1477, 1486), 'seaborn.set', 'sns.set', ([], {}), '()\n',... |
import struct
from shared import settings
from peewee import Model, PostgresqlDatabase, IntegerField, CharField, DateTimeField, \
FloatField, BigIntegerField, BlobField, TextField, BooleanField, UUIDField, ForeignKeyField
from playhouse.postgres_ext import BinaryJSONField
from shared.settings import POOLS
from bitcoin.... | [
"peewee.BooleanField",
"peewee.CharField",
"peewee.PostgresqlDatabase",
"playhouse.postgres_ext.BinaryJSONField",
"peewee.BigIntegerField",
"peewee.IntegerField",
"peewee.UUIDField",
"peewee.TextField",
"shared.utils.bytes_to_int",
"shared.settings.POOLS.items",
"peewee.DateTimeField",
"peewee... | [((407, 544), 'peewee.PostgresqlDatabase', 'PostgresqlDatabase', (['settings.DB_NAME'], {'user': 'settings.DB_USER', 'password': 'settings.DB_PASS', 'host': 'settings.DB_HOST', 'port': 'settings.DB_PORT'}), '(settings.DB_NAME, user=settings.DB_USER, password=\n settings.DB_PASS, host=settings.DB_HOST, port=settings.... |
import platform
import re
from kodi_six import xbmc, xbmcgui
from kodi_six.utils import py2_encode
from projectx.logger import log
from projectx.osarch import PLATFORM
from projectx.addon import ADDON, ADDON_NAME, ADDON_ICON
def notify(message, header=ADDON_NAME, time=5000, image=ADDON_ICON):
sound = ADDON.getS... | [
"projectx.addon.ADDON.getLocalizedString",
"ctypes.create_unicode_buffer",
"kodi_six.xbmcgui.Dialog",
"kodi_six.utils.py2_encode",
"platform.uname",
"kodi_six.xbmc.getInfoLabel",
"platform.system",
"projectx.logger.log.info",
"re.sub",
"projectx.addon.ADDON.getSetting"
] | [((369, 385), 'kodi_six.xbmcgui.Dialog', 'xbmcgui.Dialog', ([], {}), '()\n', (383, 385), False, 'from kodi_six import xbmc, xbmcgui\n'), ((535, 551), 'kodi_six.xbmcgui.Dialog', 'xbmcgui.Dialog', ([], {}), '()\n', (549, 551), False, 'from kodi_six import xbmc, xbmcgui\n'), ((1742, 1760), 'kodi_six.utils.py2_encode', 'py... |
# Copyright (c) 2017-present, GoodAI
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE_CHALLENGE file in the root directory of this source tree.
import re
import unittest
import core.environment as environment
import core.serializer as serializer
import tasks.c... | [
"re.compile",
"tasks.competition.tests.helpers.SingleTaskScheduler",
"core.scheduler.ConsecutiveTaskScheduler",
"tasks.challenge.round1.tests.test_micro_tasks.EnvironmentByteMessenger",
"tasks.challenge.round1.tests.test_micro_tasks.FixedLearner",
"unittest.SkipTest",
"tasks.competition.tests.helpers.ta... | [((4032, 4063), 'core.serializer.StandardSerializer', 'serializer.StandardSerializer', ([], {}), '()\n', (4061, 4063), True, 'import core.serializer as serializer\n'), ((4080, 4105), 'tasks.competition.tests.helpers.SingleTaskScheduler', 'SingleTaskScheduler', (['task'], {}), '(task)\n', (4099, 4105), False, 'from task... |
import logging
import os
from re import findall
import youtube_dl
from flask import Blueprint, render_template, request, jsonify
from urllib.parse import unquote_plus
from googleapiclient.discovery import build
from config import SONGS_DIR, API_KEY, SEARCH_RESULT_LIMIT, DEFAULT_SONG
from HomeTuner.util import file_ha... | [
"logging.getLogger",
"HomeTuner.util.file_handler.read_data_file",
"os.path.join",
"youtube_dl.YoutubeDL",
"flask.request.get_json",
"googleapiclient.discovery.build",
"urllib.parse.unquote_plus",
"HomeTuner.util.get_guest_name",
"HomeTuner.util.file_handler.write_data_file",
"re.findall",
"flas... | [((393, 420), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (410, 420), False, 'import logging\n'), ((442, 475), 'flask.Blueprint', 'Blueprint', (['"""downloader"""', '__name__'], {}), "('downloader', __name__)\n", (451, 475), False, 'from flask import Blueprint, render_template, request... |
# ----------------------------------------------------------------------------
# fos.lib.pyglet
# Copyright (c) 2006-2008 <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistri... | [
"os.urandom",
"math.sin",
"fos.lib.pyglet.media.AudioFormat",
"fos.lib.pyglet.media.AudioData"
] | [((2009, 2082), 'fos.lib.pyglet.media.AudioFormat', 'AudioFormat', ([], {'channels': '(1)', 'sample_size': 'sample_size', 'sample_rate': 'sample_rate'}), '(channels=1, sample_size=sample_size, sample_rate=sample_rate)\n', (2020, 2082), False, 'from fos.lib.pyglet.media import Source, AudioFormat, AudioData\n'), ((2809,... |
import torch
import numpy as np
import torch.optim as optim
from torch.nn import NLLLoss
from torch.utils.data import DataLoader
from torch.utils.data.sampler import RandomSampler
from torch.nn.utils import clip_grad_norm
from torchvision.datasets import CIFAR10
from torchvision.transforms import transforms
from src.mo... | [
"src.model.CIFAR10_Network",
"torch.max",
"torch.cuda.synchronize",
"torchvision.datasets.CIFAR10",
"numpy.zeros",
"torchvision.transforms.transforms.ToTensor",
"torch.nn.NLLLoss",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
"torch.sum",
"torch.utils.data.sampler.RandomSampler",
... | [((503, 524), 'torchvision.transforms.transforms.ToTensor', 'transforms.ToTensor', ([], {}), '()\n', (522, 524), False, 'from torchvision.transforms import transforms\n'), ((580, 670), 'torchvision.datasets.CIFAR10', 'CIFAR10', ([], {'root': 'self.params.dataset_dir', 'train': '(True)', 'download': '(True)', 'transform... |
# import all
from peace_performance_python.prelude import *
# or
# from peace_performance_python.objects import Beatmap, Calculator
from tests import async_run, join_beatmap, HITORIGOTO, UNFORGIVING
# *No longer available by default (compile without `rust_logger` features enabled)*
# Initialize Rust logger (optional)... | [
"tests.join_beatmap"
] | [((1180, 1204), 'tests.join_beatmap', 'join_beatmap', (['HITORIGOTO'], {}), '(HITORIGOTO)\n', (1192, 1204), False, 'from tests import async_run, join_beatmap, HITORIGOTO, UNFORGIVING\n'), ((2292, 2317), 'tests.join_beatmap', 'join_beatmap', (['UNFORGIVING'], {}), '(UNFORGIVING)\n', (2304, 2317), False, 'from tests impo... |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
"""Data pr... | [
"importlib.import_module"
] | [((1851, 1929), 'importlib.import_module', 'importlib.import_module', (['f"""msticpy.data.drivers.{mod_name}"""'], {'package': '"""msticpy"""'}), "(f'msticpy.data.drivers.{mod_name}', package='msticpy')\n", (1874, 1929), False, 'import importlib\n')] |
#!/usr/bin/env python
# Coincappy: Simple Python wrapper around CoinMarketCap free endpoints.
import time
from random import randint
import requests
class RateLimitExceededError(Exception):
"""
Exception for exceeding API key's rate limit.
"""
pass
class CoinMarketCap():
def __init__(self, key=... | [
"random.randint",
"requests.Session"
] | [((634, 652), 'requests.Session', 'requests.Session', ([], {}), '()\n', (650, 652), False, 'import requests\n'), ((1723, 1739), 'random.randint', 'randint', (['(0)', '(1000)'], {}), '(0, 1000)\n', (1730, 1739), False, 'from random import randint\n')] |
# coding: utf-8
from __future__ import annotations
from datetime import date, datetime # noqa: F401
import re # noqa: F401
from typing import Any, Dict, List, Optional, Union, Literal # noqa: F401
from pydantic import AnyUrl, BaseModel, EmailStr, validator, Field, Extra # noqa: F401
class V20CredAttrSpec(Base... | [
"pydantic.Field"
] | [((748, 778), 'pydantic.Field', 'Field', (['None'], {'alias': '"""mime-type"""'}), "(None, alias='mime-type')\n", (753, 778), False, 'from pydantic import AnyUrl, BaseModel, EmailStr, validator, Field, Extra\n')] |
""" To make fake Datasets
Wanted to keep this out of the testing frame works, as other repos, might want to use this
"""
from typing import List
import numpy as np
import pandas as pd
import xarray as xr
from nowcasting_dataset.consts import NWP_VARIABLE_NAMES, SAT_VARIABLE_NAMES
from nowcasting_dataset.data_sources... | [
"nowcasting_dataset.data_sources.satellite.satellite_model.HRVSatellite",
"nowcasting_dataset.data_sources.gsp.gsp_model.GSP",
"nowcasting_dataset.dataset.xr_utils.join_list_dataset_to_batch_dataset",
"nowcasting_dataset.data_sources.pv.pv_model.PV",
"pandas.Timedelta",
"nowcasting_dataset.data_sources.me... | [((1372, 1433), 'nowcasting_dataset.dataset.xr_utils.convert_coordinates_to_indexes_for_list_datasets', 'convert_coordinates_to_indexes_for_list_datasets', (['xr_datasets'], {}), '(xr_datasets)\n', (1420, 1433), False, 'from nowcasting_dataset.dataset.xr_utils import convert_coordinates_to_indexes, convert_coordinates_... |
import torch
from metrics.dataset import load_mnist
import torch.utils.data.dataset
class Dataset(torch.utils.data.Dataset):
def __init__(self, images, labels):
self.labels = labels
self.images = images
def __len__(self):
return len(self.images)
def __getitem__(self, index):
... | [
"metrics.dataset.load_mnist",
"torch.utils.data.DataLoader"
] | [((544, 556), 'metrics.dataset.load_mnist', 'load_mnist', ([], {}), '()\n', (554, 556), False, 'from metrics.dataset import load_mnist\n'), ((810, 874), 'torch.utils.data.DataLoader', 'torch.utils.data.DataLoader', (['training_set'], {'batch_size': 'batch_size'}), '(training_set, batch_size=batch_size)\n', (837, 874), ... |
# Lint as: python3
# Copyright 2018, The TensorFlow Federated 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 ... | [
"collections.OrderedDict",
"tensorflow_federated.python.core.impl.computation_building_blocks.Call",
"tensorflow_federated.python.core.impl.computation_building_blocks.Block",
"tensorflow_federated.python.common_libs.py_typecheck.check_subclass",
"tensorflow_federated.python.core.impl.computation_building_b... | [((31182, 31212), 'six.add_metaclass', 'six.add_metaclass', (['abc.ABCMeta'], {}), '(abc.ABCMeta)\n', (31199, 31212), False, 'import six\n'), ((34271, 34301), 'six.add_metaclass', 'six.add_metaclass', (['abc.ABCMeta'], {}), '(abc.ABCMeta)\n', (34288, 34301), False, 'import six\n'), ((2795, 2883), 'tensorflow_federated.... |
# Importing libraries
import numpy as np
import pandas as pd
from datetime import datetime
from sklearn.preprocessing import RobustScaler
def feat_goal_duration(df:pd.DataFrame):
"""Converts goal to USD and computes the duration between project launch and deadline and the duration between project creation and laun... | [
"pandas.get_dummies",
"sklearn.preprocessing.RobustScaler",
"pandas.DatetimeIndex",
"numpy.where"
] | [((1859, 2010), 'pandas.get_dummies', 'pd.get_dummies', (['df'], {'columns': "['winter_deadline', 'spring_deadline', 'summer_deadline',\n 'deadline_weekend', 'launched_weekend']", 'drop_first': '(True)'}), "(df, columns=['winter_deadline', 'spring_deadline',\n 'summer_deadline', 'deadline_weekend', 'launched_week... |
"""
Breadth First Traversal (or Search) for a graph is similar to Breadth First
Traversal of a tree. The only catch here is, unlike trees, graphs may contain
cycles, so we may come to the same node again. To avoid processing a node more than
once, we use a boolean visited array. For simplicity, it is assumed that all
v... | [
"collections.defaultdict"
] | [((1076, 1093), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (1087, 1093), False, 'from collections import defaultdict\n')] |
# Not consistent with test passing
import numpy as np
import path_plan
from path_plan import compute_probability
from path_plan import model_polyfit
from numpy import interp
import sys
def main():
# Indian Road congress (INC)
V_lane_width = [2.0, 23.5]
# https://nptel.ac.in/content/storage2/courses/105101008/... | [
"numpy.array",
"numpy.interp",
"path_plan.compute_probability"
] | [((429, 471), 'numpy.interp', 'interp', (['V_lane_width', 'BP_lane_width', 'speed'], {}), '(V_lane_width, BP_lane_width, speed)\n', (435, 471), False, 'from numpy import interp\n'), ((485, 529), 'numpy.array', 'np.array', (['[0.0, 0.0, 0.0, lane_width // 2.0]'], {}), '([0.0, 0.0, 0.0, lane_width // 2.0])\n', (493, 529)... |
from trame.widgets import html, vuetify, vega, trame
from . import options
import multiprocessing
NB_THREADS = int(multiprocessing.cpu_count() / 2 + 0.5)
# -----------------------------------------------------------------------------
# Global properties
# ------------------------------------------------------------... | [
"trame.widgets.vuetify.VCardTitle",
"trame.widgets.html.Div",
"multiprocessing.cpu_count",
"trame.widgets.vuetify.VSwitch",
"trame.widgets.vuetify.VRow",
"trame.widgets.vuetify.VImg",
"trame.widgets.vuetify.VBtn",
"trame.widgets.vuetify.VTextField",
"trame.widgets.vuetify.VContainer",
"trame.widge... | [((836, 858), 'trame.widgets.vuetify.VBtn', 'vuetify.VBtn', ([], {}), '(**kwargs)\n', (848, 858), False, 'from trame.widgets import html, vuetify, vega, trame\n'), ((2897, 2954), 'trame.widgets.html.Div', 'html.Div', ([], {'style': '"""position: relative;"""', 'v_show': '(_img_url,)'}), "(style='position: relative;', v... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: image_streaming.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google... | [
"google.protobuf.symbol_database.Default",
"google.protobuf.descriptor.FieldDescriptor",
"google.protobuf.descriptor.MethodDescriptor",
"google.protobuf.descriptor.FileDescriptor",
"google.protobuf.reflection.GeneratedProtocolMessageType"
] | [((420, 446), 'google.protobuf.symbol_database.Default', '_symbol_database.Default', ([], {}), '()\n', (444, 446), True, 'from google.protobuf import symbol_database as _symbol_database\n'), ((464, 1080), 'google.protobuf.descriptor.FileDescriptor', '_descriptor.FileDescriptor', ([], {'name': '"""image_streaming.proto"... |
import copy
import os
import sqlite3
import urllib
import shutil
import urllib.request
import numpy as np
import pandas as pd
from basinmaker.utilities.utilities import *
def GenerateRavenInput(
Path_final_hru_info="#",
lenThres=1,
iscalmanningn=-1,
Startyear=-1,
EndYear=-1,
CA_HYDAT="#",
... | [
"matplotlib.pyplot.hist",
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"numpy.array",
"copy.copy",
"pandas.date_range",
"pandas.to_datetime",
"pandas.read_sql_query",
"numpy.mean",
"os.path.exists",
"os.listdir",
"simpledbf.Dbf5",
"matplotlib.pyplot.xlabel",
"os.path.split",
"matplotli... | [((8636, 8676), 'os.path.join', 'os.path.join', (['OutputFolder', '"""RavenInput"""'], {}), "(OutputFolder, 'RavenInput')\n", (8648, 8676), False, 'import os\n'), ((8694, 8731), 'os.path.join', 'os.path.join', (['Raveinputsfolder', '"""obs"""'], {}), "(Raveinputsfolder, 'obs')\n", (8706, 8731), False, 'import os\n'), (... |
#Author: <NAME>
#hackcu V project
#$https://open.spotify.com/user/dlu950yaxcioasmyl8zq38tle?si=npAstWIzSl-1Ptxh20p9_g
#required imports
import spotipy
import spotipy.util as util
from keys import CLIENT_ID, CLIENT_SECRET
import sys
import json
import time
#authenticator for app, authenticates client
#print(json.dumps(... | [
"spotipy.Spotify",
"time.sleep",
"spotipy.util.prompt_for_user_token"
] | [((639, 768), 'spotipy.util.prompt_for_user_token', 'util.prompt_for_user_token', (['USER', 'scope'], {'client_id': 'CLIENT_ID', 'client_secret': 'CLIENT_SECRET', 'redirect_uri': '"""http://google.com/"""'}), "(USER, scope, client_id=CLIENT_ID, client_secret=\n CLIENT_SECRET, redirect_uri='http://google.com/')\n", (... |
from django.http import HttpResponse, HttpResponseRedirect
from django.urls import reverse
from django.core.serializers.json import DjangoJSONEncoder
from django.contrib import messages
from django.utils.translation import ugettext_lazy as _
from annoying.decorators import render_to
from blockexplorer.decorators impor... | [
"django.http.HttpResponseRedirect",
"django.utils.translation.ugettext_lazy",
"blockcypher.api.decodetx",
"blockcypher.api.get_transaction_details",
"django.http.HttpResponse",
"django.contrib.messages.warning",
"json.dumps",
"blockcypher.api.get_broadcast_transactions",
"django.contrib.messages.err... | [((1062, 1100), 'annoying.decorators.render_to', 'render_to', (['"""transaction_overview.html"""'], {}), "('transaction_overview.html')\n", (1071, 1100), False, 'from annoying.decorators import render_to\n'), ((5575, 5599), 'annoying.decorators.render_to', 'render_to', (['"""pushtx.html"""'], {}), "('pushtx.html')\n", ... |
import frappe
import json
from frappe import _
from frappe.utils import has_common, flt
item_fields = ["item_code", "item_name","qty", "discount_percentage", "description", "rate", "amount", "image"]
@frappe.whitelist(allow_guest=True)
def get_cart_details(quote_id):
"""
return quotation details.
items, taxes ... | [
"json.loads",
"frappe._dict",
"frappe.db.get_value",
"frappe.db.exists",
"frappe.whitelist",
"frappe.delete_doc",
"frappe.get_doc",
"frappe.db.commit",
"frappe.get_traceback",
"frappe.utils.flt",
"frappe.new_doc"
] | [((205, 239), 'frappe.whitelist', 'frappe.whitelist', ([], {'allow_guest': '(True)'}), '(allow_guest=True)\n', (221, 239), False, 'import frappe\n'), ((3201, 3219), 'frappe.whitelist', 'frappe.whitelist', ([], {}), '()\n', (3217, 3219), False, 'import frappe\n'), ((5054, 5072), 'frappe.whitelist', 'frappe.whitelist', (... |
from django.shortcuts import render
from github import Github
from oauth.credentials import get_credentials
from collections import Counter, defaultdict
from datetime import timedelta
from bokeh.plotting import figure, output_file, show
from bokeh.models import DatetimeTickFormatter, ColumnDataSource
from bokeh.embed ... | [
"django.shortcuts.render",
"bokeh.models.DatetimeTickFormatter",
"bokeh.plotting.figure",
"github.Github",
"bokeh.plotting.show",
"bokeh.embed.components",
"oauth.credentials.get_credentials",
"collections.Counter",
"bokeh.models.ColumnDataSource",
"collections.defaultdict",
"datetime.timedelta"... | [((361, 378), 'oauth.credentials.get_credentials', 'get_credentials', ([], {}), '()\n', (376, 378), False, 'from oauth.credentials import get_credentials\n'), ((467, 506), 'bokeh.plotting.figure', 'figure', ([], {'plot_width': '(800)', 'plot_height': '(500)'}), '(plot_width=800, plot_height=500)\n', (473, 506), False, ... |