code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import torch
from tqdm import tqdm
import torchvision.transforms as transforms
from torch.utils.data import DataLoader
from dataGenBigEarth import dataGenBigEarthLMDB, ToTensor, Normalize
def load_archive(bigEarthLMDBPth, train_csv_path, val_csv_path, test_csv_path, batch_size):
bands_mean = {
... | [
"dataGenBigEarth.Normalize",
"dataGenBigEarth.ToTensor",
"torch.utils.data.DataLoader"
] | [((1947, 2046), 'torch.utils.data.DataLoader', 'DataLoader', (['train_dataGen'], {'batch_size': 'batch_size', 'num_workers': '(8)', 'shuffle': '(True)', 'pin_memory': '(True)'}), '(train_dataGen, batch_size=batch_size, num_workers=8, shuffle=\n True, pin_memory=True)\n', (1957, 2046), False, 'from torch.utils.data i... |
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
import traceback, sys
import logging
# Make this threadsafe
class QtHandler(logging.Handler):
def __init__(self, output_widget: QTextEdit):
logging.Handler.__init__(self)
self.widget: QTextEdit = output_widget
... | [
"logging.getLogger",
"traceback.format_exc",
"logging.StreamHandler",
"logging.Formatter",
"sys.exc_info",
"logging.Handler.__init__",
"traceback.print_exc"
] | [((806, 833), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (823, 833), False, 'import logging\n'), ((856, 879), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (877, 879), False, 'import logging\n'), ((892, 1028), 'logging.Formatter', 'logging.Formatter', (['"""[%(as... |
from __future__ import absolute_import
from jsonschema.exceptions import ValidationError as SchemaValidationError
from rest_framework import serializers
from rest_framework.serializers import Serializer, ValidationError
from django.template.defaultfilters import slugify
from sentry.api.validators.sentry_apps.schema ... | [
"rest_framework.serializers.BooleanField",
"rest_framework.serializers.ValidationError",
"django.template.defaultfilters.slugify",
"rest_framework.serializers.CharField",
"sentry.models.ApiScopes",
"sentry.api.validators.sentry_apps.schema.validate"
] | [((1964, 1987), 'rest_framework.serializers.CharField', 'serializers.CharField', ([], {}), '()\n', (1985, 1987), False, 'from rest_framework import serializers\n'), ((2001, 2024), 'rest_framework.serializers.CharField', 'serializers.CharField', ([], {}), '()\n', (2022, 2024), False, 'from rest_framework import serializ... |
from tkinter import Tk, Text, ttk
from tkinter.constants import ANCHOR, BOTTOM, END, LEFT, NW, RIGHT, SW, W
class Fr_lbProduto(ttk.Frame):
def __init__(self, parent):
super().__init__(parent)
self.lbfr_produto = ttk.Labelframe(self, text='Info Produto')
self.fr = ttk.Frame(self.lbfr_produ... | [
"tkinter.ttk.Labelframe",
"tkinter.ttk.Frame",
"tkinter.ttk.Label",
"tkinter.Tk",
"tkinter.Text"
] | [((3191, 3195), 'tkinter.Tk', 'Tk', ([], {}), '()\n', (3193, 3195), False, 'from tkinter import Tk, Text, ttk\n'), ((235, 276), 'tkinter.ttk.Labelframe', 'ttk.Labelframe', (['self'], {'text': '"""Info Produto"""'}), "(self, text='Info Produto')\n", (249, 276), False, 'from tkinter import Tk, Text, ttk\n'), ((295, 323),... |
import pytest
import pp
yaml_fail = """
instances:
mmi_long:
component: mmi1x2
settings:
width_mmi: 4.5
length_mmi: 10
mmi_short:
component: mmi1x2
settings:
width_mmi: 4.5
length_mmi: 5
placements:
mmi_short:
port: W0
x: mmi_long,E1... | [
"pp.component_from_yaml",
"pytest.raises"
] | [((1023, 1056), 'pp.component_from_yaml', 'pp.component_from_yaml', (['yaml_pass'], {}), '(yaml_pass)\n', (1045, 1056), False, 'import pp\n'), ((915, 940), 'pytest.raises', 'pytest.raises', (['ValueError'], {}), '(ValueError)\n', (928, 940), False, 'import pytest\n'), ((950, 983), 'pp.component_from_yaml', 'pp.componen... |
#!/usr/bin/env python
import os,sys
curdir = os.path.abspath(".")
for f in [f for f in os.listdir(curdir) if f.endswith(".cxd") and not f.endswith("_bg.cxd")]:
fout = f[:-4] + ".out"
cmd = "sbatch --output=%s/%s cxd_to_h5.sh %s/%s" % (curdir, fout, curdir, f)
for arg in sys.argv[1:]:
cmd += " " + ... | [
"os.path.abspath",
"os.system",
"os.listdir"
] | [((46, 66), 'os.path.abspath', 'os.path.abspath', (['"""."""'], {}), "('.')\n", (61, 66), False, 'import os, sys\n'), ((343, 357), 'os.system', 'os.system', (['cmd'], {}), '(cmd)\n', (352, 357), False, 'import os, sys\n'), ((89, 107), 'os.listdir', 'os.listdir', (['curdir'], {}), '(curdir)\n', (99, 107), False, 'import... |
#!/usr/bin/env python
#
# Copyright 2011-2015 Splunk, 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... | [
"splunklib.six.moves.urllib.parse.urlencode",
"utils.parse",
"os.getcwd",
"os.path.dirname",
"server.serve"
] | [((1304, 1367), 'utils.parse', 'utils.parse', (['argv', 'redirect_port_args', '""".splunkrc"""'], {'usage': 'usage'}), "(argv, redirect_port_args, '.splunkrc', usage=usage)\n", (1315, 1367), False, 'import utils\n'), ((1935, 1963), 'splunklib.six.moves.urllib.parse.urlencode', 'urllib.parse.urlencode', (['args'], {}), ... |
import torch
import torch.nn as nn
import models
import data.dict as dict
from torch.autograd import Variable
def criterion(tgt_vocab_size, use_cuda):
weight = torch.ones(tgt_vocab_size)
weight[dict.PAD] = 0
crit = nn.CrossEntropyLoss(weight, size_average=False)
if use_cuda:
crit.c... | [
"torch.nn.CrossEntropyLoss",
"torch.ones"
] | [((174, 200), 'torch.ones', 'torch.ones', (['tgt_vocab_size'], {}), '(tgt_vocab_size)\n', (184, 200), False, 'import torch\n'), ((239, 286), 'torch.nn.CrossEntropyLoss', 'nn.CrossEntropyLoss', (['weight'], {'size_average': '(False)'}), '(weight, size_average=False)\n', (258, 286), True, 'import torch.nn as nn\n')] |
import os.path as osp
import pickle
from collections import Counter
import torch
from torch.utils.data import DataLoader
from tqdm import tqdm
import lineflow as lf
import lineflow.datasets as lfds
PAD_TOKEN = '<pad>'
UNK_TOKEN = '<unk>'
START_TOKEN = '<s>'
END_TOKEN = '</s>'
IGNORE_INDEX = -100
def preprocess(... | [
"lineflow.flat_map",
"pickle.dump",
"torch.LongTensor",
"tqdm.tqdm",
"pickle.load",
"os.path.isfile",
"collections.Counter",
"lineflow.datasets.SmallParallelEnJa"
] | [((2163, 2194), 'lineflow.datasets.SmallParallelEnJa', 'lfds.SmallParallelEnJa', (['"""train"""'], {}), "('train')\n", (2185, 2194), True, 'import lineflow.datasets as lfds\n'), ((2212, 2241), 'lineflow.datasets.SmallParallelEnJa', 'lfds.SmallParallelEnJa', (['"""dev"""'], {}), "('dev')\n", (2234, 2241), True, 'import ... |
#!/usr/bin/env python3
# Copyright (C) 2022, <NAME>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program i... | [
"logging.basicConfig",
"logging.getLogger",
"os.path.join",
"parser.BehaviorReportParser",
"os.path.expanduser"
] | [((632, 696), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': '"""memread.log"""', 'level': 'logging.DEBUG'}), "(filename='memread.log', level=logging.DEBUG)\n", (651, 696), False, 'import logging\n'), ((3205, 3227), 'parser.BehaviorReportParser', 'BehaviorReportParser', ([], {}), '()\n', (3225, 3227), ... |
"""GE Kitchen Sensor Entities"""
import async_timeout
import logging
from typing import Callable, TYPE_CHECKING
from homeassistant.components.switch import SwitchEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from .binary_sensor import GeErdBinarySensor
from .... | [
"logging.getLogger",
"async_timeout.timeout"
] | [((433, 460), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (450, 460), False, 'import logging\n'), ((1480, 1505), 'async_timeout.timeout', 'async_timeout.timeout', (['(20)'], {}), '(20)\n', (1501, 1505), False, 'import async_timeout\n')] |
import pygame
import random
import button
from pygame import mixer
pygame.init()
clock = pygame.time.Clock()
fps = 60
#game window
screen_width = 800
screen_height = 400
#game variables
current_fighter = 1
total_fighter = 2
action_cooldown = 0
action_wait_time = 90
attack = False
potion = False
potion_effect = 30
c... | [
"pygame.init",
"pygame.quit",
"pygame.time.get_ticks",
"pygame.display.set_mode",
"pygame.display.set_icon",
"pygame.mouse.get_pos",
"pygame.mixer.Sound",
"pygame.draw.rect",
"pygame.image.load",
"pygame.display.update",
"pygame.mixer.music.load",
"random.randint",
"pygame.sprite.Group",
"... | [((68, 81), 'pygame.init', 'pygame.init', ([], {}), '()\n', (79, 81), False, 'import pygame\n'), ((91, 110), 'pygame.time.Clock', 'pygame.time.Clock', ([], {}), '()\n', (108, 110), False, 'import pygame\n'), ((399, 441), 'pygame.font.SysFont', 'pygame.font.SysFont', (['"""Times New Roman"""', '(26)'], {}), "('Times New... |
import argparse
import json
import os
import time
from pathlib import Path
import torch
import torch.optim as optim
from data.data import all_loaders_in_one
# import network
from nnet.conv_tasnet_student import model_info
from nnet.conv_tasnet_student import TasNet as nnet
from nnet.original_conv_tasnet import model_i... | [
"nnet.original_conv_tasnet.TasNet",
"torch.nn.parallel.data_parallel",
"argparse.ArgumentParser",
"pathlib.Path",
"torch.set_printoptions",
"torch.mean",
"data.data.all_loaders_in_one",
"os.path.isdir",
"time.localtime",
"torch.optim.lr_scheduler.ExponentialLR",
"nnet.losses.loss_calc",
"torch... | [((737, 762), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (760, 762), False, 'import argparse\n'), ((661, 715), 'pathlib.Path', 'Path', (['"""/data/machao/multi_task_conv_tasnet_whamr/exp/"""'], {}), "('/data/machao/multi_task_conv_tasnet_whamr/exp/')\n", (665, 715), False, 'from pathlib imp... |
#
# Copyright (c) 2020 Xilinx, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
import pytest
from roast.serial import SerialBase, Serial
config = {
"board_interface": "host_target",
"remote_host": "remote_host",
"com": "com",
"baudrate": "baudrate",
}
def test_host_serial(mocker):
mo... | [
"roast.serial.Serial",
"pytest.raises"
] | [((1261, 1302), 'roast.serial.Serial', 'Serial', ([], {'serial_type': '"""host"""', 'config': 'config'}), "(serial_type='host', config=config)\n", (1267, 1302), False, 'from roast.serial import SerialBase, Serial\n'), ((1591, 1649), 'pytest.raises', 'pytest.raises', (['Exception'], {'match': '"""invalid serial interfac... |
import random
import time
BITS_LENGTH = [40, 56, 80, 128, 168, 224, 256, 512, 1024, 2048, 4096]
def lcg(m: int, seed: int = None) -> int:
a = 39177369995579819498972128804676596941198511312402174107900118507767888787985319889078498768125726538781142699985438519849879849879867913387985078149715117956575598705232... | [
"time.time",
"random.randrange"
] | [((1461, 1472), 'time.time', 'time.time', ([], {}), '()\n', (1470, 1472), False, 'import time\n'), ((1518, 1529), 'time.time', 'time.time', ([], {}), '()\n', (1527, 1529), False, 'import time\n'), ((1061, 1087), 'random.randrange', 'random.randrange', (['(2)', '(n - 1)'], {}), '(2, n - 1)\n', (1077, 1087), False, 'impo... |
"""
Copyright (c) 2016-present, Facebook, Inc.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of patent rights can be found in the PATENTS file in the same directory.
"""
import re
from redis.excepti... | [
"redis.exceptions.RedisError",
"re.match"
] | [((3927, 3957), 'redis.exceptions.RedisError', 'RedisError', (['"""mock redis error"""'], {}), "('mock redis error')\n", (3937, 3957), False, 'from redis.exceptions import RedisError\n'), ((4087, 4117), 'redis.exceptions.RedisError', 'RedisError', (['"""mock redis error"""'], {}), "('mock redis error')\n", (4097, 4117)... |
# Copyright (c) 2021 Graphcore Ltd. All rights reserved.
from typing import Iterable, List, Mapping, Optional, Tuple, Union
import popart._internal.ir as _ir
from popart.ir.context import get_current_context, op_debug_context
from popart.ir.graph import Graph
from popart.ir.tensor import Tensor
from .utils import che... | [
"popart._internal.ir.addScope",
"popart._internal.ir.NumInputs",
"popart.ir.context.get_current_context",
"popart._internal.ir.TensorInfo",
"popart._internal.ir.removeScope"
] | [((5062, 5083), 'popart.ir.context.get_current_context', 'get_current_context', ([], {}), '()\n', (5081, 5083), False, 'from popart.ir.context import get_current_context, op_debug_context\n'), ((8399, 8420), 'popart.ir.context.get_current_context', 'get_current_context', ([], {}), '()\n', (8418, 8420), False, 'from pop... |
#
# -*- coding: utf-8 -*-
#
# Copyright (c) 2019-2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | [
"tensorflow.compat.v1.ConfigProto",
"tensorflow.Graph",
"ngraph_bridge.enable",
"tensorflow.random.uniform",
"ngraph_bridge.disable",
"tensorflow.compat.v1.GraphDef",
"argparse.ArgumentParser",
"tensorflow.io.gfile.GFile",
"numpy.argmax",
"numpy.array",
"tensorflow.import_graph_def",
"time.tim... | [((1166, 1211), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': '"""Parse arguments"""'}), "(description='Parse arguments')\n", (1180, 1211), False, 'from argparse import ArgumentParser\n'), ((2156, 2182), 'tensorflow.compat.v1.ConfigProto', 'tf.compat.v1.ConfigProto', ([], {}), '()\n', (2180, 2182), ... |
#! /usr/bin/env python3
import urllib.request
import json
def chunks(l, n):
for i in range(0, len(l), n):
yield l[i:i+n]
def request_json(data, url):
req = urllib.request.Request(url)
req.add_header('Content-Type', 'application/json; charset=utf-8')
jsondata = json.dumps(data)
jsondataasb... | [
"json.dumps"
] | [((288, 304), 'json.dumps', 'json.dumps', (['data'], {}), '(data)\n', (298, 304), False, 'import json\n')] |
import turtle
import time
turtle.shape('turtle')
turtle.speed(10000000)
turtle.left(90)
step=1.5
angle=75
for i in range(5):
for j in range(angle):
turtle.forward(step)
turtle.right(180/angle)
if i==4:
break
for j in range(angle):
turtle.forward(step/5)
... | [
"turtle.shape",
"turtle.forward",
"turtle.right",
"turtle.speed",
"turtle.left",
"turtle.hideturtle"
] | [((30, 52), 'turtle.shape', 'turtle.shape', (['"""turtle"""'], {}), "('turtle')\n", (42, 52), False, 'import turtle\n'), ((54, 76), 'turtle.speed', 'turtle.speed', (['(10000000)'], {}), '(10000000)\n', (66, 76), False, 'import turtle\n'), ((80, 95), 'turtle.left', 'turtle.left', (['(90)'], {}), '(90)\n', (91, 95), Fals... |
# coding: utf-8
"""
Wavefront REST API
<p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the Wavefront REST ... | [
"six.iteritems"
] | [((17717, 17750), 'six.iteritems', 'six.iteritems', (['self.swagger_types'], {}), '(self.swagger_types)\n', (17730, 17750), False, 'import six\n')] |
"""
Copyright (c) 2021 <NAME> <EMAIL>, <NAME> <EMAIL>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publ... | [
"logging.getLogger",
"logging.NullHandler",
"logging.StreamHandler",
"logging.Formatter",
"logging.FileHandler",
"logging.addLevelName"
] | [((1193, 1225), 'logging.getLogger', 'logging.getLogger', (['"""ProcessPlot"""'], {}), "('ProcessPlot')\n", (1210, 1225), False, 'import logging\n'), ((1422, 1466), 'logging.addLevelName', 'logging.addLevelName', (['LOG_VERBOSE', '"""VERBOSE"""'], {}), "(LOG_VERBOSE, 'VERBOSE')\n", (1442, 1466), False, 'import logging\... |
# The MIT License (MIT)
#
# Copyright (c) 2020 NVIDIA CORPORATION. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the... | [
"numpy.mean",
"numpy.ceil",
"os.listdir",
"numpy.minimum",
"numpy.amin",
"os.path.join",
"numpy.square",
"h5py.File",
"mpi4py.MPI.COMM_WORLD.Dup",
"numpy.maximum",
"numpy.amax"
] | [((3399, 3419), 'mpi4py.MPI.COMM_WORLD.Dup', 'MPI.COMM_WORLD.Dup', ([], {}), '()\n', (3417, 3419), False, 'from mpi4py import MPI\n'), ((3484, 3523), 'os.path.join', 'os.path.join', (['data_path_prefix', '"""train"""'], {}), "(data_path_prefix, 'train')\n", (3496, 3523), False, 'import os\n'), ((2500, 2524), 'numpy.min... |
"""
@Time : 2021/12/17 1:40 PM
@Auth : <NAME>
@File :log_template_mappping.py
@Desc :mapping template id to block id
"""
import pickle
import re
import pandas as pd
import numpy as np
from sklearn.utils import shuffle
import os
import random
block_groups_indir = '../data_preprocessing/'
normal_logs_file = 'hdfs_normal... | [
"pickle.dump",
"pandas.read_csv",
"sklearn.utils.shuffle",
"os.path.join",
"pickle.load",
"pandas.DataFrame",
"re.sub"
] | [((6525, 6539), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (6537, 6539), True, 'import pandas as pd\n'), ((7420, 7434), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (7432, 7434), True, 'import pandas as pd\n'), ((7813, 7853), 'pandas.read_csv', 'pd.read_csv', (['"""hdfs_mapping_abnormal.csv"""'], {}... |
import os
import csv
from json import dumps
from time import sleep
from kafka import KafkaProducer
#Changing default working directory
os.chdir("C:/Users/AYUSH/Desktop/Ronnie/kafka_2.12-2.1.0/lord-overload")
#Creating producer object; Lamba function used to serialize the data and encode it to utf-8 format
producer = ... | [
"os.chdir",
"json.dumps",
"csv.DictReader",
"time.sleep"
] | [((136, 208), 'os.chdir', 'os.chdir', (['"""C:/Users/AYUSH/Desktop/Ronnie/kafka_2.12-2.1.0/lord-overload"""'], {}), "('C:/Users/AYUSH/Desktop/Ronnie/kafka_2.12-2.1.0/lord-overload')\n", (144, 208), False, 'import os\n'), ((565, 588), 'csv.DictReader', 'csv.DictReader', (['csvfile'], {}), '(csvfile)\n', (579, 588), Fals... |
# i.e.: set to False only when debugging.
import os
import sys
from typing import Optional
USE_TIMEOUTS = True
if "GITHUB_WORKFLOW" not in os.environ:
if "pydevd" in sys.modules:
USE_TIMEOUTS = False
# If USE_TIMEOUTS is None, this timeout should be used.
NO_TIMEOUT = None
DEFAULT_TIMEOUT = 10
def is_t... | [
"os.getenv"
] | [((537, 559), 'os.getenv', 'os.getenv', (['env_key', '""""""'], {}), "(env_key, '')\n", (546, 559), False, 'import os\n')] |
import json
import os
import sys
from shutil import copytree
import pytest
sys.path.insert(0, '../..')
from falcon_openapi import OpenApiRouter # isort:skip
class TestRouter():
def test_missing_default(self):
with pytest.raises(FileNotFoundError):
OpenApiRouter()
def test_bad_file(self... | [
"sys.path.insert",
"pytest.raises",
"falcon_openapi.OpenApiRouter"
] | [((77, 104), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""../.."""'], {}), "(0, '../..')\n", (92, 104), False, 'import sys\n'), ((231, 263), 'pytest.raises', 'pytest.raises', (['FileNotFoundError'], {}), '(FileNotFoundError)\n', (244, 263), False, 'import pytest\n'), ((277, 292), 'falcon_openapi.OpenApiRouter', '... |
from random import randint
from time import sleep
rdpc = randint(0, 5)
print('-=-' * 20)
print('Vou pensar em um número entre 0 e 5. Tente descobrir...')
print('-=-' * 20)
nm = int(input('Em qual número eu pensei? '))
print('PROCESSANDO...')
sleep(2)
if nm == rdpc:
print('PARABÉNS, VOCÊ ACETOU!')
else:
print(... | [
"random.randint",
"time.sleep"
] | [((58, 71), 'random.randint', 'randint', (['(0)', '(5)'], {}), '(0, 5)\n', (65, 71), False, 'from random import randint\n'), ((243, 251), 'time.sleep', 'sleep', (['(2)'], {}), '(2)\n', (248, 251), False, 'from time import sleep\n')] |
"""
Transform video
===============
In this example, we use ``torchio.Resample((2, 2, 1))`` to divide the spatial
size of the clip (height and width) by two and
``RandomAffine(degrees=(0, 0, 20))`` to rotate a maximum of 20 degrees around
the time axis.
"""
import numpy as np
import matplotlib.pyplot as plt
import ma... | [
"torch.manual_seed",
"PIL.Image.open",
"torchio.RandomAffine",
"torchio.ScalarImage",
"matplotlib.animation.FuncAnimation",
"matplotlib.pyplot.plot",
"numpy.stack",
"torchio.Resample",
"matplotlib.pyplot.subplots"
] | [((1520, 1530), 'matplotlib.pyplot.plot', 'plt.plot', ([], {}), '()\n', (1528, 1530), True, 'import matplotlib.pyplot as plt\n'), ((1539, 1581), 'torchio.ScalarImage', 'tio.ScalarImage', ([], {'tensor': 'array', 'delay': 'delay'}), '(tensor=array, delay=delay)\n', (1554, 1581), True, 'import torchio as tio\n'), ((1721,... |
import pytest
from dataclasses import dataclass
from typing import List, Tuple
from solution import solve
@dataclass
class Case:
args: Tuple[List[int], int]
want: bool
def test_solve():
cases: List[Case] = [
Case(([10, 15, 3, 7], 17), True),
Case(([-10, -15, -3, -7], -25), True),
... | [
"solution.solve"
] | [((467, 481), 'solution.solve', 'solve', (['*c.args'], {}), '(*c.args)\n', (472, 481), False, 'from solution import solve\n')] |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 20 16:53:06 2019
@author: isip40
"""
from setuptools import setup
setup(name='imagenet')
| [
"setuptools.setup"
] | [((137, 159), 'setuptools.setup', 'setup', ([], {'name': '"""imagenet"""'}), "(name='imagenet')\n", (142, 159), False, 'from setuptools import setup\n')] |
# HUBI SERVER IA
# Creado por @flowese
# Powered by @hubspain
# Versión WhatsApp.
# Librerías
from os import system, getenv
from dotenv import load_dotenv
from flask import Flask, request, session, render_template, redirect
from flask_socketio import SocketIO, send, emit
from time import sleep
import dateti... | [
"flask.render_template",
"funciones.hubi_core.variables_sistema",
"funciones.hubi_core.inicio_app",
"os.getenv",
"flask.Flask",
"flask_socketio.SocketIO",
"dotenv.load_dotenv",
"flask.redirect",
"os.system",
"api.api.funciones_chat"
] | [((556, 575), 'funciones.hubi_core.variables_sistema', 'variables_sistema', ([], {}), '()\n', (573, 575), False, 'from funciones.hubi_core import variables_sistema, inicio_app\n'), ((614, 629), 'os.system', 'system', (['"""clear"""'], {}), "('clear')\n", (620, 629), False, 'from os import system, getenv\n'), ((773, 788... |
# Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | [
"argparse.ArgumentParser",
"nvidia.dali.ops.nvJPEGDecoder",
"timeit.default_timer",
"nvidia.dali.ops.FastResizeCropMirror",
"nvidia.dali.ops.HostDecoder",
"nvidia.dali.ops.Uniform",
"nvidia.dali.ops.CoinFlip",
"nvidia.dali.ops.Resize",
"nvidia.dali.ops.ExternalSource",
"nvidia.dali.ops.NormalizePe... | [((5712, 5791), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), '(formatter_class=argparse.ArgumentDefaultsHelpFormatter)\n', (5735, 5791), False, 'import argparse\n'), ((1685, 1705), 'nvidia.dali.ops.ExternalSource', 'ops.ExternalSource', ([], ... |
#_*_ coding: utf8 _*_
from styles.menu_authors_style import MenuAuthorEsthetic as Style
import styles.styles_utils as su
from database.authors import Author
class MenuAuthor:
def run(self):
while True:
option = Style().options()
if option['option'] == Style().option_1: # Read/L... | [
"database.authors.Author",
"styles.styles_utils.waiting_user",
"styles.menu_authors_style.MenuAuthorEsthetic",
"styles.styles_utils.beep"
] | [((1499, 1516), 'styles.styles_utils.waiting_user', 'su.waiting_user', ([], {}), '()\n', (1514, 1516), True, 'import styles.styles_utils as su\n'), ((239, 246), 'styles.menu_authors_style.MenuAuthorEsthetic', 'Style', ([], {}), '()\n', (244, 246), True, 'from styles.menu_authors_style import MenuAuthorEsthetic as Style... |
"""Arithmetic Coding
Functions for doing compression using arithmetic coding.
http://en.wikipedia.org/wiki/Arithmetic_coding
The functions and classes all need predictive models; see model.py
"""
import math
import itertools
from seq_predict import CTW
def grouper(n, iterable, fillvalue=None):
args = [iter(ite... | [
"itertools.zip_longest"
] | [((343, 392), 'itertools.zip_longest', 'itertools.zip_longest', (['*args'], {'fillvalue': 'fillvalue'}), '(*args, fillvalue=fillvalue)\n', (364, 392), False, 'import itertools\n')] |
# Generated by Django 3.2.11 on 2022-01-21 15:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('university', '0003_lesson'),
]
operations = [
migrations.AlterField(
model_name='employee',
name='hired_date',
... | [
"django.db.models.DateField"
] | [((334, 372), 'django.db.models.DateField', 'models.DateField', ([], {'default': '"""2022-01-21"""'}), "(default='2022-01-21')\n", (350, 372), False, 'from django.db import migrations, models\n'), ((499, 537), 'django.db.models.DateField', 'models.DateField', ([], {'default': '"""2022-01-21"""'}), "(default='2022-01-21... |
#!/usr/bin/env python
# coding: utf-8
from typing import Tuple
import numpy as np
import PathReducer.calculate_rmsd as rmsd
import pandas as pd
import math
import glob
import os
import sys
import ntpath
import MDAnalysis as mda
import PathReducer.plotting_functions as plotting_functions
from periodictabl... | [
"sympy.Symbol",
"numpy.sqrt",
"pandas.read_csv",
"numpy.argsort",
"numpy.array",
"numpy.arange",
"numpy.mean",
"PathReducer.calculate_rmsd.kabsch_rotate",
"os.path.exists",
"numpy.reshape",
"numpy.asarray",
"pandas.set_option",
"numpy.real",
"numpy.dot",
"sympy.solve",
"os.path.isdir",... | [((431, 449), 'ntpath.split', 'ntpath.split', (['path'], {}), '(path)\n', (443, 449), False, 'import ntpath\n'), ((1818, 1847), 'MDAnalysis.Universe', 'mda.Universe', (['*args'], {}), '(*args, **kwargs)\n', (1830, 1847), True, 'import MDAnalysis as mda\n'), ((2041, 2075), 'numpy.ndarray', 'np.ndarray', (['(n_frames, n_... |
#System Dependencies
import base64
#Dash dependencies
import dash
import dash_table
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State
import plotly.graph_objs as go
import pandas as pd
import numpy as np
im... | [
"utils.detect_image",
"pandas.DataFrame",
"cv2.imencode",
"yolov3.Create_Yolov3",
"dash.dependencies.Output",
"dash_core_components.Location",
"base64.b64decode",
"base64.b64encode",
"dash.dependencies.Input",
"plotly.graph_objs.Pie",
"cv2.imdecode",
"dash_html_components.Img",
"azure.storag... | [((568, 645), 'yolov3.Create_Yolov3', 'Create_Yolov3', ([], {'input_size': '(416)', 'CLASSES': '"""./model_data/license_plate_names.txt"""'}), "(input_size=416, CLASSES='./model_data/license_plate_names.txt')\n", (581, 645), False, 'from yolov3 import Create_Yolov3\n'), ((873, 927), 'dash.dependencies.Output', 'Output'... |
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | [
"tensorflow.verify_tensor_all_finite",
"tensorflow.logging.error",
"tensorflow.pad",
"tensorflow.Variable",
"tensorflow.placeholder",
"tensorflow.sigmoid",
"tensorflow.trainable_variables",
"tensorflow.control_dependencies",
"tensorflow.clip_by_value",
"tensorflow.nn.sigmoid_cross_entropy_with_log... | [((2752, 2791), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'name': '"""seed"""'}), "(tf.float32, name='seed')\n", (2766, 2791), True, 'import tensorflow as tf\n'), ((2817, 2859), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'name': '"""patches"""'}), "(tf.float32, name='patches')\n",... |
from json import dumps
from re import finditer
from typing import Iterator, List, Optional, TextIO, Union
from ansiscape.enums import InterpretationKey, MetaInterpretation
from ansiscape.handlers import get_interpreter, get_interpreter_for_sgr_int
from ansiscape.types import Attributes, Interpretation, SequencePart, S... | [
"ansiscape.handlers.get_interpreter",
"json.dumps",
"ansiscape.types.Interpretation",
"ansiscape.handlers.get_interpreter_for_sgr_int",
"re.finditer"
] | [((709, 725), 'ansiscape.types.Interpretation', 'Interpretation', ([], {}), '()\n', (723, 725), False, 'from ansiscape.types import Attributes, Interpretation, SequencePart, SequenceType\n'), ((779, 814), 're.finditer', 'finditer', (['"""\x1b\\\\[([0-9;]+)m"""', 'part'], {}), "('\\x1b\\\\[([0-9;]+)m', part)\n", (787, 8... |
import discord
import os
from discord.ext import commands
import requests
from requests.api import get
import pycountry
import datetime
from datetime import date
import json
import newsapi
from newsapi import NewsApiClient
# covid = Covid()
list_cont = []
class News(commands.Cog):
def __init__(self,client):
... | [
"discord.Color.blurple",
"json.loads",
"requests.request",
"datetime.datetime.now",
"discord.Color.green",
"discord.Embed",
"discord.ext.commands.command"
] | [((2191, 2284), 'discord.ext.commands.command', 'commands.command', ([], {'aliases': "['cinfo', 'covidinfo']", 'help': '"""Gives You Covid-19 informations"""'}), "(aliases=['cinfo', 'covidinfo'], help=\n 'Gives You Covid-19 informations')\n", (2207, 2284), False, 'from discord.ext import commands\n'), ((3037, 3071),... |
# -*- coding: utf-8 -*-
"""Command line scripts to launch a `MatdynCalculation` for testing and demonstration purposes."""
from __future__ import absolute_import
from aiida.cmdline.params import options, types
from aiida.cmdline.utils import decorators
from ..utils import launch
from ..utils import options as options... | [
"aiida.cmdline.params.types.CodeParamType",
"aiida_quantumespresso.utils.resources.get_default_options",
"aiida.cmdline.params.types.DataParamType",
"aiida.cmdline.utils.decorators.with_dbenv",
"aiida.plugins.CalculationFactory"
] | [((826, 849), 'aiida.cmdline.utils.decorators.with_dbenv', 'decorators.with_dbenv', ([], {}), '()\n', (847, 849), False, 'from aiida.cmdline.utils import decorators\n'), ((1383, 1427), 'aiida.plugins.CalculationFactory', 'CalculationFactory', (['"""quantumespresso.matdyn"""'], {}), "('quantumespresso.matdyn')\n", (1401... |
#unit_tests.py
import os
import numpy as np
import pandas as pd
from data import clean_data
#############
# Functions #-------------------------------------------------------------------
#############
def testing_ryr2_prep_data():
"""Test that domain information and conservation information were
added correc... | [
"data.clean_data.PrepareData",
"os.remove"
] | [((495, 574), 'data.clean_data.PrepareData', 'clean_data.PrepareData', (['"""ryr2"""'], {'results_dir': '""""""', 'features_to_use': 'features_to_use'}), "('ryr2', results_dir='', features_to_use=features_to_use)\n", (517, 574), False, 'from data import clean_data\n'), ((1539, 1563), 'os.remove', 'os.remove', (['"""ryr... |
#!/usr/bin/python
#
# 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 ag... | [
"logging.getLogger",
"google.cloud.sqlcommenter.opentelemetry.get_opentelemetry_values",
"google.cloud.sqlcommenter.opencensus.get_opencensus_values",
"django.get_version"
] | [((940, 960), 'django.get_version', 'django.get_version', ([], {}), '()\n', (958, 960), False, 'import django\n'), ((970, 997), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (987, 997), False, 'import logging\n'), ((3694, 3717), 'google.cloud.sqlcommenter.opencensus.get_opencensus_values... |
import backbone.support.configurations_variables as confv
import backbone.support.data_loading as dl
import backbone.support.data_analysis as da
import backbone.support.data_cleaning as dc
import backbone.support.configuration_classes as confc
import backbone.support.saving_loading as sl
import backbone.support.plots_a... | [
"backbone.support.data_cleaning.check_and_adjust_df_for_minimum_audio_length_after_cleaning",
"backbone.support.models.get_cremad_female_model",
"tensorflow.lite.TFLiteConverter.from_saved_model",
"numpy.unique",
"backbone.support.configuration_classes.RandFeatParams",
"os.path.join",
"numpy.argmax",
... | [((3645, 3720), 'backbone.support.configuration_classes.DataFrame', 'confc.DataFrame', ([], {'database': 'confv.database_cremad', 'gender': 'confv.gender_female'}), '(database=confv.database_cremad, gender=confv.gender_female)\n', (3660, 3720), True, 'import backbone.support.configuration_classes as confc\n'), ((3739, ... |
"""Forward and back projector for PET data reconstruction"""
__author__ = "<NAME>"
__copyright__ = "Copyright 2018"
#------------------------------------------------------------------------------
import numpy as np
import sys
import os
import logging
import petprj
from niftypet.nipet.img import mmrimg
from nif... | [
"logging.getLogger",
"niftypet.nipet.mmraux.remgaps",
"petprj.bprj",
"niftypet.nipet.img.mmrimg.convert2dev",
"niftypet.nipet.img.mmrimg.convert2e7",
"niftypet.nipet.mmraux.putgaps",
"numpy.array",
"numpy.zeros",
"petprj.fprj"
] | [((555, 585), 'numpy.array', 'np.array', (['[-1]'], {'dtype': 'np.int32'}), '([-1], dtype=np.int32)\n', (563, 585), True, 'import numpy as np\n'), ((1675, 1702), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1692, 1702), False, 'import logging\n'), ((3590, 3643), 'petprj.fprj', 'petprj.... |
import json
import logging
import webapp2
from datetime import datetime
from google.appengine.ext import ndb
from controllers.api.api_base_controller import ApiBaseController
from database.event_query import EventListQuery
from helpers.award_helper import AwardHelper
from helpers.district_helper import DistrictHelp... | [
"models.event.Event.get_by_id",
"helpers.model_to_dict.ModelToDict.teamConverter",
"helpers.district_helper.DistrictHelper.calculate_event_points",
"json.dumps",
"helpers.model_to_dict.ModelToDict.eventConverter",
"helpers.model_to_dict.ModelToDict.matchConverter",
"helpers.award_helper.AwardHelper.orga... | [((970, 996), 'models.event.Event.get_by_id', 'Event.get_by_id', (['event_key'], {}), '(event_key)\n', (985, 996), False, 'from models.event import Event\n'), ((1324, 1362), 'helpers.model_to_dict.ModelToDict.eventConverter', 'ModelToDict.eventConverter', (['self.event'], {}), '(self.event)\n', (1350, 1362), False, 'fr... |
# -*- coding: utf-8 -*-
"""
Tests for the Keystone states
"""
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.helpers import destructiveTest
from tests.support.mixins i... | [
"logging.getLogger",
"tests.support.unit.skipIf"
] | [((394, 421), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (411, 421), False, 'import logging\n'), ((566, 691), 'tests.support.unit.skipIf', 'skipIf', (['NO_KEYSTONE', '"""Please install keystoneclient and a keystone server before runningkeystone integration tests."""'], {}), "(NO_KEYST... |
import scrapy
class MyDealzSpider(scrapy.Spider):
name = 'mydealz'
def start_requests(self):
urls = ('https://www.mydealz.de/deals?page={}'.format(i) for i in range(0,1000))
for url in urls:
yield scrapy.Request(url=url, callback=self.parse)
def parse... | [
"scrapy.Request"
] | [((235, 279), 'scrapy.Request', 'scrapy.Request', ([], {'url': 'url', 'callback': 'self.parse'}), '(url=url, callback=self.parse)\n', (249, 279), False, 'import scrapy\n')] |
# Week 1: Preprocess the corpus into the required format
# The format is: word_tag
# 'word' is obtained from param 'hw' of 'w'
# 'tag' is obtained from param 'c5' of 'w'
# Store the output in a TXT file.
import os
import xml.etree.ElementTree as ET
output_path = "../output/week-1.txt"
output_f = open(output_path, "w")... | [
"xml.etree.ElementTree.parse",
"os.walk"
] | [((347, 390), 'os.walk', 'os.walk', (['"""../Assignment-files/Train-corups"""'], {}), "('../Assignment-files/Train-corups')\n", (354, 390), False, 'import os\n'), ((468, 487), 'xml.etree.ElementTree.parse', 'ET.parse', (['file_path'], {}), '(file_path)\n', (476, 487), True, 'import xml.etree.ElementTree as ET\n')] |
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
def enel(codigo_cliente, cpf_cliente):
firefox = webdriver.Firefox()
firefox.get('https://www.eneldistribuicao.com.br/rj/LoginAcessoRapidoSegundaVia.aspx')
path_codigo_cliente = "ctl00$CONTENT$NumeroCliente"
pat... | [
"selenium.webdriver.Firefox",
"time.sleep"
] | [((145, 164), 'selenium.webdriver.Firefox', 'webdriver.Firefox', ([], {}), '()\n', (162, 164), False, 'from selenium import webdriver\n'), ((605, 618), 'time.sleep', 'time.sleep', (['(3)'], {}), '(3)\n', (615, 618), False, 'import time\n'), ((1006, 1019), 'time.sleep', 'time.sleep', (['(3)'], {}), '(3)\n', (1016, 1019)... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import gradcheck
import random
import numpy as np
import math
import scipy.io as sio
import matplotlib.pyplot as plt
from sphere_cuda import SPHERE_CUDA
random.seed(1)
np.random.seed(1)
torch.manual_seed(1)
if torch.cuda.is_availa... | [
"torch.manual_seed",
"torch.cuda.device_count",
"random.seed",
"torch.from_numpy",
"torch.cuda.is_available",
"sphere_cuda.SPHERE_CUDA",
"numpy.random.seed",
"torch.cuda.manual_seed",
"numpy.load",
"torch.autograd.gradcheck",
"torch.randn",
"torch.device"
] | [((241, 255), 'random.seed', 'random.seed', (['(1)'], {}), '(1)\n', (252, 255), False, 'import random\n'), ((256, 273), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (270, 273), True, 'import numpy as np\n'), ((274, 294), 'torch.manual_seed', 'torch.manual_seed', (['(1)'], {}), '(1)\n', (291, 294), Fal... |
import glob
import os
if __name__ == "__main__":
csq_path = "/home/inseo/Desktop/csq"
out_path = "/home/inseo/Desktop/csq/output"
csq_list = glob.glob(os.path.join(csq_path, '*.csq'))
for csq in csq_list:
#create output path
print("### extract {0} ###".format(os.path.basename(csq)))
... | [
"os.path.join",
"os.path.basename",
"os.makedirs"
] | [((164, 195), 'os.path.join', 'os.path.join', (['csq_path', '"""*.csq"""'], {}), "(csq_path, '*.csq')\n", (176, 195), False, 'import os\n'), ((394, 434), 'os.makedirs', 'os.makedirs', (['out_path_csq'], {'exist_ok': '(True)'}), '(out_path_csq, exist_ok=True)\n', (405, 434), False, 'import os\n'), ((363, 384), 'os.path.... |
# Copyright (c) 2015 noteness
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, ... | [
"hexchat.strip",
"hexchat.hook_print",
"hexchat.get_pluginpref",
"hexchat.command",
"fnmatch.fnmatch",
"hexchat.prnt",
"hexchat.emit_print"
] | [((1458, 1510), 'hexchat.get_pluginpref', 'hexchat.get_pluginpref', (["(__module_name__ + '_ignores')"], {}), "(__module_name__ + '_ignores')\n", (1480, 1510), False, 'import hexchat\n'), ((2558, 2578), 'hexchat.prnt', 'hexchat.prnt', (['toprnt'], {}), '(toprnt)\n', (2570, 2578), False, 'import hexchat\n'), ((3132, 319... |
from __future__ import absolute_import
import logging
import os
import functools
from lintreview.tools import Tool, run_command, process_quickfix
from lintreview.utils import in_path, go_bin_path
log = logging.getLogger(__name__)
class Golint(Tool):
"""
Run golint on files. This may need to offer config opti... | [
"logging.getLogger",
"lintreview.utils.in_path",
"os.path.splitext",
"lintreview.utils.go_bin_path",
"functools.partial",
"lintreview.tools.run_command",
"os.path.basename",
"lintreview.tools.process_quickfix"
] | [((203, 230), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (220, 230), False, 'import logging\n'), ((634, 660), 'os.path.basename', 'os.path.basename', (['filename'], {}), '(filename)\n', (650, 660), False, 'import os\n'), ((681, 703), 'os.path.splitext', 'os.path.splitext', (['base'], ... |
import numpy as np
u = np.array([3,2,1])
v = np.array([1,2,3])
z = u + v
z = u - v
z = u * v
z = u / v
x = np.arange(0,9)
print(x)
print(x.shape)
print(x.itemsize)
y = x.reshape((3,3))
print(y)
print(y.shape)
print(y.itemsize)
x = np.array([1,1,1])
soma = sum(x)
print(soma)
# Usando inner para produto intern... | [
"numpy.matlib.randn",
"numpy.cross",
"numpy.matlib.rand",
"numpy.matlib.identity",
"numpy.inner",
"numpy.array",
"numpy.arange",
"numpy.matlib.zeros"
] | [((26, 45), 'numpy.array', 'np.array', (['[3, 2, 1]'], {}), '([3, 2, 1])\n', (34, 45), True, 'import numpy as np\n'), ((48, 67), 'numpy.array', 'np.array', (['[1, 2, 3]'], {}), '([1, 2, 3])\n', (56, 67), True, 'import numpy as np\n'), ((113, 128), 'numpy.arange', 'np.arange', (['(0)', '(9)'], {}), '(0, 9)\n', (122, 128... |
# Copyright 2021 The Magenta Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | [
"note_seq.protobuf.music_pb2.NoteSequence",
"note_seq.testing_lib.add_track_to_sequence",
"note_seq.chord_inference.sequence_note_pitch_vectors",
"note_seq.chord_inference.infer_chords_for_sequence",
"absl.testing.absltest.main",
"note_seq.testing_lib.add_beats_to_sequence",
"note_seq.sequences_lib.quan... | [((5808, 5823), 'absl.testing.absltest.main', 'absltest.main', ([], {}), '()\n', (5821, 5823), False, 'from absl.testing import absltest\n'), ((970, 994), 'note_seq.protobuf.music_pb2.NoteSequence', 'music_pb2.NoteSequence', ([], {}), '()\n', (992, 994), False, 'from note_seq.protobuf import music_pb2\n'), ((999, 1206)... |
import os
import shutil
import subprocess
import sys
import re
import glob
from colors import prGreen,prCyan,prRed
TRACES_DIR = './.fpchecker/traces'
TRACES_FILES = TRACES_DIR+'/'+'trace'
STRACE = 'strace'
SUPPORTED_COMPILERS = set([
'nvcc',
'c++',
'cc',
'gcc',
'g++',
'xlc',
'xlC',
'xlc++',
'xlc... | [
"os.path.exists",
"re.split",
"os.makedirs",
"colors.prGreen",
"re.compile",
"subprocess.Popen",
"colors.prRed",
"shutil.rmtree",
"glob.glob"
] | [((1556, 1591), 're.compile', 're.compile', (['"""^\\\\[pid\\\\s+[0-9]+\\\\] """'], {}), "('^\\\\[pid\\\\s+[0-9]+\\\\] ')\n", (1566, 1591), False, 'import re\n'), ((1783, 1819), 're.compile', 're.compile', (['"""^clone\\\\(.+=\\\\s+[0-9]+"""'], {}), "('^clone\\\\(.+=\\\\s+[0-9]+')\n", (1793, 1819), False, 'import re\n'... |
from redis import Redis
from redis_natives import List
from tests import RedisWrapper
class TestListSlicing(object):
def setup_method(self, method):
self.redis = RedisWrapper(Redis())
self.redis.flushdb()
self.test_key = 'test_key'
self.list = List(self.redis, self.test_key)
... | [
"redis_natives.List",
"redis.Redis"
] | [((282, 313), 'redis_natives.List', 'List', (['self.redis', 'self.test_key'], {}), '(self.redis, self.test_key)\n', (286, 313), False, 'from redis_natives import List\n'), ((189, 196), 'redis.Redis', 'Redis', ([], {}), '()\n', (194, 196), False, 'from redis import Redis\n')] |
# This file is part of the Indico plugins.
# Copyright (C) 2002 - 2022 CERN
#
# The Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License;
# see the LICENSE file for more details.
from celery.schedules import crontab
from indico.core.celery import celery
f... | [
"indico_livesync.util.clean_old_entries",
"indico.core.db.db.session.commit",
"indico_livesync.models.agents.LiveSyncAgent.query.all",
"indico_livesync.plugin.LiveSyncPlugin.logger.warning",
"indico_livesync.plugin.LiveSyncPlugin.settings.get",
"celery.schedules.crontab",
"indico_livesync.plugin.LiveSyn... | [((619, 668), 'indico_livesync.plugin.LiveSyncPlugin.settings.get', 'LiveSyncPlugin.settings.get', (['"""disable_queue_runs"""'], {}), "('disable_queue_runs')\n", (646, 668), False, 'from indico_livesync.plugin import LiveSyncPlugin\n'), ((754, 773), 'indico_livesync.util.clean_old_entries', 'clean_old_entries', ([], {... |
#!/usr/bin/env python
# This will (hopefully) be the code to extract symmetry operations
# from Hall symbols
import numpy as np
lattice_symbols = {
'P': [[0, 0, 0]],
'A': [[0, 0, 0], [0, 1./2, 1./2]],
'B': [[0, 0, 0], [1./2, 0, 1./2]],
'C': [[0, 0, 0], [1./2, 1./2, 0]],
'I': [[0, 0, 0], [1./2, 1.... | [
"optparse.OptionParser",
"numpy.array",
"numpy.dot",
"numpy.zeros",
"numpy.rint"
] | [((10889, 10900), 'numpy.array', 'np.array', (['r'], {}), '(r)\n', (10897, 10900), True, 'import numpy as np\n'), ((12263, 12277), 'optparse.OptionParser', 'OptionParser', ([], {}), '()\n', (12275, 12277), False, 'from optparse import OptionParser\n'), ((2939, 2972), 'numpy.array', 'np.array', (["rotation_matrices['1x'... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | [
"googlecloudsdk.third_party.gapic_clients.logging_v2.types.logging_config.ListViewsRequest",
"googlecloudsdk.third_party.gapic_clients.logging_v2.types.logging_config.ListSinksRequest",
"googlecloudsdk.third_party.gapic_clients.logging_v2.types.logging_config.ListBucketsRequest",
"googlecloudsdk.third_party.g... | [((2502, 2544), 'googlecloudsdk.third_party.gapic_clients.logging_v2.types.logging_config.ListBucketsRequest', 'logging_config.ListBucketsRequest', (['request'], {}), '(request)\n', (2535, 2544), False, 'from googlecloudsdk.third_party.gapic_clients.logging_v2.types import logging_config\n'), ((5026, 5068), 'googleclou... |
"""
tools.py
DGTavo88
Contains several tools (functions) used throughout the program.
"""
from tkinter import font #From the tkinter module import font.
import os #Import os module.
import json #Import json module.
import sys #Import sys module.
import ntpath #Inport ntpath module.
import globals #Import ... | [
"os.path.exists",
"globals.mainwindow.title",
"tkinter.font.Font",
"sys.exit",
"json.load",
"globals.tobject.GetText",
"ntpath.split"
] | [((401, 412), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (409, 412), False, 'import sys\n'), ((460, 499), 'os.path.exists', 'os.path.exists', (['"""Language/lang_en.json"""'], {}), "('Language/lang_en.json')\n", (474, 499), False, 'import os\n'), ((1258, 1295), 'ntpath.split', 'ntpath.split', (['globals.loadedDire... |
from functools import partial
from django.db import models
from model_utils.managers import InheritanceManager
from coberturas_medicas.models import Cobertura
from core.models import Persona, Profesional
from dj_utils.mixins import ShowInfoMixin
from dj_utils.models import BaseModel, uploadTenantFilename
class Pac... | [
"model_utils.managers.InheritanceManager",
"django.db.models.OneToOneField",
"django.db.models.DateField",
"django.db.models.TextField",
"django.db.models.ForeignKey",
"tratamientos.models.Planificacion.estados_activos",
"functools.partial",
"django.db.models.DecimalField"
] | [((408, 487), 'django.db.models.OneToOneField', 'models.OneToOneField', (['Persona'], {'verbose_name': '"""persona"""', 'on_delete': 'models.CASCADE'}), "(Persona, verbose_name='persona', on_delete=models.CASCADE)\n", (428, 487), False, 'from django.db import models\n'), ((509, 545), 'django.db.models.DateField', 'mode... |
# -*- coding: utf-8 -*-
try:
# for py26
import unittest2 as unittest
except ImportError:
import unittest
from . import captured_output
from clingon.utils import AreYouSure
class TestAreYouSure(unittest.TestCase):
def test_default_single(self):
ays = AreYouSure()
with captured_output... | [
"unittest.main",
"clingon.utils.AreYouSure"
] | [((3201, 3216), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3214, 3216), False, 'import unittest\n'), ((279, 291), 'clingon.utils.AreYouSure', 'AreYouSure', ([], {}), '()\n', (289, 291), False, 'from clingon.utils import AreYouSure\n'), ((803, 815), 'clingon.utils.AreYouSure', 'AreYouSure', ([], {}), '()\n', (... |
import random
def get_player_choice(prompt, valid_choices):
while True:
answer = input(prompt)
if answer in valid_choices:
return answer
else:
print("Zły wybór, spróbuj jeszcze raz.")
def guess_number():
guess_min = 1
guess_max = 99
attempts_left = 10
... | [
"random.choice",
"random.randint"
] | [((342, 378), 'random.randint', 'random.randint', (['guess_min', 'guess_max'], {}), '(guess_min, guess_max)\n', (356, 378), False, 'import random\n'), ((1164, 1194), 'random.choice', 'random.choice', (["['k', 'n', 'p']"], {}), "(['k', 'n', 'p'])\n", (1177, 1194), False, 'import random\n')] |
from sympy import (Symbol, S, exp, log, sqrt, oo, E, zoo, pi, tan, sin, cos,
cot, sec, csc, Abs, symbols)
from sympy.calculus.util import (function_range, continuous_domain, not_empty_in,
periodicity, lcim, AccumBounds)
from sympy.core import Add, Mul, Pow
from sympy.... | [
"sympy.Symbol",
"sympy.cos",
"sympy.sqrt",
"sympy.calculus.util.lcim",
"sympy.tan",
"sympy.calculus.util.periodicity",
"sympy.sec",
"sympy.sets.sets.FiniteSet",
"sympy.calculus.util.function_range",
"sympy.sin",
"sympy.sets.sets.Interval.open",
"sympy.symbols",
"sympy.calculus.util.continuou... | [((505, 527), 'sympy.Symbol', 'Symbol', (['"""a"""'], {'real': '(True)'}), "('a', real=True)\n", (511, 527), False, 'from sympy import Symbol, S, exp, log, sqrt, oo, E, zoo, pi, tan, sin, cos, cot, sec, csc, Abs, symbols\n'), ((574, 592), 'sympy.symbols', 'symbols', (['"""x y a b"""'], {}), "('x y a b')\n", (581, 592),... |
import asyncio
from aiofsk.transport import AFSKTransport
async def text_console(modem):
def _text_console():
while True:
text = input(">> ")
if 'quit' in text:
return
modem.write(text.encode())
try:
return await asyncio.get_event_loop().run_... | [
"asyncio.get_event_loop",
"aiofsk.transport.AFSKTransport"
] | [((491, 552), 'aiofsk.transport.AFSKTransport', 'AFSKTransport', ([], {'baud': '(300)', 'loopback': '(False)', 'modulator': '"""standard"""'}), "(baud=300, loopback=False, modulator='standard')\n", (504, 552), False, 'from aiofsk.transport import AFSKTransport\n'), ((291, 315), 'asyncio.get_event_loop', 'asyncio.get_ev... |
"""Satisfy Heroku Requirement."""
# -*- coding: utf-8 -*-
# @Author: AnthonyKenny98
# @Date: 2020-04-24 18:56:44
# @Last Modified by: AnthonyKenny98
# @Last Modified time: 2020-04-24 18:57:00
from os import environ
from flask import Flask
app = Flask(__name__)
app.run(environ.get('PORT'))
| [
"os.environ.get",
"flask.Flask"
] | [((250, 265), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (255, 265), False, 'from flask import Flask\n'), ((274, 293), 'os.environ.get', 'environ.get', (['"""PORT"""'], {}), "('PORT')\n", (285, 293), False, 'from os import environ\n')] |
from typing import Union
from collections import deque
import json
from src.blueprints._common.utils import (
convert_iso_datetime,
bytes_to_human_decimal
)
from src.blueprints.telegram_bot._common.telegram_interface import (
Message as TelegramMessage
)
from src.blueprints.telegram_bot.webhook.dispatcher_... | [
"json.dumps",
"src.blueprints._common.utils.convert_iso_datetime",
"collections.deque",
"src.blueprints._common.utils.bytes_to_human_decimal"
] | [((2003, 2010), 'collections.deque', 'deque', ([], {}), '()\n', (2008, 2010), False, 'from collections import deque\n'), ((3014, 3051), 'src.blueprints._common.utils.convert_iso_datetime', 'convert_iso_datetime', (["info['created']"], {}), "(info['created'])\n", (3034, 3051), False, 'from src.blueprints._common.utils i... |
import os
from PIL import Image
files = [];
for filename in os.listdir("./font_standard"):
if filename.endswith(".bmp"):
files.append(filename)
im = Image.new('RGB', (8 * len(files), 8), "#ffffff")
for index, file in enumerate(files):
bitmap_char = Image.open("./font_standard/" + file)
im.paste(... | [
"os.listdir",
"PIL.Image.open"
] | [((62, 91), 'os.listdir', 'os.listdir', (['"""./font_standard"""'], {}), "('./font_standard')\n", (72, 91), False, 'import os\n'), ((269, 306), 'PIL.Image.open', 'Image.open', (["('./font_standard/' + file)"], {}), "('./font_standard/' + file)\n", (279, 306), False, 'from PIL import Image\n')] |
import os
import sys
import cv2
import numpy as np
from imageio import imread
import json
import argparse
import visualization.visualizer.shader
from PyQt5 import QtWidgets, QtGui, QtOpenGL
from PyQt5.QtWidgets import *
from PyQt5.QtGui import QIcon
import PyQt5.QtCore as QtCore
import glm
from OpenGL.GL import *
fro... | [
"argparse.ArgumentParser",
"visualization.visualizer.Viewer.LayoutView.GLWindow",
"visualization.visualizer.Viewer.Utils.OldFormat2Mine",
"json.load",
"PyQt5.QtWidgets.QApplication",
"imageio.imread",
"PyQt5.QtWidgets.QDesktopWidget"
] | [((1654, 1686), 'PyQt5.QtWidgets.QApplication', 'QtWidgets.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (1676, 1686), False, 'from PyQt5 import QtWidgets, QtGui, QtOpenGL\n'), ((1836, 1956), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""360 Layout Visualizer"""', 'formatter_class'... |
from utility import *
import subprocess
import sys
import os
import threading
import time
ssh_privkey_file = os.getenv("SSH_PRIVKEY_FILE", "daala.pem")
binaries = {
'daala':['examples/encoder_example','examples/dump_video'],
'x264': ['x264'],
'x264-rt': ['x264'],
'x265': ['build/linux/x265'],
'x26... | [
"os.getenv",
"subprocess.Popen",
"time.sleep",
"threading.Event",
"os.path.dirname",
"threading.Thread"
] | [((110, 152), 'os.getenv', 'os.getenv', (['"""SSH_PRIVKEY_FILE"""', '"""daala.pem"""'], {}), "('SSH_PRIVKEY_FILE', 'daala.pem')\n", (119, 152), False, 'import os\n'), ((2744, 2761), 'threading.Event', 'threading.Event', ([], {}), '()\n', (2759, 2761), False, 'import threading\n'), ((3413, 3483), 'subprocess.Popen', 'su... |
from twocode import utils
import builtins
import textwrap
import ctypes
def add_builtins(context):
wraps = context.native_wraps
context.builtins = utils.Object()
def create(signature):
def wrap(func):
f = context.obj.Func(native=func, sign=signature)
context.bui... | [
"ctypes.addressof",
"textwrap.dedent",
"builtins.enumerate",
"builtins.zip",
"ctypes.cast",
"twocode.utils.Object",
"builtins.print",
"builtins.open"
] | [((165, 179), 'twocode.utils.Object', 'utils.Object', ([], {}), '()\n', (177, 179), False, 'from twocode import utils\n'), ((802, 816), 'twocode.utils.Object', 'utils.Object', ([], {}), '()\n', (814, 816), False, 'from twocode import utils\n'), ((1611, 1666), 'builtins.print', 'builtins.print', (['*objects'], {'sep': '... |
"""Module for interacting with the Comet Observations Database (COBS)."""
from io import StringIO
import re
from pathlib import Path
from appdirs import user_cache_dir
from astropy.time import Time
import mechanize
import numpy as np
import pandas as pd
from . import PACKAGEDIR, log
# Where to store COBS data?
CACH... | [
"pandas.read_feather",
"pandas.to_timedelta",
"appdirs.user_cache_dir",
"re.compile",
"pandas.merge",
"astropy.time.Time",
"mechanize.Browser",
"pandas.concat",
"pandas.to_datetime",
"numpy.atleast_1d"
] | [((332, 360), 'appdirs.user_cache_dir', 'user_cache_dir', (['"""cometcurve"""'], {}), "('cometcurve')\n", (346, 360), False, 'from appdirs import user_cache_dir\n'), ((1681, 1701), 'numpy.atleast_1d', 'np.atleast_1d', (['years'], {}), '(years)\n', (1694, 1701), True, 'import numpy as np\n'), ((1866, 1881), 'pandas.conc... |
import unittest
try:
import torch_butterfly
BUTTERFLY = True
except ImportError:
BUTTERFLY = False
class TestCase(unittest.TestCase):
def test(self, butterfly=False):
pass
@unittest.skipIf(not BUTTERFLY, "torch_butterfly not found")
def test_butterfly(self, **kwargs):
self... | [
"unittest.skipIf"
] | [((207, 266), 'unittest.skipIf', 'unittest.skipIf', (['(not BUTTERFLY)', '"""torch_butterfly not found"""'], {}), "(not BUTTERFLY, 'torch_butterfly not found')\n", (222, 266), False, 'import unittest\n')] |
from collections import Counter
import config
from training.rule import Rule3, Rule1
class PCFGT:
def __init__(self):
self.nonterminals = Counter()
self.terminals = Counter()
self.rule1s = Counter()
self.rule3s = Counter()
self.pi = Counter()
self.populate()
... | [
"collections.Counter"
] | [((151, 160), 'collections.Counter', 'Counter', ([], {}), '()\n', (158, 160), False, 'from collections import Counter\n'), ((186, 195), 'collections.Counter', 'Counter', ([], {}), '()\n', (193, 195), False, 'from collections import Counter\n'), ((218, 227), 'collections.Counter', 'Counter', ([], {}), '()\n', (225, 227)... |
#!/usr/bin/env python3
import argparse, datetime, logging, os, sys
from collections import defaultdict
from textwrap import indent
import yaml
logger = logging.getLogger(__name__)
COMMAND = "dbt_docstring"
DBT_BLOCK_START_KEY = "```dbt"
def _get_models_dirs(dbt_dir):
dbt_project_file = os.path.join(dbt_dir, "db... | [
"logging.getLogger",
"argparse.ArgumentParser",
"os.path.join",
"yaml.load",
"os.path.isfile",
"datetime.datetime.now",
"os.path.isdir",
"collections.defaultdict",
"os.walk"
] | [((153, 180), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (170, 180), False, 'import argparse, datetime, logging, os, sys\n'), ((295, 335), 'os.path.join', 'os.path.join', (['dbt_dir', '"""dbt_project.yml"""'], {}), "(dbt_dir, 'dbt_project.yml')\n", (307, 335), False, 'import argparse,... |
import logging
class LogHelper():
handler = None
@staticmethod
def setup():
FORMAT = '[%(levelname)s] %(asctime)s - %(name)s - %(message)s'
LogHelper.handler = logging.StreamHandler()
LogHelper.handler.setLevel(logging.DEBUG)
LogHelper.handler.setFormatter(logging.Formatter(F... | [
"logging.getLogger",
"logging.Formatter",
"logging.StreamHandler"
] | [((188, 211), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (209, 211), False, 'import logging\n'), ((481, 504), 'logging.getLogger', 'logging.getLogger', (['name'], {}), '(name)\n', (498, 504), False, 'import logging\n'), ((301, 326), 'logging.Formatter', 'logging.Formatter', (['FORMAT'], {}), '(... |
#
# Copyright 2021 Red Hat Inc.
# SPDX-License-Identifier: Apache-2.0
#
"""Clear out our local testing directories."""
import argparse
import os
import shutil
TESTING_DIRS = [
"local_providers/aws_local",
"local_providers/aws_local_0",
"local_providers/aws_local_1",
"local_providers/aws_local_2",
"... | [
"os.scandir",
"argparse.ArgumentParser",
"shutil.rmtree"
] | [((1300, 1325), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1323, 1325), False, 'import argparse\n'), ((1169, 1193), 'shutil.rmtree', 'shutil.rmtree', (['directory'], {}), '(directory)\n', (1182, 1193), False, 'import shutil\n'), ((1029, 1045), 'os.scandir', 'os.scandir', (['path'], {}), '(... |
from sympy import Rational as frac
from ..helpers import article
from ._helpers import TriangleScheme, concat, s1, s2
citation = article(
authors=["<NAME>", "<NAME>", "<NAME>"],
title="Several new quadrature formulas for polynomial integration in the triangle",
journal="arXiv Mathematics e-prints",
ye... | [
"sympy.Rational"
] | [((496, 506), 'sympy.Rational', 'frac', (['(2)', '(3)'], {}), '(2, 3)\n', (500, 506), True, 'from sympy import Rational as frac\n'), ((508, 518), 'sympy.Rational', 'frac', (['(1)', '(6)'], {}), '(1, 6)\n', (512, 518), True, 'from sympy import Rational as frac\n')] |
#!/usr/bin/env python3
#
# Code related to ESET's Linux/Moose research
# For feedback or questions contact us at: <EMAIL>
# https://github.com/eset/malware-research/
#
# This code is provided to the community under the two-clause BSD license as
# follows:
#
# Copyright (C) 2015 ESET
# All rights reserved.
#
# Redistrib... | [
"fileinput.input"
] | [((3223, 3240), 'fileinput.input', 'fileinput.input', ([], {}), '()\n', (3238, 3240), False, 'import fileinput\n')] |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import o... | [
"logging.getLogger",
"os.path.exists",
"logging.StreamHandler",
"onnxruntime.SessionOptions",
"argparse.ArgumentParser",
"os.makedirs",
"logging.Formatter",
"onnxruntime.InferenceSession",
"onnxruntime.get_available_providers",
"bert_model_optimization.optimize_model",
"psutil.cpu_count",
"tor... | [((476, 497), 'logging.getLogger', 'logging.getLogger', (['""""""'], {}), "('')\n", (493, 497), False, 'import logging\n'), ((3344, 3369), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (3367, 3369), False, 'import argparse\n'), ((4426, 4459), 'logging.StreamHandler', 'logging.StreamHandler', (... |
import socket
import ssl
from time import sleep
import string
from random import randint, choice
# TLS Server properties
HOST = ""
PORT = 5069
max_client = 5
# TLS Identities
cert_file = "280993_cert.pem"
key_file = "280993_key.pem"
# Create TCP socket over ipv4 and bind it to given port and address. Se... | [
"random.choice",
"time.sleep",
"ssl.wrap_socket",
"socket.socket"
] | [((369, 418), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (382, 418), False, 'import socket\n'), ((718, 726), 'time.sleep', 'sleep', (['d'], {}), '(d)\n', (723, 726), False, 'from time import sleep\n'), ((1233, 1352), 'ssl.wrap_socket', 'ss... |
import numpy as np
import h5py
import argparse
np.random.seed(2019)
parser = argparse.ArgumentParser(description="Generate the diff data")
parser.add_argument("--valid", action="store_true")
parser.add_argument("--use_random", action="store_true")
# specify the interval
parser.add_argument("--bound", default=1, ty... | [
"argparse.ArgumentParser",
"h5py.File",
"numpy.array",
"numpy.random.randint",
"numpy.random.seed",
"numpy.arange"
] | [((51, 71), 'numpy.random.seed', 'np.random.seed', (['(2019)'], {}), '(2019)\n', (65, 71), True, 'import numpy as np\n'), ((81, 142), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Generate the diff data"""'}), "(description='Generate the diff data')\n", (104, 142), False, 'import argpar... |
from py_wittypi_device import WittyPiDevice
device = WittyPiDevice()
print(f'input voltage: {device.input_voltage}')
print(f'output voltage: {device.output_voltage}')
print(f'output current: {device.output_current}')
print()
n = 10
input_voltage = device.get_median_input_voltage(n)
print(f'median input voltage: {in... | [
"py_wittypi_device.WittyPiDevice"
] | [((54, 69), 'py_wittypi_device.WittyPiDevice', 'WittyPiDevice', ([], {}), '()\n', (67, 69), False, 'from py_wittypi_device import WittyPiDevice\n')] |
# This software is Copyright 2017 The Regents of the University of California. All Rights Reserved. Permission to copy, modify, and distribute this software and its documentation for educational, research and non-profit purposes, without fee, and without a written agreement is hereby granted, provided that the above co... | [
"random.uniform",
"hg19util.interval_list",
"bam_to_breakpoint.bam_to_breakpoint",
"argparse.ArgumentParser",
"matplotlib.use",
"os.path.splitext",
"os.path.abspath",
"os.path.basename",
"pysam.Samfile",
"time.time"
] | [((2027, 2048), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (2041, 2048), False, 'import matplotlib\n'), ((2275, 2371), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Reconstruct Amplicons connected to listed intervals."""'}), "(description=\n 'Reconstruct Am... |
import logging
import platform
from unittest.mock import Mock
from sanic import __version__
from sanic.application.logo import BASE_LOGO
from sanic.application.motd import MOTDTTY
def test_logo_base(app, run_startup):
logs = run_startup(app)
assert logs[0][1] == logging.DEBUG
assert logs[0][2] == BASE_... | [
"platform.platform",
"sanic.application.motd.MOTDTTY",
"unittest.mock.Mock",
"platform.python_version"
] | [((1385, 1391), 'unittest.mock.Mock', 'Mock', ([], {}), '()\n', (1389, 1391), False, 'from unittest.mock import Mock\n'), ((1403, 1428), 'sanic.application.motd.MOTDTTY', 'MOTDTTY', (['None', '""""""', '{}', '{}'], {}), "(None, '', {}, {})\n", (1410, 1428), False, 'from sanic.application.motd import MOTDTTY\n'), ((1552... |
# ex: set sts=4 ts=4 sw=4 noet:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the reproman package for the
# copyright and license terms.
#
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
"""Helper utils to... | [
"reproman.utils.safe_write",
"yaml.safe_dump"
] | [((1205, 1292), 'yaml.safe_dump', 'yaml.safe_dump', (['rec'], {'encoding': '"""utf-8"""', 'allow_unicode': '(True)', 'default_flow_style': '(False)'}), "(rec, encoding='utf-8', allow_unicode=True,\n default_flow_style=False)\n", (1219, 1292), False, 'import yaml\n'), ((1019, 1067), 'reproman.utils.safe_write', 'safe... |
import json
import sqlite3
from scrapekit.logs import log_path
conn = sqlite3.connect(':memory:')
def dict_factory(cursor, row):
d = {}
for idx, col in enumerate(cursor.description):
d[col[0]] = row[idx]
return d
def log_parse(scraper):
path = log_path(scraper)
with open(path, 'r') as... | [
"scrapekit.logs.log_path",
"json.loads",
"sqlite3.connect"
] | [((73, 100), 'sqlite3.connect', 'sqlite3.connect', (['""":memory:"""'], {}), "(':memory:')\n", (88, 100), False, 'import sqlite3\n'), ((275, 292), 'scrapekit.logs.log_path', 'log_path', (['scraper'], {}), '(scraper)\n', (283, 292), False, 'from scrapekit.logs import log_path\n'), ((368, 384), 'json.loads', 'json.loads'... |
import torch
from torch.nn.functional import mse_loss
from all.core import State
from ._agent import Agent
class VPG(Agent):
'''
Vanilla Policy Gradient (VPG/REINFORCE).
VPG (also known as REINFORCE) is the least biased implementation of the policy gradient theorem.
It uses complete episode rollouts as... | [
"torch.nn.functional.mse_loss",
"torch.stack",
"all.core.State.from_list",
"torch.tensor",
"torch.flip",
"torch.cat"
] | [((2881, 2912), 'all.core.State.from_list', 'State.from_list', (['self._features'], {}), '(self._features)\n', (2896, 2912), False, 'from all.core import State\n'), ((2931, 2982), 'torch.tensor', 'torch.tensor', (['self._rewards'], {'device': 'features.device'}), '(self._rewards, device=features.device)\n', (2943, 2982... |
from pathlib import Path
from django.core.files.base import ContentFile
from django.utils.encoding import force_bytes
from mayan.apps.mimetype.api import get_mimetype
from mayan.apps.storage.utils import fs_cleanup, mkdtemp
from mayan.apps.testing.tests.base import BaseTestCase
from ..backends.compressedstorage impo... | [
"django.core.files.base.ContentFile",
"pathlib.Path",
"mayan.apps.storage.utils.mkdtemp",
"django.utils.encoding.force_bytes",
"mayan.apps.storage.utils.fs_cleanup",
"mayan.apps.mimetype.api.get_mimetype"
] | [((655, 664), 'mayan.apps.storage.utils.mkdtemp', 'mkdtemp', ([], {}), '()\n', (662, 664), False, 'from mayan.apps.storage.utils import fs_cleanup, mkdtemp\n'), ((698, 743), 'mayan.apps.storage.utils.fs_cleanup', 'fs_cleanup', ([], {'filename': 'self.temporary_directory'}), '(filename=self.temporary_directory)\n', (708... |
import pandas as pd
import numpy as np
from Sloth import cluster
import matplotlib
#matplotlib.use('TkAgg')
#matplotlib.use('Agg')
import matplotlib.pyplot as plt
from tslearn.preprocessing import TimeSeriesScalerMeanVariance
from collections import Counter
#Sloth = Sloth()
datapath = 'post_frequency_8.09_8.15.csv'
s... | [
"matplotlib.pyplot.title",
"pandas.read_csv",
"Sloth.cluster.LoadSimilarityMatrix",
"Sloth.cluster.GenerateSimilarityMatrix",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"Sloth.cluster.SaveSimilarityMatrix",
"Sloth.cluster.ClusterSimilarityMatrix",
"matplotlib.pyplot.xlim",
"matp... | [((328, 370), 'pandas.read_csv', 'pd.read_csv', (['datapath'], {'dtype': 'str', 'header': '(0)'}), '(datapath, dtype=str, header=0)\n', (339, 370), True, 'import pandas as pd\n'), ((1262, 1329), 'Sloth.cluster.ClusterSimilarityMatrix', 'cluster.ClusterSimilarityMatrix', (['SimilarityMatrix', 'eps', 'min_samples'], {}),... |
"""
A simple Pipeline algorithm that longs the top 3 stocks by RSI and shorts
the bottom 3 each day.
"""
from six import viewkeys
from zipline.api import (
attach_pipeline,
date_rules,
order_target_percent,
pipeline_output,
record,
schedule_function,
)
from zipline.finance import commission
from... | [
"six.viewkeys",
"zipline.api.date_rules.every_day",
"zipline.pipeline.factors.RSI",
"zipline.api.pipeline_output",
"zipline.api.order_target_percent",
"zipline.finance.commission.PerShare",
"pandas.Timestamp"
] | [((428, 433), 'zipline.pipeline.factors.RSI', 'RSI', ([], {}), '()\n', (431, 433), False, 'from zipline.pipeline.factors import RSI\n'), ((2209, 2239), 'zipline.api.pipeline_output', 'pipeline_output', (['"""my_pipeline"""'], {}), "('my_pipeline')\n", (2224, 2239), False, 'from zipline.api import attach_pipeline, date_... |
import os
from flask import g, request, jsonify, make_response
from flask_sqlalchemy import SQLAlchemy
from .app import app
from .conf import CONFIG
from .utils import get_allowed_service
from DeviceManager.Logger import Log
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.config['SQLALCHEMY_DATABASE_URI'] = ... | [
"flask_sqlalchemy.SQLAlchemy",
"os.environ.get",
"DeviceManager.Logger.Log",
"flask.jsonify"
] | [((1232, 1270), 'os.environ.get', 'os.environ.get', (['"""SINGLE_TENANT"""', '(False)'], {}), "('SINGLE_TENANT', False)\n", (1246, 1270), False, 'import os\n'), ((1298, 1313), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', (['app'], {}), '(app)\n', (1308, 1313), False, 'from flask_sqlalchemy import SQLAlchemy\n'), ((386,... |
# Copyright (C) 2010 Google Inc. All rights reserved.
# Copyright (C) 2010 <NAME> (<EMAIL>), University of Szeged
#
# 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 th... | [
"logging.getLogger",
"blinkpy.web_tests.models.test_failures.has_failure_type",
"blinkpy.web_tests.models.test_expectations.EXPECTATION_DESCRIPTIONS.keys",
"collections.defaultdict",
"time.time"
] | [((1809, 1836), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1826, 1836), False, 'import logging\n'), ((7925, 7954), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (7948, 7954), False, 'import collections\n'), ((3100, 3149), 'blinkpy.web_tests.models.... |
import subprocess
print(subprocess.run(["./fib"]))
| [
"subprocess.run"
] | [((25, 50), 'subprocess.run', 'subprocess.run', (["['./fib']"], {}), "(['./fib'])\n", (39, 50), False, 'import subprocess\n')] |
from django import forms
class PaymillForm(forms.Form):
token = forms.CharField(widget=forms.HiddenInput())
| [
"django.forms.HiddenInput"
] | [((93, 112), 'django.forms.HiddenInput', 'forms.HiddenInput', ([], {}), '()\n', (110, 112), False, 'from django import forms\n')] |
# -*- coding: utf-8 -*-
from django.core.mail import mail_managers
from django.template.loader import render_to_string
import os
import requests
from freeze import settings, parser
def scan( site_url = settings.FREEZE_SITE_URL, base_url = settings.FREEZE_BASE_URL, relative_urls = settings.FREEZE_RELATIVE_URLS, loc... | [
"os.path.join",
"requests.get",
"freeze.parser.replace_base_url",
"freeze.parser.parse_html_urls",
"freeze.parser.parse_sitemap_urls",
"django.template.loader.render_to_string"
] | [((706, 733), 'freeze.parser.parse_sitemap_urls', 'parser.parse_sitemap_urls', ([], {}), '()\n', (731, 733), False, 'from freeze import settings, parser\n'), ((1661, 1703), 'requests.get', 'requests.get', (['url'], {'headers': 'request_headers'}), '(url, headers=request_headers)\n', (1673, 1703), False, 'import request... |
"""
Convert between text notebook metadata and jupyter cell metadata.
Standard cell metadata are documented here:
See also https://ipython.org/ipython-doc/3/notebook/nbformat.html#cell-metadata
"""
import ast
import re
from json import dumps, loads
try:
from json import JSONDecodeError
except ImportError:
JS... | [
"re.split",
"json.loads",
"re.compile",
"json.dumps",
"ast.literal_eval"
] | [((1880, 1925), 're.compile', 're.compile', (['"""^[a-zA-Z_\\\\.]+[a-zA-Z0-9_\\\\.]*$"""'], {}), "('^[a-zA-Z_\\\\.]+[a-zA-Z0-9_\\\\.]*$')\n", (1890, 1925), False, 'import re\n'), ((8865, 8894), 're.split', 're.split', (['"""\\\\s|,"""', 'options', '(1)'], {}), "('\\\\s|,', options, 1)\n", (8873, 8894), False, 'import r... |