code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from typing import TYPE_CHECKING, Any, Dict, List
from aiopoke.utils.minimal_resources import MinimalResource
from aiopoke.utils.resource import Resource
if TYPE_CHECKING:
from aiopoke.objects.resources import EncounterConditionValue, EncounterMethod
class Encounter(Resource):
min_level: int
max_level: ... | [
"aiopoke.utils.minimal_resources.MinimalResource"
] | [((910, 935), 'aiopoke.utils.minimal_resources.MinimalResource', 'MinimalResource', ([], {}), '(**method)\n', (925, 935), False, 'from aiopoke.utils.minimal_resources import MinimalResource\n'), ((774, 808), 'aiopoke.utils.minimal_resources.MinimalResource', 'MinimalResource', ([], {}), '(**condition_value)\n', (789, 8... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from setuptools import setup
setup(name='starsearch',
version='0.3',
description='Package to dig into the ESO archives',
author='<NAME>',
author_email='<EMAIL>',
license='MIT',
url='https://github.com/jdavidrcamacho/starsearch',
p... | [
"setuptools.setup"
] | [((77, 373), 'setuptools.setup', 'setup', ([], {'name': '"""starsearch"""', 'version': '"""0.3"""', 'description': '"""Package to dig into the ESO archives"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'license': '"""MIT"""', 'url': '"""https://github.com/jdavidrcamacho/starsearch"""', 'packages': "['... |
import os
import tempfile
from unittest.mock import patch
from galaxy.exceptions import (
ObjectNotFound,
ReferenceDataError,
)
from galaxy_test.driver import integration_util
BUILDS_DATA = (
"?\tunspecified (?)",
"hg_test\tdescription of hg_test",
"hg_test_nolen\tdescription of hg_test_nolen",
)
... | [
"tempfile.NamedTemporaryFile",
"os.path.join",
"os.makedirs",
"unittest.mock.patch.object"
] | [((711, 735), 'os.makedirs', 'os.makedirs', (['genomes_dir'], {}), '(genomes_dir)\n', (722, 735), False, 'import os\n'), ((990, 1029), 'os.path.join', 'os.path.join', (['genomes_dir', '"""builds.txt"""'], {}), "(genomes_dir, 'builds.txt')\n", (1002, 1029), False, 'import os\n'), ((1419, 1458), 'os.path.join', 'os.path.... |
import numpy as np
import pandas as pd
import os
from tqdm import tqdm
import pacmap
import matplotlib.pyplot as plt
from sklearn.manifold import TSNE
import umap
def darius1(numberDirectory):
path = ""
if(numberDirectory == 1):
directorys = [
['training_setA/training/', 'p0']
]
... | [
"pacmap.PaCMAP",
"os.listdir",
"pandas.read_csv",
"sklearn.manifold.TSNE",
"matplotlib.pyplot.scatter",
"pandas.notnull",
"pandas.concat",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((845, 859), 'pandas.concat', 'pd.concat', (['dfs'], {}), '(dfs)\n', (854, 859), True, 'import pandas as pd\n'), ((1428, 1497), 'pacmap.PaCMAP', 'pacmap.PaCMAP', ([], {'n_dims': '(2)', 'n_neighbors': 'None', 'MN_ratio': '(0.5)', 'FP_ratio': '(2.0)'}), '(n_dims=2, n_neighbors=None, MN_ratio=0.5, FP_ratio=2.0)\n', (1441... |
import torch
from torch import nn
from torch.autograd import Variable
import config
def init_weights(self):
for m in self.modules():
if isinstance(m, nn.Conv2d):
nn.init.xavier_normal_(m.weight)
if m.bias is not None:
nn.init.constant_(m.bias, 0)
def conv(in_chann... | [
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.init.constant_",
"torch.nn.Sequential",
"torch.nn.Conv2d",
"torch.nn.init.xavier_normal_",
"torch.nn.Linear",
"torch.nn.AvgPool2d",
"torch.randn",
"torch.cat"
] | [((395, 464), 'torch.nn.Conv2d', 'nn.Conv2d', (['in_channels', 'out_channels', 'kernel_size', 'stride'], {'bias': '(False)'}), '(in_channels, out_channels, kernel_size, stride, bias=False)\n', (404, 464), False, 'from torch import nn\n'), ((474, 502), 'torch.nn.BatchNorm2d', 'nn.BatchNorm2d', (['out_channels'], {}), '(... |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | [
"jax.nn.initializers.glorot_uniform",
"internal.mip.integrated_pos_enc",
"jax.numpy.pad",
"jax.tree_map",
"internal.utils.shard",
"internal.mip.volumetric_rendering",
"jax.random.split",
"internal.mip.pos_enc",
"jax.random.PRNGKey",
"jax.device_count",
"jax.numpy.concatenate",
"jax.random.norm... | [((5039, 5092), 'jax.numpy.linspace', 'jnp.linspace', (['min_freq_log2', 'max_freq_log2', 'num_bands'], {}), '(min_freq_log2, max_freq_log2, num_bands)\n', (5051, 5092), True, 'import jax.numpy as jnp\n'), ((5099, 5132), 'jax.numpy.clip', 'jnp.clip', (['(alpha - bands)', '(0.0)', '(1.0)'], {}), '(alpha - bands, 0.0, 1.... |
# -*- encoding: utf-8 -*-
try:
import unittest2 as unittest
except ImportError:
import unittest
from multiprocessing import Manager
from random import randint
import logging
import sys
import os
import copy
import shutil
# add kamma path
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dir... | [
"logging.getLogger",
"kamma.wait_fixed",
"logging.StreamHandler",
"copy.deepcopy",
"logging.Formatter",
"os.path.dirname",
"kamma.Worker",
"kamma.AbortTask",
"kamma.stop_after_attempt",
"shutil.rmtree",
"unittest.main",
"random.randint",
"multiprocessing.Manager"
] | [((407, 430), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (428, 430), False, 'import logging\n'), ((562, 592), 'logging.getLogger', 'logging.getLogger', (['"""kamma.app"""'], {}), "('kamma.app')\n", (579, 592), False, 'import logging\n'), ((685, 717), 'logging.getLogger', 'logging.getLogger', ([... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | [
"six.with_metaclass"
] | [((1154, 1205), 'six.with_metaclass', 'with_metaclass', (['_CaseInsensitiveEnumMeta', 'str', 'Enum'], {}), '(_CaseInsensitiveEnumMeta, str, Enum)\n', (1168, 1205), False, 'from six import with_metaclass\n'), ((1496, 1547), 'six.with_metaclass', 'with_metaclass', (['_CaseInsensitiveEnumMeta', 'str', 'Enum'], {}), '(_Cas... |
#!/usr/bin/env python2
# -*- mode: python -*-
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2016 The Electrum developers
#
# 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... | [
"threading.Lock",
"electrumsv.i18n._",
"electrumsv.logs.logs.get_logger",
"electrumsv.util.versiontuple"
] | [((1401, 1417), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (1415, 1417), False, 'import threading\n'), ((1559, 1587), 'electrumsv.logs.logs.get_logger', 'logs.get_logger', (['device_kind'], {}), '(device_kind)\n', (1574, 1587), False, 'from electrumsv.logs import logs\n'), ((3975, 4017), 'electrumsv.i18n._',... |
import csv
input = open('MovieI.csv', 'rb')
output = open('MovieO.csv', 'wb')
writer = csv.writer(output)
for row in csv.reader(input):
for i in range(len(row)):
if(row[0]==''):
break
elif(row[1]==''):
break
elif(row[2]==''):
break
elif(row[3]==''... | [
"csv.writer",
"csv.reader"
] | [((88, 106), 'csv.writer', 'csv.writer', (['output'], {}), '(output)\n', (98, 106), False, 'import csv\n'), ((118, 135), 'csv.reader', 'csv.reader', (['input'], {}), '(input)\n', (128, 135), False, 'import csv\n')] |
### ----------- Python Code ------------###
import csv
from flask import Flask, render_template
from flask_ask import Ask, statement, question, session
import pandas as pd
### ------------- Start Alexa Stuff ---------###
app = Flask(__name__)
ask = Ask(app, "/")
#logging.getLogger("flask_ask").setLevel(logging.DE... | [
"flask_ask.Ask",
"pandas.read_csv",
"flask.Flask",
"flask_ask.statement",
"flask_ask.question"
] | [((233, 248), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (238, 248), False, 'from flask import Flask, render_template\n'), ((255, 268), 'flask_ask.Ask', 'Ask', (['app', '"""/"""'], {}), "(app, '/')\n", (258, 268), False, 'from flask_ask import Ask, statement, question, session\n'), ((443, 476), 'pandas... |
# Copyright 2021 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acco... | [
"numpy.iinfo",
"numpy.isin",
"numpy.ascontiguousarray",
"numpy.argsort",
"numpy.array",
"scipy.sparse.sputils.get_index_dtype",
"numpy.save",
"numpy.arange",
"scipy.sparse.sputils.upcast",
"numpy.empty",
"scipy.sparse.coo_matrix",
"scipy.sparse.csr_matrix",
"sklearn.utils.extmath.randomized_... | [((33975, 34028), 'collections.namedtuple', 'collections.namedtuple', (['"""Metrics"""', "['prec', 'recall']"], {}), "('Metrics', ['prec', 'recall'])\n", (33997, 34028), False, 'import collections\n'), ((1542, 1610), 'scipy.sparse.sputils.get_index_dtype', 'smat.sputils.get_index_dtype', (['indices'], {'check_contents'... |
#!/usr/bin/env python
import os
import sys
def midi_to_freq(num):
""" Takes a MIDI number and returns a frequency in Hz for corresponding note. """
num_a = num - 69
freq = 440 * 2**(num_a / 12.0)
return freq
def fp(relative):
#if hasattr(sys, "_MEIPASS"):
# return os.path.join(sys._MEIPASS,... | [
"os.path.join"
] | [((342, 364), 'os.path.join', 'os.path.join', (['relative'], {}), '(relative)\n', (354, 364), False, 'import os\n')] |
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
import os
import sys
import shutil
import inspect
from ferenda import TextReader, util
from ferenda.testutil import RepoTester, file_parametrize
from ferenda.compa... | [
"os.path.exists",
"inspect.getmembers",
"ferenda.TextReader",
"os.path.basename",
"ferenda.util.readfile",
"inspect.isclass",
"ferenda.testutil.file_parametrize"
] | [((2841, 2895), 'ferenda.testutil.file_parametrize', 'file_parametrize', (['Parse', '"""test/files/myndfskr"""', '""".txt"""'], {}), "(Parse, 'test/files/myndfskr', '.txt')\n", (2857, 2895), False, 'from ferenda.testutil import RepoTester, file_parametrize\n'), ((864, 892), 'inspect.getmembers', 'inspect.getmembers', (... |
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import... | [
"OpenGL.platform.types",
"OpenGL.constant.Constant",
"OpenGL.platform.createFunction"
] | [((552, 602), 'OpenGL.constant.Constant', '_C', (['"""GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT"""', '(36263)'], {}), "('GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT', 36263)\n", (554, 602), True, 'from OpenGL.constant import Constant as _C\n'), ((648, 704), 'OpenGL.constant.Constant', '_C', (['"""GL_FRAMEBUFFER_ATTACHMENT_TEXTUR... |
from plumbum import local
import benchbuild as bb
from benchbuild.environments.domain.declarative import ContainerImage
from benchbuild.source import HTTP
from benchbuild.utils.cmd import make, tar
class XZ(bb.Project):
""" XZ """
VERSION = '5.2.1'
NAME = 'xz'
DOMAIN = 'compression'
GROUP = 'benc... | [
"benchbuild.environments.domain.declarative.ContainerImage",
"benchbuild.source.HTTP",
"benchbuild.compiler.cc",
"benchbuild.utils.cmd.tar",
"plumbum.local.path",
"benchbuild.wrap",
"benchbuild.watch",
"plumbum.local.cwd"
] | [((352, 439), 'benchbuild.source.HTTP', 'HTTP', ([], {'remote': "{'5.2.1': 'http://tukaani.org/xz/xz-5.2.1.tar.gz'}", 'local': '"""xz.tar.gz"""'}), "(remote={'5.2.1': 'http://tukaani.org/xz/xz-5.2.1.tar.gz'}, local=\n 'xz.tar.gz')\n", (356, 439), False, 'from benchbuild.source import HTTP\n'), ((478, 578), 'benchbui... |
import numpy as np
import csv
import cv2
from keras.models import Sequential
from keras.layers import Dense, Flatten
def load_data():
lines = []
with open('Data/driving_log.csv') as csvfile:
reader = csv.reader(csvfile)
for line in reader:
lines.append(line)
images = []
mea... | [
"keras.layers.Flatten",
"keras.models.Sequential",
"numpy.array",
"csv.reader",
"keras.layers.Dense",
"cv2.imread"
] | [((645, 661), 'numpy.array', 'np.array', (['images'], {}), '(images)\n', (653, 661), True, 'import numpy as np\n'), ((676, 698), 'numpy.array', 'np.array', (['measurements'], {}), '(measurements)\n', (684, 698), True, 'import numpy as np\n'), ((769, 781), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (779,... |
from abc import get_cache_token
from collections import OrderedDict
from torch import nn
class ResidualBlock(nn.Module):
def __init__(self, in_size, out_size):
super().__init__()
self.in_size, self.out_size = in_size, out_size
self.blocks = nn.Identity()
self.shortcut = nn.Identit... | [
"torch.nn.Identity",
"torch.nn.Linear"
] | [((272, 285), 'torch.nn.Identity', 'nn.Identity', ([], {}), '()\n', (283, 285), False, 'from torch import nn\n'), ((310, 323), 'torch.nn.Identity', 'nn.Identity', ([], {}), '()\n', (321, 323), False, 'from torch import nn\n'), ((1317, 1355), 'torch.nn.Linear', 'nn.Linear', (['self.in_size', 'self.out_size'], {}), '(sel... |
"""
Tests asserting that ModelTypes convert to and from json when working
with ModelDatas
"""
# Allow inspection of private class members
# pylint: disable=protected-access
from mock import Mock
from xblock.core import XBlock
from xblock.fields import Field, Scope, ScopeIds
from xblock.field_data import DictFieldData
... | [
"mock.Mock",
"xblock.test.tools.TestRuntime"
] | [((1487, 1535), 'xblock.test.tools.TestRuntime', 'TestRuntime', ([], {'services': "{'field-data': field_data}"}), "(services={'field-data': field_data})\n", (1498, 1535), False, 'from xblock.test.tools import TestRuntime\n'), ((1586, 1605), 'mock.Mock', 'Mock', ([], {'spec': 'ScopeIds'}), '(spec=ScopeIds)\n', (1590, 16... |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | [
"tensorflow.compat.v2.distribute.OneDeviceStrategy",
"tensorflow.compat.v2.compat.v1.distribute.experimental.ParameterServerStrategy",
"six.moves.range",
"json.dumps",
"numpy.log",
"numpy.argmax",
"numpy.equal",
"absl.logging.info",
"numpy.square",
"numpy.stack",
"tensorflow.compat.v2.keras.mode... | [((1132, 1179), 'json.dumps', 'json.dumps', (['x'], {'indent': '(2)', 'cls': '_SimpleJsonEncoder'}), '(x, indent=2, cls=_SimpleJsonEncoder)\n', (1142, 1179), False, 'import json\n'), ((1244, 1301), 'absl.logging.info', 'logging.info', (['"""Recording config to %s\n %s"""', 'path', 'out'], {}), '("""Recording config to ... |
from __future__ import division, print_function, absolute_import
from .core import SeqletCoordinates
from modisco import util
import numpy as np
from collections import defaultdict, Counter, OrderedDict
import itertools
import sys
import time
from .value_provider import (
AbstractValTransformer, AbsPercentileValTra... | [
"matplotlib.pyplot.ylabel",
"numpy.log",
"numpy.array",
"numpy.percentile",
"numpy.random.RandomState",
"numpy.histogram",
"matplotlib.pyplot.xlabel",
"numpy.concatenate",
"numpy.maximum",
"sys.stdout.flush",
"modisco.util.load_string_list",
"numpy.abs",
"numpy.ceil",
"numpy.floor",
"num... | [((33997, 34011), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (34009, 34011), True, 'from matplotlib import pyplot as plt\n'), ((5463, 5513), 'modisco.util.load_string_list', 'util.load_string_list', ([], {'dset_name': '"""coords"""', 'grp': 'grp'}), "(dset_name='coords', grp=grp)\n", (5484, 5513), ... |
# =============================================================================== #
# #
# This file has been generated automatically!! Do not change this manually! #
# ... | [
"pydantic.Field"
] | [((3037, 3067), 'pydantic.Field', 'Field', (['"""update"""'], {'alias': '"""@type"""'}), "('update', alias='@type')\n", (3042, 3067), False, 'from pydantic import Field\n'), ((3491, 3540), 'pydantic.Field', 'Field', (['"""updateActiveNotifications"""'], {'alias': '"""@type"""'}), "('updateActiveNotifications', alias='@... |
import json
from django.utils.translation import ugettext as _
from django.http import HttpResponse, HttpResponseRedirect
from django.template import RequestContext
from django.utils.encoding import smart_str
from django.shortcuts import render_to_response
from forum.modules import decorate
from forum import views
fro... | [
"forum.modules.decorate",
"json.dumps",
"django.template.RequestContext",
"lib.akismet.Akismet",
"django.utils.encoding.smart_str",
"django.utils.translation.ugettext",
"forum.forms.general.SimpleCaptchaForm"
] | [((2800, 2827), 'forum.modules.decorate', 'decorate', (['views.writers.ask'], {}), '(views.writers.ask)\n', (2808, 2827), False, 'from forum.modules import decorate\n'), ((2863, 2893), 'forum.modules.decorate', 'decorate', (['views.writers.answer'], {}), '(views.writers.answer)\n', (2871, 2893), False, 'from forum.modu... |
"""
Translate an element, which is described by the YAML method file
and a descriptor file, into a target function.
Procedure:
1. When analyzing a YAML file, parse the call to the method-element, to get:
- list of inputs,
- list of outputs
2. Parse the YAML of that element, to know the name of the inputs and outputs... | [
"re.search"
] | [((4561, 4597), 're.search', 're.search', (['var_pattern', 'rolling_code'], {}), '(var_pattern, rolling_code)\n', (4570, 4597), False, 'import re\n'), ((4621, 4657), 're.search', 're.search', (['var_pattern', 'rolling_code'], {}), '(var_pattern, rolling_code)\n', (4630, 4657), False, 'import re\n'), ((4686, 4722), 're.... |
#!/usr/bin/env python3
import csv
import gzip
import json
import networkx as nx
import sys
import time
import utils
from argparse import ArgumentParser
from calculate_activity_network import embedded_extended_tweet_url, root_of_conversation
from collections import defaultdict
from datetime import datetime
from utils ... | [
"utils.extract_text",
"time.strptime",
"csv.DictReader",
"utils.lowered_hashtags_from",
"argparse.ArgumentParser",
"gzip.open",
"calculate_activity_network.embedded_extended_tweet_url",
"utils.ts_to_str",
"time.mktime",
"utils.expanded_urls_from",
"utils.epoch_seconds_2_ts",
"utils.mentioned_i... | [((1961, 2001), 'time.strptime', 'time.strptime', (['ts_str', 'TWITTER_TS_FORMAT'], {}), '(ts_str, TWITTER_TS_FORMAT)\n', (1974, 2001), False, 'import time\n'), ((7645, 7694), 'utils.ts_to_str', 'utils.ts_to_str', (['t_0'], {'fmt': 'utils.TWITTER_TS_FORMAT'}), '(t_0, fmt=utils.TWITTER_TS_FORMAT)\n', (7660, 7694), False... |
from django.http import QueryDict
from django.http.response import JsonResponse
from rest_framework import viewsets, status
from rest_framework.views import APIView
from .serializers import *
class UserInfoViewSet(viewsets.ModelViewSet):
queryset = UserInfoModel.objects.all()
serializer_class = UserInfoSerial... | [
"django.http.QueryDict",
"django.http.response.JsonResponse"
] | [((843, 990), 'django.http.response.JsonResponse', 'JsonResponse', (["{'code': True, 'status': status.HTTP_200_OK, 'response': serializer.data,\n 'message': 'SEARCH_SUCCESS'}"], {'status': 'status.HTTP_200_OK'}), "({'code': True, 'status': status.HTTP_200_OK, 'response':\n serializer.data, 'message': 'SEARCH_SUCC... |
import os
import re
import sys
def spec_replacer(match):
if match.group(0) == ' ':
return '^_'
return '^' + match.group(0)
def create_content(type, major, minor, level, edit):
python_dir = '/python$root'
python_dir_len = len(python_dir)
all_dirs = []
all_files = []
spec_pattern = r... | [
"getopt.getopt",
"os.path.splitext",
"os.walk",
"re.compile"
] | [((319, 343), 're.compile', 're.compile', (['"""([. ^+()])"""'], {}), "('([. ^+()])')\n", (329, 343), False, 'import re\n'), ((373, 392), 'os.walk', 'os.walk', (['python_dir'], {}), '(python_dir)\n', (380, 392), False, 'import os\n'), ((4349, 4434), 'getopt.getopt', 'getopt.getopt', (['sys.argv[1:]', '""""""', "['type=... |
from flatifylists import flatifyList
example = [[[1,2], [3,[4,[5],6],7],8,9]]
print(flatifyList(example)) | [
"flatifylists.flatifyList"
] | [((86, 106), 'flatifylists.flatifyList', 'flatifyList', (['example'], {}), '(example)\n', (97, 106), False, 'from flatifylists import flatifyList\n')] |
import unittest
from sys import argv
import numpy as np
import torch
from objective.ridge import Ridge, Ridge_ClosedForm, Ridge_Gradient
from .utils import Container, assert_all_close, assert_all_close_dict
def _init_ridge(cls):
np.random.seed(1234)
torch.manual_seed(1234)
n_features = 3
n_samples ... | [
"torch.manual_seed",
"objective.ridge.Ridge_Gradient",
"torch.tensor",
"numpy.random.seed",
"objective.ridge.Ridge_ClosedForm",
"unittest.main",
"torch.randn"
] | [((237, 257), 'numpy.random.seed', 'np.random.seed', (['(1234)'], {}), '(1234)\n', (251, 257), True, 'import numpy as np\n'), ((262, 285), 'torch.manual_seed', 'torch.manual_seed', (['(1234)'], {}), '(1234)\n', (279, 285), False, 'import torch\n'), ((486, 532), 'torch.randn', 'torch.randn', (['n_features', '(1)'], {'re... |
from instanotifier.fetcher import tests
def run():
# is executed when ran with 'manage.py runscript tests'
tests.test_rss_fetcher()
| [
"instanotifier.fetcher.tests.test_rss_fetcher"
] | [((117, 141), 'instanotifier.fetcher.tests.test_rss_fetcher', 'tests.test_rss_fetcher', ([], {}), '()\n', (139, 141), False, 'from instanotifier.fetcher import tests\n')] |
import sqlite3
def main():
# se establece conexion con la BD y abro cursor
conn = sqlite3.connect("alumnos.db")
cursor = conn.cursor()
# creo una tupla de tuplas para agregar registros a la tabla
alumnos = (
(1, "Juan", "Granizado", 8, 25),
(2, "Esteban", "Quito", 2, 19),
... | [
"sqlite3.connect"
] | [((92, 121), 'sqlite3.connect', 'sqlite3.connect', (['"""alumnos.db"""'], {}), "('alumnos.db')\n", (107, 121), False, 'import sqlite3\n')] |
import sqlite3
con = sqlite3.connect('agenda.db')
cursor = con.cursor()
cursor.execute('''
create table if not exists agenda(
nome text,
telefone text)
''')
cursor.execute('''
insert into agenda(nome, telefone)
values(?, ?)
''', ("Tamara", "51-98175-05... | [
"sqlite3.connect"
] | [((21, 49), 'sqlite3.connect', 'sqlite3.connect', (['"""agenda.db"""'], {}), "('agenda.db')\n", (36, 49), False, 'import sqlite3\n')] |
import logging
import math
import re
import time
import dask
import numpy as np
import requests
import json
import xml.etree.ElementTree as ET
from falconcv.data.scraper.scraper import ImagesScraper
from falconcv.util import ImageUtil
logger = logging.getLogger(__name__)
FLICKR_ENDPOINT = "https://www.flickr.com/servic... | [
"logging.getLogger",
"json.loads",
"math.ceil",
"dask.compute",
"time.sleep",
"xml.etree.ElementTree.fromstring",
"falconcv.util.ImageUtil.url2img",
"re.search"
] | [((244, 271), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (261, 271), False, 'import logging\n'), ((3765, 3802), 'math.ceil', 'math.ceil', (['(total_matches / batch_size)'], {}), '(total_matches / batch_size)\n', (3774, 3802), False, 'import math\n'), ((1565, 1586), 'json.loads', 'json... |
# pip install -U pywinauto
from pywinauto.application import Application
import subprocess
import time
subprocess.run('SCHTASKS /DELETE /TN BuildTasks\\Sites /f')
app = Application(backend='uia')
app.start('C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe --force-renderer-accessibility ')
window = app.top_win... | [
"pywinauto.application.Application",
"subprocess.run",
"time.sleep"
] | [((103, 162), 'subprocess.run', 'subprocess.run', (['"""SCHTASKS /DELETE /TN BuildTasks\\\\Sites /f"""'], {}), "('SCHTASKS /DELETE /TN BuildTasks\\\\Sites /f')\n", (117, 162), False, 'import subprocess\n'), ((169, 195), 'pywinauto.application.Application', 'Application', ([], {'backend': '"""uia"""'}), "(backend='uia')... |
# ----------------------------------------------------------------------
# Migrate SLAProbe to workflow
# ----------------------------------------------------------------------
# Copyright (C) 2007-2021 The NOC Project
# See LICENSE for details
# ----------------------------------------------------------------------
... | [
"bson.ObjectId"
] | [((737, 773), 'bson.ObjectId', 'ObjectId', (['"""607a7e1d3d18d4fb3c12032a"""'], {}), "('607a7e1d3d18d4fb3c12032a')\n", (745, 773), False, 'from bson import ObjectId\n'), ((941, 977), 'bson.ObjectId', 'ObjectId', (['"""607a7dddff3a857a47600b9b"""'], {}), "('607a7dddff3a857a47600b9b')\n", (949, 977), False, 'from bson im... |
from ast import literal_eval
from collections import Counter
from typing import Dict, Optional
from anndata import AnnData
from spatialtis.config import Config, analysis_list
from ...utils import doc
from ..base import graph_position_interactive, graph_position_static
from .utils import query_df
@doc
def community... | [
"collections.Counter",
"ast.literal_eval"
] | [((1467, 1487), 'collections.Counter', 'Counter', (['nodes_types'], {}), '(nodes_types)\n', (1474, 1487), False, 'from collections import Counter\n'), ((1929, 1944), 'ast.literal_eval', 'literal_eval', (['n'], {}), '(n)\n', (1941, 1944), False, 'from ast import literal_eval\n'), ((2073, 2088), 'ast.literal_eval', 'lite... |
"""
Train shadow net script
"""
import argparse
import functools
import itertools
import os
import os.path as ops
import sys
import time
import numpy as np
import tensorflow as tf
import pprint
import shadownet
import six
from six.moves import xrange # pylint: disable=redefined-builtin
sys.path.append('/data/')
fr... | [
"itertools.chain",
"tensorflow.image.resize_images",
"tensorflow.shape",
"tensorflow.split",
"tensorflow.estimator.EstimatorSpec",
"tensorflow.gradients",
"tensorflow.group",
"local_utils.log_utils.init_logger",
"tensorflow.reduce_mean",
"tensorflow.cast",
"sys.path.append",
"shadownet.build_s... | [((291, 316), 'sys.path.append', 'sys.path.append', (['"""/data/"""'], {}), "('/data/')\n", (306, 316), False, 'import sys\n'), ((692, 770), 'tensorflow.app.flags.DEFINE_string', 'tf.app.flags.DEFINE_string', (['"""dataset_dir"""', '"""/data/data/tfrecords"""', '"""data path"""'], {}), "('dataset_dir', '/data/data/tfre... |
# Copyright 2014 CloudFounders NV
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
"os.path.isfile",
"os.path.exists",
"ovs.extensions.hypervisor.apis.vmware.sdk.Sdk"
] | [((953, 980), 'ovs.extensions.hypervisor.apis.vmware.sdk.Sdk', 'Sdk', (['ip', 'username', 'password'], {}), '(ip, username, password)\n', (956, 980), False, 'from ovs.extensions.hypervisor.apis.vmware.sdk import Sdk\n'), ((6953, 6977), 'os.path.exists', 'os.path.exists', (['filename'], {}), '(filename)\n', (6967, 6977)... |
# vim: set encoding=utf-8
import re
from lxml import etree
import logging
from regparser import content
from regparser.tree.depth import heuristics, rules, markers as mtypes
from regparser.tree.depth.derive import derive_depths
from regparser.tree.struct import Node
from regparser.tree.paragraph import p_level_of
from... | [
"regparser.tree.struct.Node",
"regparser.tree.xml_parser.tree_utils.get_paragraph_markers",
"regparser.tree.reg_text.build_subpart",
"regparser.tree.depth.rules.depth_type_order",
"regparser.tree.paragraph.p_level_of",
"regparser.tree.xml_parser.tree_utils.get_collapsed_markers",
"regparser.tree.depth.h... | [((1793, 1809), 'regparser.content.Macros', 'content.Macros', ([], {}), '()\n', (1807, 1809), False, 'from regparser import content\n'), ((2394, 2425), 'regparser.tree.struct.Node', 'Node', (['""""""', '[]', '[reg_part]', 'title'], {}), "('', [], [reg_part], title)\n", (2398, 2425), False, 'from regparser.tree.struct i... |
from distutils.core import setup
from setuptools import find_packages
setup(
name="stytra",
version="0.1",
author="<NAME>, <NAME> @portugueslab",
author_email="<EMAIL>",
license="MIT",
packages=find_packages(),
install_requires=[
"pyqtgraph>=0.10.0",
"numpy",
"numba... | [
"setuptools.find_packages"
] | [((220, 235), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (233, 235), False, 'from setuptools import find_packages\n')] |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'MainUi.ui'
#
# Created by: PyQt5 UI code generator 5.13.0
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWin... | [
"PyQt5.QtWidgets.QSpinBox",
"PyQt5.QtWidgets.QVBoxLayout",
"PyQt5.QtWidgets.QSizePolicy",
"PyQt5.QtWidgets.QStatusBar",
"PyQt5.QtWidgets.QGroupBox",
"PyQt5.QtWidgets.QLabel",
"PyQt5.QtWidgets.QPushButton",
"PyQt5.QtWidgets.QWidget",
"PyQt5.QtWidgets.QMenu",
"PyQt5.QtCore.QMetaObject.connectSlotsBy... | [((446, 534), 'PyQt5.QtWidgets.QSizePolicy', 'QtWidgets.QSizePolicy', (['QtWidgets.QSizePolicy.Minimum', 'QtWidgets.QSizePolicy.Minimum'], {}), '(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.\n Minimum)\n', (467, 534), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((892, 921), 'PyQt5.QtWidgets.QWid... |
from common import small_buffer
import pytest
import numpy as np
import pyarrow as pa
import vaex
def test_unique_arrow(df_factory):
ds = df_factory(x=vaex.string_column(['a', 'b', 'a', 'a', 'a', 'b', 'b', 'b', 'b', 'a']))
with small_buffer(ds, 2):
assert set(ds.unique(ds.x)) == {'a', 'b'}
v... | [
"common.small_buffer",
"pytest.mark.parametrize",
"numpy.array",
"vaex.string_column",
"numpy.isnan"
] | [((2694, 2742), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""future"""', '[False, True]'], {}), "('future', [False, True])\n", (2717, 2742), False, 'import pytest\n'), ((1088, 1143), 'numpy.array', 'np.array', (['[np.nan, 0, 1, np.nan, 2, np.nan]'], {'dtype': '"""f4"""'}), "([np.nan, 0, 1, np.nan, 2, np.... |
# utility functions for frequency related stuff
import numpy as np
import numpy.fft as fft
import math
def getFrequencyArray(fs, samples):
# frequencies go from to nyquist
nyquist = fs/2
return np.linspace(0, nyquist, samples)
# use this function for all FFT calculations
# then if change FFT later (i.e. FFTW), j... | [
"numpy.fft.rfft",
"numpy.linspace",
"numpy.fft.irfft",
"math.log"
] | [((200, 232), 'numpy.linspace', 'np.linspace', (['(0)', 'nyquist', 'samples'], {}), '(0, nyquist, samples)\n', (211, 232), True, 'import numpy as np\n'), ((462, 498), 'numpy.fft.rfft', 'fft.rfft', (['data'], {'norm': '"""ortho"""', 'axis': '(0)'}), "(data, norm='ortho', axis=0)\n", (470, 498), True, 'import numpy.fft a... |
# -*- coding: utf-8 -*-
# :Project: pglast -- Extract keywords from PostgreSQL header
# :Created: dom 06 ago 2017 23:34:53 CEST
# :Author: <NAME> <<EMAIL>>
# :License: GNU General Public License version 3 or later
# :Copyright: © 2017, 2018 Lele Gaifax
#
from collections import defaultdict
from os.path import... | [
"subprocess.check_output",
"collections.defaultdict",
"os.path.basename",
"argparse.ArgumentParser"
] | [((681, 768), 'subprocess.check_output', 'subprocess.check_output', (["['git', 'describe', '--all', '--long']"], {'cwd': '"""libpg_query"""'}), "(['git', 'describe', '--all', '--long'], cwd=\n 'libpg_query')\n", (704, 768), False, 'import subprocess\n'), ((1228, 1244), 'collections.defaultdict', 'defaultdict', (['se... |
import cv2
from imutils.paths import list_images
import imutils
import re
import datetime
from datasets.hdf5datasetwriter import HDF5DatasetWriter
import progressbar
def get_frame_number(impath):
return int(re.search(r"image data (\d+)", impath).group(1))
def get_timestamp(impath):
"assuming that the timestam... | [
"progressbar.Bar",
"re.split",
"datetime.datetime",
"datetime.datetime.strptime",
"imutils.resize",
"progressbar.Percentage",
"imutils.paths.list_images",
"progressbar.ETA",
"datetime.timedelta",
"cv2.imread",
"re.search"
] | [((455, 515), 'datetime.datetime.strptime', 'datetime.datetime.strptime', (['date_str', '"""%Y-%b-%d %H %M %S %f"""'], {}), "(date_str, '%Y-%b-%d %H %M %S %f')\n", (481, 515), False, 'import datetime\n'), ((649, 670), 'imutils.paths.list_images', 'list_images', (['basePath'], {}), '(basePath)\n', (660, 670), False, 'fr... |
#!/usr/bin/env python
import matplotlib.pyplot as plt
import numpy as np
import time
import cv2
from real.camera import Camera
from robot import Robot
from subprocess import Popen, PIPE
def get_camera_to_robot_transformation(camera):
color_img, depth_img = camera.get_data()
cv2.imwrite("real/temp.jpg", color... | [
"cv2.setMouseCallback",
"cv2.imwrite",
"numpy.float32",
"robot.Robot",
"subprocess.Popen",
"numpy.asarray",
"cv2.imshow",
"numpy.array",
"numpy.dot",
"cv2.circle",
"cv2.destroyAllWindows",
"cv2.cvtColor",
"cv2.waitKey",
"cv2.namedWindow"
] | [((1585, 1644), 'numpy.asarray', 'np.asarray', (['[[0.3, 0.748], [-0.224, 0.224], [-0.255, -0.1]]'], {}), '([[0.3, 0.748], [-0.224, 0.224], [-0.255, -0.1]])\n', (1595, 1644), True, 'import numpy as np\n'), ((1664, 1724), 'numpy.asarray', 'np.asarray', (['[[-0.237, 0.211], [-0.683, -0.235], [0.18, 0.4]]'], {}), '([[-0.2... |
# Header starts here.
from sympy.physics.units import *
from sympy import *
# Rounding:
import decimal
from decimal import Decimal as DX
from copy import deepcopy
def iso_round(obj, pv, rounding=decimal.ROUND_HALF_EVEN):
import sympy
"""
Rounding acc. to DIN EN ISO 80000-1:2013-08
place value = Rundest... | [
"copy.deepcopy"
] | [((779, 792), 'copy.deepcopy', 'deepcopy', (['obj'], {}), '(obj)\n', (787, 792), False, 'from copy import deepcopy\n')] |
#!/usr/bin/python3
import csv
ucc_dictionary_file_list = [
'./downloads/diary08/diary08/uccd08.txt',
'./downloads/diary09/diary09/uccd09.txt',
'./downloads/diary11/diary11/uccd11.txt',
'./downloads/diary10/diary10/uccd10.txt',
]
cleaned_ucc_dictionary = dict()
for dictionary in ucc_dictionary_file_l... | [
"csv.writer"
] | [((642, 703), 'csv.writer', 'csv.writer', (['csvfile'], {'delimiter': '""","""', 'quoting': 'csv.QUOTE_MINIMAL'}), "(csvfile, delimiter=',', quoting=csv.QUOTE_MINIMAL)\n", (652, 703), False, 'import csv\n')] |
from django.test import TestCase
from django.contrib.auth.models import User
from article.models import Article, Category
class ArticleModelTestCase(TestCase):
def setUp(self):
self.category = Category.objects.create(name=u'Sports')
self.user = User.objects.create(username=u'test', password=u'<PA... | [
"django.contrib.auth.models.User.objects.create",
"article.models.Category.objects.create",
"article.models.Article.objects.create"
] | [((208, 247), 'article.models.Category.objects.create', 'Category.objects.create', ([], {'name': 'u"""Sports"""'}), "(name=u'Sports')\n", (231, 247), False, 'from article.models import Article, Category\n'), ((268, 329), 'django.contrib.auth.models.User.objects.create', 'User.objects.create', ([], {'username': 'u"""tes... |
import os , sys
sys.path.append(os.getcwd())
import pytest
from typehints_checker import *
@pytest.mark.asyncio
async def test_import():
... | [
"os.getcwd"
] | [((32, 43), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (41, 43), False, 'import os, sys\n')] |
import glib
import dbus
from dbus.mainloop.glib import DBusGMainLoop
from pyee import EventEmitter
import logbook
logger = logbook.Logger('connman-dispatcher')
__all__ = ['detector']
def property_changed(_, message):
if message.get_member() == "PropertyChanged":
_, state = message.get_args_list()
... | [
"pyee.EventEmitter",
"logbook.Logger",
"dbus.mainloop.glib.DBusGMainLoop",
"glib.MainLoop",
"dbus.SystemBus"
] | [((123, 159), 'logbook.Logger', 'logbook.Logger', (['"""connman-dispatcher"""'], {}), "('connman-dispatcher')\n", (137, 159), False, 'import logbook\n'), ((677, 691), 'pyee.EventEmitter', 'EventEmitter', ([], {}), '()\n', (689, 691), False, 'from pyee import EventEmitter\n'), ((692, 726), 'dbus.mainloop.glib.DBusGMainL... |
#!/usr/bin/env python3
#
# Copyright (c) 2015 - 2022, Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
#
"""
Runs an application with a large number of short regions and checks
that the controller successfully runs.
"""
import sys
import unittest
import os
import subprocess
import glob
import geopmpy.io
i... | [
"integration.test.check_trace.check_sample_rate",
"os.path.join",
"os.environ.pop",
"os.path.realpath",
"integration.test.geopm_test_launcher.TestLauncher",
"os.path.basename",
"unittest.main",
"glob.glob"
] | [((4278, 4293), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4291, 4293), False, 'import unittest\n'), ((1009, 1067), 'os.path.join', 'os.path.join', (['script_dir', '""".libs"""', '"""test_profile_overflow"""'], {}), "(script_dir, '.libs', 'test_profile_overflow')\n", (1021, 1067), False, 'import os\n'), ((244... |
from django import template
register = template.Library()
RACK_SIZE_PX = 20
MARGIN_HEIGHT = 2
def _rack_unit_to_height(units):
# for every unit over 1 add a 2 px margin
margin = (units - 1) * MARGIN_HEIGHT
return units * RACK_SIZE_PX + margin
def _equipment_spacer(units):
return {
'units': ... | [
"django.template.Library"
] | [((40, 58), 'django.template.Library', 'template.Library', ([], {}), '()\n', (56, 58), False, 'from django import template\n')] |
import numpy as np
import matplotlib.pyplot as plt
from shamir import *
from binascii import hexlify
# img = plt.imread('cat.png')
# plt.imshow(img)
# plt.show()
s = 'TEST_STRING'.encode()
print("Original secret:", hexlify(s))
l = Shamir.split(3, 5, '12345'.encode())
for idx, item in l:
print("Share {}: {}".fo... | [
"binascii.hexlify"
] | [((218, 228), 'binascii.hexlify', 'hexlify', (['s'], {}), '(s)\n', (225, 228), False, 'from binascii import hexlify\n'), ((335, 348), 'binascii.hexlify', 'hexlify', (['item'], {}), '(item)\n', (342, 348), False, 'from binascii import hexlify\n')] |
from gerapy.server.manage import manage
import sys
def server():
# Call django cmd
manage()
| [
"gerapy.server.manage.manage"
] | [((92, 100), 'gerapy.server.manage.manage', 'manage', ([], {}), '()\n', (98, 100), False, 'from gerapy.server.manage import manage\n')] |
#!/usr/bin/env python
import sys, tty, termios, array, fcntl, curses
class TTYSettings(object):
def __init__(self):
self.tty_fd = sys.stdout.fileno()
# save
self.saved = termios.tcgetattr(self.tty_fd)
self.win_size = self.get_win_size()
self.rows, self.cols = self.win_size[0... | [
"fcntl.ioctl",
"array.array",
"curses.tigetnum",
"termios.tcsetattr",
"curses.setupterm",
"termios.tcgetattr",
"sys.stdout.fileno",
"tty.setraw"
] | [((143, 162), 'sys.stdout.fileno', 'sys.stdout.fileno', ([], {}), '()\n', (160, 162), False, 'import sys, tty, termios, array, fcntl, curses\n'), ((199, 229), 'termios.tcgetattr', 'termios.tcgetattr', (['self.tty_fd'], {}), '(self.tty_fd)\n', (216, 229), False, 'import sys, tty, termios, array, fcntl, curses\n'), ((348... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2021 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... | [
"improver.calibration.ensemble_calibration.CalibratedForecastDistributionParameters",
"numpy.testing.assert_array_almost_equal",
"iris.cube.CubeList",
"numpy.ones",
"improver.synthetic_data.set_up_test_cubes.set_up_variable_cube",
"improver.calibration.ensemble_calibration.EstimateCoefficientsForEnsembleC... | [((2638, 2799), 'improver.utilities.warnings_handler.ManageWarnings', 'ManageWarnings', ([], {'ignored_messages': "['Collapsing a non-contiguous coordinate.', 'invalid escape sequence']", 'warning_types': '[UserWarning, DeprecationWarning]'}), "(ignored_messages=['Collapsing a non-contiguous coordinate.',\n 'invalid... |
"Test handling/parsing of various DAZ Studio files"
from pathlib import Path
from tempfile import NamedTemporaryFile
from django.apps import apps
from rendaz.daztools import (
DSONFile,
ProductMeta,
manifest_files,
supplement_product_name,
)
TEST_DIR = Path(__file__).parent
def test_read_dson_com... | [
"rendaz.daztools.DSONFile",
"pathlib.Path",
"rendaz.daztools.manifest_files",
"django.apps.apps.get_app_config",
"rendaz.daztools.ProductMeta",
"tempfile.NamedTemporaryFile",
"rendaz.daztools.supplement_product_name"
] | [((274, 288), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (278, 288), False, 'from pathlib import Path\n'), ((1071, 1114), 'tempfile.NamedTemporaryFile', 'NamedTemporaryFile', ([], {'mode': '"""wt"""', 'delete': '(False)'}), "(mode='wt', delete=False)\n", (1089, 1114), False, 'from tempfile import Named... |
from django.db import models
# Create your models here.
class Project(models.Model):
title = models.CharField(max_length = 200, verbose_name = "Titulo")
description = models.TextField(verbose_name="Descripcion")
image = models.ImageField(verbose_name="Imagen", upload_to = "projects")
link = mode... | [
"django.db.models.TextField",
"django.db.models.DateTimeField",
"django.db.models.ImageField",
"django.db.models.URLField",
"django.db.models.CharField"
] | [((102, 157), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(200)', 'verbose_name': '"""Titulo"""'}), "(max_length=200, verbose_name='Titulo')\n", (118, 157), False, 'from django.db import models\n'), ((181, 225), 'django.db.models.TextField', 'models.TextField', ([], {'verbose_name': '"""Descr... |
import datetime
from .monzobalance import MonzoBalance
from .monzopagination import MonzoPaging
from .monzotransaction import MonzoTransaction
class MonzoAccount(object):
def __init__(self,api,json_dict=None):
self.api = api
self.account_id = None
self.created = None
self.descripti... | [
"datetime.datetime.strptime",
"datetime.datetime.now"
] | [((1656, 1679), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (1677, 1679), False, 'import datetime\n'), ((1943, 1966), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (1964, 1966), False, 'import datetime\n'), ((718, 783), 'datetime.datetime.strptime', 'datetime.datetime.strpt... |
from typing import Dict, Optional
from fastapi import status, Request
from fastapi.responses import JSONResponse
from fastapi.exceptions import RequestValidationError
from learninghouse.models import LearningHouseErrorMessage
MIMETYPE_JSON = 'application/json'
class LearningHouseException(Exception):
STATUS_CO... | [
"learninghouse.models.LearningHouseErrorMessage"
] | [((797, 899), 'learninghouse.models.LearningHouseErrorMessage', 'LearningHouseErrorMessage', ([], {'error': '(key or self.UNKNOWN)', 'description': '(description or self.DESCRIPTION)'}), '(error=key or self.UNKNOWN, description=\n description or self.DESCRIPTION)\n', (822, 899), False, 'from learninghouse.models imp... |
from pathlib import Path
from toolz import itertoolz, curried
import vaex
transform_path_to_posix = lambda path: path.as_posix()
def path_to_posix():
return curried.valmap(transform_path_to_posix)
transform_xlsx_to_vaex = lambda path: vaex.from_ascii(path, seperator="\t")
def xlsx_to_vaex():
return curr... | [
"toolz.curried.valmap",
"toolz.itertoolz.second",
"vaex.from_ascii"
] | [((165, 204), 'toolz.curried.valmap', 'curried.valmap', (['transform_path_to_posix'], {}), '(transform_path_to_posix)\n', (179, 204), False, 'from toolz import itertoolz, curried\n'), ((245, 282), 'vaex.from_ascii', 'vaex.from_ascii', (['path'], {'seperator': '"""\t"""'}), "(path, seperator='\\t')\n", (260, 282), False... |
# Copyright 2018-2021 The Matrix.org Foundation C.I.C.
#
# 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... | [
"logging.getLogger",
"synapse.replication.http.membership.ReplicationRemoteRejectInviteRestServlet.make_client",
"synapse.replication.http.membership.ReplicationUserJoinedLeftRoomRestServlet.make_client",
"synapse.replication.http.membership.ReplicationRemoteRescindKnockRestServlet.make_client",
"synapse.re... | [((1264, 1291), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1281, 1291), False, 'import logging\n'), ((1451, 1481), 'synapse.replication.http.membership.ReplicationRemoteJoinRestServlet.make_client', 'ReplRemoteJoin.make_client', (['hs'], {}), '(hs)\n', (1477, 1481), True, 'from synap... |
from datetime import datetime
from pathlib import Path
import pytz
import kobuddy
def get_test_db():
# db = Path(__file__).absolute().parent.parent / 'KoboShelfes' / 'KoboReader.sqlite.0'
db = Path(__file__).absolute().parent / 'data' / 'kobo_notes' / 'input' / 'KoboReader.sqlite'
return db
# a bit meh, ... | [
"datetime.datetime",
"kobuddy._iter_events_aux",
"kobuddy.print_books",
"pathlib.Path",
"kobuddy._iter_highlights",
"kobuddy.print_annotations",
"kobuddy.get_books_with_highlights",
"kobuddy.get_events",
"kobuddy.print_progress"
] | [((501, 519), 'kobuddy._iter_events_aux', '_iter_events_aux', ([], {}), '()\n', (517, 519), False, 'from kobuddy import _iter_events_aux, get_events, get_books_with_highlights, _iter_highlights\n'), ((569, 587), 'kobuddy._iter_highlights', '_iter_highlights', ([], {}), '()\n', (585, 587), False, 'from kobuddy import _i... |
from django.shortcuts import render
from .models import Tank
from django.db import models
from django.http import HttpResponse
from django.views import View
# Create your views here.
# The view for the created model Tank
def tank_view(request):
queryset = Tank.objects.all()
context = {
'object': quer... | [
"django.shortcuts.render"
] | [((342, 385), 'django.shortcuts.render', 'render', (['request', '"""tankbattle.html"""', 'context'], {}), "(request, 'tankbattle.html', context)\n", (348, 385), False, 'from django.shortcuts import render\n'), ((511, 554), 'django.shortcuts.render', 'render', (['request', '"""tankbattle.html"""', 'context'], {}), "(req... |
import os
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import argparse
from tqdm import tqdm
import sys
import distributed as dist
import utils
from models.vqvae import VQVAE, VQVAE_Blob2Full
from models.discriminator import discriminator
visual_folder = '/home2/bipasha31/python_... | [
"os.getuid",
"torch.cuda.device_count",
"torch.nn.MSELoss",
"models.vqvae.VQVAE",
"numpy.mean",
"models.discriminator.discriminator",
"argparse.ArgumentParser",
"torch.mean",
"utils.load_data_and_data_loaders",
"utils.readable_timestamp",
"utils.save_model_and_results",
"os.makedirs",
"distr... | [((356, 397), 'os.makedirs', 'os.makedirs', (['visual_folder'], {'exist_ok': '(True)'}), '(visual_folder, exist_ok=True)\n', (367, 397), False, 'import os\n'), ((783, 916), 'models.vqvae.VQVAE', 'VQVAE', (['args.n_hiddens', 'args.n_residual_hiddens', 'args.n_residual_layers', 'args.n_embeddings', 'args.embedding_dim', ... |
# pylint: disable=unused-variable,unused-argument,expression-not-assigned
from django.forms.models import model_to_dict
import arrow
import pytest
from expecter import expect
from api.elections.models import Election
from .. import models
@pytest.fixture
def info():
return models.Identity(
first_name=... | [
"api.elections.models.Election",
"expecter.expect",
"arrow.get",
"django.forms.models.model_to_dict"
] | [((372, 395), 'arrow.get', 'arrow.get', (['"""1985-06-19"""'], {}), "('1985-06-19')\n", (381, 395), False, 'import arrow\n'), ((498, 517), 'django.forms.models.model_to_dict', 'model_to_dict', (['info'], {}), '(info)\n', (511, 517), False, 'from django.forms.models import model_to_dict\n'), ((626, 658), 'api.elections.... |
import yaml
class Config:
def __init__(self, path: str):
self.path = path
self.cfg = {}
self.parse()
def parse(self):
with open(self.path, 'r') as f:
self.cfg = yaml.load(f)
@property
def secret(self) -> str:
return self.cfg.get('secret')
@pro... | [
"yaml.load"
] | [((216, 228), 'yaml.load', 'yaml.load', (['f'], {}), '(f)\n', (225, 228), False, 'import yaml\n')] |
#!/usr/bin/env python3
import argparse
import csv
import logging
import os
import re
import sys
DELIMITER = ','
class CsvFilter:
def __init__(
self,
file=None,
deduplicate=False,
filter_query=None,
filter_inverse=False,
ignore_case=False,... | [
"logging.getLogger",
"argparse.ArgumentParser",
"csv.writer",
"re.match",
"os.getcwd",
"csv.reader"
] | [((3419, 3444), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (3442, 3444), False, 'import argparse\n'), ((658, 690), 'logging.getLogger', 'logging.getLogger', (['"""deduplicate"""'], {}), "('deduplicate')\n", (675, 690), False, 'import logging\n'), ((806, 817), 'os.getcwd', 'os.getcwd', ([], ... |
# coding=utf-8
from builtins import str
import json
from django.contrib.auth.models import Group, Permission
from django.urls import reverse
from rest_framework import status
from bluebottle.impact.models import ImpactGoal
from bluebottle.impact.tests.factories import (
ImpactTypeFactory, ImpactGoalFactory
)
from... | [
"bluebottle.time_based.tests.factories.DateActivityFactory.create",
"django.contrib.auth.models.Permission.objects.get",
"django.contrib.auth.models.Group.objects.get",
"bluebottle.test.utils.JSONAPITestClient",
"bluebottle.impact.tests.factories.ImpactTypeFactory.create",
"bluebottle.impact.tests.factori... | [((747, 766), 'bluebottle.test.utils.JSONAPITestClient', 'JSONAPITestClient', ([], {}), '()\n', (764, 766), False, 'from bluebottle.test.utils import BluebottleTestCase, JSONAPITestClient\n'), ((788, 822), 'bluebottle.impact.tests.factories.ImpactTypeFactory.create_batch', 'ImpactTypeFactory.create_batch', (['(10)'], {... |
from django.db import models
from categorias.models import Categoria
from django.contrib.auth.models import User
from django.utils import timezone
# Create your models here.
class Post(models.Model):
titulo_post = models.CharField(max_length=50, verbose_name='Titulo')
autor_post = models.ForeignKey(User, on_... | [
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.BooleanField",
"django.db.models.ImageField",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((221, 275), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(50)', 'verbose_name': '"""Titulo"""'}), "(max_length=50, verbose_name='Titulo')\n", (237, 275), False, 'from django.db import models\n'), ((293, 367), 'django.db.models.ForeignKey', 'models.ForeignKey', (['User'], {'on_delete': 'model... |
#!/usr/bin/env python
import datetime
import logging
import os
import random
import rospy
import schedule
from interaction_engine.cordial_interface import CordialInterface
from interaction_engine.database import Database
from interaction_engine.int_engine import InteractionEngine
from interaction_engine.message impor... | [
"logging.basicConfig",
"interaction_engine.database.Database",
"rospy.is_shutdown",
"interaction_engine.state_collection.StateCollection",
"os.getcwd",
"os.path.realpath",
"interaction_engine.state.State",
"interaction_engine.cordial_interface.CordialInterface",
"rospy.sleep",
"rospy.logdebug",
... | [((540, 579), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (559, 579), False, 'import logging\n'), ((727, 938), 'interaction_engine.state.State', 'State', ([], {'name': 'Keys.GREETING', 'message_type': 'Message.Type.MULTIPLE_CHOICE_ONE_COLUMN', 'content': '"""... |
#!/usr/bin/env python
"""Script used to test the network with batfish"""
from pybatfish.client.commands import *
from pybatfish.question import load_questions
from pybatfish.client.asserts import (
assert_no_duplicate_router_ids,
assert_no_incompatible_bgp_sessions,
assert_no_incompatible_ospf_sessions,
... | [
"pybatfish.client.asserts.assert_no_duplicate_router_ids",
"pybatfish.client.asserts.assert_no_unestablished_bgp_sessions",
"pybatfish.client.asserts.assert_no_undefined_references",
"rich.console.Console",
"pybatfish.client.asserts.assert_no_incompatible_bgp_sessions",
"pybatfish.question.load_questions"... | [((444, 477), 'rich.console.Console', 'Console', ([], {'color_system': '"""truecolor"""'}), "(color_system='truecolor')\n", (451, 477), False, 'from rich.console import Console\n'), ((706, 778), 'pybatfish.client.asserts.assert_no_duplicate_router_ids', 'assert_no_duplicate_router_ids', ([], {'snapshot': 'snap', 'proto... |
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import pytest
import stat
from spack.hooks.permissions_setters import (
chmod_real_entries, InvalidPermissi... | [
"llnl.util.filesystem.chmod_x",
"spack.hooks.permissions_setters.chmod_real_entries",
"os.chmod",
"pytest.raises",
"os.stat"
] | [((525, 545), 'os.chmod', 'os.chmod', (['path', 'mode'], {}), '(path, mode)\n', (533, 545), False, 'import os\n'), ((653, 684), 'spack.hooks.permissions_setters.chmod_real_entries', 'chmod_real_entries', (['path', 'perms'], {}), '(path, perms)\n', (671, 684), False, 'from spack.hooks.permissions_setters import chmod_re... |
# returns number of unique records for icews with different filtering:
# -by rounded lat/lon (100,000)
# -by country, district, province, city (100,000)
# -by lat/lon, filtered by 2 or more matches (70,000)
from pymongo import MongoClient
import os
mongo_client = MongoClient(host='localhost', port=27017) # Default p... | [
"pymongo.MongoClient"
] | [((266, 307), 'pymongo.MongoClient', 'MongoClient', ([], {'host': '"""localhost"""', 'port': '(27017)'}), "(host='localhost', port=27017)\n", (277, 307), False, 'from pymongo import MongoClient\n')] |
import MapReduce
import sys
"""
SQL style Joins in MapReduce
"""
mr = MapReduce.MapReduce()
# =============================
# Do not modify above this line
def mapper(record):
# key: document identifier
# value: document contents
value = str(record[0])
num = str(record[1])
mr.emit_intermediate(num, (value... | [
"MapReduce.MapReduce"
] | [((72, 93), 'MapReduce.MapReduce', 'MapReduce.MapReduce', ([], {}), '()\n', (91, 93), False, 'import MapReduce\n')] |
from anonapi.testresources import (
MockAnonClientTool,
JobInfoFactory,
RemoteAnonServerFactory,
JobStatus,
)
def test_mock_anon_client_tool():
some_responses = [
JobInfoFactory(status=JobStatus.DONE),
JobInfoFactory(status=JobStatus.ERROR),
JobInfoFactory(status=JobStatus.... | [
"anonapi.testresources.MockAnonClientTool",
"anonapi.testresources.JobInfoFactory",
"anonapi.testresources.RemoteAnonServerFactory"
] | [((348, 392), 'anonapi.testresources.MockAnonClientTool', 'MockAnonClientTool', ([], {'responses': 'some_responses'}), '(responses=some_responses)\n', (366, 392), False, 'from anonapi.testresources import MockAnonClientTool, JobInfoFactory, RemoteAnonServerFactory, JobStatus\n'), ((406, 431), 'anonapi.testresources.Rem... |
#!/usr/bin/env python
import rospy
import rosbag
import os
import sys
import textwrap
import yaml
lidarmsg=None
################# read the lidar msg from yaml file and return ##############
def readlidardummy():
global lidarmsg
if lidarmsg==None:
lidarmsg= doreadlidar()
return lidarmsg
def doreadlidar():... | [
"yaml.load"
] | [((601, 616), 'yaml.load', 'yaml.load', (['file'], {}), '(file)\n', (610, 616), False, 'import yaml\n')] |
# Generated by Django 2.0.9 on 2018-12-12 08:18
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('cycleshare', '0012_cycle_toprofile'),
]
operations = [
migrations.RemoveField(
model_name='cycle',
name='toprofile',
... | [
"django.db.migrations.RemoveField"
] | [((227, 287), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""cycle"""', 'name': '"""toprofile"""'}), "(model_name='cycle', name='toprofile')\n", (249, 287), False, 'from django.db import migrations\n')] |
import discord
import asyncio
import re
import logging
from data.groups_name import free_random_name
logging.basicConfig(level=logging.INFO)
client = discord.Client()
class ClientEvents(discord.Client):
'''
Classe initialization
'''
def __init__(self, *args, **kwargs):
super().__init__(*args... | [
"logging.basicConfig",
"data.groups_name.free_random_name",
"asyncio.sleep",
"discord.Client",
"re.findall"
] | [((102, 141), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (121, 141), False, 'import logging\n'), ((151, 167), 'discord.Client', 'discord.Client', ([], {}), '()\n', (165, 167), False, 'import discord\n'), ((757, 774), 'asyncio.sleep', 'asyncio.sleep', (['(60)... |
"""
Utilities
---------
The utilities module.
"""
from collections.abc import Mapping, Sequence
from functools import wraps
import types
class FrozenDict(Mapping):
"""A frozen dictionary implementation that prevents the object from being
mutated. This is primarily used when defining a dict-like object as a ... | [
"functools.wraps"
] | [((1099, 1110), 'functools.wraps', 'wraps', (['meth'], {}), '(meth)\n', (1104, 1110), False, 'from functools import wraps\n')] |
try:
from . import generic as g
except BaseException:
import generic as g
class NormalsTest(g.unittest.TestCase):
def test_vertex_normal(self):
mesh = g.trimesh.creation.icosahedron()
# the icosahedron is centered at zero, so the true vertex
# normal is just a unit vector of the v... | [
"generic.trimesh.creation.icosahedron",
"generic.trimesh.util.attach_to_log",
"generic.np.allclose",
"generic.unittest.main",
"generic.trimesh.util.unitize"
] | [((1764, 1794), 'generic.trimesh.util.attach_to_log', 'g.trimesh.util.attach_to_log', ([], {}), '()\n', (1792, 1794), True, 'import generic as g\n'), ((1799, 1816), 'generic.unittest.main', 'g.unittest.main', ([], {}), '()\n', (1814, 1816), True, 'import generic as g\n'), ((174, 206), 'generic.trimesh.creation.icosahed... |
# /***********************************************************************
# Copyright 2019 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
#
# http://www.apache.org/licenses/LICE... | [
"os.path.exists",
"termcolor.colored",
"yaml.dump",
"flagmaker.building_blocks.list_to_string_list",
"os.remove",
"flagmaker.validators.ChoiceValidator",
"prompt_toolkit.ANSI",
"termcolor.cprint",
"typing.TypeVar"
] | [((1802, 1839), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {'bound': 'SettingsInterface'}), "('T', bound=SettingsInterface)\n", (1809, 1839), False, 'from typing import TypeVar\n'), ((4345, 4378), 'flagmaker.building_blocks.list_to_string_list', 'list_to_string_list', (['self.options'], {}), '(self.options)\n', (4364, ... |
# coding:utf-8
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2020 azai/Rgveda/GolemQuant base on QUANTAXIS/yutiansut
#
# 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, ... | [
"datetime.datetime.strptime",
"CommonUtils.sendDingMsg",
"easyquotation.use",
"QUANTAXIS.QAUtil.QADate_trade.QA_util_if_tradetime",
"time.sleep",
"GolemQ.utils.symbol.normalize_code",
"datetime.datetime.now",
"traceback.print_exc",
"numba.jit",
"datetime.date.today",
"QUANTAXIS.QA_fetch_stock_bl... | [((4670, 4691), 'numba.jit', 'nb.jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (4676, 4691), True, 'import numba as nb\n'), ((6803, 6828), 'easyquotation.use', 'easyquotation.use', (['"""sina"""'], {}), "('sina')\n", (6820, 6828), False, 'import easyquotation\n'), ((6928, 6936), 'datetime.datetime.now', 'dt.... |
#!/usr/bin/env python
"""
Installs ETA.
Copyright 2017-2021, Voxel51, Inc.
voxel51.com
"""
import os
from setuptools import setup, find_packages
from wheel.bdist_wheel import bdist_wheel
VERSION = "0.6.1"
class BdistWheelCustom(bdist_wheel):
def finalize_options(self):
bdist_wheel.finalize_options(self... | [
"wheel.bdist_wheel.bdist_wheel.finalize_options",
"setuptools.find_packages"
] | [((287, 321), 'wheel.bdist_wheel.bdist_wheel.finalize_options', 'bdist_wheel.finalize_options', (['self'], {}), '(self)\n', (315, 321), False, 'from wheel.bdist_wheel import bdist_wheel\n'), ((1165, 1180), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (1178, 1180), False, 'from setuptools import setup,... |
import wx
import cv2
#----------------------------------------------------------------------
# Panel to display image from camera
#----------------------------------------------------------------------
class WebcamPanel(wx.Window): # wx.Panel, wx.Control
def __init__(self, parent, camera, fps=15, flip=Fals... | [
"wx.Button",
"wx.BufferedPaintDC",
"cv2.flip",
"wx.BoxSizer",
"wx.Timer",
"wx.Panel",
"cv2.VideoCapture",
"cv2.cvtColor",
"wx.Frame.__init__",
"wx.App",
"wx.BitmapFromBuffer",
"wx.Window.__init__"
] | [((2976, 2995), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (2992, 2995), False, 'import cv2\n'), ((3003, 3011), 'wx.App', 'wx.App', ([], {}), '()\n', (3009, 3011), False, 'import wx\n'), ((332, 364), 'wx.Window.__init__', 'wx.Window.__init__', (['self', 'parent'], {}), '(self, parent)\n', (350, 364... |
import os
import shutil
import tempfile
from taskmage2.utils import filesystem, functional
from taskmage2.asttree import asttree, renderers
from taskmage2.parser import iostream, parsers
from taskmage2.project import taskfiles
class Project(object):
def __init__(self, root='.'):
""" Constructor.
... | [
"taskmage2.utils.filesystem.walk_parents",
"os.path.exists",
"taskmage2.utils.filesystem.format_path",
"taskmage2.parser.iostream.FileDescriptor",
"taskmage2.parser.parsers.parse",
"os.path.relpath",
"os.path.dirname",
"os.path.isfile",
"os.path.isdir",
"tempfile.mkdtemp",
"os.path.basename",
... | [((11557, 11650), 'taskmage2.utils.functional.pipeline', 'functional.pipeline', (['path', '[_ensure_path_ends_with_dot_taskmage, filesystem.format_path]'], {}), '(path, [_ensure_path_ends_with_dot_taskmage, filesystem.\n format_path])\n', (11576, 11650), False, 'from taskmage2.utils import filesystem, functional\n')... |
from discord.ext import commands
class FilteredUser(commands.UserConverter):
"""
A simple :class:`discord.ext.commands.UserConverter` that doesn't allow bots
or the author to be passed into the function.
"""
def __init__(self, *, allow_author: bool = False, allow_bots: bool = False):
supe... | [
"discord.ext.commands.BadArgument"
] | [((613, 676), 'discord.ext.commands.BadArgument', 'commands.BadArgument', (['"""You can\'t run this command on yourself."""'], {}), '("You can\'t run this command on yourself.")\n', (633, 676), False, 'from discord.ext import commands\n'), ((742, 801), 'discord.ext.commands.BadArgument', 'commands.BadArgument', (['"""Y... |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"unittest.main"
] | [((3339, 3354), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3352, 3354), False, 'import unittest\n')] |
# Improved version of the code from chapter 03
# created in chapter 11 to accelerate execution
import random
XMAX, YMAX = 19, 16
def create_grid_string(dots, xsize, ysize):
"""
Creates a grid of size (xx, yy)
with the given positions of dots.
"""
grid = ""
for y in range(ysize):
f... | [
"random.shuffle"
] | [((989, 1014), 'random.shuffle', 'random.shuffle', (['positions'], {}), '(positions)\n', (1003, 1014), False, 'import random\n')] |
from api.models.models import User
from api import db, create_app
db.create_all(app=create_app()) | [
"api.create_app"
] | [((85, 97), 'api.create_app', 'create_app', ([], {}), '()\n', (95, 97), False, 'from api import db, create_app\n')] |
import numpy as np
import scipy.stats as stats
from UQpy.Distributions.baseclass.Distribution import Distribution
class DistributionContinuous1D(Distribution):
"""
Parent class for univariate continuous probability distributions.
"""
def __init__(self, **kwargs):
super().__init__(**kwargs)
... | [
"numpy.atleast_1d"
] | [((499, 515), 'numpy.atleast_1d', 'np.atleast_1d', (['x'], {}), '(x)\n', (512, 515), True, 'import numpy as np\n')] |
import requests
import re
import time
import random
import pprint
import os
headers = {"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3858.0 Safari/537.36"}
def youdict(threadName, q):
res = []
index = 0
url = q.get(timeout = 2)
... | [
"random.random",
"re.findall",
"requests.get"
] | [((343, 388), 'requests.get', 'requests.get', (['url'], {'headers': 'headers', 'timeout': '(5)'}), '(url, headers=headers, timeout=5)\n', (355, 388), False, 'import requests\n'), ((547, 717), 're.findall', 're.findall', (['"""<div class="caption"><h3 style="margin-top: 10px;"><a style="color:#333;" target="_blank" href... |
#!/usr/bin/env python3
"""
Created by sarathkaul on 14/11/19
Basic authentication using an API password is deprecated and will soon no longer work.
Visit https://developer.github.com/changes/2020-02-14-deprecating-password-auth
for more information around suggested workarounds and removal dates.
"""
import requests... | [
"requests.get"
] | [((516, 570), 'requests.get', 'requests.get', (['_GITHUB_API'], {'auth': '(auth_user, auth_pass)'}), '(_GITHUB_API, auth=(auth_user, auth_pass))\n', (528, 570), False, 'import requests\n')] |
#!/usr/bin/env python3
# vim: set ai et ts=4 sw=4:
import os
import subprocess
import argparse
import time
import calendar
import re
def run(cmd):
code = subprocess.call(['/bin/bash', '-o', 'pipefail', '-c', cmd])
if code != 0:
raise RuntimeError("Command `%s` returned non-zero status: %d" %
... | [
"subprocess.check_output",
"os.listdir",
"argparse.ArgumentParser",
"os.chdir",
"subprocess.call",
"os.unlink",
"time.time",
"re.search"
] | [((494, 570), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Run nightly Insolar Jepsen-like tests"""'}), "(description='Run nightly Insolar Jepsen-like tests')\n", (517, 570), False, 'import argparse\n'), ((161, 220), 'subprocess.call', 'subprocess.call', (["['/bin/bash', '-o', 'pipefai... |
# Copyright 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | [
"six.moves.mock.Mock",
"eventlet.getcurrent",
"oslo_config.cfg.ConfigOpts",
"eventlet.sleep",
"oslo_messaging.get_rpc_transport",
"eventlet.spawn",
"fixtures.MockPatchObject",
"threading.Lock",
"oslo_messaging.get_rpc_server",
"testscenarios.multiply_scenarios",
"threading.Event",
"six.moves.m... | [((3927, 3954), 'six.moves.mock.patch', 'mock.patch', (['"""warnings.warn"""'], {}), "('warnings.warn')\n", (3937, 3954), False, 'from six.moves import mock\n'), ((5379, 5406), 'six.moves.mock.patch', 'mock.patch', (['"""warnings.warn"""'], {}), "('warnings.warn')\n", (5389, 5406), False, 'from six.moves import mock\n'... |
from itertools import chain
from components.config import getConfig
from components.convert import fetchUser, pretRes
import discord
from discord import channel
from discord.ext import commands
class Feelings(commands.Cog):
def __init__(self, client) -> None:
self.client = client
self.config = get... | [
"components.config.getConfig",
"discord.ext.commands.command",
"components.convert.fetchUser"
] | [((336, 354), 'discord.ext.commands.command', 'commands.command', ([], {}), '()\n', (352, 354), False, 'from discord.ext import commands\n'), ((591, 609), 'discord.ext.commands.command', 'commands.command', ([], {}), '()\n', (607, 609), False, 'from discord.ext import commands\n'), ((844, 862), 'discord.ext.commands.co... |
"""
The tool to check the availability or syntax of domain, IP or URL.
::
██████╗ ██╗ ██╗███████╗██╗ ██╗███╗ ██╗ ██████╗███████╗██████╗ ██╗ ███████╗
██╔══██╗╚██╗ ██╔╝██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝██╔══██╗██║ ██╔════╝
██████╔╝ ╚████╔╝ █████╗ ██║ ██║██╔██╗ ██║██║ █████╗ █... | [
"secrets.token_hex",
"PyFunceble.utils.platform.PlatformUtility.is_windows",
"PyFunceble.helpers.file.FileHelper",
"tempfile.gettempdir",
"tempfile.NamedTemporaryFile",
"unittest.main",
"os.remove"
] | [((12749, 12764), 'unittest.main', 'unittest.main', ([], {}), '()\n', (12762, 12764), False, 'import unittest\n'), ((2067, 2096), 'tempfile.NamedTemporaryFile', 'tempfile.NamedTemporaryFile', ([], {}), '()\n', (2094, 2096), False, 'import tempfile\n'), ((2120, 2132), 'PyFunceble.helpers.file.FileHelper', 'FileHelper', ... |
from malaya_speech.utils import (
check_file,
load_graph,
generate_session,
nodes_session,
)
from malaya_speech.model.tf import UNET, UNETSTFT, UNET1D
def load(model, module, quantized=False, **kwargs):
path = check_file(
file=model,
module=module,
keys={'model': 'model.pb... | [
"malaya_speech.utils.nodes_session",
"malaya_speech.utils.check_file",
"malaya_speech.utils.load_graph",
"malaya_speech.utils.generate_session"
] | [((233, 334), 'malaya_speech.utils.check_file', 'check_file', ([], {'file': 'model', 'module': 'module', 'keys': "{'model': 'model.pb'}", 'quantized': 'quantized'}), "(file=model, module=module, keys={'model': 'model.pb'}, quantized\n =quantized, **kwargs)\n", (243, 334), False, 'from malaya_speech.utils import chec... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
test_util_matrix
@author: jdiedrichsen
"""
import unittest
import pyrsa.util as rsu
import numpy as np
class TestIndicator(unittest.TestCase):
def test_indicator(self):
a = np.array(range(0, 5))
a = np.concatenate((a, a))
X = rsu.matrix... | [
"pyrsa.util.matrix.indicator",
"pyrsa.util.matrix.pairwise_contrast",
"numpy.concatenate",
"unittest.main",
"pyrsa.util.matrix.centering"
] | [((1224, 1239), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1237, 1239), False, 'import unittest\n'), ((275, 297), 'numpy.concatenate', 'np.concatenate', (['(a, a)'], {}), '((a, a))\n', (289, 297), True, 'import numpy as np\n'), ((310, 333), 'pyrsa.util.matrix.indicator', 'rsu.matrix.indicator', (['a'], {}), '... |